]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[SCSI] hpsa: only do device rescan for certain events
authorStephen M. Cameron <scameron@beardog.cce.hp.com>
Tue, 18 Feb 2014 19:57:42 +0000 (13:57 -0600)
committerJames Bottomley <JBottomley@Parallels.com>
Sat, 15 Mar 2014 17:19:09 +0000 (10:19 -0700)
Do no rescan on every events -- way too many rescans are
triggered if we don't filter the events.  Limit rescans
to be triggered by the following set of events:

 * controller state change
 * enclosure hot plug
 * physical drive state change
 * logical drive state change
 * redundant controller state change
 * accelerated io enabled/disabled
 * accelerated io configuration change

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/hpsa.c
drivers/scsi/hpsa.h

index cb8760f33ea21788100e79036d24a0f30a8f67b5..6e5dbbf58bee6a1c88018e9d2dfa44fd7ffc7778 100644 (file)
@@ -6419,7 +6419,7 @@ static void hpsa_ctlr_needs_rescan(struct ctlr_info *h)
                return;
 
        h->events = readl(&(h->cfgtable->event_notify));
-       if (!h->events && !h->drv_req_rescan)
+       if (!(h->events & RESCAN_REQUIRED_EVENT_BITS) && !h->drv_req_rescan)
                return;
 
        /*
index fe813e9aa50c64da85cc533b6aa8c8d06c450a46..fe8d281afdaee2402eb2304bb6ab221d10a95d96 100644 (file)
@@ -181,6 +181,22 @@ struct ctlr_info {
 #define HPSATMF_LOG_QRY_TSET    (1 << 24)
 #define HPSATMF_LOG_QRY_ASYNC   (1 << 25)
        u32 events;
+#define CTLR_STATE_CHANGE_EVENT                                (1 << 0)
+#define CTLR_ENCLOSURE_HOT_PLUG_EVENT                  (1 << 1)
+#define CTLR_STATE_CHANGE_EVENT_PHYSICAL_DRV           (1 << 4)
+#define CTLR_STATE_CHANGE_EVENT_LOGICAL_DRV            (1 << 5)
+#define CTLR_STATE_CHANGE_EVENT_REDUNDANT_CNTRL                (1 << 6)
+#define CTLR_STATE_CHANGE_EVENT_AIO_ENABLED_DISABLED   (1 << 30)
+#define CTLR_STATE_CHANGE_EVENT_AIO_CONFIG_CHANGE      (1 << 31)
+
+#define RESCAN_REQUIRED_EVENT_BITS \
+               (CTLR_STATE_CHANGE_EVENT | \
+               CTLR_ENCLOSURE_HOT_PLUG_EVENT | \
+               CTLR_STATE_CHANGE_EVENT_PHYSICAL_DRV | \
+               CTLR_STATE_CHANGE_EVENT_LOGICAL_DRV | \
+               CTLR_STATE_CHANGE_EVENT_REDUNDANT_CNTRL | \
+               CTLR_STATE_CHANGE_EVENT_AIO_ENABLED_DISABLED | \
+               CTLR_STATE_CHANGE_EVENT_AIO_CONFIG_CHANGE)
        int     acciopath_status;
        int     drv_req_rescan; /* flag for driver to request rescan event */
 };