aacraid: Patchset for aacraid driver version 41066
Subsystems (2)
cover aacraid: Patchset for aacraid driver version 41066
This patchset contains the following changes(bug fixes, features and code refactors) specific to the aacraid driver
---
Raghava Aditya Renukunta (10):
[SCSI] aacraid: Removed unnecessary checks for NULL [SCSI] aacraid: Fix incorrectly named MACRO
[SCSI] aacraid: Start adapter after updating number of MSIX vectors [SCSI] aacraid: Relinquish CPU during timeout wait [SCSI] aacraid: Disable MSI mode for series 6, 7, 8 cards [SCSI] aacraid: Fix for aac_command_thread hang
[SCSI] aacraid: Log firmware AIF messages
[SCSI] aacraid: Remove code to needlessly complete fib [SCSI] aacraid: Fix for KDUMP driver hang
[SCSI] aacraid: Update driver version
drivers/scsi/aacraid/aachba.c | 22 -------------------- drivers/scsi/aacraid/aacraid.h | 9 ++++++-- drivers/scsi/aacraid/comminit.c | 43 ++++++++++++++++++++++++--------------- drivers/scsi/aacraid/commsup.c | 39 ++++++++++++++++++++++++++++++++--- drivers/scsi/aacraid/dpcsup.c | 7 ++++-- drivers/scsi/aacraid/linit.c | 4 +++- drivers/scsi/aacraid/src.c | 3 ++- 7 files changed, 78 insertions(+), 49 deletions(-)
--
Signature
PATCH 2/10 aacraid: Fix incorrectly named MACRO
--- drivers/scsi/aacraid/aacraid.h | 2 +- drivers/scsi/aacraid/comminit.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/aacraid/aacraid.h +1 -1
@@ -720,7 +720,7 @@ struct sa_registers { }; -#define Sa_MINIPORT_REVISION 1 +#define SA_INIT_NUM_MSIXVECTORS 1#define sa_readw (AEP ,CSR ) readl(&((AEP)->regs.sa->CSR))#define sa_readl (AEP ,CSR ) readl(&((AEP)->regs.sa->CSR))
drivers/scsi/aacraid/comminit.c +1 -1
@@ -91,7 +91,7 @@ static int aac_alloc_comm(struct aac_dev *dev, void **commaddr, unsigned long co init->InitStructRevision =cpu_to_le32 (ADAPTER_INIT_STRUCT_REVISION );if (dev->max_fib_size !=sizeof (struct hw_fib )) init->InitStructRevision =cpu_to_le32 (ADAPTER_INIT_STRUCT_REVISION_4 ); - init->Sa_MSIXVectors =cpu_to_le32 (Sa_MINIPORT_REVISION); + init->Sa_MSIXVectors =cpu_to_le32 (SA_INIT_NUM_MSIXVECTORS ); init->fsrev =cpu_to_le32 (dev->fsrev);/*
PATCH 9/10 aacraid: Fix for KDUMP driver hang
In reply to Raghava Aditya RenukuntaWhen KDUMP is triggered the driver first talks to the firmware in INTX mode, but the adapter firmware is still in MSIX mode. Therefore the first driver command hangs since the driver is waiting for an INTX response and firmware gives a MSIX response. If when the OS is installed on a RAID drive created by the adapter KDUMP will hang since the driver does not receive a response in sync mode.
Fixed by: Change the firmware to INTX mode if it is in MSIX mode before sending the first sync command.
Cc: [email protected]
--- drivers/scsi/aacraid/aacraid.h | 1 + drivers/scsi/aacraid/comminit.c | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+)
drivers/scsi/aacraid/aacraid.h +1 -0
@@ -29,6 +29,7 @@ enum {#define AAC_INT_MODE_MSI (1<<1)#define AAC_INT_MODE_AIF (1<<2)#define AAC_INT_MODE_SYNC (1<<3) +#define AAC_INT_MODE_MSIX (1<<16)#define AAC_INT_ENABLE_TYPE1_INTX 0xfffffffb#define AAC_INT_ENABLE_TYPE1_MSIX 0xfffffffa
drivers/scsi/aacraid/comminit.c +24 -0
@@ -37,6 +37,7 @@#include <linux/spinlock.h> #include <linux/slab.h> #include <linux/blkdev.h> +#include <linux/delay.h> #include <linux/completion.h> #include <linux/mm.h> #include <scsi/scsi_host.h>
@@ -47,6 +48,20 @@ struct aac_common aac_config = { .irq_mod = 1 }; +static inline int aac_is_msix_mode (struct aac_dev *dev) +{ +u32 status; + + status =src_readl (dev, MUnit.OMR); +return (status &AAC_INT_MODE_MSIX ); +} + +static inline void aac_change_to_intx (struct aac_dev *dev) +{ +aac_src_access_devreg (dev,AAC_DISABLE_MSIX ); +aac_src_access_devreg (dev,AAC_ENABLE_INTX ); +} +static int aac_alloc_comm (struct aac_dev *dev,void **commaddr,unsigned long commsize,unsigned long commalign) {unsigned char *base;
@@ -414,6 +429,15 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev) dev->comm_interface =AAC_COMM_PRODUCER ; dev->raw_io_interface = dev->raw_io_64 =0 ; + +/* +* Enable INTX mode, if not done already Enabled +*/ +if (aac_is_msix_mode (dev)) { +aac_change_to_intx (dev); +dev_info (&dev->pdev->dev,"Changed firmware to INTX mode" ); + } + if ((!aac_adapter_sync_cmd(dev, GET_ADAPTER_PROPERTIES, 0, 0, 0, 0, 0, 0, status+0, status+1, status+2, status+3, NULL)) &&
PATCH 4/10 aacraid: Relinquish CPU during timeout wait
In reply to Raghava Aditya Renukuntaaac_fib_send has a special function case for initial commands during driver initialization using wait < 0(pseudo sync mode). In this case, the command does not sleep but rather spins checking for timeout.This loop is calls cpu_relax() in an attempt to allow other processes/threads to use the CPU, but this function does not relinquish the CPU and so the command will hog the processor. This was observed in a KDUMP "crashkernel" and that prevented the "command thread" (which is responsible for completing the command from being timed out) from starting because it could not get the CPU.
Fixed by replacing "cpu_relax()" call with "schedule()"
Cc: [email protected]
--- drivers/scsi/aacraid/commsup.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/scsi/aacraid/commsup.c +4 -4
@@ -637,10 +637,10 @@ int aac_fib_send(u16 command, struct fib *fibptr, unsigned long size, }return -EFAULT ; } -/* We used to udelay() here but that absorbed -* a CPU when a timeout occured. Not very -* useful. */ -cpu_relax (); +/* +* Allow other processes / CPUS to use core +*/ +schedule (); } }else if (down_interruptible (&fibptr->event_wait)) {/* Do nothing ... satisfy
PATCH 10/10 aacraid: Update driver version
In reply to Raghava Aditya Renukunta--- drivers/scsi/aacraid/aacraid.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/aacraid/aacraid.h +1 -1
@@ -63,7 +63,7 @@ enum {#define PMC_GLOBAL_INT_BIT0 0x00000001#ifndef AAC_DRIVER_BUILD -# define AAC_DRIVER_BUILD 41052 +# define AAC_DRIVER_BUILD 41066# define AAC_DRIVER_BRANCH "-ms"#endif #define MAXIMUM_NUM_CONTAINERS 32
PATCH 1/10 aacraid: Removed unnecessary checks for NULL
In reply to Raghava Aditya RenukuntaCurrent driver checks for NULL return from aac_fib_alloc_tag, but it not possible for it to return NULL.
Fixed by: Remove all the checks for NULL returns from aac_fib_alloc_tag
--- drivers/scsi/aacraid/aachba.c | 22 ---------------------- 1 file changed, 22 deletions(-)
drivers/scsi/aacraid/aachba.c +0 -22
@@ -555,8 +555,6 @@ static int aac_get_container_name(struct scsi_cmnd * scsicmd) dev = (struct aac_dev *)scsicmd->device->host->hostdata; cmd_fibcontext =aac_fib_alloc_tag (dev, scsicmd); -if (!cmd_fibcontext) -return -ENOMEM ;aac_fib_init (cmd_fibcontext); dinfo = (struct aac_get_name *)fib_data (cmd_fibcontext);
@@ -1037,8 +1035,6 @@ static int aac_get_container_serial(struct scsi_cmnd * scsicmd) dev = (struct aac_dev *)scsicmd->device->host->hostdata; cmd_fibcontext =aac_fib_alloc_tag (dev, scsicmd); -if (!cmd_fibcontext) -return -ENOMEM ;aac_fib_init (cmd_fibcontext); dinfo = (struct aac_get_serial *)fib_data (cmd_fibcontext);
@@ -1950,10 +1946,6 @@ static int aac_read(struct scsi_cmnd * scsicmd)* Alocate and initialize a Fib */ cmd_fibcontext =aac_fib_alloc_tag (dev, scsicmd); -if (!cmd_fibcontext) { -printk (KERN_WARNING "aac_read: fib allocation failed\n" ); -return -1 ; - } status =aac_adapter_read (cmd_fibcontext, scsicmd, lba, count);
@@ -2048,16 +2040,6 @@ static int aac_write(struct scsi_cmnd * scsicmd)* Allocate and initialize a Fib then setup a BlockWrite command */ cmd_fibcontext =aac_fib_alloc_tag (dev, scsicmd); -if (!cmd_fibcontext) { -/* FIB temporarily unavailable,not catastrophic failure */ - -/* scsicmd->result = DID_ERROR << 16; -* scsicmd->scsi_done(scsicmd); -* return 0; -*/ -printk (KERN_WARNING "aac_write: fib allocation failed\n" ); -return -1 ; - } status =aac_adapter_write (cmd_fibcontext, scsicmd, lba, count, fua);
@@ -2283,8 +2265,6 @@ static int aac_start_stop(struct scsi_cmnd *scsicmd)* Allocate and initialize a Fib */ cmd_fibcontext =aac_fib_alloc_tag (aac, scsicmd); -if (!cmd_fibcontext) -return SCSI_MLQUEUE_HOST_BUSY ;aac_fib_init (cmd_fibcontext);
@@ -3184,8 +3164,6 @@ static int aac_send_srb_fib(struct scsi_cmnd* scsicmd)* Allocate and initialize a Fib then setup a BlockWrite command */ cmd_fibcontext =aac_fib_alloc_tag (dev, scsicmd); -if (!cmd_fibcontext) -return -1 ; status =aac_adapter_scsi (cmd_fibcontext, scsicmd);
PATCH 3/10 aacraid: Start adapter after updating number of MSIX vectors
In reply to Raghava Aditya RenukuntaThe adapter has to be started after updating the number of MSIX Vectors
--- drivers/scsi/aacraid/linit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/aacraid/linit.c +1 -1
@@ -1431,8 +1431,8 @@ static int aac_acquire_resources(struct aac_dev *dev)/* After EEH recovery or suspend resume, max_msix count * may change, therfore updating in init as well. */ -aac_adapter_start (dev); dev->init->Sa_MSIXVectors =cpu_to_le32 (dev->max_msix); +aac_adapter_start (dev); }return 0 ;
PATCH 5/10 aacraid: Disable MSI mode for series 6, 7, 8 cards
In reply to Raghava Aditya RenukuntaAs the firmware for series 6, 7, 8 cards does not support msi, remove it in the driver
--- drivers/scsi/aacraid/comminit.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-)
drivers/scsi/aacraid/comminit.c +2 -15
@@ -378,21 +378,8 @@ void aac_define_int_mode(struct aac_dev *dev) msi_count = i; }else { dev->msi_enabled =0 ; -printk (KERN_ERR "%s%d: MSIX not supported!! Will try MSI 0x%x.\n" , - dev->name, dev->id, i); - } - } - -if (!dev->msi_enabled) { - msi_count =1 ; - i =pci_enable_msi (dev->pdev); - -if (!i) { - dev->msi_enabled =1 ; - dev->msi =1 ; - }else { -printk (KERN_ERR "%s%d: MSI not supported!! Will try INTx 0x%x.\n" , - dev->name, dev->id, i); +dev_err (&dev->pdev->dev, +"MSIX not supported!! Will try INTX 0x%x.\n" , i); } }
PATCH 6/10 aacraid: Fix for aac_command_thread hang
In reply to Raghava Aditya RenukuntaTypically under error conditions, it is possible for aac_command_thread() to miss the wakeup from kthread_stop() and go back to sleep, causing it to hang aac_shutdown.
In the observed scenario, the adapter is not functioning correctly and so aac_fib_send() never completes (or time-outs depending on how it was called). Shortly after aac_command_thread() starts it performs aac_fib_send(SendHostTime) which hangs. When aac_probe_one /aac_get_adapter_info send time outs, kthread_stop is called which breaks the command thread out of it's hang.
The code will still go back to sleep in schedule_timeout() without checking kthread_should_stop() so it causes aac_probe_one to hang until the schedule_timeout() which is 30 minutes.
Fixed by: Adding another kthread_should_stop() before schedule_timeout()
Cc: [email protected]
--- drivers/scsi/aacraid/commsup.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/scsi/aacraid/commsup.c +4 -0
@@ -1996,6 +1996,10 @@ int aac_command_thread(void *data)if (difference <=0 ) difference =1 ;set_current_state (TASK_INTERRUPTIBLE ); + +if (kthread_should_stop ()) +break ; +schedule_timeout (difference);if (kthread_should_stop ())
PATCH 7/10 aacraid: Log firmware AIF messages
In reply to Raghava Aditya RenukuntaFirmware AIF messages about cache loss and data recovery are being missed by the driver since currently they are not captured but rather let go. This patch to capture those messages and log them for the user.
--- drivers/scsi/aacraid/aacraid.h | 4 ++++ drivers/scsi/aacraid/commsup.c | 27 +++++++++++++++++++++++++++ drivers/scsi/aacraid/linit.c | 2 ++ drivers/scsi/aacraid/src.c | 3 ++- 4 files changed, 35 insertions(+), 1 deletion(-)
drivers/scsi/aacraid/aacraid.h +4 -0
@@ -2065,6 +2065,10 @@ extern struct aac_common aac_config;#define AifEnAddJBOD 30/* JBOD created */ #define AifEnDeleteJBOD 31/* JBOD deleted */ +#define AifBuManagerEvent 42/* Bu management*/ +#define AifBuCacheDataLoss 10 +#define AifBuCacheDataRecover 11 +#define AifCmdJobProgress 2/* Progress report */ #define AifJobCtrZero 101/* Array Zero progress */ #define AifJobStsSuccess 1/* Job completes */
drivers/scsi/aacraid/commsup.c +27 -0
@@ -901,6 +901,31 @@ void aac_printf(struct aac_dev *dev, u32 val)memset (cp,0 ,256 ); } +static inline int aac_aif_data (struct aac_aifcmd *aifcmd,uint32_t index) +{ +return le32_to_cpu (((__le32 *)aifcmd->data)[index]); +} + + +static void aac_handle_aif_bu (struct aac_dev *dev,struct aac_aifcmd *aifcmd) +{ +switch (aac_aif_data (aifcmd,1 )) { +case AifBuCacheDataLoss: +if (aac_aif_data (aifcmd,2 )) +dev_info (&dev->pdev->dev,"Backup unit had cache data loss - [%d]\n" , +aac_aif_data (aifcmd,2 )); +else +dev_info (&dev->pdev->dev,"Backup Unit had cache data loss\n" ); +break ; +case AifBuCacheDataRecover: +if (aac_aif_data (aifcmd,2 )) +dev_info (&dev->pdev->dev,"DDR cache data recovered successfully - [%d]\n" , +aac_aif_data (aifcmd,2 )); +else +dev_info (&dev->pdev->dev,"DDR cache data recovered successfully\n" ); +break ; + } +}/** * aac_handle_aif - Handle a message from the firmware
@@ -1154,6 +1179,8 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr) ADD :DELETE ;break ; } +case AifBuManagerEvent: +aac_handle_aif_bu (dev, aifcmd);break ; }
drivers/scsi/aacraid/linit.c +2 -0
@@ -1299,6 +1299,8 @@ static int aac_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)else shost->this_id = shost->max_id; +aac_intr_normal (aac,0 ,2 ,0 ,NULL ); +/* * dmb - we may need to move the setting of these parms somewhere else once * we get a fib that can report the actual numbers
drivers/scsi/aacraid/src.c +2 -1
@@ -135,7 +135,8 @@ static irqreturn_t aac_src_intr_message(int irq, void *dev_id)if (mode &AAC_INT_MODE_AIF ) {/* handle AIF */ -aac_intr_normal (dev,0 ,2 ,0 ,NULL ); +if (dev->aif_thread && dev->fsa_dev) +aac_intr_normal (dev,0 ,2 ,0 ,NULL );if (dev->msi_enabled)aac_src_access_devreg (dev,AAC_CLEAR_AIF_BIT ); mode =0 ;
PATCH 8/10 aacraid: Remove code to needlessly complete fib
In reply to Raghava Aditya RenukuntaCurrently driver completes double completed or spurious interrupted fibs. This is not necessary and causes the SCSI mid layer to issue aborts and resets, since completing a fib prematurely might trigger a race condition resulting in the driver not calling the scsi_done callback.
Fixed by removing the call to fib complete.
--- drivers/scsi/aacraid/dpcsup.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/scsi/aacraid/dpcsup.c +4 -3
@@ -392,9 +392,10 @@ unsigned int aac_intr_normal(struct aac_dev *dev, u32 index,if (likely (fib->callback && fib->callback_data)) { fib->flags &=FIB_CONTEXT_FLAG_FASTRESP ; fib->callback (fib->callback_data, fib); - }else { -aac_fib_complete (fib); - } + }else +dev_info (&dev->pdev->dev, +"Invalid callback_fib[%d] (*%p)(%p)\n" , + index, fib->callback, fib->callback_data); }else {unsigned long flagv;dprintk ((KERN_INFO "event_wait up\n" ));
Re: [PATCH 02/10] aacraid: Fix incorrectly named MACRO
In reply to Raghava Aditya RenukuntaQuoted 2 lines · Raghava Aditya Renukunta
Suggested-by Seymour, Shane M <[email protected]>Signed-off-by Raghava Aditya Renukunta <[email protected]>
Signature · 10 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 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 03/10] aacraid: Start adapter after updating number of MSIX vectors
In reply to Raghava Aditya RenukuntaQuoted 6 lines · Raghava Aditya Renukunta
The adapter has to be started after updating the number of MSIX Vectors
Fixes ecc479e00db8 (aacraid: Set correct MSIX count for EEH recovery)Signed-off-by Raghava Aditya Renukunta <[email protected]>
Signature · 10 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 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 05/10] aacraid: Disable MSI mode for series 6, 7, 8 cards
In reply to Raghava Aditya RenukuntaQuoted 4 lines · Raghava Aditya Renukunta
As the firmware for series 6, 7, 8 cards does not support msi, remove it in the driver
Signed-off-by Raghava Aditya Renukunta <[email protected]>
Signature · 10 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 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 07/10] aacraid: Log firmware AIF messages
In reply to Raghava Aditya RenukuntaQuoted 5 lines · Raghava Aditya Renukunta
Firmware AIF messages about cache loss and data recovery are being missed by the driver since currently they are not captured but rather let go. This patch to capture those messages and log them for the user.
Signed-off-by Raghava Aditya Renukunta <[email protected]>
Signature · 10 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 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 08/10] aacraid: Remove code to needlessly complete fib
In reply to Raghava Aditya RenukuntaQuoted 17 lines · Raghava Aditya Renukunta
Currently driver completes double completed or spurious interrupted fibs. This is not necessary and causes the SCSI mid layer to issue aborts and resets, since completing a fib prematurely might trigger a race condition resulting in the driver not calling the
scsi_donecallback.Fixed by removing the call to fib complete.
Signed-off-by Raghava Aditya Renukunta <[email protected]>--- drivers/scsi/aacraid/dpcsup.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)drivers/scsi/aacraid/dpcsup.c +0
-0
drivers/scsi/aacraid/dpcsup.c unsigned int aac_intr_normal(struct aac_dev *dev, u32 index, · line 398
Quoted 10 lines
drivers/scsi/aacraid/dpcsup.c +4
-3@@ -392,9 +392,10 @@ unsigned int aac_intr_normal(struct aac_dev *dev, u32 index,if (likely (fib->callback && fib->callback_data)) { fib->flags &=FIB_CONTEXT_FLAG_FASTRESP ; fib->callback (fib->callback_data, fib); - }else { -aac_fib_complete (fib); - } + }else +dev_info (&dev->pdev->dev, +"Invalid callback_fib[%d] (*%p)(%p)\n" , + index, fib->callback, fib->callback_data);
I'm not sure INFO is the right logging level for this. WARN or ERROR might be more suited.
Quoted 8 lines
drivers/scsi/aacraid/dpcsup.c +0
-1}else {unsigned long flagv;dprintk ((KERN_INFO "event_wait up\n" )); --To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 10 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 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 09/10] aacraid: Fix for KDUMP driver hang
In reply to Raghava Aditya RenukuntaQuoted 47 lines · Raghava Aditya Renukunta
When KDUMP is triggered the driver first talks to the firmware in INTX mode, but the adapter firmware is still in MSIX mode. Therefore the first driver command hangs since the driver is waiting for an INTX response and firmware gives a MSIX response. If when the OS is installed on a RAID drive created by the adapter KDUMP will hang since the driver does not receive a response in sync mode.
Fixed by: Change the firmware to INTX mode if it is in MSIX mode before sending the first sync command.
Cc: [email protected]Signed-off-by Raghava Aditya Renukunta <[email protected]>--- drivers/scsi/aacraid/aacraid.h | 1 + drivers/scsi/aacraid/comminit.c | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+)drivers/scsi/aacraid/aacraid.h +1
-0@@ -29,6 +29,7 @@ enum {#define AAC_INT_MODE_MSI (1<<1)#define AAC_INT_MODE_AIF (1<<2)#define AAC_INT_MODE_SYNC (1<<3) +#define AAC_INT_MODE_MSIX (1<<16)#define AAC_INT_ENABLE_TYPE1_INTX 0xfffffffb#define AAC_INT_ENABLE_TYPE1_MSIX 0xfffffffadrivers/scsi/aacraid/comminit.c +3
-0@@ -37,6 +37,7 @@#include <linux/spinlock.h> #include <linux/slab.h> #include <linux/blkdev.h> +#include <linux/delay.h> #include <linux/completion.h> #include <linux/mm.h> #include <scsi/scsi_host.h> @@ -47,6 +48,20 @@ struct aac_common aac_config = { .irq_mod = 1 }; +static inline int aac_is_msix_mode (struct aac_dev *dev) +{
drivers/scsi/aacraid/comminit.c struct aac_common aac_config = { · line 62
Quoted 10 lines
drivers/scsi/aacraid/comminit.c +10
-0+u32 status; + + status =src_readl (dev, MUnit.OMR); +return (status &AAC_INT_MODE_MSIX ); +} + +static inline void aac_change_to_intx (struct aac_dev *dev) +{ +aac_src_access_devreg (dev,AAC_DISABLE_MSIX ); +aac_src_access_devreg (dev,AAC_ENABLE_INTX );
I don't know your adpater firmware, but isn't it possible to loose interrupts this way or do they get queued?
Quoted 26 lines
drivers/scsi/aacraid/comminit.c +11
-1+} +static int aac_alloc_comm (struct aac_dev *dev,void **commaddr,unsigned long commsize,unsigned long commalign) {unsigned char *base;@@ -414,6 +429,15 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev) dev->comm_interface =AAC_COMM_PRODUCER ; dev->raw_io_interface = dev->raw_io_64 =0 ; + +/* +* Enable INTX mode, if not done already Enabled +*/ +if (aac_is_msix_mode (dev)) { +aac_change_to_intx (dev); +dev_info (&dev->pdev->dev,"Changed firmware to INTX mode" ); + } + if ((!aac_adapter_sync_cmd(dev, GET_ADAPTER_PROPERTIES, 0, 0, 0, 0, 0, 0, status+0, status+1, status+2, status+3, NULL)) && --To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 10 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 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 10/10] aacraid: Update driver version
In reply to Raghava Aditya RenukuntaQuoted 1 line · Raghava Aditya Renukunta
Signed-off-by Raghava Aditya Renukunta <[email protected]>
Signature · 10 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 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 04/10] aacraid: Relinquish CPU during timeout wait
In reply to Raghava Aditya RenukuntaQuoted 10 lines · Raghava Aditya Renukunta
aac_fib_sendhas a special function case for initial commands during driver initialization using wait < 0(pseudo sync mode). In this case, the command does not sleep but rather spins checking for timeout.This loop is callscpu_relax()in an attempt to allow other processes/threads to use the CPU, but this function does not relinquish the CPU and so the command will hog the processor. This was observed in a KDUMP "crashkernel" and that prevented the "command thread" (which is responsible for completing the command from being timed out) from starting because it could not get the CPU.
Quoted 4 lines
Fixed by replacing "
cpu_relax()" call with "schedule()"
Cc: [email protected]Signed-off-by Raghava Aditya Renukunta <[email protected]>
Signature · 10 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 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 06/10] aacraid: Fix for aac_command_thread hang
In reply to Raghava Aditya RenukuntaQuoted 11 lines · Raghava Aditya Renukunta
Typically under error conditions, it is possible for
aac_command_thread()to miss the wakeup fromkthread_stop()and go back to sleep, causing it to hangaac_shutdown.In the observed scenario, the adapter is not functioning correctly and so
aac_fib_send()never completes (or time-outs depending on how it was called). Shortly afteraac_command_thread()starts it performsaac_fib_send(SendHostTime)which hangs. Whenaac_probe_one/aac_get_adapter_info send time outs,kthread_stopis called which breaks the command thread out of it's hang.
Quoted 8 lines
The code will still go back to sleep in
schedule_timeout()without checkingkthread_should_stop()so it causesaac_probe_oneto hang until theschedule_timeout()which is 30 minutes.Fixed by: Adding another
kthread_should_stop()beforeschedule_timeout()
Cc: [email protected]Signed-off-by Raghava Aditya Renukunta <[email protected]>
Signature · 10 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 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 08/10] aacraid: Remove code to needlessly complete fib
In reply to Johannes ThumshirnHello Johannes,
Quoted 43 lines
-----Original Message-----
From: Johannes Thumshirn [mailto:[email protected]]
Sent: Wednesday, April 27, 2016 2:24 AM
To: Raghava Aditya Renukunta
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Gana Sridaran; Scott Benesh; Vishal Jose Mannanal
Subject: Re: [PATCH 08/10] aacraid: Remove code to needlessly complete fibEXTERNAL EMAIL
Quoted 8 lines · Raghava Aditya Renukunta
Currently driver completes double completed or spurious interrupted fibs. This is not necessary and causes the SCSI mid layer to issue aborts and resets, since completing a fib prematurely might trigger a race condition resulting in the driver not calling the
scsi_donecallback.Fixed by removing the call to fib complete.
Signed-off-by Raghava Aditya Renukuntadrivers/scsi/aacraid/dpcsup.c unsigned int aac_intr_normal(struct aac_dev *dev,
Quoted 9 lines
--- drivers/scsi/aacraid/dpcsup.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)drivers/scsi/aacraid/dpcsup.c +0
-0@@ -392,9 +392,10 @@ unsigned int aac_intr_normal(struct aac_dev *dev,u32 index,
drivers/scsi/aacraid/dpcsup.c unsigned int aac_intr_normal(struct aac_dev *dev, u32 index, · line 398
Quoted 10 lines
drivers/scsi/aacraid/dpcsup.c +4
-3if (likely (fib->callback && fib->callback_data)) { fib->flags &=FIB_CONTEXT_FLAG_FASTRESP ; fib->callback (fib->callback_data, fib); - }else { -aac_fib_complete (fib); - } + }else +dev_info (&dev->pdev->dev, +"Invalid callback_fib[%d] (*%p)(%p)\n" , + index, fib->callback, fib->callback_data);
Quoted 2 lines
I'm not sure INFO is the right logging level for this. WARN or ERROR might be more suited.
I intended it be an acknowledgement that we ran into this issue. That was why I used info, It should not impact the flow of the driver.
Regards,
Raghava Aditya
Quoted 10 lines
Quoted 9 lines
drivers/scsi/aacraid/dpcsup.c +0
-1}else {unsigned long flagv;dprintk ((KERN_INFO "event_wait up\n" )); --To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 7 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
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 09/10] aacraid: Fix for KDUMP driver hang
In reply to Johannes ThumshirnHello Johannes,
Quoted 60 lines
-----Original Message-----
From: Johannes Thumshirn [mailto:[email protected]]
Sent: Wednesday, April 27, 2016 2:30 AM
To: Raghava Aditya Renukunta
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Gana Sridaran; Scott Benesh; Vishal Jose Mannanal
Subject: Re: [PATCH 09/10] aacraid: Fix for KDUMP driver hangEXTERNAL EMAIL
Quoted 7 lines · Raghava Aditya Renukunta
When KDUMP is triggered the driver first talks to the firmware in INTX mode, but the adapter firmware is still in MSIX mode. Therefore the first driver command hangs since the driver is waiting for an INTX response and firmware gives a MSIX response. If when the OS is installed on a RAID drive created by the adapter KDUMP will hang since the driver does not receive a response in sync mode.
Quoted 5 lines
Fixed by: Change the firmware to INTX mode if it is in MSIX mode before sending the first sync command.
Cc: [email protected]Signed-off-by Raghava Aditya RenukuntaReview
Quoted 18 lines
--- drivers/scsi/aacraid/aacraid.h | 1 + drivers/scsi/aacraid/comminit.c | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+)drivers/scsi/aacraid/aacraid.h +1
-0@@ -29,6 +29,7 @@ enum {#define AAC_INT_MODE_MSI (1<<1)#define AAC_INT_MODE_AIF (1<<2)#define AAC_INT_MODE_SYNC (1<<3) +#define AAC_INT_MODE_MSIX (1<<16)#define AAC_INT_ENABLE_TYPE1_INTX 0xfffffffb#define AAC_INT_ENABLE_TYPE1_MSIX 0xfffffffa(quoted diff) +0
-0
b/drivers/scsi/aacraid/comminit.cQuoted 15 lines
index 50d521a..341ea32 100644
drivers/scsi/aacraid/comminit.c +1
-0@@ -37,6 +37,7 @@#include <linux/spinlock.h> #include <linux/slab.h> #include <linux/blkdev.h> +#include <linux/delay.h> #include <linux/completion.h> #include <linux/mm.h> #include <scsi/scsi_host.h> @@ -47,6 +48,20 @@ struct aac_common aac_config = { .irq_mod = 1 };
Quoted 15 lines
drivers/scsi/aacraid/comminit.c struct aac_common aac_config = { · line 62
Quoted 12 lines
drivers/scsi/aacraid/comminit.c +12
-0+static inline int aac_is_msix_mode (struct aac_dev *dev) +{ +u32 status; + + status =src_readl (dev, MUnit.OMR); +return (status &AAC_INT_MODE_MSIX ); +} + +static inline void aac_change_to_intx (struct aac_dev *dev) +{ +aac_src_access_devreg (dev,AAC_DISABLE_MSIX ); +aac_src_access_devreg (dev,AAC_ENABLE_INTX );I don't know your adpater firmware, but isn't it possible to loose interrupts this way or do they get queued?
The firmware queues interrupts messages in its own buffers, and the driver sends a command to retrieve those messages once the driver gets initialized.
The code that sends the command once the driver is initialized is in the patch 7 of this Series.
Hope that clarifies your doubt.
Regards,
Raghava Aditya
Quoted 24 lines
drivers/scsi/aacraid/comminit.c struct aac_common aac_config = {
Quoted 3 lines
drivers/scsi/aacraid/comminit.c +2
-0+} + static int aac_alloc_comm(struct aac_dev *dev, void **commaddr,unsigned long commsize, unsigned long commalign)
drivers/scsi/aacraid/comminit.c struct aac_dev *aac_init_adapter(struct aac_dev
Quoted 3 lines
drivers/scsi/aacraid/comminit.c +0
-0{unsigned char *base;@@ -414,6 +429,15 @@ struct aac_dev *aac_init_adapter(struct aac_dev*dev)
Quoted 16 lines
drivers/scsi/aacraid/comminit.c +9
-0dev->comm_interface =AAC_COMM_PRODUCER ; dev->raw_io_interface = dev->raw_io_64 =0 ; + +/* +* Enable INTX mode, if not done already Enabled +*/ +if (aac_is_msix_mode (dev)) { +aac_change_to_intx (dev); +dev_info (&dev->pdev->dev,"Changed firmware to INTX mode" ); + } + if ((!aac_adapter_sync_cmd(dev, GET_ADAPTER_PROPERTIES, 0, 0, 0, 0, 0, 0, status+0, status+1, status+2, status+3, NULL)) &&
Quoted 12 lines
Quoted 4 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html--
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
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Johannes Thumshirn
Reviewed-byRe: [PATCH 08/10] aacraid: Remove code to needlessly complete fib
In reply to Raghava Aditya RenukuntaQuoted 7 lines · Raghava Aditya Renukunta
Hello Johannes,
Quoted 4 lines
Quoted 3 lines
drivers/scsi/aacraid/dpcsup.c +3
-0+dev_info (&dev->pdev->dev, +"Invalid callback_fib[%d] (*%p)(%p)\n" , + index, fib->callback, fib->callback_data);
Quoted 5 lines
Quoted 2 lines
I'm not sure INFO is the right logging level for this. WARN or ERROR might be more suited.
I intended it be an acknowledgement that we ran into this issue. That was why I used info, It should not impact the flow of the driver.
OK, I'm fine with the explanation
Signature · 10 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 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Johannes Thumshirn
Reviewed-byRe: [PATCH 09/10] aacraid: Fix for KDUMP driver hang
In reply to Raghava Aditya RenukuntaQuoted 83 lines · Raghava Aditya Renukunta
Hello Johannes,
Quoted 60 lines
-----Original Message-----
From: Johannes Thumshirn [mailto:[email protected]]
Sent: Wednesday, April 27, 2016 2:30 AM
To: Raghava Aditya Renukunta
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Gana Sridaran; Scott Benesh; Vishal Jose Mannanal
Subject: Re: [PATCH 09/10] aacraid: Fix for KDUMP driver hangEXTERNAL EMAIL
Quoted 7 lines · Raghava Aditya Renukunta
When KDUMP is triggered the driver first talks to the firmware in INTX mode, but the adapter firmware is still in MSIX mode. Therefore the first driver command hangs since the driver is waiting for an INTX response and firmware gives a MSIX response. If when the OS is installed on a RAID drive created by the adapter KDUMP will hang since the driver does not receive a response in sync mode.
Quoted 5 lines
Fixed by: Change the firmware to INTX mode if it is in MSIX mode before sending the first sync command.
Cc: [email protected]Signed-off-by Raghava Aditya RenukuntaReview
Quoted 18 lines
--- drivers/scsi/aacraid/aacraid.h | 1 + drivers/scsi/aacraid/comminit.c | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+)drivers/scsi/aacraid/aacraid.h +1
-0@@ -29,6 +29,7 @@ enum {#define AAC_INT_MODE_MSI (1<<1)#define AAC_INT_MODE_AIF (1<<2)#define AAC_INT_MODE_SYNC (1<<3) +#define AAC_INT_MODE_MSIX (1<<16)#define AAC_INT_ENABLE_TYPE1_INTX 0xfffffffb#define AAC_INT_ENABLE_TYPE1_MSIX 0xfffffffa(quoted diff) +0
-0
b/drivers/scsi/aacraid/comminit.cQuoted 15 lines
index 50d521a..341ea32 100644
drivers/scsi/aacraid/comminit.c +1
-0@@ -37,6 +37,7 @@#include <linux/spinlock.h> #include <linux/slab.h> #include <linux/blkdev.h> +#include <linux/delay.h> #include <linux/completion.h> #include <linux/mm.h> #include <scsi/scsi_host.h> @@ -47,6 +48,20 @@ struct aac_common aac_config = { .irq_mod = 1 };Quoted 15 lines
drivers/scsi/aacraid/comminit.c struct aac_common aac_config = { · line 62
Quoted 12 lines
drivers/scsi/aacraid/comminit.c +12
-0+static inline int aac_is_msix_mode (struct aac_dev *dev) +{ +u32 status; + + status =src_readl (dev, MUnit.OMR); +return (status &AAC_INT_MODE_MSIX ); +} + +static inline void aac_change_to_intx (struct aac_dev *dev) +{ +aac_src_access_devreg (dev,AAC_DISABLE_MSIX ); +aac_src_access_devreg (dev,AAC_ENABLE_INTX );I don't know your adpater firmware, but isn't it possible to loose interrupts this way or do they get queued?
The firmware queues interrupts messages in its own buffers, and the driver sends a command to retrieve those messages once the driver gets initialized.
The code that sends the command once the driver is initialized is in the patch 7 of this Series.
Quoted 4 lines
Hope that clarifies your doubt.
Regards,
Raghava Aditya
OK, thanks for the clarification
Signature · 10 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 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
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 patchset contains the following changes(bug fixes, Raghava> features and code refactors) specific to the aacraid driver
Applied to 4.7/scsi-queue.
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering