]> git.karo-electronics.de Git - linux-beck.git/commitdiff
aacraid: Log firmware AIF messages
authorRaghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
Tue, 26 Apr 2016 06:32:09 +0000 (23:32 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 29 Apr 2016 23:08:24 +0000 (19:08 -0400)
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>
drivers/scsi/aacraid/aacraid.h
drivers/scsi/aacraid/commsup.c
drivers/scsi/aacraid/linit.c
drivers/scsi/aacraid/src.c

index 1936e0813f136fbbff25b66ac973b45e48490f0d..b70f3eb323f73d10dd1e54a5e0499bcd4ef4f1cd 100644 (file)
@@ -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 */
index bb7988d5321655ad55a8012570c610d036331b5c..0aeecec1f5eafa6390a020eb0174cb2582519524 100644 (file)
@@ -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;
                }
 
index 79a1cec1a51f8638f4313d4764a43374d6e666f5..a943bd230bc2fdb6cb5272c911c30fe0eea2e2b8 100644 (file)
@@ -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
index bc0203f3d243e8e8926e1975408017d9dd5f5012..28f8b8a1b8a4a1ee481531374afd92ed524d8e62 100644 (file)
@@ -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;