Skip to content

Commit

Permalink
scsi: libsas: use flush_workqueue to process disco events synchronously
Browse files Browse the repository at this point in the history
Now we are processing sas event and discover event in different
workqueues.  It's safe to wait the discover event done in the sas event
work. Use flush_workqueue() to insure the disco and revalidate events
processed synchronously so that the whole discover and revalidate
process will not be interrupted by other events.

Signed-off-by: Jason Yan <[email protected]>
CC: John Garry <[email protected]>
CC: Johannes Thumshirn <[email protected]>
CC: Ewan Milne <[email protected]>
CC: Christoph Hellwig <[email protected]>
CC: Tomas Henzl <[email protected]>
CC: Dan Williams <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
  • Loading branch information
JasonYanHw authored and martinkpetersen committed Jan 9, 2018
1 parent 93bdbd0 commit 517e515
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/scsi/libsas/sas_port.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ static void sas_form_port(struct asd_sas_phy *phy)
si->dft->lldd_port_formed(phy);

sas_discover_event(phy->port, DISCE_DISCOVER_DOMAIN);
flush_workqueue(sas_ha->disco_q);
}

/**
Expand Down Expand Up @@ -277,6 +278,9 @@ void sas_porte_broadcast_rcvd(struct work_struct *work)

SAS_DPRINTK("broadcast received: %d\n", prim);
sas_discover_event(phy->port, DISCE_REVALIDATE_DOMAIN);

if (phy->port)
flush_workqueue(phy->port->ha->disco_q);
}

void sas_porte_link_reset_err(struct work_struct *work)
Expand Down

0 comments on commit 517e515

Please sign in to comment.