From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Bart Van Assche <bvanassche@acm.org>,
"David S . Miller" <davem@davemloft.net>,
Alan Stern <stern@rowland.harvard.edu>,
Can Guo <cang@codeaurora.org>,
Stanley Chu <stanley.chu@mediatek.com>,
Ming Lei <ming.lei@redhat.com>,
"Rafael J . Wysocki" <rafael.j.wysocki@intel.com>,
Christoph Hellwig <hch@lst.de>, Hannes Reinecke <hare@suse.de>,
Jens Axboe <axboe@kernel.dk>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
Sasha Levin <sashal@kernel.org>,
linux-ide@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org
Subject: [PATCH AUTOSEL 5.10 09/17] scsi: ide: Do not set the RQF_PREEMPT flag for sense requests
Date: Mon, 4 Jan 2021 19:59:07 -0500 [thread overview]
Message-ID: <20210105005915.3954208-9-sashal@kernel.org> (raw)
In-Reply-To: <20210105005915.3954208-1-sashal@kernel.org>
From: Bart Van Assche <bvanassche@acm.org>
[ Upstream commit 96d86e6a80a3ab9aff81d12f9f1f2a0da2917d38 ]
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>
---
drivers/ide/ide-atapi.c | 1 -
drivers/ide/ide-io.c | 5 -----
2 files changed, 6 deletions(-)
diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c
index 2162bc80f09e0..013ad33fbbc81 100644
--- a/drivers/ide/ide-atapi.c
+++ b/drivers/ide/ide-atapi.c
@@ -223,7 +223,6 @@ void ide_prep_sense(ide_drive_t *drive, struct request *rq)
sense_rq->rq_disk = rq->rq_disk;
sense_rq->cmd_flags = REQ_OP_DRV_IN;
ide_req(sense_rq)->type = ATA_PRIV_SENSE;
- sense_rq->rq_flags |= RQF_PREEMPT;
req->cmd[0] = GPCMD_REQUEST_SENSE;
req->cmd[4] = cmd_len;
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 1a53c7a752244..c210ea3bd02fa 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -515,11 +515,6 @@ blk_status_t ide_issue_rq(ide_drive_t *drive, struct request *rq,
* above to return us whatever is in the queue. Since we call
* ide_do_request() ourselves, we end up taking requests while
* the queue is blocked...
- *
- * We let requests forced at head of queue with ide-preempt
- * though. I hope that doesn't happen too much, hopefully not
- * unless the subdriver triggers such a thing in its own PM
- * state machine.
*/
if ((drive->dev_flags & IDE_DFLAG_BLOCKED) &&
ata_pm_request(rq) == 0 &&
--
2.27.0
next prev parent reply other threads:[~2021-01-05 1:06 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-05 0:58 [PATCH AUTOSEL 5.10 01/17] workqueue: Kick a worker based on the actual activation of delayed works Sasha Levin
2021-01-05 0:59 ` [PATCH AUTOSEL 5.10 02/17] scsi: ufs: Fix wrong print message in dev_err() Sasha Levin
2021-01-05 0:59 ` [PATCH AUTOSEL 5.10 03/17] scsi: ufs: Clear UAC for RPMB after ufshcd resets Sasha Levin
2021-01-05 0:59 ` [PATCH AUTOSEL 5.10 04/17] scsi: ufs-pci: Fix restore from S4 for Intel controllers Sasha Levin
2021-01-05 0:59 ` [PATCH AUTOSEL 5.10 05/17] scsi: ufs-pci: Ensure UFS device is in PowerDown mode for suspend-to-disk ->poweroff() Sasha Levin
2021-01-05 0:59 ` [PATCH AUTOSEL 5.10 06/17] scsi: ufs-pci: Fix recovery from hibernate exit errors for Intel controllers Sasha Levin
2021-01-05 0:59 ` [PATCH AUTOSEL 5.10 07/17] scsi: ufs-pci: Enable UFSHCD_CAP_RPM_AUTOSUSPEND " Sasha Levin
2021-01-05 0:59 ` [PATCH AUTOSEL 5.10 08/17] scsi: block: Introduce BLK_MQ_REQ_PM Sasha Levin
2021-01-05 0:59 ` Sasha Levin [this message]
2021-01-05 0:59 ` [PATCH AUTOSEL 5.10 10/17] scsi: ide: Mark power management requests with RQF_PM instead of RQF_PREEMPT Sasha Levin
2021-01-05 0:59 ` [PATCH AUTOSEL 5.10 11/17] scsi: scsi_transport_spi: Set RQF_PM for domain validation commands Sasha Levin
2021-01-05 0:59 ` [PATCH AUTOSEL 5.10 12/17] scsi: core: Only process PM requests if rpm_status != RPM_ACTIVE Sasha Levin
2021-01-05 0:59 ` [PATCH AUTOSEL 5.10 13/17] local64.h: make <asm/local64.h> mandatory Sasha Levin
2021-01-05 0:59 ` [PATCH AUTOSEL 5.10 14/17] kdev_t: always inline major/minor helper functions Sasha Levin
2021-01-05 0:59 ` [PATCH AUTOSEL 5.10 15/17] lib/genalloc: fix the overflow when size is too big Sasha Levin
2021-01-05 0:59 ` [PATCH AUTOSEL 5.10 16/17] depmod: handle the case of /sbin/depmod without /sbin in PATH Sasha Levin
2021-01-05 0:59 ` [PATCH AUTOSEL 5.10 17/17] scsi: ufs: Clear UAC for FFU and RPMB LUNs Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210105005915.3954208-9-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=cang@codeaurora.org \
--cc=davem@davemloft.net \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=martin.petersen@oracle.com \
--cc=ming.lei@redhat.com \
--cc=rafael.j.wysocki@intel.com \
--cc=stable@vger.kernel.org \
--cc=stanley.chu@mediatek.com \
--cc=stern@rowland.harvard.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox