Skip to content

Commit 78cbccd

Browse files
Raghava Aditya Renukuntamartinkpetersen
authored andcommitted
aacraid: Fix for KDUMP driver hang
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]>
1 parent eef76f1 commit 78cbccd

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>
@@ -47,6 +48,20 @@ struct aac_common aac_config = {
4748
.irq_mod = 1
4849
};
4950

51+
static inline int aac_is_msix_mode(struct aac_dev *dev)
52+
{
53+
u32 status;
54+
55+
status = src_readl(dev, MUnit.OMR);
56+
return (status & AAC_INT_MODE_MSIX);
57+
}
58+
59+
static inline void aac_change_to_intx(struct aac_dev *dev)
60+
{
61+
aac_src_access_devreg(dev, AAC_DISABLE_MSIX);
62+
aac_src_access_devreg(dev, AAC_ENABLE_INTX);
63+
}
64+
5065
static int aac_alloc_comm(struct aac_dev *dev, void **commaddr, unsigned long commsize, unsigned long commalign)
5166
{
5267
unsigned char *base;
@@ -414,6 +429,15 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev)
414429
dev->comm_interface = AAC_COMM_PRODUCER;
415430
dev->raw_io_interface = dev->raw_io_64 = 0;
416431

432+
433+
/*
434+
* Enable INTX mode, if not done already Enabled
435+
*/
436+
if (aac_is_msix_mode(dev)) {
437+
aac_change_to_intx(dev);
438+
dev_info(&dev->pdev->dev, "Changed firmware to INTX mode");
439+
}
440+
417441
if ((!aac_adapter_sync_cmd(dev, GET_ADAPTER_PROPERTIES,
418442
0, 0, 0, 0, 0, 0,
419443
status+0, status+1, status+2, status+3, NULL)) &&

0 commit comments

Comments
 (0)