[SCSI] fusion: spi bus reset when driver loads
authorMoore, Eric <Eric.Moore@lsil.com>
Tue, 17 Jan 2006 01:53:06 +0000 (18:53 -0700)
committerJames Bottomley <jejb@mulgrave.(none)>
Tue, 31 Jan 2006 20:39:51 +0000 (14:39 -0600)
This patch is for spi.  This issues bus reset when driver
loads. Handling cases when initator has negotiated for packetized,
and target negotiated for non-packetized; effectly this bus reset
is getting both target and initiator on the same sheet of music.

Signed-off-by: Eric Moore <Eric.Moore@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/message/fusion/mptbase.c
drivers/message/fusion/mptspi.c

index d890b2b8a93e94973f345068f95b75e9121b679d..2806662a9cf924911b52067b08b86dfeced46aec 100644 (file)
@@ -4598,6 +4598,14 @@ mpt_GetScsiPortSettings(MPT_ADAPTER *ioc, int portnum)
                                SCSIPortPage2_t *pPP2 = (SCSIPortPage2_t  *) pbuf;
                                MpiDeviceInfo_t *pdevice = NULL;
 
+                               /*
+                                * Save "Set to Avoid SCSI Bus Resets" flag
+                                */
+                               ioc->spi_data.bus_reset =
+                                   (le32_to_cpu(pPP2->PortFlags) &
+                               MPI_SCSIPORTPAGE2_PORT_FLAGS_AVOID_SCSI_RESET) ?
+                                   0 : 1 ;
+
                                /* Save the Port Page 2 data
                                 * (reformat into a 32bit quantity)
                                 */
index 7dce29277cb748e51e1ef8a3956f618cddc28818..f148dfa39117edb097bb5f481dcb9c8bad05bd60 100644 (file)
@@ -384,6 +384,14 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
                goto out_mptspi_probe;
        }
 
+       /*
+        * issue internal bus reset
+        */
+       if (ioc->spi_data.bus_reset)
+               mptscsih_TMHandler(hd,
+                   MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS,
+                   0, 0, 0, 0, 5);
+
        scsi_scan_host(sh);
        return 0;
 
@@ -445,7 +453,7 @@ static void __exit
 mptspi_exit(void)
 {
        pci_unregister_driver(&mptspi_driver);
-       
+
        mpt_reset_deregister(mptspiDoneCtx);
        dprintk((KERN_INFO MYNAM
          ": Deregistered for IOC reset notifications\n"));