aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libsas/sas_discover.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/libsas/sas_discover.c')
-rw-r--r--drivers/scsi/libsas/sas_discover.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/scsi/libsas/sas_discover.c b/drivers/scsi/libsas/sas_discover.c
index 364679675602..c7ac88288bf1 100644
--- a/drivers/scsi/libsas/sas_discover.c
+++ b/drivers/scsi/libsas/sas_discover.c
@@ -205,8 +205,7 @@ void sas_notify_lldd_dev_gone(struct domain_device *dev)
205static void sas_probe_devices(struct work_struct *work) 205static void sas_probe_devices(struct work_struct *work)
206{ 206{
207 struct domain_device *dev, *n; 207 struct domain_device *dev, *n;
208 struct sas_discovery_event *ev = 208 struct sas_discovery_event *ev = to_sas_discovery_event(work);
209 container_of(work, struct sas_discovery_event, work);
210 struct asd_sas_port *port = ev->port; 209 struct asd_sas_port *port = ev->port;
211 210
212 clear_bit(DISCE_PROBE, &port->disc.pending); 211 clear_bit(DISCE_PROBE, &port->disc.pending);
@@ -291,8 +290,7 @@ static void sas_unregister_common_dev(struct asd_sas_port *port, struct domain_d
291static void sas_destruct_devices(struct work_struct *work) 290static void sas_destruct_devices(struct work_struct *work)
292{ 291{
293 struct domain_device *dev, *n; 292 struct domain_device *dev, *n;
294 struct sas_discovery_event *ev = 293 struct sas_discovery_event *ev = to_sas_discovery_event(work);
295 container_of(work, struct sas_discovery_event, work);
296 struct asd_sas_port *port = ev->port; 294 struct asd_sas_port *port = ev->port;
297 295
298 clear_bit(DISCE_DESTRUCT, &port->disc.pending); 296 clear_bit(DISCE_DESTRUCT, &port->disc.pending);
@@ -377,8 +375,7 @@ static void sas_discover_domain(struct work_struct *work)
377{ 375{
378 struct domain_device *dev; 376 struct domain_device *dev;
379 int error = 0; 377 int error = 0;
380 struct sas_discovery_event *ev = 378 struct sas_discovery_event *ev = to_sas_discovery_event(work);
381 container_of(work, struct sas_discovery_event, work);
382 struct asd_sas_port *port = ev->port; 379 struct asd_sas_port *port = ev->port;
383 380
384 clear_bit(DISCE_DISCOVER_DOMAIN, &port->disc.pending); 381 clear_bit(DISCE_DISCOVER_DOMAIN, &port->disc.pending);
@@ -437,8 +434,7 @@ static void sas_discover_domain(struct work_struct *work)
437static void sas_revalidate_domain(struct work_struct *work) 434static void sas_revalidate_domain(struct work_struct *work)
438{ 435{
439 int res = 0; 436 int res = 0;
440 struct sas_discovery_event *ev = 437 struct sas_discovery_event *ev = to_sas_discovery_event(work);
441 container_of(work, struct sas_discovery_event, work);
442 struct asd_sas_port *port = ev->port; 438 struct asd_sas_port *port = ev->port;
443 struct sas_ha_struct *ha = port->ha; 439 struct sas_ha_struct *ha = port->ha;
444 440
@@ -466,21 +462,25 @@ static void sas_revalidate_domain(struct work_struct *work)
466 462
467/* ---------- Events ---------- */ 463/* ---------- Events ---------- */
468 464
469static void sas_chain_work(struct sas_ha_struct *ha, struct work_struct *work) 465static void sas_chain_work(struct sas_ha_struct *ha, struct sas_work *sw)
470{ 466{
471 /* chained work is not subject to SA_HA_DRAINING or SAS_HA_REGISTERED */ 467 /* chained work is not subject to SA_HA_DRAINING or
472 scsi_queue_work(ha->core.shost, work); 468 * SAS_HA_REGISTERED, because it is either submitted in the
469 * workqueue, or known to be submitted from a context that is
470 * not racing against draining
471 */
472 scsi_queue_work(ha->core.shost, &sw->work);
473} 473}
474 474
475static void sas_chain_event(int event, unsigned long *pending, 475static void sas_chain_event(int event, unsigned long *pending,
476 struct work_struct *work, 476 struct sas_work *sw,
477 struct sas_ha_struct *ha) 477 struct sas_ha_struct *ha)
478{ 478{
479 if (!test_and_set_bit(event, pending)) { 479 if (!test_and_set_bit(event, pending)) {
480 unsigned long flags; 480 unsigned long flags;
481 481
482 spin_lock_irqsave(&ha->state_lock, flags); 482 spin_lock_irqsave(&ha->state_lock, flags);
483 sas_chain_work(ha, work); 483 sas_chain_work(ha, sw);
484 spin_unlock_irqrestore(&ha->state_lock, flags); 484 spin_unlock_irqrestore(&ha->state_lock, flags);
485 } 485 }
486} 486}
@@ -519,7 +519,7 @@ void sas_init_disc(struct sas_discovery *disc, struct asd_sas_port *port)
519 519
520 disc->pending = 0; 520 disc->pending = 0;
521 for (i = 0; i < DISC_NUM_EVENTS; i++) { 521 for (i = 0; i < DISC_NUM_EVENTS; i++) {
522 INIT_WORK(&disc->disc_work[i].work, sas_event_fns[i]); 522 INIT_SAS_WORK(&disc->disc_work[i].work, sas_event_fns[i]);
523 disc->disc_work[i].port = port; 523 disc->disc_work[i].port = port;
524 } 524 }
525} 525}