linux-stable/drivers/ide
Bart Van Assche 737cfa329c scsi: ide: Do not set the RQF_PREEMPT flag for sense requests
[ Upstream commit 96d86e6a80 ]

RQF_PREEMPT is used for two different purposes in the legacy IDE code:

 1. To mark power management requests.

 2. To mark requests that should preempt another request. An (old)
    explanation of that feature is as follows: "The IDE driver in the Linux
    kernel normally uses a series of busywait delays during its
    initialization. When the driver executes these busywaits, the kernel
    does nothing for the duration of the wait. The time spent in these
    waits could be used for other initialization activities, if they could
    be run concurrently with these waits.

    More specifically, busywait-style delays such as udelay() in module
    init functions inhibit kernel preemption because the Big Kernel Lock is
    held, while yielding APIs such as schedule_timeout() allow
    preemption. This is true because the kernel handles the BKL specially
    and releases and reacquires it across reschedules allowed by the
    current thread.

    This IDE-preempt specification requires that the driver eliminate these
    busywaits and replace them with a mechanism that allows other work to
    proceed while the IDE driver is initializing."

Since I haven't found an implementation of (2), do not set the PREEMPT flag
for sense requests. This patch causes sense requests to be postponed while
a drive is suspended instead of being submitted to ide_queue_rq().

If it would ever be necessary to restore the IDE PREEMPT functionality,
that can be done by introducing a new flag in struct ide_request.

Link: https://lore.kernel.org/r/20201209052951.16136-4-bvanassche@acm.org
Cc: David S. Miller <davem@davemloft.net>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Can Guo <cang@codeaurora.org>
Cc: Stanley Chu <stanley.chu@mediatek.com>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-01-12 20:09:05 +01:00
..
aec62xx.c
ali14xx.c
alim15x3.c
amd74xx.c
atiixp.c
au1xxx-ide.c
buddha.c
cmd64x.c cmd64x: potential buffer overflow in cmd64x_program_timings() 2020-02-28 16:36:05 +01:00
cmd640.c cmd640: add __init attribute 2016-07-26 15:25:30 -07:00
cs5520.c
cs5530.c
cs5535.c
cs5536.c
cy82c693.c
delkin_cb.c
dtc2278.c
falconide.c
gayle.c
hpt366.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
ht6560b.c
icside.c ide: icside: remove incorrect initconst annotation 2016-03-20 16:59:27 -04:00
ide-4drives.c
ide-acpi.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ide-atapi.c scsi: ide: Do not set the RQF_PREEMPT flag for sense requests 2021-01-12 20:09:05 +01:00
ide-cd.c block: Move SECTOR_SIZE and SECTOR_SHIFT definitions into <linux/blkdev.h> 2020-09-09 19:03:12 +02:00
ide-cd.h block: Move SECTOR_SIZE and SECTOR_SHIFT definitions into <linux/blkdev.h> 2020-09-09 19:03:12 +02:00
ide-cd_ioctl.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ide-cd_verbose.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ide-cs.c
ide-devsets.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ide-disk.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ide-disk.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ide-disk_ioctl.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ide-disk_proc.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ide-dma-sff.c
ide-dma.c block: introduce new block status code type 2017-06-09 09:27:32 -06:00
ide-eh.c block: introduce new block status code type 2017-06-09 09:27:32 -06:00
ide-floppy.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ide-floppy.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ide-floppy_ioctl.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ide-floppy_proc.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ide-gd.c block: convert to device_add_disk() 2016-06-27 12:26:08 -07:00
ide-gd.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ide-generic.c Revert "ide: Fix interface autodetection in legacy IDE driver (trial #2)" 2017-01-09 15:27:59 -05:00
ide-io-std.c
ide-io.c scsi: ide: Do not set the RQF_PREEMPT flag for sense requests 2021-01-12 20:09:05 +01:00
ide-ioctls.c block: Make most scsi_req_init() calls implicit 2017-06-20 19:27:14 -06:00
ide-iops.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
ide-legacy.c
ide-lib.c
ide-park.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ide-pci-generic.c
ide-pio-blacklist.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ide-pm.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ide-pnp.c
ide-probe.c ide: free hwif->portdev on hwif_init() failure 2017-10-03 13:36:17 -05:00
ide-proc.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
ide-scan-pci.c ide: fix IRQ assignment for PCI bus order probing 2017-10-03 14:03:31 -05:00
ide-sysfs.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ide-tape.c block: Make most scsi_req_init() calls implicit 2017-06-20 19:27:14 -06:00
ide-taskfile.c block: Make most scsi_req_init() calls implicit 2017-06-20 19:27:14 -06:00
ide-timings.c ide: avoid warning for timings calculation 2017-07-21 04:37:22 +01:00
ide-xfer-mode.c
ide.c
ide_platform.c
it821x.c
it8172.c
it8213.c
jmicron.c
Kconfig block: make scsi_request and scsi ioctl support optional 2017-01-31 10:53:05 -07:00
macide.c
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ns87415.c
opti621.c
palm_bk3710.c ide: palm_bk3710: add __initdata to palm_bk3710_port_info 2017-02-27 20:43:26 -05:00
pdc202xx_new.c PCI: Remove includes of asm/pci-bridge.h 2016-02-05 16:29:28 -06:00
pdc202xx_old.c
piix.c
pmac.c ide: pmac: add of_node_put() 2018-12-21 14:13:14 +01:00
q40ide.c
qd65xx.c
qd65xx.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rapide.c
rz1000.c
sc1200.c
serverworks.c ide: serverworks: potential overflow in svwks_set_pio_mode() 2020-02-28 16:36:05 +01:00
setup-pci.c ide: pci: free PCI BARs on initialization failure 2017-10-03 14:02:57 -05:00
sgiioc4.c
siimage.c block: introduce new block status code type 2017-06-09 09:27:32 -06:00
sis5513.c block: split scsi_request out of struct request 2017-01-27 15:08:35 -07:00
sl82c105.c
slc90e66.c
tc86c001.c
triflex.c
trm290.c
tx4938ide.c
tx4939ide.c
umc8672.c
via82cxxx.c