Skip to content

Commit

Permalink
aacraid: Log firmware AIF messages
Browse files Browse the repository at this point in the history
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 <RaghavaAditya.Renukunta@microsemi.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
Raghava Aditya Renukunta authored and Martin K. Petersen committed Apr 29, 2016
1 parent fc4bf75 commit 9cb62fa
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 1 deletion.
4 changes: 4 additions & 0 deletions drivers/scsi/aacraid/aacraid.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
27 changes: 27 additions & 0 deletions drivers/scsi/aacraid/commsup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}

Expand Down
2 changes: 2 additions & 0 deletions drivers/scsi/aacraid/linit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion drivers/scsi/aacraid/src.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9cb62fa

Please sign in to comment.