mptspi: Bug fix to prevent infinite nested domainvalidation
Subsystems (2)
PATCH 1/1 mptspi: Bug fix to prevent infinite nested domainvalidation
Quoted 1 line
From
host_reset, this patch will complete domain validation
in the same context as the eh threads. I've added passing the sleepFlag, which is CAN_SLEEP in the context of eh threads.
Mark pls try this with the patch that James posted earlier that prevents re entry to pending dv.
drivers/message/fusion/Makefile +1 -1
@@ -8,6 +8,7 @@ #EXTRA_CFLAGS += -DMPT_DEBUG_INIT #EXTRA_CFLAGS += -DMPT_DEBUG_EXIT #EXTRA_CFLAGS += -DMPT_DEBUG_FAIL +#EXTRA_CFLAGS += -DMPT_DEBUG_TM # # driver/module specifics...
@@ -22,7 +23,6 @@ # For mptscsih: #CFLAGS_mptscsih.o += -DMPT_DEBUG_DV #CFLAGS_mptscsih.o += -DMPT_DEBUG_NEGO -#CFLAGS_mptscsih.o += -DMPT_DEBUG_TM #CFLAGS_mptscsih.o += -DMPT_DEBUG_SCSI #CFLAGS_mptscsih.o += -DMPT_DEBUG_REPLY #
drivers/message/fusion/mptbase.c +11 -9
@@ -1552,7 +1552,7 @@ mpt_resume(struct pci_dev *pdev)#endif static int -mpt_signal_reset (int index,MPT_ADAPTER *ioc,int reset_phase) +mpt_signal_reset (int index,MPT_ADAPTER *ioc,int reset_phase,int sleepFlag) { if ((MptDriverClass[index] == MPTSPI_DRIVER && ioc->bus_type != SPI) ||
@@ -1563,7 +1563,7 @@ mpt_signal_reset(int index, MPT_ADAPTER/* make sure we only call the relevant reset handler * for the bus */ return 0 ; -return (MptResetHandlers[index])(ioc, reset_phase); +return (MptResetHandlers[index])(ioc, reset_phase, sleepFlag); }/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -1869,14 +1869,14 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u3if ((ret ==0 ) && MptResetHandlers[ii]) {dprintk ((MYIOC_s_INFO_FMT"Calling IOC post_reset handler #%d\n" , ioc->name, ii)); - rc +=mpt_signal_reset (ii, ioc,MPT_IOC_POST_RESET ); + rc +=mpt_signal_reset (ii, ioc,MPT_IOC_POST_RESET , sleepFlag); handlers++; }if (alt_ioc_ready && MptResetHandlers[ii]) {drsprintk ((MYIOC_s_INFO_FMT"Calling alt-%s post_reset handler #%d\n" , ioc->name, ioc->alt_ioc->name, ii)); - rc +=mpt_signal_reset (ii, ioc->alt_ioc,MPT_IOC_POST_RESET ); + rc +=mpt_signal_reset (ii, ioc->alt_ioc,MPT_IOC_POST_RESET , sleepFlag); handlers++; } }
@@ -3292,11 +3292,12 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignif (MptResetHandlers[ii]) {dprintk ((MYIOC_s_INFO_FMT"Calling IOC pre_reset handler #%d\n" , ioc->name, ii)); - r +=mpt_signal_reset (ii, ioc,MPT_IOC_PRE_RESET ); + r +=mpt_signal_reset (ii, ioc,MPT_IOC_PRE_RESET , sleepFlag);if (ioc->alt_ioc) {dprintk ((MYIOC_s_INFO_FMT"Calling alt-%s pre_reset handler #%d\n" , ioc->name, ioc->alt_ioc->name, ii)); - r +=mpt_signal_reset (ii, ioc->alt_ioc,MPT_IOC_PRE_RESET ); + r +=mpt_signal_reset (ii, ioc->alt_ioc,MPT_IOC_PRE_RESET , + sleepFlag); } } }
@@ -5219,11 +5220,12 @@ mpt_timer_expired(unsigned long data)* mpt_ioc_reset - Base cleanup for hard reset * @ioc: Pointer to the adapter structure * @reset_phase: Indicates pre- or post-reset functionality +* @sleepFlag: Indicates if sleep or schedule must be called. * * Remark: Free's resources with internally generated commands. */ static int -mpt_ioc_reset (MPT_ADAPTER *ioc,int reset_phase) +mpt_ioc_reset (MPT_ADAPTER *ioc,int reset_phase,int sleepFlag) {CONFIGPARMS *pCfg;unsigned long flags;
@@ -5632,11 +5634,11 @@ mpt_HardResetHandler(MPT_ADAPTER *ioc, iif (MptResetHandlers[ii]) {dtmprintk ((MYIOC_s_INFO_FMT"Calling IOC reset_setup handler #%d\n" , ioc->name, ii)); - r +=mpt_signal_reset (ii, ioc,MPT_IOC_SETUP_RESET ); + r +=mpt_signal_reset (ii, ioc,MPT_IOC_SETUP_RESET , sleepFlag);if (ioc->alt_ioc) {dtmprintk ((MYIOC_s_INFO_FMT"Calling alt-%s setup reset handler #%d\n" , ioc->name, ioc->alt_ioc->name, ii)); - r +=mpt_signal_reset (ii, ioc->alt_ioc,MPT_IOC_SETUP_RESET ); + r +=mpt_signal_reset (ii, ioc->alt_ioc,MPT_IOC_SETUP_RESET , sleepFlag); } } }
drivers/message/fusion/mptbase.h +1 -1
@@ -652,7 +652,7 @@ typedef struct _MPT_ADAPTER*/ typedef int (*MPT_CALLBACK )(MPT_ADAPTER *ioc,MPT_FRAME_HDR *req,MPT_FRAME_HDR *reply);typedef int (*MPT_EVHANDLER )(MPT_ADAPTER *ioc,EventNotificationReply_t *evReply); -typedef int (*MPT_RESETHANDLER )(MPT_ADAPTER *ioc,int reset_phase); +typedef int (*MPT_RESETHANDLER )(MPT_ADAPTER *ioc,int reset_phase,int sleepFlag);/* reset_phase defs */ #define MPT_IOC_PRE_RESET 0#define MPT_IOC_POST_RESET 1
drivers/message/fusion/mptctl.c +2 -2
@@ -134,7 +134,7 @@ static void mptctl_free_tm_flags(MPT_ADA/* * Reset Handler cleanup function */ -static int mptctl_ioc_reset (MPT_ADAPTER *ioc,int reset_phase); +static int mptctl_ioc_reset (MPT_ADAPTER *ioc,int reset_phase,int sleepFlag);/* * Event Handler function
@@ -452,7 +452,7 @@ mptctl_free_tm_flags(MPT_ADAPTER *ioc)* */ static int -mptctl_ioc_reset (MPT_ADAPTER *ioc,int reset_phase) +mptctl_ioc_reset (MPT_ADAPTER *ioc,int reset_phase,int sleepFlag) {MPT_IOCTL *ioctl = ioc->ioctl; dctlprintk((KERN_INFO MYNAM ": IOC %s_reset routed to IOCTL driver!\n",
drivers/message/fusion/mptfc.c +2 -2
@@ -1271,12 +1271,12 @@ mptfc_event_process(MPT_ADAPTER *ioc, Ev }static int -mptfc_ioc_reset (MPT_ADAPTER *ioc,int reset_phase) +mptfc_ioc_reset (MPT_ADAPTER *ioc,int reset_phase,int sleepFlag) {int rc;unsigned long flags; - rc =mptscsih_ioc_reset (ioc,reset_phase); + rc =mptscsih_ioc_reset (ioc, reset_phase, sleepFlag);if (rc ==0 )return rc;
drivers/message/fusion/mptlan.c +2 -2
@@ -141,7 +141,7 @@ static int mpt_lan_receive_post_reply(sstatic int mpt_lan_send_turbo (struct net_device *dev,u32 tmsg);static int mpt_lan_send_reply (struct net_device *dev,LANSendReply_t *pSendRep); -static int mpt_lan_ioc_reset (MPT_ADAPTER *ioc,int reset_phase); +static int mpt_lan_ioc_reset (MPT_ADAPTER *ioc,int reset_phase,int sleepFlag);static int mpt_lan_event_process (MPT_ADAPTER *ioc,EventNotificationReply_t *pEvReply);static unsigned short mpt_lan_type_trans (struct sk_buff *skb,struct net_device *dev);
@@ -309,7 +309,7 @@ lan_reply (MPT_ADAPTER *ioc, MPT_FRAME_H/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ static int -mpt_lan_ioc_reset (MPT_ADAPTER *ioc,int reset_phase) +mpt_lan_ioc_reset (MPT_ADAPTER *ioc,int reset_phase,int sleepFlag) {struct net_device *dev = ioc->netdev;struct mpt_lan_priv *priv;
drivers/message/fusion/mptscsih.c +2 -2
@@ -132,7 +132,7 @@ static int SCPNT_TO_LOOKUP_IDX(struct scstatic int mptscsih_IssueTaskMgmt (MPT_SCSI_HOST *hd,u8 type,u8 channel,u8 target,u8 lun,int ctx2abort,ulong timeout); -int mptscsih_ioc_reset (MPT_ADAPTER *ioc,int post_reset); +int mptscsih_ioc_reset (MPT_ADAPTER *ioc,int post_reset,int sleepFlag);int mptscsih_event_process (MPT_ADAPTER *ioc,EventNotificationReply_t *pEvReply);static void mptscsih_initTarget (MPT_SCSI_HOST *hd,VirtTarget *vtarget,struct scsi_device *sdev);
@@ -2514,7 +2514,7 @@ SCPNT_TO_LOOKUP_IDX(struct scsi_cmnd *sc/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ int -mptscsih_ioc_reset (MPT_ADAPTER *ioc,int reset_phase) +mptscsih_ioc_reset (MPT_ADAPTER *ioc,int reset_phase,int sleepFlag) {MPT_SCSI_HOST *hd;unsigned long flags;
drivers/message/fusion/mptscsih.h +1 -1
@@ -95,7 +95,7 @@ extern int mptscsih_io_done(MPT_ADAPTERextern int mptscsih_taskmgmt_complete (MPT_ADAPTER *ioc,MPT_FRAME_HDR *mf,MPT_FRAME_HDR *r);extern int mptscsih_scandv_complete (MPT_ADAPTER *ioc,MPT_FRAME_HDR *mf,MPT_FRAME_HDR *r);extern int mptscsih_event_process (MPT_ADAPTER *ioc,EventNotificationReply_t *pEvReply); -extern int mptscsih_ioc_reset (MPT_ADAPTER *ioc,int post_reset); +extern int mptscsih_ioc_reset (MPT_ADAPTER *ioc,int post_reset,int sleepFlag);extern int mptscsih_change_queue_depth (struct scsi_device *sdev,int qdepth);extern void mptscsih_timer_expired (unsigned long data);extern int mptscsih_TMHandler (MPT_SCSI_HOST *hd,u8 type,u8 channel,u8 target,u8 lun,int ctx2abort,ulong timeout);
drivers/message/fusion/mptspi.c +10 -4
@@ -814,15 +814,21 @@ mptspi_dv_renegotiate(struct _MPT_SCSI_H* spi module reset handler */ static int -mptspi_ioc_reset (MPT_ADAPTER *ioc,int reset_phase) +mptspi_ioc_reset (MPT_ADAPTER *ioc,int reset_phase,int sleepFlag) {struct _MPT_SCSI_HOST *hd = (struct _MPT_SCSI_HOST *)ioc->sh->hostdata; +struct scsi_device *sdev;int rc; - rc =mptscsih_ioc_reset (ioc, reset_phase); + rc =mptscsih_ioc_reset (ioc, reset_phase, sleepFlag); -if (reset_phase ==MPT_IOC_POST_RESET ) -mptspi_dv_renegotiate (hd); +if (reset_phase ==MPT_IOC_POST_RESET ) { +if (sleepFlag ==CAN_SLEEP ) { +shost_for_each_device (sdev, hd->ioc->sh) +mptspi_dv_device (hd, sdev); + }else +mptspi_dv_renegotiate (hd); + }return rc; }
Quoted 6 lines · Eric Moore
From
host_reset, this patch will complete domain validation in the same context as the eh threads. I've added passing the sleepFlag, which isCAN_SLEEPin the context of eh threads.Mark pls try this with the patch that James posted earlier that prevents re entry to pending dv.
Something isn't working quite right. Here is the log. The modprobe gets stuck.
Sep 20 08:20:37 stp4-000 Fusion MPT base driver 3.04.01
Sep 20 08:20:37 stp4-000 Copyright (c) 1999-2005 LSI Logic Corporation
Sep 20 08:20:37 stp4-000 Fusion MPT SPI Host driver 3.04.01
Sep 20 08:20:37 stp4-000 mptbase: Initiating ioc0 bringup
Sep 20 08:20:39 stp4-000 ioc0: 53C1030: Capabilities={Initiator}
Sep 20 08:20:40 stp4-000 scsi1 : ioc0: LSI53C1030, FwRev=01030a00h, Ports=1, MaxQ=222, IRQ=20
Sep 20 08:20:41 stp4-000 scsi 1:0:1:0: Direct access HP 18.2GB C 80-H008 H008 PQ: 0 ANSI: 2
Sep 20 08:20:41 stp4-000 target1:0:1: Beginning Domain Validation
Sep 20 08:20:41 stp4-000 target1:0:1: Ending Domain Validation
Sep 20 08:20:41 stp4-000 target1:0:1: FAST-80 WIDE SCSI 160.0 MB/s DT RTI WRFLOW PCOMP (12.5 ns, offset 126)
Sep 20 08:20:41 stp4-000 SCSI device sdb: 35566480 512-byte hdwr sectors (18210 MB)
Sep 20 08:20:41 stp4-000 sdb: Write Protect is off
Sep 20 08:20:41 stp4-000 sdb: Mode Sense: a7 00 10 08
Sep 20 08:20:41 stp4-000 SCSI device sdb: drive cache: write back w/ FUA
Sep 20 08:20:41 stp4-000 SCSI device sdb: 35566480 512-byte hdwr sectors (18210 MB)
Sep 20 08:20:41 stp4-000 sdb: Write Protect is off
Sep 20 08:20:41 stp4-000 sdb: Mode Sense: a7 00 10 08
Sep 20 08:20:41 stp4-000 SCSI device sdb: drive cache: write back w/ FUA
Sep 20 08:20:41 stp4-000 sdb: sdb1
Sep 20 08:20:41 stp4-000 sd 1:0:1:0: Attached scsi disk sdb
Sep 20 08:20:41 stp4-000 sd 1:0:1:0: Attached scsi generic sg1 type 0
Sep 20 08:20:41 stp4-000 scsi 1:0:2:0: Direct access HP 18.2GB C 80-H008 H008 PQ: 0 ANSI: 2
Sep 20 08:20:41 stp4-000 target1:0:2: Beginning Domain Validation
Sep 20 08:20:41 stp4-000 target1:0:2: Ending Domain Validation
Sep 20 08:20:41 stp4-000 target1:0:2: FAST-80 WIDE SCSI 160.0 MB/s DT RTI WRFLOW PCOMP (12.5 ns, offset 126)
Sep 20 08:20:41 stp4-000 SCSI device sdc: 35566480 512-byte hdwr sectors (18210 MB)
Sep 20 08:20:42 stp4-000 sdc: Write Protect is off
Sep 20 08:20:42 stp4-000 sdc: Mode Sense: a7 00 10 08
Sep 20 08:20:42 stp4-000 SCSI device sdc: drive cache: write back w/ FUA
Sep 20 08:20:42 stp4-000 SCSI device sdc: 35566480 512-byte hdwr sectors (18210 MB)
Sep 20 08:20:42 stp4-000 sdc: Write Protect is off
Sep 20 08:20:42 stp4-000 sdc: Mode Sense: a7 00 10 08
Sep 20 08:20:42 stp4-000 SCSI device sdc: drive cache: write back w/ FUA
Sep 20 08:20:42 stp4-000 sdc: unknown partition table
Sep 20 08:20:42 stp4-000 sd 1:0:2:0: Attached scsi disk sdc
Sep 20 08:20:42 stp4-000 sd 1:0:2:0: Attached scsi generic sg2 type 0
Sep 20 08:20:42 stp4-000 scsi 1:0:3:0: Direct access HP 18.2GB C 80-H008 H008 PQ: 0 ANSI: 2
Sep 20 08:20:42 stp4-000 target1:0:3: Beginning Domain Validation
Sep 20 08:20:42 stp4-000 target1:0:3: Ending Domain Validation
Sep 20 08:20:42 stp4-000 target1:0:3: FAST-80 WIDE SCSI 160.0 MB/s DT RTI WRFLOW PCOMP (12.5 ns, offset 126)
Sep 20 08:20:42 stp4-000 SCSI device sdd: 35566480 512-byte hdwr sectors (18210 MB)
Sep 20 08:20:42 stp4-000 sdd: Write Protect is off
Sep 20 08:20:42 stp4-000 sdd: Mode Sense: a7 00 10 08
Sep 20 08:20:42 stp4-000 SCSI device sdd: drive cache: write back w/ FUA
Sep 20 08:20:42 stp4-000 SCSI device sdd: 35566480 512-byte hdwr sectors (18210 MB)
Sep 20 08:20:42 stp4-000 sdd: Write Protect is off
Sep 20 08:20:42 stp4-000 sdd: Mode Sense: a7 00 10 08
Sep 20 08:20:42 stp4-000 SCSI device sdd: drive cache: write back w/ FUA
Sep 20 08:20:42 stp4-000 sdd: unknown partition table
Sep 20 08:20:42 stp4-000 sd 1:0:3:0: Attached scsi disk sdd
Sep 20 08:20:42 stp4-000 sd 1:0:3:0: Attached scsi generic sg3 type 0
Sep 20 08:20:42 stp4-000 scsi 1:0:5:0: Processor HP D5989C 1.06 PQ: 0 ANSI: 2
Sep 20 08:20:42 stp4-000 target1:0:5: Beginning Domain Validation
Sep 20 08:20:42 stp4-000 target1:0:5: Ending Domain Validation
Sep 20 08:20:42 stp4-000 target1:0:5: asynchronous
Sep 20 08:20:42 stp4-000 scsi 1:0:5:0: Attached scsi generic sg4 type 3
Sep 20 08:20:42 stp4-000 scsi 1:0:8:0: Direct access HP 18.2G MAP3367NC#HJ HPC6 PQ: 0 ANSI: 3
Sep 20 08:20:42 stp4-000 target1:0:8: Beginning Domain Validation
Sep 20 08:20:52 stp4-000 mptscsih: ioc0: attempting task abort! (sc=d4c2be60)
Sep 20 08:20:52 stp4-000 scsi 1:0:8:0:
Sep 20 08:20:52 stp4-000 command: cdb[0]=0x12: 12 00 00 00 60 00
Sep 20 08:20:54 stp4-000 mptbase: Initiating ioc0 recovery
Sep 20 08:21:19 stp4-000 target1:0:1: Beginning Domain ValidationQuoted 1 line
Signature · 1 line
Mark Haverkamp <[email protected]>