diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-02 22:01:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-02 22:01:32 -0400 |
commit | 3151367f8778a1789d6f6e6f6c642681b6cd6d64 (patch) | |
tree | 1869d5429a25abd994ae94079808b8db060ec6f3 /drivers/ata | |
parent | 16642a2e7be23bbda013fc32d8f6c68982eab603 (diff) | |
parent | fe709ed827d370e6b0c0a9f9456da1c22bdcd118 (diff) |
Merge tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull first round of SCSI updates from James Bottomley:
"This is a large set of updates, mostly for drivers (qla2xxx [including
support for new 83xx based card], qla4xxx, mpt2sas, bfa, zfcp, hpsa,
be2iscsi, isci, lpfc, ipr, ibmvfc, ibmvscsi, megaraid_sas).
There's also a rework for tape adding virtually unlimited numbers of
tape drives plus a set of dif fixes for sd and a fix for a live lock
on hot remove of SCSI devices.
This round includes a signed tag pull of isci-for-3.6
Signed-off-by: James Bottomley <JBottomley@Parallels.com>"
Fix up trivial conflict in drivers/scsi/qla2xxx/qla_nx.c due to new PCI
helper function use in a function that was removed by this pull.
* tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (198 commits)
[SCSI] st: remove st_mutex
[SCSI] sd: Ensure we correctly disable devices with unknown protection type
[SCSI] hpsa: gen8plus Smart Array IDs
[SCSI] qla4xxx: Update driver version to 5.03.00-k1
[SCSI] qla4xxx: Disable generating pause frames for ISP83XX
[SCSI] qla4xxx: Fix double clearing of risc_intr for ISP83XX
[SCSI] qla4xxx: IDC implementation for Loopback
[SCSI] qla4xxx: update copyrights in LICENSE.qla4xxx
[SCSI] qla4xxx: Fix panic while rmmod
[SCSI] qla4xxx: Fail probe_adapter if IRQ allocation fails
[SCSI] qla4xxx: Prevent MSI/MSI-X falling back to INTx for ISP82XX
[SCSI] qla4xxx: Update idc reg in case of PCI AER
[SCSI] qla4xxx: Fix double IDC locking in qla4_8xxx_error_recovery
[SCSI] qla4xxx: Clear interrupt while unloading driver for ISP83XX
[SCSI] qla4xxx: Print correct IDC version
[SCSI] qla4xxx: Added new mbox cmd to pass driver version to FW
[SCSI] scsi_dh_alua: Enable STPG for unavailable ports
[SCSI] scsi_remove_target: fix softlockup regression on hot remove
[SCSI] ibmvscsi: Fix host config length field overflow
[SCSI] ibmvscsi: Remove backend abstraction
...
Diffstat (limited to 'drivers/ata')
-rw-r--r-- | drivers/ata/libata-core.c | 69 | ||||
-rw-r--r-- | drivers/ata/libata-eh.c | 2 |
2 files changed, 51 insertions, 20 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 3492aa73d3a6..3cc7096cfda7 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -5273,16 +5273,20 @@ bool ata_link_offline(struct ata_link *link) | |||
5273 | #ifdef CONFIG_PM | 5273 | #ifdef CONFIG_PM |
5274 | static int ata_port_request_pm(struct ata_port *ap, pm_message_t mesg, | 5274 | static int ata_port_request_pm(struct ata_port *ap, pm_message_t mesg, |
5275 | unsigned int action, unsigned int ehi_flags, | 5275 | unsigned int action, unsigned int ehi_flags, |
5276 | int wait) | 5276 | int *async) |
5277 | { | 5277 | { |
5278 | struct ata_link *link; | 5278 | struct ata_link *link; |
5279 | unsigned long flags; | 5279 | unsigned long flags; |
5280 | int rc; | 5280 | int rc = 0; |
5281 | 5281 | ||
5282 | /* Previous resume operation might still be in | 5282 | /* Previous resume operation might still be in |
5283 | * progress. Wait for PM_PENDING to clear. | 5283 | * progress. Wait for PM_PENDING to clear. |
5284 | */ | 5284 | */ |
5285 | if (ap->pflags & ATA_PFLAG_PM_PENDING) { | 5285 | if (ap->pflags & ATA_PFLAG_PM_PENDING) { |
5286 | if (async) { | ||
5287 | *async = -EAGAIN; | ||
5288 | return 0; | ||
5289 | } | ||
5286 | ata_port_wait_eh(ap); | 5290 | ata_port_wait_eh(ap); |
5287 | WARN_ON(ap->pflags & ATA_PFLAG_PM_PENDING); | 5291 | WARN_ON(ap->pflags & ATA_PFLAG_PM_PENDING); |
5288 | } | 5292 | } |
@@ -5291,10 +5295,10 @@ static int ata_port_request_pm(struct ata_port *ap, pm_message_t mesg, | |||
5291 | spin_lock_irqsave(ap->lock, flags); | 5295 | spin_lock_irqsave(ap->lock, flags); |
5292 | 5296 | ||
5293 | ap->pm_mesg = mesg; | 5297 | ap->pm_mesg = mesg; |
5294 | if (wait) { | 5298 | if (async) |
5295 | rc = 0; | 5299 | ap->pm_result = async; |
5300 | else | ||
5296 | ap->pm_result = &rc; | 5301 | ap->pm_result = &rc; |
5297 | } | ||
5298 | 5302 | ||
5299 | ap->pflags |= ATA_PFLAG_PM_PENDING; | 5303 | ap->pflags |= ATA_PFLAG_PM_PENDING; |
5300 | ata_for_each_link(link, ap, HOST_FIRST) { | 5304 | ata_for_each_link(link, ap, HOST_FIRST) { |
@@ -5307,7 +5311,7 @@ static int ata_port_request_pm(struct ata_port *ap, pm_message_t mesg, | |||
5307 | spin_unlock_irqrestore(ap->lock, flags); | 5311 | spin_unlock_irqrestore(ap->lock, flags); |
5308 | 5312 | ||
5309 | /* wait and check result */ | 5313 | /* wait and check result */ |
5310 | if (wait) { | 5314 | if (!async) { |
5311 | ata_port_wait_eh(ap); | 5315 | ata_port_wait_eh(ap); |
5312 | WARN_ON(ap->pflags & ATA_PFLAG_PM_PENDING); | 5316 | WARN_ON(ap->pflags & ATA_PFLAG_PM_PENDING); |
5313 | } | 5317 | } |
@@ -5315,9 +5319,8 @@ static int ata_port_request_pm(struct ata_port *ap, pm_message_t mesg, | |||
5315 | return rc; | 5319 | return rc; |
5316 | } | 5320 | } |
5317 | 5321 | ||
5318 | static int ata_port_suspend_common(struct device *dev, pm_message_t mesg) | 5322 | static int __ata_port_suspend_common(struct ata_port *ap, pm_message_t mesg, int *async) |
5319 | { | 5323 | { |
5320 | struct ata_port *ap = to_ata_port(dev); | ||
5321 | unsigned int ehi_flags = ATA_EHI_QUIET; | 5324 | unsigned int ehi_flags = ATA_EHI_QUIET; |
5322 | int rc; | 5325 | int rc; |
5323 | 5326 | ||
@@ -5332,10 +5335,17 @@ static int ata_port_suspend_common(struct device *dev, pm_message_t mesg) | |||
5332 | if (mesg.event == PM_EVENT_SUSPEND) | 5335 | if (mesg.event == PM_EVENT_SUSPEND) |
5333 | ehi_flags |= ATA_EHI_NO_AUTOPSY | ATA_EHI_NO_RECOVERY; | 5336 | ehi_flags |= ATA_EHI_NO_AUTOPSY | ATA_EHI_NO_RECOVERY; |
5334 | 5337 | ||
5335 | rc = ata_port_request_pm(ap, mesg, 0, ehi_flags, 1); | 5338 | rc = ata_port_request_pm(ap, mesg, 0, ehi_flags, async); |
5336 | return rc; | 5339 | return rc; |
5337 | } | 5340 | } |
5338 | 5341 | ||
5342 | static int ata_port_suspend_common(struct device *dev, pm_message_t mesg) | ||
5343 | { | ||
5344 | struct ata_port *ap = to_ata_port(dev); | ||
5345 | |||
5346 | return __ata_port_suspend_common(ap, mesg, NULL); | ||
5347 | } | ||
5348 | |||
5339 | static int ata_port_suspend(struct device *dev) | 5349 | static int ata_port_suspend(struct device *dev) |
5340 | { | 5350 | { |
5341 | if (pm_runtime_suspended(dev)) | 5351 | if (pm_runtime_suspended(dev)) |
@@ -5360,16 +5370,22 @@ static int ata_port_poweroff(struct device *dev) | |||
5360 | return ata_port_suspend_common(dev, PMSG_HIBERNATE); | 5370 | return ata_port_suspend_common(dev, PMSG_HIBERNATE); |
5361 | } | 5371 | } |
5362 | 5372 | ||
5363 | static int ata_port_resume_common(struct device *dev) | 5373 | static int __ata_port_resume_common(struct ata_port *ap, int *async) |
5364 | { | 5374 | { |
5365 | struct ata_port *ap = to_ata_port(dev); | ||
5366 | int rc; | 5375 | int rc; |
5367 | 5376 | ||
5368 | rc = ata_port_request_pm(ap, PMSG_ON, ATA_EH_RESET, | 5377 | rc = ata_port_request_pm(ap, PMSG_ON, ATA_EH_RESET, |
5369 | ATA_EHI_NO_AUTOPSY | ATA_EHI_QUIET, 1); | 5378 | ATA_EHI_NO_AUTOPSY | ATA_EHI_QUIET, async); |
5370 | return rc; | 5379 | return rc; |
5371 | } | 5380 | } |
5372 | 5381 | ||
5382 | static int ata_port_resume_common(struct device *dev) | ||
5383 | { | ||
5384 | struct ata_port *ap = to_ata_port(dev); | ||
5385 | |||
5386 | return __ata_port_resume_common(ap, NULL); | ||
5387 | } | ||
5388 | |||
5373 | static int ata_port_resume(struct device *dev) | 5389 | static int ata_port_resume(struct device *dev) |
5374 | { | 5390 | { |
5375 | int rc; | 5391 | int rc; |
@@ -5402,6 +5418,24 @@ static const struct dev_pm_ops ata_port_pm_ops = { | |||
5402 | .runtime_idle = ata_port_runtime_idle, | 5418 | .runtime_idle = ata_port_runtime_idle, |
5403 | }; | 5419 | }; |
5404 | 5420 | ||
5421 | /* sas ports don't participate in pm runtime management of ata_ports, | ||
5422 | * and need to resume ata devices at the domain level, not the per-port | ||
5423 | * level. sas suspend/resume is async to allow parallel port recovery | ||
5424 | * since sas has multiple ata_port instances per Scsi_Host. | ||
5425 | */ | ||
5426 | int ata_sas_port_async_suspend(struct ata_port *ap, int *async) | ||
5427 | { | ||
5428 | return __ata_port_suspend_common(ap, PMSG_SUSPEND, async); | ||
5429 | } | ||
5430 | EXPORT_SYMBOL_GPL(ata_sas_port_async_suspend); | ||
5431 | |||
5432 | int ata_sas_port_async_resume(struct ata_port *ap, int *async) | ||
5433 | { | ||
5434 | return __ata_port_resume_common(ap, async); | ||
5435 | } | ||
5436 | EXPORT_SYMBOL_GPL(ata_sas_port_async_resume); | ||
5437 | |||
5438 | |||
5405 | /** | 5439 | /** |
5406 | * ata_host_suspend - suspend host | 5440 | * ata_host_suspend - suspend host |
5407 | * @host: host to suspend | 5441 | * @host: host to suspend |
@@ -5947,24 +5981,18 @@ int ata_host_start(struct ata_host *host) | |||
5947 | } | 5981 | } |
5948 | 5982 | ||
5949 | /** | 5983 | /** |
5950 | * ata_sas_host_init - Initialize a host struct | 5984 | * ata_sas_host_init - Initialize a host struct for sas (ipr, libsas) |
5951 | * @host: host to initialize | 5985 | * @host: host to initialize |
5952 | * @dev: device host is attached to | 5986 | * @dev: device host is attached to |
5953 | * @flags: host flags | ||
5954 | * @ops: port_ops | 5987 | * @ops: port_ops |
5955 | * | 5988 | * |
5956 | * LOCKING: | ||
5957 | * PCI/etc. bus probe sem. | ||
5958 | * | ||
5959 | */ | 5989 | */ |
5960 | /* KILLME - the only user left is ipr */ | ||
5961 | void ata_host_init(struct ata_host *host, struct device *dev, | 5990 | void ata_host_init(struct ata_host *host, struct device *dev, |
5962 | unsigned long flags, struct ata_port_operations *ops) | 5991 | struct ata_port_operations *ops) |
5963 | { | 5992 | { |
5964 | spin_lock_init(&host->lock); | 5993 | spin_lock_init(&host->lock); |
5965 | mutex_init(&host->eh_mutex); | 5994 | mutex_init(&host->eh_mutex); |
5966 | host->dev = dev; | 5995 | host->dev = dev; |
5967 | host->flags = flags; | ||
5968 | host->ops = ops; | 5996 | host->ops = ops; |
5969 | } | 5997 | } |
5970 | 5998 | ||
@@ -6408,6 +6436,7 @@ static int __init ata_parse_force_one(char **cur, | |||
6408 | { "nohrst", .lflags = ATA_LFLAG_NO_HRST }, | 6436 | { "nohrst", .lflags = ATA_LFLAG_NO_HRST }, |
6409 | { "nosrst", .lflags = ATA_LFLAG_NO_SRST }, | 6437 | { "nosrst", .lflags = ATA_LFLAG_NO_SRST }, |
6410 | { "norst", .lflags = ATA_LFLAG_NO_HRST | ATA_LFLAG_NO_SRST }, | 6438 | { "norst", .lflags = ATA_LFLAG_NO_HRST | ATA_LFLAG_NO_SRST }, |
6439 | { "rstonce", .lflags = ATA_LFLAG_RST_ONCE }, | ||
6411 | }; | 6440 | }; |
6412 | char *start = *cur, *p = *cur; | 6441 | char *start = *cur, *p = *cur; |
6413 | char *id, *val, *endp; | 6442 | char *id, *val, *endp; |
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 26598941e1b3..e60437cd0d19 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
@@ -2625,6 +2625,8 @@ int ata_eh_reset(struct ata_link *link, int classify, | |||
2625 | */ | 2625 | */ |
2626 | while (ata_eh_reset_timeouts[max_tries] != ULONG_MAX) | 2626 | while (ata_eh_reset_timeouts[max_tries] != ULONG_MAX) |
2627 | max_tries++; | 2627 | max_tries++; |
2628 | if (link->flags & ATA_LFLAG_RST_ONCE) | ||
2629 | max_tries = 1; | ||
2628 | if (link->flags & ATA_LFLAG_NO_HRST) | 2630 | if (link->flags & ATA_LFLAG_NO_HRST) |
2629 | hardreset = NULL; | 2631 | hardreset = NULL; |
2630 | if (link->flags & ATA_LFLAG_NO_SRST) | 2632 | if (link->flags & ATA_LFLAG_NO_SRST) |