diff options
author | Dan Williams <dan.j.williams@intel.com> | 2011-03-03 21:01:43 -0500 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2011-07-03 06:55:29 -0400 |
commit | 1a38045ba88ed3bee6c57444670fb639c8b61be7 (patch) | |
tree | 9a1fc0caf72e2cd8f236e1675e2918fc6498b5c9 /drivers/scsi/isci | |
parent | d9c37390c4f02153188a64a7a89fa6798dc3ffc2 (diff) |
isci: replace remote_device_lock with scic_lock
The remote_device_lock is currently used to protect a controller global
resource (RNCs), but the remote_device_lock is per-port.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/scsi/isci')
-rw-r--r-- | drivers/scsi/isci/port.c | 1 | ||||
-rw-r--r-- | drivers/scsi/isci/port.h | 1 | ||||
-rw-r--r-- | drivers/scsi/isci/remote_device.c | 14 |
3 files changed, 5 insertions, 11 deletions
diff --git a/drivers/scsi/isci/port.c b/drivers/scsi/isci/port.c index 30da3ec703e3..a5b2565ac5af 100644 --- a/drivers/scsi/isci/port.c +++ b/drivers/scsi/isci/port.c | |||
@@ -94,7 +94,6 @@ void isci_port_init( | |||
94 | 94 | ||
95 | INIT_LIST_HEAD(&isci_port->remote_dev_list); | 95 | INIT_LIST_HEAD(&isci_port->remote_dev_list); |
96 | INIT_LIST_HEAD(&isci_port->domain_dev_list); | 96 | INIT_LIST_HEAD(&isci_port->domain_dev_list); |
97 | spin_lock_init(&isci_port->remote_device_lock); | ||
98 | spin_lock_init(&isci_port->state_lock); | 97 | spin_lock_init(&isci_port->state_lock); |
99 | init_completion(&isci_port->start_complete); | 98 | init_completion(&isci_port->start_complete); |
100 | isci_port->isci_host = isci_host; | 99 | isci_port->isci_host = isci_host; |
diff --git a/drivers/scsi/isci/port.h b/drivers/scsi/isci/port.h index b864d70363e7..b7a7dd7dca69 100644 --- a/drivers/scsi/isci/port.h +++ b/drivers/scsi/isci/port.h | |||
@@ -90,7 +90,6 @@ struct isci_port { | |||
90 | struct isci_host *isci_host; | 90 | struct isci_host *isci_host; |
91 | struct asd_sas_port sas_port; | 91 | struct asd_sas_port sas_port; |
92 | struct list_head remote_dev_list; | 92 | struct list_head remote_dev_list; |
93 | spinlock_t remote_device_lock; | ||
94 | spinlock_t state_lock; | 93 | spinlock_t state_lock; |
95 | struct list_head domain_dev_list; | 94 | struct list_head domain_dev_list; |
96 | struct completion start_complete; | 95 | struct completion start_complete; |
diff --git a/drivers/scsi/isci/remote_device.c b/drivers/scsi/isci/remote_device.c index 48556e47bb9d..1dae2184b9e9 100644 --- a/drivers/scsi/isci/remote_device.c +++ b/drivers/scsi/isci/remote_device.c | |||
@@ -287,16 +287,13 @@ isci_remote_device_alloc(struct isci_host *ihost, struct isci_port *iport) | |||
287 | void isci_remote_device_ready(struct isci_remote_device *idev) | 287 | void isci_remote_device_ready(struct isci_remote_device *idev) |
288 | { | 288 | { |
289 | struct isci_host *ihost = idev->isci_port->isci_host; | 289 | struct isci_host *ihost = idev->isci_port->isci_host; |
290 | unsigned long flags; | ||
291 | 290 | ||
292 | dev_dbg(&ihost->pdev->dev, | 291 | dev_dbg(&ihost->pdev->dev, |
293 | "%s: isci_device = %p\n", __func__, idev); | 292 | "%s: idev = %p\n", __func__, idev); |
294 | 293 | ||
295 | spin_lock_irqsave(&idev->isci_port->remote_device_lock, flags); | ||
296 | isci_remote_device_change_state(idev, isci_ready_for_io); | 294 | isci_remote_device_change_state(idev, isci_ready_for_io); |
297 | if (test_and_clear_bit(IDEV_START_PENDING, &idev->flags)) | 295 | if (test_and_clear_bit(IDEV_START_PENDING, &idev->flags)) |
298 | wake_up(&ihost->eventq); | 296 | wake_up(&ihost->eventq); |
299 | spin_unlock_irqrestore(&idev->isci_port->remote_device_lock, flags); | ||
300 | } | 297 | } |
301 | 298 | ||
302 | /** | 299 | /** |
@@ -432,7 +429,6 @@ void isci_remote_device_gone(struct domain_device *dev) | |||
432 | */ | 429 | */ |
433 | int isci_remote_device_found(struct domain_device *domain_dev) | 430 | int isci_remote_device_found(struct domain_device *domain_dev) |
434 | { | 431 | { |
435 | unsigned long flags; | ||
436 | struct isci_host *isci_host; | 432 | struct isci_host *isci_host; |
437 | struct isci_port *isci_port; | 433 | struct isci_port *isci_port; |
438 | struct isci_phy *isci_phy; | 434 | struct isci_phy *isci_phy; |
@@ -474,12 +470,12 @@ int isci_remote_device_found(struct domain_device *domain_dev) | |||
474 | isci_remote_device_change_state(isci_device, isci_starting); | 470 | isci_remote_device_change_state(isci_device, isci_starting); |
475 | 471 | ||
476 | 472 | ||
477 | spin_lock_irqsave(&isci_port->remote_device_lock, flags); | 473 | spin_lock_irq(&isci_host->scic_lock); |
478 | list_add_tail(&isci_device->node, &isci_port->remote_dev_list); | 474 | list_add_tail(&isci_device->node, &isci_port->remote_dev_list); |
479 | 475 | ||
480 | set_bit(IDEV_START_PENDING, &isci_device->flags); | 476 | set_bit(IDEV_START_PENDING, &isci_device->flags); |
481 | status = isci_remote_device_construct(isci_port, isci_device); | 477 | status = isci_remote_device_construct(isci_port, isci_device); |
482 | spin_unlock_irqrestore(&isci_port->remote_device_lock, flags); | 478 | spin_unlock_irq(&isci_host->scic_lock); |
483 | 479 | ||
484 | dev_dbg(&isci_host->pdev->dev, | 480 | dev_dbg(&isci_host->pdev->dev, |
485 | "%s: isci_device = %p\n", | 481 | "%s: isci_device = %p\n", |
@@ -487,12 +483,12 @@ int isci_remote_device_found(struct domain_device *domain_dev) | |||
487 | 483 | ||
488 | if (status != SCI_SUCCESS) { | 484 | if (status != SCI_SUCCESS) { |
489 | 485 | ||
490 | spin_lock_irqsave(&isci_port->remote_device_lock, flags); | 486 | spin_lock_irq(&isci_host->scic_lock); |
491 | isci_remote_device_deconstruct( | 487 | isci_remote_device_deconstruct( |
492 | isci_host, | 488 | isci_host, |
493 | isci_device | 489 | isci_device |
494 | ); | 490 | ); |
495 | spin_unlock_irqrestore(&isci_port->remote_device_lock, flags); | 491 | spin_unlock_irq(&isci_host->scic_lock); |
496 | return -ENODEV; | 492 | return -ENODEV; |
497 | } | 493 | } |
498 | 494 | ||