From f41b5cec9bd6fec1b11b74500f5fb9c3e6e808b2 Mon Sep 17 00:00:00 2001 From: Hannes Reinecke Date: Mon, 3 Apr 2006 08:19:34 +0200 Subject: [SCSI] aic79xx bus reset update As James B. correctly noted, ahd_reset_channel() in ahd_linux_bus_reset() should be protected by ahd_lock(). However, the main reason for not doing so was a deadlock with the interesting polling mechanism to detect the end a bus reset. This patch replaces the polling mechanism with a saner signalling via flags; it also gives us the benefit of detecting any multiple calls to ahd_reset_channel(). Signed-off-by: Hannes Reinecke Signed-off-by: James Bottomley --- drivers/scsi/aic7xxx/aic79xx_osm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/scsi/aic7xxx/aic79xx_osm.c') diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c index bcced0a417e..66e4a47bb9e 100644 --- a/drivers/scsi/aic7xxx/aic79xx_osm.c +++ b/drivers/scsi/aic7xxx/aic79xx_osm.c @@ -782,6 +782,7 @@ ahd_linux_bus_reset(struct scsi_cmnd *cmd) { struct ahd_softc *ahd; int found; + unsigned long flags; ahd = *(struct ahd_softc **)cmd->device->host->hostdata; #ifdef AHD_DEBUG @@ -789,8 +790,11 @@ ahd_linux_bus_reset(struct scsi_cmnd *cmd) printf("%s: Bus reset called for cmd %p\n", ahd_name(ahd), cmd); #endif + ahd_lock(ahd, &flags); + found = ahd_reset_channel(ahd, scmd_channel(cmd) + 'A', /*initiate reset*/TRUE); + ahd_unlock(ahd, &flags); if (bootverbose) printf("%s: SCSI bus reset delivered. " -- cgit v1.2.3