aacraid: Fixes and enhancements for arc family
Subsystems (2)
v2 cover aacraid: Fixes and enhancements for arc family
This patch set contains issue fixes, enhancements and other misc changes.
The majority of the fixes are a direct outcome of testing and work done on the adapter reset mechanism. Initially it just had IOP reset and then was augmented with IWBR soft hardware resets in the previous patch set. The reset mechanism is triggered in 2 paths, one is from the eh handler from the kernel and the other is from the driver's internal periodic health checkup.
Changes in V2:
Withdrew PATCH 10 (aacraid: Terminate kthread on controller fw assert) in lieu of reworking and submitting it in this patchset.
Refactored memory leak fix patch
Refactored EEH patch to remove macro
Misc grammar fixes
Raghava Aditya Renukunta (15):
[SCSI] aacraid: Fix camel case
[SCSI] aacraid: Use correct channel number for raw srb [SCSI] aacraid: Fix for excessive prints on EEH
[SCSI] aacraid: Prevent E3 lockup when deleting units [SCSI] aacraid: Fix memory leak in fib init path [SCSI] aacraid: Added sysfs for driver version
[SCSI] aacraid: Fix sync fibs time out on controller reset [SCSI] aacraid: Skip wellness sync on controller failure [SCSI] aacraid: Reload offlined drives after controller reset [SCSI] aacraid: Decrease adapter health check interval [SCSI] aacraid: Skip IOP reset on controller panic(SMART Family) [SCSI] aacraid: Reorder Adapter status check
[SCSI] aacraid: Save adapter fib log before an IOP reset [SCSI] aacraid: Fix a potential spinlock double unlock bug [SCSI] aacraid: Update driver version
drivers/scsi/aacraid/aachba.c | 59 ++++++++++++---------- drivers/scsi/aacraid/aacraid.h | 107 +++++++++++++++++++++------------------- drivers/scsi/aacraid/commctrl.c | 2 +- drivers/scsi/aacraid/comminit.c | 2 +- drivers/scsi/aacraid/commsup.c | 107 ++++++++++++++++++++++++++++++++-------- drivers/scsi/aacraid/linit.c | 47 ++++++++++++------ drivers/scsi/aacraid/rx.c | 2 +- drivers/scsi/aacraid/src.c | 48 +++++++++++++++--- 8 files changed, 254 insertions(+), 120 deletions(-)
Signature · 1 line
2.7.4
PATCH v2 1/15 aacraid: Fix camel case
Replaced camel case with snake case for init supported options.
---
Changes in V2:
None
drivers/scsi/aacraid/aachba.c | 53 ++++++++++++----------- drivers/scsi/aacraid/aacraid.h | 98 +++++++++++++++++++++--------------------- drivers/scsi/aacraid/commsup.c | 6 +-- drivers/scsi/aacraid/linit.c | 32 +++++++------- drivers/scsi/aacraid/rx.c | 2 +- drivers/scsi/aacraid/src.c | 2 +- 6 files changed, 100 insertions(+), 93 deletions(-)
drivers/scsi/aacraid/aachba.c +29 -24
@@ -483,7 +483,7 @@ int aac_get_containers(struct aac_dev *dev)if (status >=0 ) { dresp = (struct aac_get_container_count_resp *)fib_data (fibptr); maximum_num_containers =le32_to_cpu (dresp->ContainerSwitchEntries); -if (fibptr->dev->supplement_adapter_info.SupportedOptions2 & +if (fibptr->dev->supplement_adapter_info.supported_options2 &AAC_OPTION_SUPPORTED_240_VOLUMES ) { maximum_num_containers =le32_to_cpu (dresp->MaxSimpleVolumes);
@@ -639,13 +639,16 @@ static void _aac_probe_container2(void * context, struct fib * fibptr) fsa_dev_ptr = fibptr->dev->fsa_dev;if (fsa_dev_ptr) {struct aac_mount * dresp = (struct aac_mount *)fib_data (fibptr); +__le32 sup_options2; + fsa_dev_ptr +=scmd_id (scsicmd); + sup_options2 = + fibptr->dev->supplement_adapter_info.supported_options2;if ((le32_to_cpu (dresp->status) ==ST_OK ) && (le32_to_cpu (dresp->mnt[0 ].vol) !=CT_NONE ) && (le32_to_cpu (dresp->mnt[0 ].state) !=FSCS_HIDDEN )) { -if (!(fibptr->dev->supplement_adapter_info.SupportedOptions2 & -AAC_OPTION_VARIABLE_BLOCK_SIZE )) { +if (!(sup_options2 &AAC_OPTION_VARIABLE_BLOCK_SIZE )) { dresp->mnt[0 ].fileinfo.bdevinfo.block_size =0x200 ; fsa_dev_ptr->block_size =0x200 ; }else {
@@ -688,7 +691,7 @@ static void _aac_probe_container1(void * context, struct fib * fibptr)int status; dresp = (struct aac_mount *)fib_data (fibptr); -if (!(fibptr->dev->supplement_adapter_info.SupportedOptions2 & +if (!(fibptr->dev->supplement_adapter_info.supported_options2 &AAC_OPTION_VARIABLE_BLOCK_SIZE )) dresp->mnt[0 ].capacityhigh =0 ; if ((le32_to_cpu(dresp->status) != ST_OK) ||
@@ -705,7 +708,7 @@ static void _aac_probe_container1(void * context, struct fib * fibptr) dinfo = (struct aac_query_mount *)fib_data (fibptr); -if (fibptr->dev->supplement_adapter_info.SupportedOptions2 & +if (fibptr->dev->supplement_adapter_info.supported_options2 &AAC_OPTION_VARIABLE_BLOCK_SIZE ) dinfo->command =cpu_to_le32 (VM_NameServeAllBlk);else
@@ -745,7 +748,7 @@ static int _aac_probe_container(struct scsi_cmnd * scsicmd, int (*callback)(stru dinfo = (struct aac_query_mount *)fib_data (fibptr); -if (fibptr->dev->supplement_adapter_info.SupportedOptions2 & +if (fibptr->dev->supplement_adapter_info.supported_options2 &AAC_OPTION_VARIABLE_BLOCK_SIZE ) dinfo->command =cpu_to_le32 (VM_NameServeAllBlk);else
@@ -896,12 +899,14 @@ char * get_container_type(unsigned tindex)static void setinqstr (struct aac_dev *dev,void *data,int tindex) {struct scsi_inq *str; +struct aac_supplement_adapter_info *sup_adap_info; + sup_adap_info = &dev->supplement_adapter_info; str = (struct scsi_inq *)(data);/* cast data to scsi inq block */ memset (str,' ' ,sizeof (*str)); -if (dev->supplement_adapter_info.AdapterTypeText[0 ]) { -char * cp = dev->supplement_adapter_info.AdapterTypeText; +if (sup_adap_info->adapter_type_text[0 ]) { +char *cp = sup_adap_info->adapter_type_text;int c;if ((cp[0 ] =='A' ) && (cp[1 ] =='O' ) && (cp[2 ] =='C' ))inqstrcpy ("SMC" , str->vid);
@@ -911,8 +916,7 @@ static void setinqstr(struct aac_dev *dev, void *data, int tindex) ++cp; c = *cp; *cp ='\0' ; -inqstrcpy (dev->supplement_adapter_info.AdapterTypeText, - str->vid); +inqstrcpy (sup_adap_info->adapter_type_text, str->vid); *cp = c;while (*cp && *cp !=' ' ) ++cp;
@@ -1675,8 +1679,8 @@ int aac_issue_bmic_identify(struct aac_dev *dev, u32 bus, u32 target)if (!identify_resp) goto fib_free_ptr; - vbus = (u32 )le16_to_cpu (dev->supplement_adapter_info.VirtDeviceBus); - vid = (u32 )le16_to_cpu (dev->supplement_adapter_info.VirtDeviceTarget); + vbus = (u32 )le16_to_cpu (dev->supplement_adapter_info.virt_device_bus); + vid = (u32 )le16_to_cpu (dev->supplement_adapter_info.virt_device_target);aac_fib_init (fibptr);
@@ -1815,9 +1819,9 @@ int aac_report_phys_luns(struct aac_dev *dev, struct fib *fibptr, int rescan) } vbus = (u32 )le16_to_cpu ( - dev->supplement_adapter_info.VirtDeviceBus); + dev->supplement_adapter_info.virt_device_bus); vid = (u32 )le16_to_cpu ( - dev->supplement_adapter_info.VirtDeviceTarget); + dev->supplement_adapter_info.virt_device_target);aac_fib_init (fibptr);
@@ -1893,7 +1897,7 @@ int aac_get_adapter_info(struct aac_dev* dev) }memcpy (&dev->adapter_info, info,sizeof (*info)); - dev->supplement_adapter_info.VirtDeviceBus =0xffff ; + dev->supplement_adapter_info.virt_device_bus =0xffff ;if (dev->adapter_info.options &AAC_OPT_SUPPLEMENT_ADAPTER_INFO ) {struct aac_supplement_adapter_info * sinfo;
@@ -1961,7 +1965,7 @@ int aac_get_adapter_info(struct aac_dev* dev) }if (!dev->sync_mode && dev->sa_firmware && - dev->supplement_adapter_info.VirtDeviceBus !=0xffff ) { + dev->supplement_adapter_info.virt_device_bus !=0xffff ) {/* Thor SA Firmware -> CISS_REPORT_PHYSICAL_LUNS */ rcode =aac_report_phys_luns (dev, fibptr,AAC_INIT ); }
@@ -1976,8 +1980,8 @@ int aac_get_adapter_info(struct aac_dev* dev) (tmp>>16 )&0xff , tmp&0xff ,le32_to_cpu (dev->adapter_info.kernelbuild), - (int )sizeof (dev->supplement_adapter_info.BuildDate), - dev->supplement_adapter_info.BuildDate); + (int )sizeof (dev->supplement_adapter_info.build_date), + dev->supplement_adapter_info.build_date); tmp =le32_to_cpu (dev->adapter_info.monitorrev); printk(KERN_INFO "%s%d: monitor %d.%d-%d[%d]\n", dev->name, dev->id,
@@ -1993,14 +1997,15 @@ int aac_get_adapter_info(struct aac_dev* dev) shost_to_class(dev->scsi_host_ptr), buffer))printk (KERN_INFO "%s%d: serial %s" , dev->name, dev->id, buffer); -if (dev->supplement_adapter_info.VpdInfo.Tsid[0 ]) { +if (dev->supplement_adapter_info.vpd_info.tsid[0 ]) {printk (KERN_INFO "%s%d: TSID %.*s\n" , dev->name, dev->id, - (int )sizeof (dev->supplement_adapter_info.VpdInfo.Tsid), - dev->supplement_adapter_info.VpdInfo.Tsid); + (int )sizeof (dev->supplement_adapter_info + .vpd_info.tsid), + dev->supplement_adapter_info.vpd_info.tsid); }if (!aac_check_reset || ((aac_check_reset ==1 ) && - (dev->supplement_adapter_info.SupportedOptions2 & + (dev->supplement_adapter_info.supported_options2 &AAC_OPTION_IGNORE_RESET ))) {printk (KERN_INFO "%s%d: Reset Adapter Ignored\n" , dev->name, dev->id);
@@ -2008,7 +2013,7 @@ int aac_get_adapter_info(struct aac_dev* dev) } dev->cache_protected =0 ; - dev->jbod = ((dev->supplement_adapter_info.FeatureBits & + dev->jbod = ((dev->supplement_adapter_info.feature_bits &AAC_FEATURE_JBOD ) !=0 ); dev->nondasd_support =0 ; dev->raid_scsi_mode =0 ;
@@ -2631,7 +2636,7 @@ static int aac_start_stop(struct scsi_cmnd *scsicmd)struct scsi_device *sdev = scsicmd->device;struct aac_dev *aac = (struct aac_dev *)sdev->host->hostdata; -if (!(aac->supplement_adapter_info.SupportedOptions2 & +if (!(aac->supplement_adapter_info.supported_options2 &AAC_OPTION_POWER_MANAGEMENT )) { scsicmd->result =DID_OK <<16 |COMMAND_COMPLETE <<8 |SAM_STAT_GOOD ;
drivers/scsi/aacraid/aacraid.h +49 -49
106 lines not on this page · raw message
drivers/scsi/aacraid/commsup.c +3 -3
@@ -1815,7 +1815,7 @@ int aac_check_health(struct aac_dev * aac)printk (KERN_ERR "%s: Host adapter BLINK LED 0x%x\n" , aac->name, BlinkLED);if (!aac_check_reset || ((aac_check_reset ==1 ) && - (aac->supplement_adapter_info.SupportedOptions2 & + (aac->supplement_adapter_info.supported_options2 &AAC_OPTION_IGNORE_RESET ))) goto out; host = aac->scsi_host_ptr;
@@ -2264,8 +2264,8 @@ static int aac_send_wellness_command(struct aac_dev *dev, char *wellness_str,aac_fib_init (fibptr); - vbus = (u32 )le16_to_cpu (dev->supplement_adapter_info.VirtDeviceBus); - vid = (u32 )le16_to_cpu (dev->supplement_adapter_info.VirtDeviceTarget); + vbus = (u32 )le16_to_cpu (dev->supplement_adapter_info.virt_device_bus); + vid = (u32 )le16_to_cpu (dev->supplement_adapter_info.virt_device_target); srbcmd = (struct aac_srb *)fib_data (fibptr);
drivers/scsi/aacraid/linit.c +17 -15
@@ -891,13 +891,13 @@ static int aac_eh_reset(struct scsi_cmnd* cmd)* Adapters that support a register, instead of a commanded, * reset. */ -if (((aac->supplement_adapter_info.SupportedOptions2 & +if (((aac->supplement_adapter_info.supported_options2 &AAC_OPTION_MU_RESET ) || - (aac->supplement_adapter_info.SupportedOptions2 & + (aac->supplement_adapter_info.supported_options2 &AAC_OPTION_DOORBELL_RESET )) && aac_check_reset && ((aac_check_reset !=1 ) || - !(aac->supplement_adapter_info.SupportedOptions2 & + !(aac->supplement_adapter_info.supported_options2 &AAC_OPTION_IGNORE_RESET ))) {/* Bypass wait for command quiesce */ aac_reset_adapter (aac,2 ,IOP_HWSOFT_RESET );
@@ -1029,8 +1029,8 @@ static ssize_t aac_show_model(struct device *device,struct aac_dev *dev = (struct aac_dev *)class_to_shost (device)->hostdata;int len; -if (dev->supplement_adapter_info.AdapterTypeText[0 ]) { -char * cp = dev->supplement_adapter_info.AdapterTypeText; +if (dev->supplement_adapter_info.adapter_type_text[0 ]) { +char *cp = dev->supplement_adapter_info.adapter_type_text;while (*cp && *cp !=' ' ) ++cp;while (*cp ==' ' )
@@ -1046,18 +1046,20 @@ static ssize_t aac_show_vendor(struct device *device, struct device_attribute *attr, char *buf) { struct aac_dev *dev = (struct aac_dev*)class_to_shost(device)->hostdata; +struct aac_supplement_adapter_info *sup_adap_info;int len; -if (dev->supplement_adapter_info.AdapterTypeText[0 ]) { -char * cp = dev->supplement_adapter_info.AdapterTypeText; + sup_adap_info = &dev->supplement_adapter_info; +if (sup_adap_info->adapter_type_text[0 ]) { +char *cp = sup_adap_info->adapter_type_text;while (*cp && *cp !=' ' ) ++cp; len =snprintf (buf,PAGE_SIZE ,"%.*s\n" , - (int )(cp - (char *)dev->supplement_adapter_info.AdapterTypeText), - dev->supplement_adapter_info.AdapterTypeText); + (int )(cp - (char *)sup_adap_info->adapter_type_text), + sup_adap_info->adapter_type_text); }else len =snprintf (buf,PAGE_SIZE ,"%s\n" , - aac_drivers[dev->cardtype].vname); + aac_drivers[dev->cardtype].vname);return len; }
@@ -1078,7 +1080,7 @@ static ssize_t aac_show_flags(struct device *cdev, "SAI_READ_CAPACITY_16\n");if (dev->jbod) len +=snprintf (buf + len,PAGE_SIZE - len,"SUPPORTED_JBOD\n" ); -if (dev->supplement_adapter_info.SupportedOptions2 & +if (dev->supplement_adapter_info.supported_options2 &AAC_OPTION_POWER_MANAGEMENT ) len +=snprintf (buf + len,PAGE_SIZE - len,"SUPPORTED_POWER_MANAGEMENT\n" );
@@ -1139,12 +1141,12 @@ static ssize_t aac_show_serial_number(struct device *device, len =snprintf (buf,16 ,"%06X\n" ,le32_to_cpu (dev->adapter_info.serial[0 ]));if (len && - !memcmp (&dev->supplement_adapter_info.MfgPcbaSerialNo[ -sizeof (dev->supplement_adapter_info.MfgPcbaSerialNo)-len], + !memcmp (&dev->supplement_adapter_info.mfg_pcba_serial_no[ +sizeof (dev->supplement_adapter_info.mfg_pcba_serial_no)-len], buf, len-1 )) len =snprintf (buf,16 ,"%.*s\n" , - (int )sizeof (dev->supplement_adapter_info.MfgPcbaSerialNo), - dev->supplement_adapter_info.MfgPcbaSerialNo); + (int )sizeof (dev->supplement_adapter_info.mfg_pcba_serial_no), + dev->supplement_adapter_info.mfg_pcba_serial_no);return min (len,16 ); }
drivers/scsi/aacraid/rx.c +1 -1
@@ -475,7 +475,7 @@ static int aac_rx_restart_adapter(struct aac_dev *dev, int bled, u8 reset_type) {u32 var =0 ; -if (!(dev->supplement_adapter_info.SupportedOptions2 & +if (!(dev->supplement_adapter_info.supported_options2 &AAC_OPTION_MU_RESET ) || (bled >=0 ) || (bled ==-2 )) {if (bled) printk(KERN_ERR "%s%d: adapter kernel panic'd %x.\n",
drivers/scsi/aacraid/src.c +1 -1
@@ -684,7 +684,7 @@ static void aac_send_iop_reset(struct aac_dev *dev, int bled)aac_set_intx_mode (dev); -if (!bled && (dev->supplement_adapter_info.SupportedOptions2 & +if (!bled && (dev->supplement_adapter_info.supported_options2 &AAC_OPTION_DOORBELL_RESET )) {src_writel (dev, MUnit.IDR, reset_mask); }else {
Signature · 1 line
2.7.4
PATCH v2 2/15 aacraid: Use correct channel number for raw srb
In reply to Raghava Aditya RenukuntaThe channel being used for raw srb commands is retrieved from the utility sent fibs and is converted into physical channel id. The driver does not need to to do this since the management utility sends the correct channel id in the first place and in addition the driver sets inaccurate information in the cmd sent to the firmware and gets an invalid response.
Fixed by using channel id from srb command.
---
Changes in V2:
None
drivers/scsi/aacraid/commctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/aacraid/commctrl.c +1 -1
@@ -580,7 +580,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg) goto cleanup; } - chn =aac_logical_to_phys (user_srbcmd->channel); + chn = user_srbcmd->channel;if (chn <AAC_MAX_BUSES && user_srbcmd->id <AAC_MAX_TARGETS && dev->hba_map[chn][user_srbcmd->id].devtype ==AAC_DEVTYPE_NATIVE_RAW ) {
Signature · 1 line
2.7.4
PATCH v2 3/15 aacraid: Fix for excessive prints on EEH
In reply to Raghava Aditya RenukuntaThis issue showed up on a kdump debug(single CPU on powerkvm), when EEH errors rendered the adapter unusable. The driver correctly detected the issue and attempted to restart the controller, in doing so the driver attempted to read the status registers of the controller. This triggered additional eeh errors which continued for a good 6 minutes.
Fixed by returning without waiting when EEH error is reported.
---
Changes for V2:
Refactored code to remove CONFIG_EEH macros
drivers/scsi/aacraid/commsup.c | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-)
drivers/scsi/aacraid/commsup.c +38 -1
@@ -461,6 +461,35 @@ int aac_queue_get(struct aac_dev * dev, u32 * index, u32 qid, struct hw_fib * hwreturn 0 ; } +#ifdef CONFIG_EEH +static inline int aac_check_eeh_failure (struct aac_dev *dev) +{ +/* Check for an EEH failure for the given +* device node. Function eeh_dev_check_failure() +* returns 0 if there has not been an EEH error +* otherwise returns a non-zero value. +* +* Need to be called before any PCI operation, +* i.e.,before aac_adapter_check_health() +*/ +struct eeh_dev *edev =pci_dev_to_eeh_dev (dev->pdev); + +if (eeh_dev_check_failure (edev)) { +/* The EEH mechanisms will handle this +* error and reset the device if +* necessary. +*/ +return 1 ; + } +return 0 ; +} +#else +static inline int aac_check_eeh_failure (struct aac_dev *dev) +{ +return 0 ; +} +#endif +/* * Define the highest level of host to adapter communication routines. * These routines will support host to adapter FS commuication. These
@@ -496,7 +525,6 @@ int aac_fib_send(u16 command, struct fib *fibptr, unsigned long size,unsigned long mflags =0 ;unsigned long sflags =0 ; -if (!(hw_fib->header.XferState &cpu_to_le32 (HostOwned)))return -EBUSY ;/*
@@ -662,6 +690,10 @@ int aac_fib_send(u16 command, struct fib *fibptr, unsigned long size, }return -ETIMEDOUT ; } + +if (aac_check_eeh_failure (dev)) +return -EFAULT ; +if ((blink =aac_adapter_check_health (dev)) >0 ) {if (wait ==-1 ) { printk(KERN_ERR "aacraid: aac_fib_send: adapter blinkLED 0x%x.\n"
@@ -755,7 +787,12 @@ int aac_hba_send(u8 command, struct fib *fibptr, fib_callback callback,FIB_COUNTER_INCREMENT (aac_config.NativeSent);if (wait) { +spin_unlock_irqrestore (&fibptr->event_lock, flags); + +if (aac_check_eeh_failure (dev)) +return -EFAULT ; +/* Only set for first known interruptable command */ if (down_interruptible (&fibptr->event_wait)) { fibptr->done =2 ;
Signature · 1 line
2.7.4
Re: [PATCH V2 03/15] aacraid: Fix for excessive prints on EEH
Quoted 6 lines · Raghava Aditya Renukunta
This issue showed up on a kdump debug(single CPU on powerkvm), when EEH errors rendered the adapter unusable. The driver correctly detected the issue and attempted to restart the controller, in doing so the driver attempted to read the status registers of the controller. This triggered additional eeh errors which continued for a good 6 minutes.
Quoted 8 lines
Fixed by returning without waiting when EEH error is reported.
Signed-off-by Raghava Aditya Renukunta <[email protected]>Reviewed-by David Carroll <[email protected]>---
Changes for V2:
Refactored code to removeCONFIG_EEHmacros
Thanks,
Signature · 6 lines
Johannes Thumshirn Storage [email protected] +49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
PATCH v2 4/15 aacraid: Prevent E3 lockup when deleting units
In reply to Raghava Aditya RenukuntaArrconf management utility at times sends fibs with AdapterProcessed set in its fibs. This causes the controller to panic and lockup.
Fixed by failing the commands that have AdapterProcessed set in its flag.
---
Changes in V2:
None
drivers/scsi/aacraid/commsup.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/scsi/aacraid/commsup.c +4 -0
@@ -527,6 +527,10 @@ int aac_fib_send(u16 command, struct fib *fibptr, unsigned long size,if (!(hw_fib->header.XferState &cpu_to_le32 (HostOwned)))return -EBUSY ; + +if (hw_fib->header.XferState &cpu_to_le32 (AdapterProcessed)) +return -EINVAL ; +/* * There are 5 cases with the wait and response requested flags. * The only invalid cases are if the caller requests to wait and
Signature · 1 line
2.7.4
PATCH v2 5/15 aacraid: Fix memory leak in fib init path
In reply to Raghava Aditya Renukuntaaac_fib_map_free frees misaligned fib dma memory, additionally it does not free up the whole memory.
Fixed by changing the code to free up the correct and full memory allocation.
---
Changes in V2:
Refactored memory free code to make it easier to understand
drivers/scsi/aacraid/commsup.c | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-)
drivers/scsi/aacraid/commsup.c +21 -15
@@ -95,12 +95,20 @@ static int fib_map_alloc(struct aac_dev *dev)void aac_fib_map_free (struct aac_dev *dev) { -if (dev->hw_fib_va && dev->max_cmd_size) { -pci_free_consistent (dev->pdev, - (dev->max_cmd_size * - (dev->scsi_host_ptr->can_queue +AAC_NUM_MGT_FIB )), - dev->hw_fib_va, dev->hw_fib_pa); - } +size_t alloc_size; +size_t fib_size; +int num_fibs; + +if (!dev->hw_fib_va || !dev->max_cmd_size) +return ; + + num_fibs = dev->scsi_host_ptr->can_queue +AAC_NUM_MGT_FIB ; + fib_size = dev->max_fib_size +sizeof (struct aac_fib_xporthdr ); + alloc_size = fib_size * num_fibs +ALIGN32 -1 ; + +pci_free_consistent (dev->pdev, alloc_size, dev->hw_fib_va, + dev->hw_fib_pa); + dev->hw_fib_va =NULL ; dev->hw_fib_pa =0 ; }
@@ -153,22 +161,20 @@ int aac_fib_setup(struct aac_dev * dev)if (i<0 )return -ENOMEM ; -/* 32 byte alignment for PMC */ - hw_fib_pa = (dev->hw_fib_pa + (ALIGN32 -1 )) & ~(ALIGN32 -1 ); - dev->hw_fib_va = (struct hw_fib *)((unsigned char *)dev->hw_fib_va + - (hw_fib_pa - dev->hw_fib_pa)); - dev->hw_fib_pa = hw_fib_pa;memset (dev->hw_fib_va,0 , (dev->max_cmd_size +sizeof (struct aac_fib_xporthdr )) * (dev->scsi_host_ptr->can_queue +AAC_NUM_MGT_FIB )); +/* 32 byte alignment for PMC */ + hw_fib_pa = (dev->hw_fib_pa + (ALIGN32 -1 )) & ~(ALIGN32 -1 ); + hw_fib = (struct hw_fib *)((unsigned char *)dev->hw_fib_va + + (hw_fib_pa - dev->hw_fib_pa)); +/* add Xport header */ - dev->hw_fib_va = (struct hw_fib *)((unsigned char *)dev->hw_fib_va + + hw_fib = (struct hw_fib *)((unsigned char *)hw_fib +sizeof (struct aac_fib_xporthdr )); - dev->hw_fib_pa +=sizeof (struct aac_fib_xporthdr ); + hw_fib_pa +=sizeof (struct aac_fib_xporthdr ); - hw_fib = dev->hw_fib_va; - hw_fib_pa = dev->hw_fib_pa;/* * Initialise the fibs */
Signature · 1 line
2.7.4
Re: [PATCH V2 05/15] aacraid: Fix memory leak in fib init path
Quoted 6 lines · Raghava Aditya Renukunta
aac_fib_map_freefrees misaligned fib dma memory, additionally it does not free up the whole memory.Fixed by changing the code to free up the correct and full memory allocation.
Quoted 8 lines
Fixes e8b12f0fb835223 ([SCSI] aacraid: Add new code for PMC-Sierra's SRC based controller family)Signed-off-by Raghava Aditya Renukunta <[email protected]>Reviewed-by David Carroll <[email protected]>---
Changes in V2:
Refactored memory free code to make it easier to understand
Thanks,
Signature · 6 lines
Johannes Thumshirn Storage [email protected] +49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
PATCH v2 6/15 aacraid: Added sysfs for driver version
In reply to Raghava Aditya RenukuntaAdded support to retrieve driver version from a new sysfs variable called driver_version. It makes it easier for the user to figure out the driver version that is currently running.
---
Changes in V2:
None
drivers/scsi/aacraid/linit.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
drivers/scsi/aacraid/linit.c +15 -0
@@ -1131,6 +1131,13 @@ static ssize_t aac_show_bios_version(struct device *device,return len; } +static ssize_t aac_show_driver_version (struct device *device, +struct device_attribute *attr, +char *buf) +{ +return snprintf (buf,PAGE_SIZE ,"%s\n" , aac_driver_version); +} +static ssize_t aac_show_serial_number (struct device *device,struct device_attribute *attr,char *buf) {
@@ -1241,6 +1248,13 @@ static struct device_attribute aac_bios_version = { }, .show = aac_show_bios_version, }; +static struct device_attribute aac_lld_version = { + .attr = { + .name ="driver_version" , + .mode =0444 , + }, + .show = aac_show_driver_version, +};static struct device_attribute aac_serial_number = { .attr = { .name ="serial_number" ,
@@ -1278,6 +1292,7 @@ static struct device_attribute *aac_attrs[] = { &aac_kernel_version, &aac_monitor_version, &aac_bios_version, + &aac_lld_version, &aac_serial_number, &aac_max_channel, &aac_max_id,
Signature · 1 line
2.7.4
Re: [PATCH V2 06/15] aacraid: Added sysfs for driver version
Quoted 8 lines · Raghava Aditya Renukunta
Added support to retrieve driver version from a new sysfs variable called
driver_version. It makes it easier for the user to figure out the driver version that is currently running.Signed-off-by Raghava Aditya Renukunta <[email protected]>Reviewed-by David Carroll <[email protected]>---
Thanks,
Signature · 6 lines
Johannes Thumshirn Storage [email protected] +49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
PATCH v2 7/15 aacraid: Fix sync fibs time out on controller reset
In reply to Raghava Aditya RenukuntaAfter controller shutdown, all sync fibs time out due to not knowing about the switch to INT-x mode
Fixed by replacing aac_src_access_devreg() to aac_set_intx_mode() call.
---
Changes in V2:
None
drivers/scsi/aacraid/aacraid.h | 1 + drivers/scsi/aacraid/comminit.c | 2 +- drivers/scsi/aacraid/src.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-)
drivers/scsi/aacraid/aacraid.h +1 -0
@@ -2639,6 +2639,7 @@ void aac_hba_callback(void *context, struct fib *fibptr);#define fib_data (fibctx) ((void *)(fibctx)->hw_fib_va->data)struct aac_dev *aac_init_adapter (struct aac_dev *dev);void aac_src_access_devreg (struct aac_dev *dev,int mode); +void aac_set_intx_mode (struct aac_dev *dev);int aac_get_config_status (struct aac_dev *dev,int commit_flag);int aac_get_containers (struct aac_dev *dev);int aac_scsi_cmd (struct scsi_cmnd *cmd);
drivers/scsi/aacraid/comminit.c +1 -1
@@ -326,7 +326,7 @@ int aac_send_shutdown(struct aac_dev * dev) dev->pdev->device == PMC_DEVICE_S8 || dev->pdev->device == PMC_DEVICE_S9) && dev->msi_enabled) -aac_src_access_devreg (dev,AAC_ENABLE_INTX ); +aac_set_intx_mode (dev);return status; }
drivers/scsi/aacraid/src.c +1 -1
@@ -657,7 +657,7 @@ static int aac_srcv_ioremap(struct aac_dev *dev, u32 size)return 0 ; } -static void aac_set_intx_mode (struct aac_dev *dev) +void aac_set_intx_mode (struct aac_dev *dev) {if (dev->msi_enabled) {aac_src_access_devreg (dev,AAC_ENABLE_INTX );
Signature · 1 line
2.7.4
PATCH v2 8/15 aacraid: Skip wellness sync on controller failure
In reply to Raghava Aditya Renukuntaaac_command_thread checks on the health of controller periodically, using aac_check_health. If the status is an error state KERNEL_PANIC or anything else. The driver will attempt to restart the adapter, but the response is not checked in aac_command_thread. This allows the periodic sync to go thru and lead the driver to a hung state.
Fixed by terminating the periodic loop(intended per original design), if the controller is not restored to a healthy state.
---
Changes in V2:
None
drivers/scsi/aacraid/commsup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/aacraid/commsup.c +1 -1
@@ -2481,7 +2481,7 @@ int aac_command_thread(void *data)/* Don't even try to talk to adapter if its sick */ ret =aac_check_health (dev); -if (!dev->queues) +if (ret || !dev->queues)break ; next_check_jiffies = jiffies + ((long )(unsigned )check_interval)
Signature · 1 line
2.7.4
PATCH v2 9/15 aacraid: Reload offlined drives after controller reset
In reply to Raghava Aditya RenukuntaDuring the IOP reset stress testing, it was found that the drives can be marked offline when the adapter controller crashes and IO's are running in parallel. When the controller does come back from the reset, the drive that is marked offline is not exposed.
Fixed by removing and adding drives that are marked offline. In addition invoke a scsi host bus rescan to capture any additional configuration changes.
---
Changes in V2:
None
drivers/scsi/aacraid/commsup.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
drivers/scsi/aacraid/commsup.c +18 -0
@@ -1637,11 +1637,29 @@ static int _aac_reset_adapter(struct aac_dev *aac, int forced, u8 reset_type) command->SCp.phase =AAC_OWNER_ERROR_HANDLER ; command->scsi_done (command); } +/* +* Any Device that was already marked offline needs to be cleaned up +*/ +__shost_for_each_device (dev, host) { +if (!scsi_device_online (dev)) { +sdev_printk (KERN_INFO , dev,"Removing offline device\n" ); +scsi_remove_device (dev); +scsi_device_put (dev); + } + } retval =0 ; out: aac->in_reset =0 ;scsi_unblock_requests (host); +/* +* Issue bus rescan to catch any configuration that might have +* occurred +*/ +if (!retval) { +dev_info (&aac->pdev->dev,"Issuing bus rescan\n" ); +scsi_scan_host (host); + }if (jafo) {spin_lock_irq (host->host_lock); }
Signature · 1 line
2.7.4
PATCH v2 10/15 aacraid: Decrease adapter health check interval
In reply to Raghava Aditya RenukuntaCurrently driver checks the health status of the adapter once every 24 hours. When that happens the driver becomes dependent on the kernel to figure out if the adapter is misbehaving. This might take some time (when the adapter is idle). The driver currently has support to restart/recover the controller when it fails, and decreasing the time interval will help.
Fixed by decreasing check interval from 24 hours to 1 minute
---
Changes in V2:
None
drivers/scsi/aacraid/aachba.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/aacraid/aachba.c +1 -1
@@ -311,7 +311,7 @@ module_param(update_interval, int, S_IRUGO|S_IWUSR);MODULE_PARM_DESC (update_interval,"Interval in seconds between time sync" " updates issued to adapter." ); -int check_interval =24 *60 *60 ; +int check_interval =60 ;module_param (check_interval, int,S_IRUGO |S_IWUSR );MODULE_PARM_DESC (check_interval,"Interval in seconds between adapter health" " checks." );
Signature · 1 line
2.7.4
PATCH v2 11/15 aacraid: Skip IOP reset on controller panic(SMART Family)
In reply to Raghava Aditya RenukuntaWhen the SMART family of controller panic (KERNEL_PANIC) , they do not honor IOP resets. So better to skip it and directly perform a IWBR reset.
---
Changes in V2:
Removed unnecessary brackets and fixed a spelling mistake
drivers/scsi/aacraid/src.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/scsi/aacraid/src.c +6 -0
@@ -714,6 +714,12 @@ static int aac_src_restart_adapter(struct aac_dev *dev, int bled, u8 reset_type)pr_err ("%s%d: adapter kernel panic'd %x.\n" , dev->name, dev->id, bled); +/* +* When there is a BlinkLED, IOP_RESET has not effect +*/ +if (bled >=2 && dev->sa_firmware && reset_type &HW_IOP_RESET ) + reset_type &= ~HW_IOP_RESET ; + dev->a_ops.adapter_enable_int = aac_src_disable_interrupt;switch (reset_type) {
Signature · 1 line
2.7.4
PATCH v2 12/15 aacraid: Reorder Adapter status check
In reply to Raghava Aditya RenukuntaThe driver currently checks the SELF_TEST_FAILED first and then KERNEL_PANIC next. Under error conditions(boot code failure) both SELF_TEST_FAILED and KERNEL_PANIC can be set at the same time.
The driver has the capability to reset the controller on an KERNEL_PANIC, but not on SELF_TEST_FAILED.
Fixed by first checking KERNEL_PANIC and then the others.
---
Changes in V2:
Corrected stray , in commit message
drivers/scsi/aacraid/src.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-)
drivers/scsi/aacraid/src.c +17 -4
@@ -437,16 +437,23 @@ static int aac_src_check_health(struct aac_dev *dev)u32 status =src_readl (dev, MUnit.OMR);/* +* Check to see if the board panic'd. +*/ +if (unlikely (status &KERNEL_PANIC )) + goto err_blink; + +/* * Check to see if the board failed any self tests. */ if (unlikely (status &SELF_TEST_FAILED )) -return -1 ; + goto err_out;/* -* Check to see if the board panic'd. +* Check to see if the board failed any self tests. */ -if (unlikely (status &KERNEL_PANIC )) -return (status >>16 ) &0xFF ; +if (unlikely (status &MONITOR_PANIC )) + goto err_out; +/* * Wait for the adapter to be up and running. */
@@ -456,6 +463,12 @@ static int aac_src_check_health(struct aac_dev *dev)* Everything is OK */ return 0 ; + +err_out: +return -1 ; + +err_blink: +return (status >16 ) &0xFF ; }static inline u32 aac_get_vector (struct aac_dev *dev)
Signature · 1 line
2.7.4
PATCH v2 13/15 aacraid: Save adapter fib log before an IOP reset
In reply to Raghava Aditya RenukuntaCurrently the adapter firmware does not save outstanding I/O's log information when an IOP reset is triggered. This is problematic when trying to root cause and debug issues.
Fixed by adding sync command to trigger I/O log file save in the adapter firmware before issuing an IOP reset.
---
Changes in V2:
None
drivers/scsi/aacraid/aachba.c | 4 ++++ drivers/scsi/aacraid/aacraid.h | 6 ++++++ drivers/scsi/aacraid/src.c | 17 +++++++++++++++++ 3 files changed, 27 insertions(+)
drivers/scsi/aacraid/aachba.c +4 -0
@@ -294,6 +294,10 @@ MODULE_PARM_DESC(aif_timeout, "The duration of time in seconds to wait for""deregistering them. This is typically adjusted for heavily burdened" " systems."); +int aac_fib_dump; +module_param (aac_fib_dump, int,0644 ); +MODULE_PARM_DESC (aac_fib_dump,"Dump controller fibs prior to IOP_RESET 0=off, 1=on" ); +int numacb =-1 ;module_param (numacb, int,S_IRUGO |S_IWUSR ); MODULE_PARM_DESC(numacb, "Request a limit to the number of adapter control"
drivers/scsi/aacraid/aacraid.h +6 -0
@@ -1444,6 +1444,10 @@ struct aac_supplement_adapter_info#define AAC_OPTION_VARIABLE_BLOCK_SIZE cpu_to_le32(0x00040000)/* 240 simple volume support */ #define AAC_OPTION_SUPPORTED_240_VOLUMES cpu_to_le32(0x10000000) +/* +* Supports FIB dump sync command send prior to IOP_RESET +*/ +#define AAC_OPTION_SUPPORTED3_IOP_RESET_FIB_DUMP cpu_to_le32(0x00004000)#define AAC_SIS_VERSION_V3 3#define AAC_SIS_SLOT_UNKNOWN 0xFF
@@ -2483,6 +2487,7 @@ struct aac_hba_info {#define GET_DRIVER_BUFFER_PROPERTIES 0x00000023#define RCV_TEMP_READINGS 0x00000025#define GET_COMM_PREFERRED_SETTINGS 0x00000026 +#define IOP_RESET_FW_FIB_DUMP 0x00000034#define IOP_RESET 0x00001000#define IOP_RESET_ALWAYS 0x00001001#define RE_INIT_ADAPTER 0x000000ee
@@ -2686,4 +2691,5 @@ extern int aac_commit;extern int update_interval;extern int check_interval;extern int aac_check_reset; +extern int aac_fib_dump;#endif
drivers/scsi/aacraid/src.c +17 -0
@@ -679,10 +679,27 @@ void aac_set_intx_mode(struct aac_dev *dev) } } +static void aac_dump_fw_fib_iop_reset (struct aac_dev *dev) +{ +__le32 supported_options3; + +if (!aac_fib_dump) +return ; + + supported_options3 = dev->supplement_adapter_info.supported_options3; +if (!(supported_options3 &AAC_OPTION_SUPPORTED3_IOP_RESET_FIB_DUMP )) +return ; + +aac_adapter_sync_cmd (dev,IOP_RESET_FW_FIB_DUMP , +0 ,0 ,0 ,0 ,0 ,0 ,NULL ,NULL ,NULL ,NULL ,NULL ); +} +static void aac_send_iop_reset (struct aac_dev *dev,int bled) {u32 var, reset_mask; +aac_dump_fw_fib_iop_reset (dev); + bled =aac_adapter_sync_cmd (dev,IOP_RESET_ALWAYS ,0 ,0 ,0 ,0 ,0 ,0 , &var, &reset_mask,NULL ,NULL ,NULL );
Signature · 1 line
2.7.4
PATCH v2 14/15 aacraid: Fix a potential spinlock double unlock bug
In reply to Raghava Aditya RenukuntaThe driver does not unlock the reply queue spin lock after handling SMART adapter events. Instead it might attempt to unlock an already unlocked spin lock.
Fixed by making sure the driver locks the spin lock before freeing it.
Thank you dan for finding this issue out.
---
Changes in V2:
None
drivers/scsi/aacraid/commsup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/aacraid/commsup.c +1 -1
@@ -2215,7 +2215,7 @@ static void aac_process_events(struct aac_dev *dev)/* Thor AIF */ aac_handle_sa_aif (dev, fib);aac_fib_adapter_complete (fib, (u16 )sizeof (u32)); -continue ; + goto free_fib; }/* * We will process the FIB here or pass it to a
Signature · 1 line
2.7.4
PATCH v2 15/15 aacraid: Update driver version
In reply to Raghava Aditya RenukuntaUpdated driver version to 50792
---
Changes in V2:
None
drivers/scsi/aacraid/aacraid.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/aacraid/aacraid.h +1 -1
@@ -97,7 +97,7 @@ enum {#define PMC_GLOBAL_INT_BIT0 0x00000001#ifndef AAC_DRIVER_BUILD -# define AAC_DRIVER_BUILD 50740 +# define AAC_DRIVER_BUILD 50792# define AAC_DRIVER_BRANCH "-custom"#endif #define MAXIMUM_NUM_CONTAINERS 32
Signature · 1 line
2.7.4
Martin K. Petersen
AppliedQuoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Raghava" == Raghava Aditya Renukunta <[email protected]> writes:
Raghava> This patch set contains issue fixes, enhancements and other Raghava> misc changes. The majority of the fixes are a direct outcome Raghava> of testing and work done on the adapter reset Raghava> mechanism. Initially it just had IOP reset and then was Raghava> augmented with IWBR soft hardware resets in the previous patch Raghava> set. The reset mechanism is triggered in 2 paths, one is from Raghava> the eh handler from the kernel and the other is from the Raghava> driver's internal periodic health checkup.
Applied to 4.11/scsi-queue.
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering