aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libsas/sas_discover.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2011-11-17 20:59:49 -0500
committerJames Bottomley <JBottomley@Parallels.com>2012-02-19 14:41:04 -0500
commitb15ebe0b5d0b95aeb1d84cae3649df1e0e065e9b (patch)
treeff93ad5f8be5fe91c7e6cf4963253491ddd058fb /drivers/scsi/libsas/sas_discover.c
parent756f173fb5fa90ec15222e80fb579288be7794fd (diff)
[SCSI] libsas: replace event locks with atomic bitops
The locks only served to make sure the pending event bitmask was updated consistently. Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/libsas/sas_discover.c')
-rw-r--r--drivers/scsi/libsas/sas_discover.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/scsi/libsas/sas_discover.c b/drivers/scsi/libsas/sas_discover.c
index dc52b1fa218e..ed041189e764 100644
--- a/drivers/scsi/libsas/sas_discover.c
+++ b/drivers/scsi/libsas/sas_discover.c
@@ -295,8 +295,7 @@ static void sas_discover_domain(struct work_struct *work)
295 container_of(work, struct sas_discovery_event, work); 295 container_of(work, struct sas_discovery_event, work);
296 struct asd_sas_port *port = ev->port; 296 struct asd_sas_port *port = ev->port;
297 297
298 sas_begin_event(DISCE_DISCOVER_DOMAIN, &port->disc.disc_event_lock, 298 clear_bit(DISCE_DISCOVER_DOMAIN, &port->disc.pending);
299 &port->disc.pending);
300 299
301 if (port->port_dev) 300 if (port->port_dev)
302 return; 301 return;
@@ -355,8 +354,7 @@ static void sas_revalidate_domain(struct work_struct *work)
355 container_of(work, struct sas_discovery_event, work); 354 container_of(work, struct sas_discovery_event, work);
356 struct asd_sas_port *port = ev->port; 355 struct asd_sas_port *port = ev->port;
357 356
358 sas_begin_event(DISCE_REVALIDATE_DOMAIN, &port->disc.disc_event_lock, 357 clear_bit(DISCE_REVALIDATE_DOMAIN, &port->disc.pending);
359 &port->disc.pending);
360 358
361 SAS_DPRINTK("REVALIDATING DOMAIN on port %d, pid:%d\n", port->id, 359 SAS_DPRINTK("REVALIDATING DOMAIN on port %d, pid:%d\n", port->id,
362 task_pid_nr(current)); 360 task_pid_nr(current));
@@ -379,8 +377,7 @@ int sas_discover_event(struct asd_sas_port *port, enum discover_event ev)
379 377
380 BUG_ON(ev >= DISC_NUM_EVENTS); 378 BUG_ON(ev >= DISC_NUM_EVENTS);
381 379
382 sas_queue_event(ev, &disc->disc_event_lock, &disc->pending, 380 sas_queue_event(ev, &disc->pending, &disc->disc_work[ev].work, port->ha);
383 &disc->disc_work[ev].work, port->ha);
384 381
385 return 0; 382 return 0;
386} 383}
@@ -400,7 +397,6 @@ void sas_init_disc(struct sas_discovery *disc, struct asd_sas_port *port)
400 [DISCE_REVALIDATE_DOMAIN] = sas_revalidate_domain, 397 [DISCE_REVALIDATE_DOMAIN] = sas_revalidate_domain,
401 }; 398 };
402 399
403 spin_lock_init(&disc->disc_event_lock);
404 disc->pending = 0; 400 disc->pending = 0;
405 for (i = 0; i < DISC_NUM_EVENTS; i++) { 401 for (i = 0; i < DISC_NUM_EVENTS; i++) {
406 INIT_WORK(&disc->disc_work[i].work, sas_event_fns[i]); 402 INIT_WORK(&disc->disc_work[i].work, sas_event_fns[i]);