Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Mar 2017 16:55:18 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r315163 - head/sys/dev/isp
Message-ID:  <201703121655.v2CGtIjX049531@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Sun Mar 12 16:55:18 2017
New Revision: 315163
URL: https://svnweb.freebsd.org/changeset/base/315163

Log:
  Remove strange config_intrhook_establish() magic.
  
  Interrupts are enabled as part of chip reset just during driver attach.
  Later "enabling" of already enabled interrupts is useless.
  
  MFC after:	2 weeks

Modified:
  head/sys/dev/isp/isp_freebsd.c
  head/sys/dev/isp/isp_freebsd.h

Modified: head/sys/dev/isp/isp_freebsd.c
==============================================================================
--- head/sys/dev/isp/isp_freebsd.c	Sun Mar 12 16:03:34 2017	(r315162)
+++ head/sys/dev/isp/isp_freebsd.c	Sun Mar 12 16:55:18 2017	(r315163)
@@ -278,25 +278,11 @@ isp_attach(ispsoftc_t *isp)
 	int du = device_get_unit(isp->isp_dev);
 	int chan;
 
-	isp->isp_osinfo.ehook.ich_func = isp_intr_enable;
-	isp->isp_osinfo.ehook.ich_arg = isp;
-	/*
-	 * Haha. Set this first, because if we're loaded as a module isp_intr_enable
-	 * will be called right awawy, which will clear isp_osinfo.ehook_active,
-	 * which would be unwise to then set again later.
-	 */
-	isp->isp_osinfo.ehook_active = 1;
-	if (config_intrhook_establish(&isp->isp_osinfo.ehook) != 0) {
-		isp_prt(isp, ISP_LOGERR, "could not establish interrupt enable hook");
-		return (-EIO);
-	}
-
 	/*
 	 * Create the device queue for our SIM(s).
 	 */
 	isp->isp_osinfo.devq = cam_simq_alloc(isp->isp_maxcmds);
 	if (isp->isp_osinfo.devq == NULL) {
-		config_intrhook_disestablish(&isp->isp_osinfo.ehook);
 		return (EIO);
 	}
 
@@ -330,10 +316,6 @@ unwind:
 		ISP_UNLOCK(isp);
 		cam_sim_free(sim, FALSE);
 	}
-	if (isp->isp_osinfo.ehook_active) {
-		config_intrhook_disestablish(&isp->isp_osinfo.ehook);
-		isp->isp_osinfo.ehook_active = 0;
-	}
 	if (isp->isp_osinfo.cdev) {
 		destroy_dev(isp->isp_osinfo.cdev);
 		isp->isp_osinfo.cdev = NULL;
@@ -371,10 +353,6 @@ isp_detach(ispsoftc_t *isp)
 		destroy_dev(isp->isp_osinfo.cdev);
 		isp->isp_osinfo.cdev = NULL;
 	}
-	if (isp->isp_osinfo.ehook_active) {
-		config_intrhook_disestablish(&isp->isp_osinfo.ehook);
-		isp->isp_osinfo.ehook_active = 0;
-	}
 	if (isp->isp_osinfo.devq != NULL) {
 		cam_simq_free(isp->isp_osinfo.devq);
 		isp->isp_osinfo.devq = NULL;
@@ -786,28 +764,6 @@ ispioctl(struct cdev *dev, u_long c, cad
 	return (retval);
 }
 
-static void
-isp_intr_enable(void *arg)
-{
-	int chan;
-	ispsoftc_t *isp = arg;
-	ISP_LOCK(isp);
-	if (IS_FC(isp)) {
-		for (chan = 0; chan < isp->isp_nchan; chan++) {
-			if (FCPARAM(isp, chan)->role != ISP_ROLE_NONE) {
-				ISP_ENABLE_INTS(isp);
-				break;
-			}
-		}
-	} else {
-		ISP_ENABLE_INTS(isp);
-	}
-	isp->isp_osinfo.ehook_active = 0;
-	ISP_UNLOCK(isp);
-	/* Release our hook so that the boot can continue. */
-	config_intrhook_disestablish(&isp->isp_osinfo.ehook);
-}
-
 /*
  * Local Inlines
  */

Modified: head/sys/dev/isp/isp_freebsd.h
==============================================================================
--- head/sys/dev/isp/isp_freebsd.h	Sun Mar 12 16:03:34 2017	(r315162)
+++ head/sys/dev/isp/isp_freebsd.h	Sun Mar 12 16:55:18 2017	(r315163)
@@ -270,7 +270,6 @@ struct isposinfo {
 	struct mtx		lock;
 	device_t		dev;
 	struct cdev *		cdev;
-	struct intr_config_hook	ehook;
 	struct cam_devq *	devq;
 
 	/*
@@ -310,7 +309,6 @@ struct isposinfo {
 		sixtyfourbit	: 1,	/* sixtyfour bit platform */
 		timer_active	: 1,
 		autoconf	: 1,
-		ehook_active	: 1,
 		mbox_sleeping	: 1,
 		mbox_sleep_ok	: 1,
 		mboxcmd_done	: 1,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703121655.v2CGtIjX049531>