mpt fusion: Resending Code clean up patch
Subsystems (2)
PATCH 1/3 mpt fusion: Resending Code clean up patch
Resending patch considering Grants G's code review.
Main goal to submit this patch is code cleaup.
1. Better driver debug prints and code indentation.
2. fault_reset_work_lock is not used anywhere. driver is using taskmgmt_lock instead of fault_reset_work_lock.
3. setting pci_set_drvdata properly.
4. Ingore config request when IOC is in reset state.( ioc_reset_in_progress is set).
5. Init/clear managment frame proprely.(INITIALIZE_MGMT_STATUS and CLEAR_MGMT_STATUS)
---
---
drivers/message/fusion/mptbase.c +284 -133
@@ -207,7 +207,6 @@ static int procmpt_iocinfo_read(char *buf, char **start, off_t offset,#endif static void mpt_get_fw_exp_ver (char *buf,MPT_ADAPTER *ioc); -//int mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag); static int ProcessEventNotification (MPT_ADAPTER *ioc,EventNotificationReply_t *evReply,int *evHandlers);static void mpt_iocstatus_info (MPT_ADAPTER *ioc,u32 ioc_status,MPT_FRAME_HDR *mf);
@@ -374,11 +373,11 @@ mpt_fault_reset_work(struct work_struct *work) ioc = ioc->alt_ioc;/* rearm the timer */ -spin_lock_irqsave (&ioc->fault_reset_work_lock, flags); +spin_lock_irqsave (&ioc->taskmgmt_lock, flags);if (ioc->reset_work_q)queue_delayed_work (ioc->reset_work_q, &ioc->fault_reset_work,msecs_to_jiffies (MPT_POLLING_INTERVAL )); -spin_unlock_irqrestore (&ioc->fault_reset_work_lock, flags); +spin_unlock_irqrestore (&ioc->taskmgmt_lock, flags); }
@@ -972,11 +971,15 @@ mpt_free_msg_frame(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf)/* Put Request back on FreeQ! */ spin_lock_irqsave (&ioc->FreeQlock, flags); - mf->u.frame.linkage.arg1 =0xdeadbeaf ;/* signature to know if this mf is freed */ +if (cpu_to_le32 (mf->u.frame.linkage.arg1) ==0xdeadbeaf ) + goto out; +/* signature to know if this mf is freed */ + mf->u.frame.linkage.arg1 =cpu_to_le32 (0xdeadbeaf );list_add_tail (&mf->u.frame.linkage.list, &ioc->FreeQ);#ifdef MFCNT ioc->mfcnt--;#endif + out:spin_unlock_irqrestore (&ioc->FreeQlock, flags); }
@@ -1728,6 +1731,7 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) ioc->id = mpt_ids++;sprintf (ioc->name,"ioc%d" , ioc->id); + dinitprintk(ioc, printk(KERN_WARNING MYNAM ": mpt_adapter_install\n"));/* * set initial debug level
@@ -1768,7 +1772,6 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) ioc->reply_sz =MPT_REPLY_FRAME_SIZE ; ioc->pcidev = pdev; -spin_lock_init (&ioc->initializing_hba_lock);spin_lock_init (&ioc->taskmgmt_lock);mutex_init (&ioc->internal_cmds.mutex);
@@ -1789,6 +1792,7 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) ioc->mfcnt =0 ;#endif + ioc->sh =NULL ; ioc->cached_fw =NULL ;/* Initilize SCSI Config Data structure
@@ -1805,9 +1809,8 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)/* Initialize workqueue */ INIT_DELAYED_WORK (&ioc->fault_reset_work, mpt_fault_reset_work); -spin_lock_init (&ioc->fault_reset_work_lock); -snprintf (ioc->reset_work_q_name,sizeof (ioc->reset_work_q_name), +snprintf (ioc->reset_work_q_name,MPT_KOBJ_NAME_LEN ,"mpt_poll_%d" , ioc->id); ioc->reset_work_q =create_singlethread_workqueue (ioc->reset_work_q_name);
@@ -1882,11 +1885,14 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)case MPI_MANUFACTPAGE_DEVID_SAS1064 :case MPI_MANUFACTPAGE_DEVID_SAS1068 : ioc->errata_flag_1064 =1 ; + ioc->bus_type =SAS ; +break ;case MPI_MANUFACTPAGE_DEVID_SAS1064E :case MPI_MANUFACTPAGE_DEVID_SAS1068E :case MPI_MANUFACTPAGE_DEVID_SAS1078 : ioc->bus_type =SAS ; +break ; }
@@ -1930,7 +1936,7 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)INIT_LIST_HEAD (&ioc->fw_event_list);spin_lock_init (&ioc->fw_event_lock); -snprintf (ioc->fw_event_q_name,20 ,"mpt/%d" , ioc->id); +snprintf (ioc->fw_event_q_name,MPT_KOBJ_NAME_LEN ,"mpt/%d" , ioc->id); ioc->fw_event_q =create_singlethread_workqueue (ioc->fw_event_q_name); if ((r = mpt_do_ioc_recovery(ioc, MPT_HOSTEVENT_IOC_BRINGUP,
@@ -2005,10 +2011,10 @@ mpt_detach(struct pci_dev *pdev)/* * Stop polling ioc for fault condition */ -spin_lock_irqsave (&ioc->fault_reset_work_lock, flags); +spin_lock_irqsave (&ioc->taskmgmt_lock, flags); wq = ioc->reset_work_q; ioc->reset_work_q =NULL ; -spin_unlock_irqrestore (&ioc->fault_reset_work_lock, flags); +spin_unlock_irqrestore (&ioc->taskmgmt_lock, flags);cancel_delayed_work (&ioc->fault_reset_work);destroy_workqueue (wq);
@@ -2231,12 +2237,16 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) ioc->active =0 ;if (ioc->alt_ioc) { -if (ioc->alt_ioc->active) +if (ioc->alt_ioc->active || + reason ==MPT_HOSTEVENT_IOC_RECOVER ) { reset_alt_ioc_active =1 ; - -/* Disable alt-IOC's reply interrupts (and FreeQ) for a bit ... */ -CHIPREG_WRITE32 (&ioc->alt_ioc->chip->IntMask,0xFFFFFFFF ); - ioc->alt_ioc->active =0 ; +/* Disable alt-IOC's reply interrupts +* (and FreeQ) for a bit +**/ +CHIPREG_WRITE32 (&ioc->alt_ioc->chip->IntMask, +0xFFFFFFFF ); + ioc->alt_ioc->active =0 ; + } } hard =1 ;
@@ -2257,9 +2267,11 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) } }else { -printk (MYIOC_s_WARN_FMT"NOT READY!\n" , ioc->name); +printk (MYIOC_s_WARN_FMT +"NOT READY WARNING!\n" , ioc->name); } -return -1 ; + ret =-1 ; + goto out; }/* hard_reset_done = 0 if a soft reset was performed
@@ -2269,7 +2281,9 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)if ((rc =MakeIocReady (ioc->alt_ioc,0 , sleepFlag)) ==0 ) alt_ioc_ready =1 ;else -printk (MYIOC_s_WARN_FMT"alt_ioc not ready!\n" , ioc->alt_ioc->name); +printk (MYIOC_s_WARN_FMT +": alt-ioc Not ready WARNING!\n" , + ioc->alt_ioc->name); }for (ii=0 ; ii<5 ; ii++) {
@@ -2290,7 +2304,8 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)if (alt_ioc_ready) {if ((rc =GetIocFacts (ioc->alt_ioc, sleepFlag, reason)) !=0 ) {dinitprintk (ioc,printk (MYIOC_s_DEBUG_FMT -"Initial Alt IocFacts failed rc=%x\n" , ioc->name, rc)); +"Initial Alt IocFacts failed rc=%x\n" , + ioc->name, rc));/* Retry - alt IOC was initialized once */ rc =GetIocFacts (ioc->alt_ioc, sleepFlag, reason);
@@ -2334,16 +2349,20 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) IRQF_SHARED, ioc->name, ioc);if (rc <0 ) {printk (MYIOC_s_ERR_FMT"Unable to allocate " -"interrupt %d!\n" , ioc->name, ioc->pcidev->irq); +"interrupt %d!\n" , + ioc->name, ioc->pcidev->irq);if (ioc->msi_enable)pci_disable_msi (ioc->pcidev); -return -EBUSY ; + ret = -EBUSY ; + goto out; } irq_allocated =1 ; ioc->pci_irq = ioc->pcidev->irq;pci_set_master (ioc->pcidev);/* ?? */ -dprintk (ioc,printk (MYIOC_s_INFO_FMT"installed at interrupt " -"%d\n" , ioc->name, ioc->pcidev->irq)); +pci_set_drvdata (ioc->pcidev, ioc); +dinitprintk (ioc,printk (MYIOC_s_INFO_FMT +"installed at interrupt %d\n" , ioc->name, + ioc->pcidev->irq)); } }
@@ -2352,17 +2371,22 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)* init as upper addresses are needed for init. * If fails, continue with alt-ioc processing */ +dinitprintk (ioc,printk (MYIOC_s_INFO_FMT"PrimeIocFifos\n" , + ioc->name));if ((ret ==0 ) && ((rc =PrimeIocFifos (ioc)) !=0 )) ret =-3 ;/* May need to check/upload firmware & data here! * If fails, continue with alt-ioc processing */ +dinitprintk (ioc,printk (MYIOC_s_INFO_FMT"SendIocInit\n" , + ioc->name));if ((ret ==0 ) && ((rc =SendIocInit (ioc, sleepFlag)) !=0 )) ret =-4 ;// NEW! if (alt_ioc_ready && ((rc =PrimeIocFifos (ioc->alt_ioc)) !=0 )) { -printk (MYIOC_s_WARN_FMT": alt_ioc (%d) FIFO mgmt alloc!\n" , +printk (MYIOC_s_WARN_FMT +": alt-ioc (%d) FIFO mgmt alloc WARNING!\n" , ioc->alt_ioc->name, rc); alt_ioc_ready =0 ; reset_alt_ioc_active =0 ;
@@ -2372,8 +2396,9 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)if ((rc =SendIocInit (ioc->alt_ioc, sleepFlag)) !=0 ) { alt_ioc_ready =0 ; reset_alt_ioc_active =0 ; -printk (MYIOC_s_WARN_FMT"alt_ioc (%d) init failure!\n" , - ioc->alt_ioc->name, rc); +printk (MYIOC_s_WARN_FMT +": alt-ioc: (%d) init failure WARNING!\n" , + ioc->alt_ioc->name, rc); } }
@@ -2454,8 +2479,9 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)mutex_init (&ioc->raid_data.inactive_list_mutex);INIT_LIST_HEAD (&ioc->raid_data.inactive_list); -if (ioc->bus_type ==SAS ) { +switch (ioc->bus_type) { +case SAS :/* clear persistency table */ if (ioc->facts.IOCExceptions &MPI_IOCFACTS_EXCEPT_PERSISTENT_TABLE_FULL ) {
@@ -2469,8 +2495,15 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)*/ mpt_findImVolumes (ioc); - }else if (ioc->bus_type ==FC ) { -if ((ioc->pfacts[0 ].ProtocolFlags &MPI_PORTFACTS_PROTOCOL_LAN ) && +/* Check, and possibly reset, the coalescing value +*/ +mpt_read_ioc_pg_1 (ioc); + +break ; + +case FC : +if ((ioc->pfacts[0 ].ProtocolFlags & +MPI_PORTFACTS_PROTOCOL_LAN ) && (ioc->lan_cnfg_page0.Header.PageLength ==0 )) {/* * Pre-fetch the ports LAN MAC address!
@@ -2479,11 +2512,14 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) (void )GetLanConfigPages (ioc); a = (u8 *)&ioc->lan_cnfg_page1.HardwareAddressLow;dprintk (ioc,printk (MYIOC_s_DEBUG_FMT -"LanAddr = %02X:%02X:%02X:%02X:%02X:%02X\n" , - ioc->name, a[5 ], a[4 ], a[3 ], a[2 ], a[1 ], a[0 ])); - +"LanAddr = %02X:%02X:%02X" +":%02X:%02X:%02X\n" , + ioc->name, a[5 ], a[4 ], + a[3 ], a[2 ], a[1 ], a[0 ])); } - }else { +break ; + +case SPI :/* Get NVRAM and adapter maximums from SPP 0 and 2 */ mpt_GetScsiPortSettings (ioc,0 );
@@ -2502,6 +2538,8 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)mpt_read_ioc_pg_1 (ioc);mpt_read_ioc_pg_4 (ioc); + +break ; }GetIoUnitPage2 (ioc);
@@ -2583,16 +2621,20 @@ mpt_detect_bound_ports(MPT_ADAPTER *ioc, struct pci_dev *pdev)if (_pcidev == peer) {/* Paranoia checks */ if (ioc->alt_ioc !=NULL ) { -printk (MYIOC_s_WARN_FMT"Oops, already bound to %s!\n" , - ioc->name, ioc->alt_ioc->name); +printk (MYIOC_s_WARN_FMT +"Oops, already bound (%s <==> %s)!\n" , + ioc->name, ioc->name, ioc->alt_ioc->name);break ; }else if (ioc_srch->alt_ioc !=NULL ) { -printk (MYIOC_s_WARN_FMT"Oops, already bound to %s!\n" , - ioc_srch->name, ioc_srch->alt_ioc->name); +printk (MYIOC_s_WARN_FMT +"Oops, already bound (%s <==> %s)!\n" , + ioc_srch->name, ioc_srch->name, + ioc_srch->alt_ioc->name);break ; } -dprintk (ioc,printk (MYIOC_s_INFO_FMT"FOUND! binding to %s\n" , - ioc->name, ioc_srch->name)); +dprintk (ioc,printk (MYIOC_s_DEBUG_FMT +"FOUND! binding %s <==> %s\n" , + ioc->name, ioc->name, ioc_srch->name)); ioc_srch->alt_ioc = ioc; ioc->alt_ioc = ioc_srch; }
@@ -2612,8 +2654,8 @@ mpt_adapter_disable(MPT_ADAPTER *ioc)int ret;if (ioc->cached_fw !=NULL ) { -ddlprintk (ioc,printk (MYIOC_s_DEBUG_FMT"%s: Pushing FW onto " -"adapter\n" , __func__, ioc->name)); +ddlprintk (ioc,printk (MYIOC_s_DEBUG_FMT +"%s: Pushing FW onto adapter\n" , __func__, ioc->name));if ((ret =mpt_downloadboot (ioc, (MpiFwHeader_t *) ioc->cached_fw,CAN_SLEEP )) <0 ) { printk(MYIOC_s_WARN_FMT
@@ -2623,10 +2665,13 @@ mpt_adapter_disable(MPT_ADAPTER *ioc) }/* Disable adapter interrupts! */ +synchronize_irq (ioc->pcidev->irq);CHIPREG_WRITE32 (&ioc->chip->IntMask,0xFFFFFFFF ); ioc->active =0 ; +/* Clear any lingering interrupt */ CHIPREG_WRITE32 (&ioc->chip->IntStatus,0 ); +CHIPREG_READ32 (&ioc->chip->IntStatus);if (ioc->alloc !=NULL ) { sz = ioc->alloc_sz;
@@ -2686,19 +2731,22 @@ mpt_adapter_disable(MPT_ADAPTER *ioc)if ((ret =mpt_host_page_access_control (ioc,MPI_DB_HPBAC_FREE_BUFFER ,NO_SLEEP )) !=0 ) {printk (MYIOC_s_ERR_FMT -"host page buffers free failed (%d)!\n" , - ioc->name, ret); +": %s: host page buffers free failed (%d)!\n" , + ioc->name, __func__, ret); } -dexitprintk (ioc,printk (MYIOC_s_INFO_FMT"HostPageBuffer free @ %p, sz=%d bytes\n" , - ioc->name, ioc->HostPageBuffer, ioc->HostPageBuffer_sz)); +dexitprintk (ioc,printk (MYIOC_s_DEBUG_FMT +"HostPageBuffer free @ %p, sz=%d bytes\n" , + ioc->name, ioc->HostPageBuffer, + ioc->HostPageBuffer_sz));pci_free_consistent (ioc->pcidev, ioc->HostPageBuffer_sz, ioc->HostPageBuffer, ioc->HostPageBuffer_dma); ioc->HostPageBuffer =NULL ; ioc->HostPageBuffer_sz =0 ; ioc->alloc_total -= ioc->HostPageBuffer_sz; } -} +pci_set_drvdata (ioc->pcidev,NULL ); +}/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /** * mpt_adapter_dispose - Free all resources associated with an MPT adapter
@@ -2838,8 +2886,12 @@ MakeIocReady(MPT_ADAPTER *ioc, int force, int sleepFlag) }/* Is it already READY? */ -if (!statefault && (ioc_state &MPI_IOC_STATE_MASK ) ==MPI_IOC_STATE_READY ) +if (!statefault && + ((ioc_state &MPI_IOC_STATE_MASK ) ==MPI_IOC_STATE_READY )) { +dinitprintk (ioc,printk (MYIOC_s_INFO_FMT +"IOC is in READY state\n" , ioc->name));return 0 ; + }/* * Check to see if IOC is in FAULT state.
@@ -2912,8 +2964,9 @@ MakeIocReady(MPT_ADAPTER *ioc, int force, int sleepFlag) ii++; cntdn--;if (!cntdn) { -printk (MYIOC_s_ERR_FMT"Wait IOC_READY state timeout(%d)!\n" , - ioc->name, (int )((ii+5 )/HZ )); +printk (MYIOC_s_ERR_FMT +"Wait IOC_READY state (0x%x) timeout(%d)!\n" , + ioc->name, ioc_state, (int )((ii+5 )/HZ ));return -ETIME ; }
@@ -2926,9 +2979,8 @@ MakeIocReady(MPT_ADAPTER *ioc, int force, int sleepFlag) }if (statefault <3 ) { -printk (MYIOC_s_INFO_FMT"Recovered from %s\n" , - ioc->name, - statefault==1 ?"stuck handshake" :"IOC FAULT" ); +printk (MYIOC_s_INFO_FMT"Recovered from %s\n" , ioc->name, + statefault ==1 ?"stuck handshake" :"IOC FAULT" ); }return hard_reset_done;
@@ -2981,8 +3033,9 @@ GetIocFacts(MPT_ADAPTER *ioc, int sleepFlag, int reason)/* IOC *must* NOT be in RESET state! */ if (ioc->last_state ==MPI_IOC_STATE_RESET ) { -printk (MYIOC_s_ERR_FMT"Can't get IOCFacts NOT READY! (%08x)\n" , - ioc->name, ioc->last_state ); + printk(KERN_ERR MYNAM +": ERROR - Can't get IOCFacts, %s NOT READY! (%08x)\n" , + ioc->name, ioc->last_state);return -44 ; }
@@ -3044,7 +3097,7 @@ GetIocFacts(MPT_ADAPTER *ioc, int sleepFlag, int reason)* Old: u16{Major(4),Minor(4),SubMinor(8)} * New: u32{Major(8),Minor(8),Unit(8),Dev(8)} */ -if (facts->MsgVersion <0x0102 ) { +if (facts->MsgVersion <MPI_VERSION_01_02 ) {/* * Handle old FC f/w style, convert to new... */
@@ -3056,9 +3109,11 @@ GetIocFacts(MPT_ADAPTER *ioc, int sleepFlag, int reason) facts->FWVersion.Word =le32_to_cpu (facts->FWVersion.Word); facts->ProductID =le16_to_cpu (facts->ProductID); +if ((ioc->facts.ProductID &MPI_FW_HEADER_PID_PROD_MASK ) >MPI_FW_HEADER_PID_PROD_TARGET_SCSI ) ioc->ir_firmware =1 ; + facts->CurrentHostMfaHighAddr =le32_to_cpu (facts->CurrentHostMfaHighAddr); facts->GlobalCredits =le16_to_cpu (facts->GlobalCredits);
@@ -3074,7 +3129,7 @@ GetIocFacts(MPT_ADAPTER *ioc, int sleepFlag, int reason)* to 14 in MPI-1.01.0x. */ if (facts->MsgLength >= (offsetof(IOCFactsReply_t ,FWImageSize) +7 )/4 && - facts->MsgVersion >0x0100 ) { + facts->MsgVersion >MPI_VERSION_01_00 ) { facts->FWImageSize =le32_to_cpu (facts->FWImageSize); }
@@ -3256,6 +3311,7 @@ SendIocInit(MPT_ADAPTER *ioc, int sleepFlag) ioc_init.MaxDevices = (U8 )ioc->devices_per_bus; ioc_init.MaxBuses = (U8 )ioc->number_of_buses; +dinitprintk (ioc,printk (MYIOC_s_DEBUG_FMT"facts.MsgVersion=%x\n" , ioc->name, ioc->facts.MsgVersion));if (ioc->facts.MsgVersion >=MPI_VERSION_01_05 ) {
@@ -3270,7 +3326,7 @@ SendIocInit(MPT_ADAPTER *ioc, int sleepFlag) } ioc_init.ReplyFrameSize =cpu_to_le16 (ioc->reply_sz);/* in BYTES */ -if (sizeof (dma_addr_t) ==sizeof (u64)) { +if (ioc->sg_addr_size ==sizeof (u64)) {/* Save the upper 32-bits of the request * (reply) and sense buffers. */
@@ -3523,29 +3579,29 @@ mpt_do_upload(MPT_ADAPTER *ioc, int sleepFlag) ii =mpt_handshake_req_reply_wait (ioc, request_size, (u32 *)prequest, reply_sz, (u16 *)preply,65 /*seconds*/ , sleepFlag); -dinitprintk (ioc,printk (MYIOC_s_INFO_FMT": FW Upload completed rc=%x \n" , ioc->name, ii)); +dinitprintk (ioc,printk (MYIOC_s_DEBUG_FMT"FW Upload completed " +"rc=%x \n" , ioc->name, ii)); cmdStatus = -EFAULT ;if (ii ==0 ) {/* Handshake transfer was complete and successful. * Check the Reply Frame. */ -int status, transfer_sz; - status =le16_to_cpu (preply->IOCStatus); -if (status ==MPI_IOCSTATUS_SUCCESS ) { - transfer_sz =le32_to_cpu (preply->ActualImageSize); -if (transfer_sz == sz) +int status; + status =le16_to_cpu (preply->IOCStatus) & +MPI_IOCSTATUS_MASK ; +if (status ==MPI_IOCSTATUS_SUCCESS && + ioc->facts.FWImageSize == +le32_to_cpu (preply->ActualImageSize)) cmdStatus =0 ; - } }dinitprintk (ioc,printk (MYIOC_s_DEBUG_FMT": do_upload cmdStatus=%d \n" , ioc->name, cmdStatus));if (cmdStatus) { - -ddlprintk (ioc,printk (MYIOC_s_DEBUG_FMT": fw upload failed, freeing image \n" , - ioc->name)); +ddlprintk (ioc,printk (MYIOC_s_DEBUG_FMT"fw upload failed, " +"freeing image \n" , ioc->name));mpt_free_fw_memory (ioc); }kfree (prequest);
@@ -3869,6 +3925,10 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag)CHIPREG_WRITE32 (&ioc->chip->IntStatus,0 );if (ioc->pcidev->device ==MPI_MANUFACTPAGE_DEVID_SAS1078 ) { + +if (!ignore) +return 0 ; +drsprintk (ioc,printk (MYIOC_s_WARN_FMT"%s: Doorbell=%p; 1078 reset " "address=%p\n" , ioc->name, __func__, &ioc->chip->Doorbell, &ioc->chip->Reset_1078));
@@ -3886,6 +3946,7 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag)"looking for READY STATE: doorbell=%x" " count=%d\n" , ioc->name, doorbell, count)); +if (doorbell ==MPI_IOC_STATE_READY ) {return 1 ; }
@@ -4036,6 +4097,10 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag) doorbell =CHIPREG_READ32 (&ioc->chip->Doorbell); doorbell &=MPI_IOC_STATE_MASK ; +drsprintk (ioc,printk (MYIOC_s_DEBUG_FMT +"looking for READY STATE: doorbell=%x" +" count=%d\n" , ioc->name, doorbell, count)); +if (doorbell ==MPI_IOC_STATE_READY ) {break ; }
@@ -4047,6 +4112,11 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag)mdelay (1000 ); } } + +if (doorbell !=MPI_IOC_STATE_READY ) +printk (MYIOC_s_ERR_FMT"Failed to come READY " +"after reset! IocState=%x" , ioc->name, + doorbell); } }
@@ -4165,8 +4235,9 @@ SendIocReset(MPT_ADAPTER *ioc, u8 reset_type, int sleepFlag)if (sleepFlag !=CAN_SLEEP ) count *=10 ; -printk (MYIOC_s_ERR_FMT"Wait IOC_READY state timeout(%d)!\n" , - ioc->name, (int )((count+5 )/HZ )); +printk (MYIOC_s_ERR_FMT +"Wait IOC_READY state (0x%x) timeout(%d)!\n" , + ioc->name, state, (int )((count+5 )/HZ ));return -ETIME ; }
@@ -4252,8 +4323,14 @@ initChainBuffers(MPT_ADAPTER *ioc)dinitprintk (ioc,printk (MYIOC_s_DEBUG_FMT"num_sge=%d numSGE=%d\n" , ioc->name, num_sge, numSGE)); -if ( numSGE >MPT_SCSI_SG_DEPTH ) - numSGE =MPT_SCSI_SG_DEPTH ; +if (ioc->bus_type ==FC ) { +if (numSGE >MPT_SCSI_FC_SG_DEPTH ) + numSGE =MPT_SCSI_FC_SG_DEPTH ; + } +else { +if (numSGE >MPT_SCSI_SG_DEPTH ) + numSGE =MPT_SCSI_SG_DEPTH ; + } num_chain =1 ;while (numSGE - num_sge >0 ) {
@@ -4490,6 +4567,7 @@ PrimeIocFifos(MPT_ADAPTER *ioc)return 0 ; out_fail: +if (ioc->alloc !=NULL ) { sz = ioc->alloc_sz; pci_free_consistent(ioc->pcidev,
@@ -5607,17 +5685,20 @@ mpt_inactive_raid_volumes(MPT_ADAPTER *ioc, u8 channel, u8 id)* -ENOMEM if pci_alloc failed **/ int -mpt_raid_phys_disk_pg0 (MPT_ADAPTER *ioc,u8 phys_disk_num,pRaidPhysDiskPage0_t phys_disk) +mpt_raid_phys_disk_pg0 (MPT_ADAPTER *ioc,u8 phys_disk_num, +RaidPhysDiskPage0_t *phys_disk) { -CONFIGPARMS cfg; -ConfigPageHeader_t hdr; +CONFIGPARMS cfg; +ConfigPageHeader_t hdr;dma_addr_t dma_handle;pRaidPhysDiskPage0_t buffer =NULL ;int rc;memset (&cfg,0 ,sizeof (CONFIGPARMS ));memset (&hdr,0 ,sizeof (ConfigPageHeader_t)); +memset (phys_disk,0 ,sizeof (RaidPhysDiskPage0_t)); + hdr.PageVersion =MPI_RAIDPHYSDISKPAGE0_PAGEVERSION ; hdr.PageType =MPI_CONFIG_PAGETYPE_RAID_PHYSDISK ; cfg.cfghdr.hdr = &hdr; cfg.physAddr =-1 ;
@@ -6071,7 +6152,8 @@ mpt_config(MPT_ADAPTER *ioc, CONFIGPARMS *pCfg)int ret;u8 page_type =0 , extend_page;unsigned long timeleft; -int in_isr; +unsigned long flags; +int in_isr;u8 issue_hard_reset =0 ;u8 retry_count =0 ;
@@ -6083,7 +6165,17 @@ mpt_config(MPT_ADAPTER *ioc, CONFIGPARMS *pCfg)dcprintk (ioc,printk (MYIOC_s_WARN_FMT"Config request not allowed in ISR context!\n" , ioc->name));return -EPERM ; + } + +/* don't send a config page during diag reset */ +spin_lock_irqsave (&ioc->taskmgmt_lock, flags); +if (ioc->ioc_reset_in_progress) { +dfailprintk (ioc,printk (MYIOC_s_DEBUG_FMT +"%s: busy with host reset\n" , ioc->name, __func__)); +spin_unlock_irqrestore (&ioc->taskmgmt_lock, flags); +return -EBUSY ; } +spin_unlock_irqrestore (&ioc->taskmgmt_lock, flags);/* don't send if no chance of success */ if (!ioc->active ||
@@ -6266,6 +6358,12 @@ mpt_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)MPT_MGMT_STATUS_DID_IOCRESET ;complete (&ioc->mptbase_cmds.done); } +/* wake up taskmgmt_cmds */ +if (ioc->taskmgmt_cmds.status &MPT_MGMT_STATUS_PENDING ) { + ioc->taskmgmt_cmds.status |= +MPT_MGMT_STATUS_DID_IOCRESET ; +complete (&ioc->taskmgmt_cmds.done); + }break ;default :break ;
@@ -6688,7 +6786,9 @@ int mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag) {int rc; +u8 cb_idx;unsigned long flags; +unsigned long time_count;dtmprintk (ioc,printk (MYIOC_s_DEBUG_FMT"HardResetHandler Entered!\n" , ioc->name));#ifdef MFCNT
@@ -6719,30 +6819,24 @@ mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag)* Prevents timeouts occurring during a diagnostic reset...very bad. * For all other protocol drivers, this is a no-op. */ - { -u8 cb_idx; -int r =0 ; - -for (cb_idx =MPT_MAX_PROTOCOL_DRIVERS -1 ; cb_idx; cb_idx--) { -if (MptResetHandlers[cb_idx]) { -dtmprintk (ioc,printk (MYIOC_s_DEBUG_FMT"Calling IOC reset_setup handler #%d\n" , - ioc->name, cb_idx)); - r +=mpt_signal_reset (cb_idx, ioc,MPT_IOC_SETUP_RESET ); -if (ioc->alt_ioc) { -dtmprintk (ioc,printk (MYIOC_s_DEBUG_FMT"Calling alt-%s setup reset handler #%d\n" , - ioc->name, ioc->alt_ioc->name, cb_idx)); - r +=mpt_signal_reset (cb_idx, ioc->alt_ioc,MPT_IOC_SETUP_RESET ); - } - } +for (cb_idx =MPT_MAX_PROTOCOL_DRIVERS -1 ; cb_idx; cb_idx--) { +if (MptResetHandlers[cb_idx]) { +mpt_signal_reset (cb_idx, ioc,MPT_IOC_SETUP_RESET ); +if (ioc->alt_ioc) +mpt_signal_reset (cb_idx, ioc->alt_ioc, +MPT_IOC_SETUP_RESET ); } } -if ((rc =mpt_do_ioc_recovery (ioc,MPT_HOSTEVENT_IOC_RECOVER , sleepFlag)) !=0 ) { -printk (MYIOC_s_WARN_FMT"Cannot recover rc = %d!\n" , ioc->name, rc); + time_count = jiffies; + rc =mpt_do_ioc_recovery (ioc,MPT_HOSTEVENT_IOC_RECOVER , sleepFlag); +if (rc !=0 ) { + printk(KERN_WARNING MYNAM + ": WARNING - (%d) Cannot recover %s\n", rc, ioc->name); + }else { +if (ioc->hard_resets <-1 ) + ioc->hard_resets++; } - ioc->reload_fw =0 ; -if (ioc->alt_ioc) - ioc->alt_ioc->reload_fw =0 ;spin_lock_irqsave (&ioc->taskmgmt_lock, flags); ioc->taskmgmt_quiesce_io =0 ;
@@ -6755,16 +6849,27 @@ mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag) }spin_unlock_irqrestore (&ioc->taskmgmt_lock, flags); -dtmprintk (ioc,printk (MYIOC_s_DEBUG_FMT"HardResetHandler rc = %d!\n" , ioc->name, rc)); +dtmprintk (ioc, +printk (MYIOC_s_DEBUG_FMT +"HardResetHandler: completed (%d seconds): %s\n" , ioc->name, +jiffies_to_msecs (jiffies - time_count)/1000 , ((rc ==0 ) ? +"SUCCESS" :"FAILED" )));return rc; } -/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +#ifdef CONFIG_FUSION_LOGGING static void -EventDescriptionStr (u8 event,u32 evData0,char *evStr) +mpt_display_event_info (MPT_ADAPTER *ioc,EventNotificationReply_t *pEventReply) {char *ds =NULL ; +u32 evData0; +int ii; +u8 event; +char *evStr = ioc->evStr; + + event =le32_to_cpu (pEventReply->Event) &0xFF ; + evData0 =le32_to_cpu (pEventReply->Data[0 ]);switch (event) {case MPI_EVENT_NONE :
@@ -6798,9 +6903,9 @@ EventDescriptionStr(u8 event, u32 evData0, char *evStr)if (evData0 ==MPI_EVENT_LOOP_STATE_CHANGE_LIP ) ds ="Loop State(LIP) Change" ;else if (evData0 ==MPI_EVENT_LOOP_STATE_CHANGE_LPE ) - ds ="Loop State(LPE) Change" ;/* ??? */ + ds ="Loop State(LPE) Change" ;else - ds ="Loop State(LPB) Change" ;/* ??? */ + ds ="Loop State(LPB) Change" ;break ;case MPI_EVENT_LOGOUT : ds ="Logout" ;
@@ -7000,28 +7105,53 @@ EventDescriptionStr(u8 event, u32 evData0, char *evStr) }case MPI_EVENT_IR2 : { +u8 id = (u8)(evData0); +u8 channel = (u8)(evData0 >>8 ); +u8 phys_num = (u8)(evData0 >>24 );u8 ReasonCode = (u8)(evData0 >>16 ); +switch (ReasonCode) {case MPI_EVENT_IR2_RC_LD_STATE_CHANGED : - ds ="IR2: LD State Changed" ; +snprintf (evStr,EVENT_DESCR_STR_SZ , +"IR2: LD State Changed: " +"id=%d channel=%d phys_num=%d" , + id, channel, phys_num);break ;case MPI_EVENT_IR2_RC_PD_STATE_CHANGED : - ds ="IR2: PD State Changed" ; +snprintf (evStr,EVENT_DESCR_STR_SZ , +"IR2: PD State Changed " +"id=%d channel=%d phys_num=%d" , + id, channel, phys_num);break ;case MPI_EVENT_IR2_RC_BAD_BLOCK_TABLE_FULL : - ds ="IR2: Bad Block Table Full" ; +snprintf (evStr,EVENT_DESCR_STR_SZ , +"IR2: Bad Block Table Full: " +"id=%d channel=%d phys_num=%d" , + id, channel, phys_num);break ;case MPI_EVENT_IR2_RC_PD_INSERTED : - ds ="IR2: PD Inserted" ; +snprintf (evStr,EVENT_DESCR_STR_SZ , +"IR2: PD Inserted: " +"id=%d channel=%d phys_num=%d" , + id, channel, phys_num);break ;case MPI_EVENT_IR2_RC_PD_REMOVED : - ds ="IR2: PD Removed" ; +snprintf (evStr,EVENT_DESCR_STR_SZ , +"IR2: PD Removed: " +"id=%d channel=%d phys_num=%d" , + id, channel, phys_num);break ;case MPI_EVENT_IR2_RC_FOREIGN_CFG_DETECTED : - ds ="IR2: Foreign CFG Detected" ; +snprintf (evStr,EVENT_DESCR_STR_SZ , +"IR2: Foreign CFG Detected: " +"id=%d channel=%d phys_num=%d" , + id, channel, phys_num);break ;case MPI_EVENT_IR2_RC_REBUILD_MEDIUM_ERROR : - ds ="IR2: Rebuild Medium Error" ; +snprintf (evStr,EVENT_DESCR_STR_SZ , +"IR2: Rebuild Medium Error: " +"id=%d channel=%d phys_num=%d" , + id, channel, phys_num);break ;default : ds ="IR2" ;
@@ -7057,13 +7187,18 @@ EventDescriptionStr(u8 event, u32 evData0, char *evStr)case MPI_EVENT_SAS_INIT_DEVICE_STATUS_CHANGE : {u8 reason = (u8)(evData0); -u8 port_num = (u8)(evData0 >>8 ); -u16 handle =le16_to_cpu (evData0 >>16 ); -snprintf (evStr,EVENT_DESCR_STR_SZ , -"SAS Initiator Device Status Change: reason=0x%02x " -"port=%d handle=0x%04x" , - reason, port_num, handle); +switch (reason) { +case MPI_EVENT_SAS_INIT_RC_ADDED : + ds ="SAS Initiator Status Change: Added" ; +break ; +case MPI_EVENT_SAS_INIT_RC_REMOVED : + ds ="SAS Initiator Status Change: Deleted" ; +break ; +default : + ds ="SAS Initiator Status Change" ; +break ; + }break ; }
@@ -7111,6 +7246,24 @@ EventDescriptionStr(u8 event, u32 evData0, char *evStr)break ; } +case MPI_EVENT_SAS_EXPANDER_STATUS_CHANGE : + { +u8 reason = (u8)(evData0); + +switch (reason) { +case MPI_EVENT_SAS_EXP_RC_ADDED : + ds ="Expander Status Change: Added" ; +break ; +case MPI_EVENT_SAS_EXP_RC_NOT_RESPONDING : + ds ="Expander Status Change: Deleted" ; +break ; +default : + ds ="Expander Status Change" ; +break ; + } +break ; + } +/* * MPT base "custom" events may be added here... */
@@ -7120,8 +7273,20 @@ EventDescriptionStr(u8 event, u32 evData0, char *evStr) }if (ds)strncpy (evStr, ds,EVENT_DESCR_STR_SZ ); -} + +devtprintk (ioc,printk (MYIOC_s_DEBUG_FMT +"MPT event:(%02Xh) : %s\n" , + ioc->name, event, evStr)); + + devtverboseprintk(ioc, printk(KERN_DEBUG MYNAM +": Event data:\n" )); +for (ii =0 ; ii <le16_to_cpu (pEventReply->EventDataLength); ii++) +devtverboseprintk (ioc,printk (" %08x" , +le32_to_cpu (pEventReply->Data[ii]))); +devtverboseprintk (ioc,printk (KERN_DEBUG "\n" )); +} +#endif /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /** * ProcessEventNotification - Route EventNotificationReply to all event handlers
@@ -7138,37 +7303,24 @@ ProcessEventNotification(MPT_ADAPTER *ioc, EventNotificationReply_t *pEventReply {u16 evDataLen;u32 evData0 =0 ; -// u32 evCtx; int ii;u8 cb_idx;int r =0 ;int handlers =0 ; -char evStr[EVENT_DESCR_STR_SZ ];u8 event;/* * Do platform normalization of values */ event =le32_to_cpu (pEventReply->Event) &0xFF ; -// evCtx = le32_to_cpu(pEventReply->EventContext); evDataLen =le16_to_cpu (pEventReply->EventDataLength);if (evDataLen) { evData0 =le32_to_cpu (pEventReply->Data[0 ]); } -EventDescriptionStr (event, evData0, evStr); -devtprintk (ioc,printk (MYIOC_s_DEBUG_FMT"MPT event:(%02Xh) : %s\n" , - ioc->name, - event, - evStr)); -#ifdef CONFIG_FUSION_LOGGING -devtverboseprintk (ioc,printk (MYIOC_s_DEBUG_FMT -": Event data:\n" , ioc->name)); -for (ii =0 ; ii < evDataLen; ii++) -devtverboseprintk (ioc,printk (" %08x" , -le32_to_cpu (pEventReply->Data[ii]))); -devtverboseprintk (ioc,printk ("\n" )); +if (evDataLen) +mpt_display_event_info (ioc, pEventReply);#endif /*
@@ -7223,8 +7375,9 @@ ProcessEventNotification(MPT_ADAPTER *ioc, EventNotificationReply_t *pEventReply*/ for (cb_idx =MPT_MAX_PROTOCOL_DRIVERS -1 ; cb_idx; cb_idx--) {if (MptEvHandlers[cb_idx]) { -devtverboseprintk (ioc,printk (MYIOC_s_DEBUG_FMT"Routing Event to event handler #%d\n" , - ioc->name, cb_idx)); +devtverboseprintk (ioc,printk (MYIOC_s_DEBUG_FMT +"Routing Event to event handler #%d\n" , + ioc->name, cb_idx)); r += (*(MptEvHandlers[cb_idx]))(ioc, pEventReply); handlers++; }
@@ -7308,8 +7461,6 @@ mpt_spi_log_info(MPT_ADAPTER *ioc, u32 log_info)switch (info) {case 0x00010000 : desc ="bug! MID not found" ; -if (ioc->reload_fw ==0 ) - ioc->reload_fw++;break ;case 0x00020000 :
drivers/message/fusion/mptbase.h +32 -14
112 lines not on this page · raw message
drivers/message/fusion/mptctl.c +3 -3
@@ -2534,9 +2534,9 @@ mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size)MPT_SCSI_HOST *hd =shost_priv (ioc->sh);if (hd && (cim_rev ==1 )) { - karg.hard_resets = hd->hard_resets; - karg.soft_resets = hd->soft_resets; - karg.timeouts = hd->timeouts; + karg.hard_resets = ioc->hard_resets; + karg.soft_resets = ioc->soft_resets; + karg.timeouts = ioc->timeouts; } }
drivers/message/fusion/mptsas.c +62 -32
225 lines not on this page · raw message
drivers/message/fusion/mptscsih.c +62 -112
332 lines not on this page · raw message
drivers/message/fusion/mptscsih.h +2 -0
@@ -90,6 +90,8 @@#endif + +#define mpt_sg_next sg_next typedef struct _internal_cmd { char *data; /* data pointer */ dma_addr_t data_dma; /* data dma address */
James Bottomley
maintainerQuoted 11 lines · Desai
Resending patch considering Grants G's code review.
Main goal to submit this patch is code cleaup.
1. Better driver debug prints and code indentation.
2.fault_reset_work_lockis not used anywhere. driver is usingtaskmgmt_lockinstead offault_reset_work_lock.
3. settingpci_set_drvdataproperly.
4. Ingore config request when IOC is in reset state.(ioc_reset_in_progressis set).
5. Init/clear managment frame proprely.(INITIALIZE_MGMT_STATUS andCLEAR_MGMT_STATUS)
This isn't applying too well against scsi misc (which is identical to Linus tree for the purposes of fusion). Could you regenerate for either of these trees, please?
patching file drivers/message/fusion/mptbase.c Hunk #1 FAILED at 207.
Hunk #2 succeeded at 316 (offset -57 lines).
Hunk #3 succeeded at 1044 (offset 73 lines).
Hunk #4 succeeded at 1562 (offset -169 lines). Hunk #5 FAILED at 1603.
Hunk #6 succeeded at 1842 (offset 50 lines).
Hunk #7 succeeded at 1644 (offset -165 lines). Hunk #8 succeeded at 1935 (offset 50 lines).
Hunk #9 FAILED at 1986.
Hunk #10 succeeded at 1841 (offset -170 lines). Hunk #11 succeeded at 2267 (offset 30 lines).
Hunk #12 succeeded at 2097 (offset -170 lines). Hunk #13 succeeded at 2311 (offset 30 lines).
Hunk #14 succeeded at 2134 (offset -170 lines). Hunk #15 succeeded at 2379 (offset 30 lines).
Hunk #16 succeeded at 2201 (offset -170 lines). Hunk #17 succeeded at 2426 (offset 30 lines).
Hunk #18 succeeded at 2301 (offset -178 lines). Hunk #19 succeeded at 2525 (offset 30 lines).
Hunk #20 succeeded at 2334 (offset -178 lines). Hunk #21 succeeded at 2568 (offset 30 lines).
Hunk #22 succeeded at 2443 (offset -178 lines). Hunk #23 succeeded at 2684 (offset 30 lines).
Hunk #24 succeeded at 2487 (offset -178 lines). Hunk #25 succeeded at 2761 (offset 30 lines).
Hunk #26 succeeded at 2708 (offset -178 lines). Hunk #27 succeeded at 2994 (offset 30 lines).
Hunk #28 succeeded at 2801 (offset -178 lines). Hunk #29 succeeded at 3063 (offset 30 lines).
Hunk #30 succeeded at 2919 (offset -178 lines). Hunk #31 succeeded at 3139 (offset 30 lines).
Hunk #32 succeeded at 2951 (offset -178 lines). Hunk #33 succeeded at 3341 (offset 30 lines).
Hunk #34 succeeded at 3148 (offset -178 lines). Hunk #35 succeeded at 3611 with fuzz 2 (offset 32 lines). Hunk #36 succeeded at 3747 (offset -178 lines). Hunk #37 succeeded at 3978 (offset 32 lines).
Hunk #38 succeeded at 3919 (offset -178 lines). Hunk #39 succeeded at 4144 (offset 32 lines).
Hunk #40 succeeded at 4057 (offset -178 lines). Hunk #41 succeeded at 4355 (offset 32 lines).
Hunk #42 succeeded at 4353 (offset -214 lines). Hunk #43 succeeded at 5686 (offset 1 line).
Hunk #44 FAILED at 6153.
Hunk #45 succeeded at 5947 with fuzz 2 (offset -218 lines). Hunk #46 succeeded at 6868 with fuzz 2 (offset 510 lines). Hunk #47 FAILED at 7296.
Hunk #48 FAILED at 7329.
Hunk #49 FAILED at 7359.
Hunk #50 FAILED at 7413.
Hunk #51 succeeded at 6298 (offset -807 lines). Hunk #52 succeeded at 7697 (offset 510 lines). Hunk #53 succeeded at 6439 (offset -807 lines). Hunk #54 succeeded at 7783 (offset 510 lines). Hunk #55 succeeded at 6496 (offset -807 lines). Hunk #56 succeeded at 7885 (offset 510 lines). Hunk #57 succeeded at 6654 (offset -807 lines).
8 out of 57 hunks FAILED -- saving rejects to file drivers/message/fusion/mptbase.c.rej
patching file drivers/message/fusion/mptbase.h Hunk #1 FAILED at 76.
Hunk #3 succeeded at 162 (offset -1 lines).
Hunk #5 succeeded at 586 (offset -3 lines).
Hunk #6 succeeded at 702 (offset 3 lines).
Hunk #7 FAILED at 716.
Hunk #8 FAILED at 748.
Hunk #9 succeeded at 862 with fuzz 1 (offset -29 lines). 3 out of 9 hunks FAILED -- saving rejects to file drivers/message/fusion/mptbase.h.rej
patching file drivers/message/fusion/mptctl.c
Hunk #1 succeeded at 2466 (offset -68 lines). patching file drivers/message/fusion/mptsas.c
Hunk #1 succeeded at 434 (offset -290 lines).
Hunk #2 succeeded at 892 with fuzz 1 (offset -60 lines). Hunk #3 succeeded at 1180 (offset -611 lines). Hunk #4 succeeded at 1776 (offset -60 lines).
Hunk #5 succeeded at 1257 (offset -611 lines). Hunk #6 FAILED at 1395.
Hunk #7 succeeded at 1962 with fuzz 2 (offset -60 lines). Hunk #8 succeeded at 1433 (offset -611 lines). Hunk #9 succeeded at 2000 (offset -60 lines).
Hunk #10 succeeded at 1513 (offset -611 lines). Hunk #11 succeeded at 2226 (offset -60 lines). Hunk #12 succeeded at 1715 (offset -611 lines). Hunk #13 succeeded at 2298 (offset -60 lines). Hunk #14 succeeded at 1795 (offset -611 lines). Hunk #15 succeeded at 2382 (offset -60 lines). Hunk #16 succeeded at 1866 (offset -611 lines). Hunk #17 succeeded at 2642 (offset -60 lines). Hunk #18 succeeded at 2118 (offset -611 lines). Hunk #19 succeeded at 2977 with fuzz 1 (offset -464 lines). 1 out of 19 hunks FAILED -- saving rejects to file drivers/message/fusion/mptsas.c.rej
patching file drivers/message/fusion/mptscsih.c Hunk #2 succeeded at 292 (offset 57 lines).
Hunk #3 FAILED at 301.
Hunk #4 succeeded at 536 (offset 2 lines).
Hunk #5 succeeded at 654 (offset 57 lines).
Hunk #6 succeeded at 753 (offset 2 lines).
Hunk #7 succeeded at 994 (offset 57 lines).
Hunk #8 succeeded at 1000 (offset 2 lines).
Hunk #9 succeeded at 1350 (offset 57 lines).
Hunk #10 succeeded at 1305 (offset 2 lines).
Hunk #11 succeeded at 1845 (offset 133 lines). Hunk #12 succeeded at 1737 with fuzz 1.
Hunk #13 succeeded at 1926 (offset 138 lines). Hunk #14 FAILED at 1984.
Hunk #15 succeeded at 1875 (offset -4 lines).
Hunk #16 FAILED at 1896.
Hunk #17 succeeded at 2471 (offset 217 lines). Hunk #18 succeeded at 2261 (offset -4 lines).
Hunk #19 succeeded at 2555 (offset 217 lines). Hunk #20 FAILED at 2664.
4 out of 20 hunks FAILED -- saving rejects to file drivers/message/fusion/mptscsih.c.rej
patching file drivers/message/fusion/mptscsih.h Hunk #1 succeeded at 89 (offset -1 lines).
James
James,
This patch required all other pending patches to be applied first.
In any case I have to resend all other pending patches once again due to some committees went into Fusion driver in 2.6.30-rc6. I have to sync all pending patches with latest upstream. I am resending all pending patches once again to synced with latest upstream kernel 2.6.30-rc6.
Thanks,
Kashyap
-----Original Message-----
From: James Bottomley [mailto:[email protected]]
Sent: Thursday, May 21, 2009 12:59 AM
To: Desai, Kashyap
Cc: [email protected]; Moore, Eric; Prakash, Sathya
Subject: Re: [PATCH 1/3] mpt fusion: Resending Code clean up patch
Quoted 11 lines · Desai
Resending patch considering Grants G's code review.
Main goal to submit this patch is code cleaup.
1. Better driver debug prints and code indentation.
2.fault_reset_work_lockis not used anywhere. driver is usingtaskmgmt_lockinstead offault_reset_work_lock.
3. settingpci_set_drvdataproperly.
4. Ingore config request when IOC is in reset state.(ioc_reset_in_progressis set).
5. Init/clear managment frame proprely.(INITIALIZE_MGMT_STATUS andCLEAR_MGMT_STATUS)
This isn't applying too well against scsi misc (which is identical to Linus tree for the purposes of fusion). Could you regenerate for either of these trees, please?
patching file drivers/message/fusion/mptbase.c Hunk #1 FAILED at 207.
Hunk #2 succeeded at 316 (offset -57 lines).
Hunk #3 succeeded at 1044 (offset 73 lines).
Hunk #4 succeeded at 1562 (offset -169 lines). Hunk #5 FAILED at 1603.
Hunk #6 succeeded at 1842 (offset 50 lines).
Hunk #7 succeeded at 1644 (offset -165 lines). Hunk #8 succeeded at 1935 (offset 50 lines).
Hunk #9 FAILED at 1986.
Hunk #10 succeeded at 1841 (offset -170 lines). Hunk #11 succeeded at 2267 (offset 30 lines).
Hunk #12 succeeded at 2097 (offset -170 lines). Hunk #13 succeeded at 2311 (offset 30 lines).
Hunk #14 succeeded at 2134 (offset -170 lines). Hunk #15 succeeded at 2379 (offset 30 lines).
Hunk #16 succeeded at 2201 (offset -170 lines). Hunk #17 succeeded at 2426 (offset 30 lines).
Hunk #18 succeeded at 2301 (offset -178 lines). Hunk #19 succeeded at 2525 (offset 30 lines).
Hunk #20 succeeded at 2334 (offset -178 lines). Hunk #21 succeeded at 2568 (offset 30 lines).
Hunk #22 succeeded at 2443 (offset -178 lines). Hunk #23 succeeded at 2684 (offset 30 lines).
Hunk #24 succeeded at 2487 (offset -178 lines). Hunk #25 succeeded at 2761 (offset 30 lines).
Hunk #26 succeeded at 2708 (offset -178 lines). Hunk #27 succeeded at 2994 (offset 30 lines).
Hunk #28 succeeded at 2801 (offset -178 lines). Hunk #29 succeeded at 3063 (offset 30 lines).
Hunk #30 succeeded at 2919 (offset -178 lines). Hunk #31 succeeded at 3139 (offset 30 lines).
Hunk #32 succeeded at 2951 (offset -178 lines). Hunk #33 succeeded at 3341 (offset 30 lines).
Hunk #34 succeeded at 3148 (offset -178 lines). Hunk #35 succeeded at 3611 with fuzz 2 (offset 32 lines). Hunk #36 succeeded at 3747 (offset -178 lines). Hunk #37 succeeded at 3978 (offset 32 lines).
Hunk #38 succeeded at 3919 (offset -178 lines). Hunk #39 succeeded at 4144 (offset 32 lines).
Hunk #40 succeeded at 4057 (offset -178 lines). Hunk #41 succeeded at 4355 (offset 32 lines).
Hunk #42 succeeded at 4353 (offset -214 lines). Hunk #43 succeeded at 5686 (offset 1 line).
Hunk #44 FAILED at 6153.
Hunk #45 succeeded at 5947 with fuzz 2 (offset -218 lines). Hunk #46 succeeded at 6868 with fuzz 2 (offset 510 lines). Hunk #47 FAILED at 7296.
Hunk #48 FAILED at 7329.
Hunk #49 FAILED at 7359.
Hunk #50 FAILED at 7413.
Hunk #51 succeeded at 6298 (offset -807 lines). Hunk #52 succeeded at 7697 (offset 510 lines). Hunk #53 succeeded at 6439 (offset -807 lines). Hunk #54 succeeded at 7783 (offset 510 lines). Hunk #55 succeeded at 6496 (offset -807 lines). Hunk #56 succeeded at 7885 (offset 510 lines). Hunk #57 succeeded at 6654 (offset -807 lines).
8 out of 57 hunks FAILED -- saving rejects to file drivers/message/fusion/mptbase.c.rej
patching file drivers/message/fusion/mptbase.h Hunk #1 FAILED at 76.
Hunk #3 succeeded at 162 (offset -1 lines).
Hunk #5 succeeded at 586 (offset -3 lines).
Hunk #6 succeeded at 702 (offset 3 lines).
Hunk #7 FAILED at 716.
Hunk #8 FAILED at 748.
Hunk #9 succeeded at 862 with fuzz 1 (offset -29 lines). 3 out of 9 hunks FAILED -- saving rejects to file drivers/message/fusion/mptbase.h.rej
patching file drivers/message/fusion/mptctl.c
Hunk #1 succeeded at 2466 (offset -68 lines). patching file drivers/message/fusion/mptsas.c
Hunk #1 succeeded at 434 (offset -290 lines).
Hunk #2 succeeded at 892 with fuzz 1 (offset -60 lines). Hunk #3 succeeded at 1180 (offset -611 lines). Hunk #4 succeeded at 1776 (offset -60 lines).
Hunk #5 succeeded at 1257 (offset -611 lines). Hunk #6 FAILED at 1395.
Hunk #7 succeeded at 1962 with fuzz 2 (offset -60 lines). Hunk #8 succeeded at 1433 (offset -611 lines). Hunk #9 succeeded at 2000 (offset -60 lines).
Hunk #10 succeeded at 1513 (offset -611 lines). Hunk #11 succeeded at 2226 (offset -60 lines). Hunk #12 succeeded at 1715 (offset -611 lines). Hunk #13 succeeded at 2298 (offset -60 lines). Hunk #14 succeeded at 1795 (offset -611 lines). Hunk #15 succeeded at 2382 (offset -60 lines). Hunk #16 succeeded at 1866 (offset -611 lines). Hunk #17 succeeded at 2642 (offset -60 lines). Hunk #18 succeeded at 2118 (offset -611 lines). Hunk #19 succeeded at 2977 with fuzz 1 (offset -464 lines). 1 out of 19 hunks FAILED -- saving rejects to file drivers/message/fusion/mptsas.c.rej
patching file drivers/message/fusion/mptscsih.c Hunk #2 succeeded at 292 (offset 57 lines).
Hunk #3 FAILED at 301.
Hunk #4 succeeded at 536 (offset 2 lines).
Hunk #5 succeeded at 654 (offset 57 lines).
Hunk #6 succeeded at 753 (offset 2 lines).
Hunk #7 succeeded at 994 (offset 57 lines).
Hunk #8 succeeded at 1000 (offset 2 lines).
Hunk #9 succeeded at 1350 (offset 57 lines).
Hunk #10 succeeded at 1305 (offset 2 lines).
Hunk #11 succeeded at 1845 (offset 133 lines). Hunk #12 succeeded at 1737 with fuzz 1.
Hunk #13 succeeded at 1926 (offset 138 lines). Hunk #14 FAILED at 1984.
Hunk #15 succeeded at 1875 (offset -4 lines).
Hunk #16 FAILED at 1896.
Hunk #17 succeeded at 2471 (offset 217 lines). Hunk #18 succeeded at 2261 (offset -4 lines).
Hunk #19 succeeded at 2555 (offset 217 lines). Hunk #20 FAILED at 2664.
4 out of 20 hunks FAILED -- saving rejects to file drivers/message/fusion/mptscsih.c.rej
patching file drivers/message/fusion/mptscsih.h Hunk #1 succeeded at 89 (offset -1 lines).
James