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/remote_device.c | |
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/remote_device.c')
-rw-r--r-- | drivers/scsi/isci/remote_device.c | 14 |
1 files changed, 5 insertions, 9 deletions
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 | ||