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 <RaghavaAditya.Renukunta@microsemi.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
Raghava Aditya Renukunta 2016-04-25 23:32:09 -07:00 коммит произвёл Martin K. Petersen
Родитель fc4bf75ea3
Коммит 9cb62fa24e
4 изменённых файлов: 35 добавлений и 1 удалений

Просмотреть файл

@ -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 */

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -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

Просмотреть файл

@ -135,6 +135,7 @@ static irqreturn_t aac_src_intr_message(int irq, void *dev_id)
if (mode & AAC_INT_MODE_AIF) {
/* handle AIF */
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);