]> www.infradead.org Git - users/jedix/linux-maple.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)
committerChuck Anderson <chuck.anderson@oracle.com>
Mon, 27 Feb 2017 06:21:05 +0000 (22:21 -0800)
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>
(cherry picked from commit 9cb62fa24e0d22dbe991c315d6c454a341ea3f76)

Orabug: 25505509
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
drivers/scsi/aacraid/aacraid.h
drivers/scsi/aacraid/commsup.c
drivers/scsi/aacraid/linit.c
drivers/scsi/aacraid/src.c

index 53a17e1d5c3d0031d33304e30fe9da2558907f13..86d218659ba85492dfd7fd9205f812eeb4827e27 100644 (file)
@@ -2064,6 +2064,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 123912137ee217d8ce1ba964d3f1ca3f44134da5..d80e374e638883eaae26ff3068a663a9462d3537 100644 (file)
@@ -870,6 +870,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
@@ -1123,6 +1148,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 f909aaedd791a943b18b30faf187efdf04637d1e..25104892aa783ced162a0995b0d0ce4f9cc5e2fc 100644 (file)
@@ -1297,6 +1297,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 2aa34ea8ceb1e903781331acd3283ba264eadd53..8c2fe86103d78962ef432a398418bddf572096f0 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;