Skip to content

Commit 9cb62fa

Browse files
Raghava Aditya Renukuntamartinkpetersen
authored andcommitted
aacraid: Log firmware AIF messages
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]> Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent fc4bf75 commit 9cb62fa

File tree

4 files changed

+35
-1
lines changed

4 files changed

+35
-1
lines changed

drivers/scsi/aacraid/aacraid.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2065,6 +2065,10 @@ extern struct aac_common aac_config;
20652065
#define AifEnAddJBOD 30 /* JBOD created */
20662066
#define AifEnDeleteJBOD 31 /* JBOD deleted */
20672067

2068+
#define AifBuManagerEvent 42 /* Bu management*/
2069+
#define AifBuCacheDataLoss 10
2070+
#define AifBuCacheDataRecover 11
2071+
20682072
#define AifCmdJobProgress 2 /* Progress report */
20692073
#define AifJobCtrZero 101 /* Array Zero progress */
20702074
#define AifJobStsSuccess 1 /* Job completes */

drivers/scsi/aacraid/commsup.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -901,6 +901,31 @@ void aac_printf(struct aac_dev *dev, u32 val)
901901
memset(cp, 0, 256);
902902
}
903903

904+
static inline int aac_aif_data(struct aac_aifcmd *aifcmd, uint32_t index)
905+
{
906+
return le32_to_cpu(((__le32 *)aifcmd->data)[index]);
907+
}
908+
909+
910+
static void aac_handle_aif_bu(struct aac_dev *dev, struct aac_aifcmd *aifcmd)
911+
{
912+
switch (aac_aif_data(aifcmd, 1)) {
913+
case AifBuCacheDataLoss:
914+
if (aac_aif_data(aifcmd, 2))
915+
dev_info(&dev->pdev->dev, "Backup unit had cache data loss - [%d]\n",
916+
aac_aif_data(aifcmd, 2));
917+
else
918+
dev_info(&dev->pdev->dev, "Backup Unit had cache data loss\n");
919+
break;
920+
case AifBuCacheDataRecover:
921+
if (aac_aif_data(aifcmd, 2))
922+
dev_info(&dev->pdev->dev, "DDR cache data recovered successfully - [%d]\n",
923+
aac_aif_data(aifcmd, 2));
924+
else
925+
dev_info(&dev->pdev->dev, "DDR cache data recovered successfully\n");
926+
break;
927+
}
928+
}
904929

905930
/**
906931
* 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)
11541179
ADD : DELETE;
11551180
break;
11561181
}
1182+
case AifBuManagerEvent:
1183+
aac_handle_aif_bu(dev, aifcmd);
11571184
break;
11581185
}
11591186

drivers/scsi/aacraid/linit.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,6 +1299,8 @@ static int aac_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
12991299
else
13001300
shost->this_id = shost->max_id;
13011301

1302+
aac_intr_normal(aac, 0, 2, 0, NULL);
1303+
13021304
/*
13031305
* dmb - we may need to move the setting of these parms somewhere else once
13041306
* we get a fib that can report the actual numbers

drivers/scsi/aacraid/src.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ static irqreturn_t aac_src_intr_message(int irq, void *dev_id)
135135

136136
if (mode & AAC_INT_MODE_AIF) {
137137
/* handle AIF */
138-
aac_intr_normal(dev, 0, 2, 0, NULL);
138+
if (dev->aif_thread && dev->fsa_dev)
139+
aac_intr_normal(dev, 0, 2, 0, NULL);
139140
if (dev->msi_enabled)
140141
aac_src_access_devreg(dev, AAC_CLEAR_AIF_BIT);
141142
mode = 0;

0 commit comments

Comments
 (0)