Skip to content

Commit bb3412e

Browse files
Raghava Aditya Renukuntasashalevin
authored andcommitted
aacraid: Fix for KDUMP driver hang
[ Upstream commit 78cbccd ] 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]> Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent ca7bb25 commit bb3412e

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

drivers/scsi/aacraid/aacraid.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ enum {
2929
#define AAC_INT_MODE_MSI (1<<1)
3030
#define AAC_INT_MODE_AIF (1<<2)
3131
#define AAC_INT_MODE_SYNC (1<<3)
32+
#define AAC_INT_MODE_MSIX (1<<16)
3233

3334
#define AAC_INT_ENABLE_TYPE1_INTX 0xfffffffb
3435
#define AAC_INT_ENABLE_TYPE1_MSIX 0xfffffffa

drivers/scsi/aacraid/comminit.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include <linux/spinlock.h>
3838
#include <linux/slab.h>
3939
#include <linux/blkdev.h>
40+
#include <linux/delay.h>
4041
#include <linux/completion.h>
4142
#include <linux/mm.h>
4243
#include <scsi/scsi_host.h>
@@ -49,6 +50,20 @@ struct aac_common aac_config = {
4950
.irq_mod = 1
5051
};
5152

53+
static inline int aac_is_msix_mode(struct aac_dev *dev)
54+
{
55+
u32 status;
56+
57+
status = src_readl(dev, MUnit.OMR);
58+
return (status & AAC_INT_MODE_MSIX);
59+
}
60+
61+
static inline void aac_change_to_intx(struct aac_dev *dev)
62+
{
63+
aac_src_access_devreg(dev, AAC_DISABLE_MSIX);
64+
aac_src_access_devreg(dev, AAC_ENABLE_INTX);
65+
}
66+
5267
static int aac_alloc_comm(struct aac_dev *dev, void **commaddr, unsigned long commsize, unsigned long commalign)
5368
{
5469
unsigned char *base;
@@ -358,6 +373,15 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev)
358373
dev->comm_interface = AAC_COMM_PRODUCER;
359374
dev->raw_io_interface = dev->raw_io_64 = 0;
360375

376+
377+
/*
378+
* Enable INTX mode, if not done already Enabled
379+
*/
380+
if (aac_is_msix_mode(dev)) {
381+
aac_change_to_intx(dev);
382+
dev_info(&dev->pdev->dev, "Changed firmware to INTX mode");
383+
}
384+
361385
if ((!aac_adapter_sync_cmd(dev, GET_ADAPTER_PROPERTIES,
362386
0, 0, 0, 0, 0, 0,
363387
status+0, status+1, status+2, status+3, NULL)) &&

0 commit comments

Comments
 (0)