]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/scsi/libsas/sas_port.c
scsi: libsas: Use dynamic alloced work to avoid sas event lost
[mirror_ubuntu-bionic-kernel.git] / drivers / scsi / libsas / sas_port.c
index d3c5297c6c89e242d845d16142f7a309ed4ef773..93266283f51ff0c606b4e5d7210aa0f5d63d48ab 100644 (file)
@@ -261,8 +261,6 @@ void sas_porte_bytes_dmaed(struct work_struct *work)
        struct asd_sas_event *ev = to_asd_sas_event(work);
        struct asd_sas_phy *phy = ev->phy;
 
-       clear_bit(PORTE_BYTES_DMAED, &phy->port_events_pending);
-
        sas_form_port(phy);
 }
 
@@ -273,8 +271,6 @@ void sas_porte_broadcast_rcvd(struct work_struct *work)
        unsigned long flags;
        u32 prim;
 
-       clear_bit(PORTE_BROADCAST_RCVD, &phy->port_events_pending);
-
        spin_lock_irqsave(&phy->sas_prim_lock, flags);
        prim = phy->sas_prim;
        spin_unlock_irqrestore(&phy->sas_prim_lock, flags);
@@ -288,8 +284,6 @@ void sas_porte_link_reset_err(struct work_struct *work)
        struct asd_sas_event *ev = to_asd_sas_event(work);
        struct asd_sas_phy *phy = ev->phy;
 
-       clear_bit(PORTE_LINK_RESET_ERR, &phy->port_events_pending);
-
        sas_deform_port(phy, 1);
 }
 
@@ -298,8 +292,6 @@ void sas_porte_timer_event(struct work_struct *work)
        struct asd_sas_event *ev = to_asd_sas_event(work);
        struct asd_sas_phy *phy = ev->phy;
 
-       clear_bit(PORTE_TIMER_EVENT, &phy->port_events_pending);
-
        sas_deform_port(phy, 1);
 }
 
@@ -308,8 +300,6 @@ void sas_porte_hard_reset(struct work_struct *work)
        struct asd_sas_event *ev = to_asd_sas_event(work);
        struct asd_sas_phy *phy = ev->phy;
 
-       clear_bit(PORTE_HARD_RESET, &phy->port_events_pending);
-
        sas_deform_port(phy, 1);
 }
 
@@ -353,3 +343,11 @@ void sas_unregister_ports(struct sas_ha_struct *sas_ha)
                        sas_deform_port(sas_ha->sas_phy[i], 0);
 
 }
+
+const work_func_t sas_port_event_fns[PORT_NUM_EVENTS] = {
+       [PORTE_BYTES_DMAED] = sas_porte_bytes_dmaed,
+       [PORTE_BROADCAST_RCVD] = sas_porte_broadcast_rcvd,
+       [PORTE_LINK_RESET_ERR] = sas_porte_link_reset_err,
+       [PORTE_TIMER_EVENT] = sas_porte_timer_event,
+       [PORTE_HARD_RESET] = sas_porte_hard_reset,
+};