Skip to content

Commit bdc0077

Browse files
committed
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull first round of SCSI updates from James Bottomley: "The most important feature of this patch set is the new async infrastructure that makes sure async_synchronize_full() synchronizes all domains and allows us to remove all the hacks (like having scsi_complete_async_scans() in the device base code) and means that the async infrastructure will "just work" in future. The rest is assorted driver updates (aacraid, bnx2fc, virto-scsi, megaraid, bfa, lpfc, qla2xxx, qla4xxx) plus a lot of infrastructure work in sas and FC. Signed-off-by: James Bottomley <JBottomley@Parallels.com>" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (97 commits) [SCSI] Revert "[SCSI] fix async probe regression" [SCSI] cleanup usages of scsi_complete_async_scans [SCSI] queue async scan work to an async_schedule domain [SCSI] async: make async_synchronize_full() flush all work regardless of domain [SCSI] async: introduce 'async_domain' type [SCSI] bfa: Fix to set correct return error codes and misc cleanup. [SCSI] aacraid: Series 7 Async. (performance) mode support [SCSI] aha152x: Allow use on 64bit systems [SCSI] virtio-scsi: Add vdrv->scan for post VIRTIO_CONFIG_S_DRIVER_OK LUN scanning [SCSI] bfa: squelch lockdep complaint with a spin_lock_init [SCSI] qla2xxx: remove unnecessary reads of PCI_CAP_ID_EXP [SCSI] qla4xxx: remove unnecessary read of PCI_CAP_ID_EXP [SCSI] ufs: fix incorrect return value about SUCCESS and FAILED [SCSI] ufs: reverse the ufshcd_is_device_present logic [SCSI] ufs: use module_pci_driver [SCSI] usb-storage: update usb devices for write cache quirk in quirk list. [SCSI] usb-storage: add support for write cache quirk [SCSI] set to WCE if usb cache quirk is present. [SCSI] virtio-scsi: hotplug support for virtio-scsi [SCSI] virtio-scsi: split scatterlist per target ...
2 parents 801b036 + e96eb23 commit bdc0077

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+2509
-1018
lines changed

Documentation/kernel-parameters.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2936,6 +2936,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
29362936
initial READ(10) command);
29372937
o = CAPACITY_OK (accept the capacity
29382938
reported by the device);
2939+
p = WRITE_CACHE (the device cache is ON
2940+
by default);
29392941
r = IGNORE_RESIDUE (the device reports
29402942
bogus residue values);
29412943
s = SINGLE_LUN (the device has only one

block/blk-exec.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ static void blk_end_sync_rq(struct request *rq, int error)
4343
* Description:
4444
* Insert a fully prepared request at the back of the I/O scheduler queue
4545
* for execution. Don't wait for completion.
46+
*
47+
* Note:
48+
* This function will invoke @done directly if the queue is dead.
4649
*/
4750
void blk_execute_rq_nowait(struct request_queue *q, struct gendisk *bd_disk,
4851
struct request *rq, int at_head,
@@ -51,18 +54,20 @@ void blk_execute_rq_nowait(struct request_queue *q, struct gendisk *bd_disk,
5154
int where = at_head ? ELEVATOR_INSERT_FRONT : ELEVATOR_INSERT_BACK;
5255

5356
WARN_ON(irqs_disabled());
57+
58+
rq->rq_disk = bd_disk;
59+
rq->end_io = done;
60+
5461
spin_lock_irq(q->queue_lock);
5562

5663
if (unlikely(blk_queue_dead(q))) {
57-
spin_unlock_irq(q->queue_lock);
5864
rq->errors = -ENXIO;
5965
if (rq->end_io)
6066
rq->end_io(rq, rq->errors);
67+
spin_unlock_irq(q->queue_lock);
6168
return;
6269
}
6370

64-
rq->rq_disk = bd_disk;
65-
rq->end_io = done;
6671
__elv_add_request(q, rq, where);
6772
__blk_run_queue(q);
6873
/* the queue is stopped so it won't be run */

drivers/ata/libata-core.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ const struct ata_port_operations ata_base_port_ops = {
8080
.prereset = ata_std_prereset,
8181
.postreset = ata_std_postreset,
8282
.error_handler = ata_std_error_handler,
83+
.sched_eh = ata_std_sched_eh,
84+
.end_eh = ata_std_end_eh,
8385
};
8486

8587
const struct ata_port_operations sata_port_ops = {
@@ -6642,6 +6644,8 @@ struct ata_port_operations ata_dummy_port_ops = {
66426644
.qc_prep = ata_noop_qc_prep,
66436645
.qc_issue = ata_dummy_qc_issue,
66446646
.error_handler = ata_dummy_error_handler,
6647+
.sched_eh = ata_std_sched_eh,
6648+
.end_eh = ata_std_end_eh,
66456649
};
66466650

66476651
const struct ata_port_info ata_dummy_port_info = {

drivers/ata/libata-eh.c

Lines changed: 46 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -793,12 +793,12 @@ void ata_scsi_port_error_handler(struct Scsi_Host *host, struct ata_port *ap)
793793
ata_for_each_link(link, ap, HOST_FIRST)
794794
memset(&link->eh_info, 0, sizeof(link->eh_info));
795795

796-
/* Clear host_eh_scheduled while holding ap->lock such
797-
* that if exception occurs after this point but
798-
* before EH completion, SCSI midlayer will
796+
/* end eh (clear host_eh_scheduled) while holding
797+
* ap->lock such that if exception occurs after this
798+
* point but before EH completion, SCSI midlayer will
799799
* re-initiate EH.
800800
*/
801-
host->host_eh_scheduled = 0;
801+
ap->ops->end_eh(ap);
802802

803803
spin_unlock_irqrestore(ap->lock, flags);
804804
ata_eh_release(ap);
@@ -986,16 +986,13 @@ void ata_qc_schedule_eh(struct ata_queued_cmd *qc)
986986
}
987987

988988
/**
989-
* ata_port_schedule_eh - schedule error handling without a qc
990-
* @ap: ATA port to schedule EH for
991-
*
992-
* Schedule error handling for @ap. EH will kick in as soon as
993-
* all commands are drained.
989+
* ata_std_sched_eh - non-libsas ata_ports issue eh with this common routine
990+
* @ap: ATA port to schedule EH for
994991
*
995-
* LOCKING:
992+
* LOCKING: inherited from ata_port_schedule_eh
996993
* spin_lock_irqsave(host lock)
997994
*/
998-
void ata_port_schedule_eh(struct ata_port *ap)
995+
void ata_std_sched_eh(struct ata_port *ap)
999996
{
1000997
WARN_ON(!ap->ops->error_handler);
1001998

@@ -1007,6 +1004,44 @@ void ata_port_schedule_eh(struct ata_port *ap)
10071004

10081005
DPRINTK("port EH scheduled\n");
10091006
}
1007+
EXPORT_SYMBOL_GPL(ata_std_sched_eh);
1008+
1009+
/**
1010+
* ata_std_end_eh - non-libsas ata_ports complete eh with this common routine
1011+
* @ap: ATA port to end EH for
1012+
*
1013+
* In the libata object model there is a 1:1 mapping of ata_port to
1014+
* shost, so host fields can be directly manipulated under ap->lock, in
1015+
* the libsas case we need to hold a lock at the ha->level to coordinate
1016+
* these events.
1017+
*
1018+
* LOCKING:
1019+
* spin_lock_irqsave(host lock)
1020+
*/
1021+
void ata_std_end_eh(struct ata_port *ap)
1022+
{
1023+
struct Scsi_Host *host = ap->scsi_host;
1024+
1025+
host->host_eh_scheduled = 0;
1026+
}
1027+
EXPORT_SYMBOL(ata_std_end_eh);
1028+
1029+
1030+
/**
1031+
* ata_port_schedule_eh - schedule error handling without a qc
1032+
* @ap: ATA port to schedule EH for
1033+
*
1034+
* Schedule error handling for @ap. EH will kick in as soon as
1035+
* all commands are drained.
1036+
*
1037+
* LOCKING:
1038+
* spin_lock_irqsave(host lock)
1039+
*/
1040+
void ata_port_schedule_eh(struct ata_port *ap)
1041+
{
1042+
/* see: ata_std_sched_eh, unless you know better */
1043+
ap->ops->sched_eh(ap);
1044+
}
10101045

10111046
static int ata_do_link_abort(struct ata_port *ap, struct ata_link *link)
10121047
{

drivers/base/dd.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#include <linux/wait.h>
2525
#include <linux/async.h>
2626
#include <linux/pm_runtime.h>
27-
#include <scsi/scsi_scan.h>
2827

2928
#include "base.h"
3029
#include "power/power.h"
@@ -333,7 +332,6 @@ void wait_for_device_probe(void)
333332
/* wait for the known devices to complete their probing */
334333
wait_event(probe_waitqueue, atomic_read(&probe_count) == 0);
335334
async_synchronize_full();
336-
scsi_complete_async_scans();
337335
}
338336
EXPORT_SYMBOL_GPL(wait_for_device_probe);
339337

drivers/regulator/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2826,7 +2826,7 @@ static void regulator_bulk_enable_async(void *data, async_cookie_t cookie)
28262826
int regulator_bulk_enable(int num_consumers,
28272827
struct regulator_bulk_data *consumers)
28282828
{
2829-
LIST_HEAD(async_domain);
2829+
ASYNC_DOMAIN_EXCLUSIVE(async_domain);
28302830
int i;
28312831
int ret = 0;
28322832

drivers/scsi/Kconfig

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -263,23 +263,6 @@ config SCSI_SCAN_ASYNC
263263
You can override this choice by specifying "scsi_mod.scan=sync"
264264
or async on the kernel's command line.
265265

266-
config SCSI_WAIT_SCAN
267-
tristate # No prompt here, this is an invisible symbol.
268-
default m
269-
depends on SCSI
270-
depends on MODULES
271-
# scsi_wait_scan is a loadable module which waits until all the async scans are
272-
# complete. The idea is to use it in initrd/ initramfs scripts. You modprobe
273-
# it after all the modprobes of the root SCSI drivers and it will wait until
274-
# they have all finished scanning their buses before allowing the boot to
275-
# proceed. (This method is not applicable if targets boot independently in
276-
# parallel with the initiator, or with transports with non-deterministic target
277-
# discovery schemes, or if a transport driver does not support scsi_wait_scan.)
278-
#
279-
# This symbol is not exposed as a prompt because little is to be gained by
280-
# disabling it, whereas people who accidentally switch it off may wonder why
281-
# their mkinitrd gets into trouble.
282-
283266
menu "SCSI Transports"
284267
depends on SCSI
285268

@@ -461,7 +444,7 @@ config SCSI_ACARD
461444

462445
config SCSI_AHA152X
463446
tristate "Adaptec AHA152X/2825 support"
464-
depends on ISA && SCSI && !64BIT
447+
depends on ISA && SCSI
465448
select SCSI_SPI_ATTRS
466449
select CHECK_SIGNATURE
467450
---help---

drivers/scsi/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,6 @@ obj-$(CONFIG_SCSI_OSD_INITIATOR) += osd/
159159
# This goes last, so that "real" scsi devices probe earlier
160160
obj-$(CONFIG_SCSI_DEBUG) += scsi_debug.o
161161

162-
obj-$(CONFIG_SCSI_WAIT_SCAN) += scsi_wait_scan.o
163-
164162
scsi_mod-y += scsi.o hosts.o scsi_ioctl.o constants.o \
165163
scsicam.o scsi_error.o scsi_lib.o
166164
scsi_mod-$(CONFIG_SCSI_DMA) += scsi_lib_dma.o

0 commit comments

Comments
 (0)