]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
scsi: aacraid: Remove unused aac_check_health()
authorDr. David Alan Gilbert <linux@treblig.org>
Fri, 20 Sep 2024 20:23:04 +0000 (21:23 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 4 Oct 2024 02:00:08 +0000 (22:00 -0400)
aac_check_health() has been unused since commit

  9473ddb2b037 ("scsi: aacraid: Use correct function to get ctrl health")

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Link: https://lore.kernel.org/r/20240920202304.333108-1-linux@treblig.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/aacraid/aacraid.h
drivers/scsi/aacraid/commsup.c

index 1d09d3ac6aa45003c1fb825fc970457af0fb55a0..8c384c25dca179d82e91a7892195c4f2a430787b 100644 (file)
@@ -2736,7 +2736,6 @@ unsigned int aac_intr_normal(struct aac_dev *dev, u32 Index,
                        int isAif, int isFastResponse,
                        struct hw_fib *aif_fib);
 int aac_reset_adapter(struct aac_dev *dev, int forced, u8 reset_type);
-int aac_check_health(struct aac_dev * dev);
 int aac_command_thread(void *data);
 int aac_close_fib_context(struct aac_dev * dev, struct aac_fib_context *fibctx);
 int aac_fib_adapter_complete(struct fib * fibptr, unsigned short size);
index 47287559c768f379b9c685328dff7e963e81b995..ffef61c4aa0159f38f6069c610116372d8adf0f3 100644 (file)
@@ -1698,127 +1698,6 @@ int aac_reset_adapter(struct aac_dev *aac, int forced, u8 reset_type)
        return retval;
 }
 
-int aac_check_health(struct aac_dev * aac)
-{
-       int BlinkLED;
-       unsigned long time_now, flagv = 0;
-       struct list_head * entry;
-
-       /* Extending the scope of fib_lock slightly to protect aac->in_reset */
-       if (spin_trylock_irqsave(&aac->fib_lock, flagv) == 0)
-               return 0;
-
-       if (aac->in_reset || !(BlinkLED = aac_adapter_check_health(aac))) {
-               spin_unlock_irqrestore(&aac->fib_lock, flagv);
-               return 0; /* OK */
-       }
-
-       aac->in_reset = 1;
-
-       /* Fake up an AIF:
-        *      aac_aifcmd.command = AifCmdEventNotify = 1
-        *      aac_aifcmd.seqnum = 0xFFFFFFFF
-        *      aac_aifcmd.data[0] = AifEnExpEvent = 23
-        *      aac_aifcmd.data[1] = AifExeFirmwarePanic = 3
-        *      aac.aifcmd.data[2] = AifHighPriority = 3
-        *      aac.aifcmd.data[3] = BlinkLED
-        */
-
-       time_now = jiffies/HZ;
-       entry = aac->fib_list.next;
-
-       /*
-        * For each Context that is on the
-        * fibctxList, make a copy of the
-        * fib, and then set the event to wake up the
-        * thread that is waiting for it.
-        */
-       while (entry != &aac->fib_list) {
-               /*
-                * Extract the fibctx
-                */
-               struct aac_fib_context *fibctx = list_entry(entry, struct aac_fib_context, next);
-               struct hw_fib * hw_fib;
-               struct fib * fib;
-               /*
-                * Check if the queue is getting
-                * backlogged
-                */
-               if (fibctx->count > 20) {
-                       /*
-                        * It's *not* jiffies folks,
-                        * but jiffies / HZ, so do not
-                        * panic ...
-                        */
-                       u32 time_last = fibctx->jiffies;
-                       /*
-                        * Has it been > 2 minutes
-                        * since the last read off
-                        * the queue?
-                        */
-                       if ((time_now - time_last) > aif_timeout) {
-                               entry = entry->next;
-                               aac_close_fib_context(aac, fibctx);
-                               continue;
-                       }
-               }
-               /*
-                * Warning: no sleep allowed while
-                * holding spinlock
-                */
-               hw_fib = kzalloc(sizeof(struct hw_fib), GFP_ATOMIC);
-               fib = kzalloc(sizeof(struct fib), GFP_ATOMIC);
-               if (fib && hw_fib) {
-                       struct aac_aifcmd * aif;
-
-                       fib->hw_fib_va = hw_fib;
-                       fib->dev = aac;
-                       aac_fib_init(fib);
-                       fib->type = FSAFS_NTC_FIB_CONTEXT;
-                       fib->size = sizeof (struct fib);
-                       fib->data = hw_fib->data;
-                       aif = (struct aac_aifcmd *)hw_fib->data;
-                       aif->command = cpu_to_le32(AifCmdEventNotify);
-                       aif->seqnum = cpu_to_le32(0xFFFFFFFF);
-                       ((__le32 *)aif->data)[0] = cpu_to_le32(AifEnExpEvent);
-                       ((__le32 *)aif->data)[1] = cpu_to_le32(AifExeFirmwarePanic);
-                       ((__le32 *)aif->data)[2] = cpu_to_le32(AifHighPriority);
-                       ((__le32 *)aif->data)[3] = cpu_to_le32(BlinkLED);
-
-                       /*
-                        * Put the FIB onto the
-                        * fibctx's fibs
-                        */
-                       list_add_tail(&fib->fiblink, &fibctx->fib_list);
-                       fibctx->count++;
-                       /*
-                        * Set the event to wake up the
-                        * thread that will waiting.
-                        */
-                       complete(&fibctx->completion);
-               } else {
-                       printk(KERN_WARNING "aifd: didn't allocate NewFib.\n");
-                       kfree(fib);
-                       kfree(hw_fib);
-               }
-               entry = entry->next;
-       }
-
-       spin_unlock_irqrestore(&aac->fib_lock, flagv);
-
-       if (BlinkLED < 0) {
-               printk(KERN_ERR "%s: Host adapter is dead (or got a PCI error) %d\n",
-                               aac->name, BlinkLED);
-               goto out;
-       }
-
-       printk(KERN_ERR "%s: Host adapter BLINK LED 0x%x\n", aac->name, BlinkLED);
-
-out:
-       aac->in_reset = 0;
-       return BlinkLED;
-}
-
 static inline int is_safw_raid_volume(struct aac_dev *aac, int bus, int target)
 {
        return bus == CONTAINER_CHANNEL && target < aac->maximum_num_containers;