Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 15344C433E0 for ; Tue, 5 Jan 2021 01:01:06 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CF5A322581 for ; Tue, 5 Jan 2021 01:01:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CF5A322581 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=PTE1ZTK6vjrQ3sCDRYfT/166EyERQE12p9VaBE+UN2U=; b=fzrPM8nnzqRNUkXO+RyM+bKY6 Hla2X8jlmu3ASuW+IaWpF5xJewqSgV0G7uBkgjwcvypH6UuV0gvxxiqpfIgKWKtu9vwqUKNUiUV6U FD9LOWR9T4y4i+w2KvmBAX6oTQPntGh5E5CaKok5i3iywiVo9x5jjeFb7s/Kfk6uBffv7cxFAPLZm yFFPX6AzjUtBrgW2IvdaxubOl7YNsShGTLXIlgWit2Ao+PZ/J5aGczlTn4QVgI/TBYGKxgA9ymM+4 TBtNqiGJ0Fvk8wCngugqIeldcXZsVCcZU1JVLLH6q2ym6p7RGM/ytPT7bd4a0YoxZ3RldHYt1bcfU LhVk/fNAg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kwaiR-0005vm-Cj; Tue, 05 Jan 2021 01:00:51 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kwahi-0005Vl-JP; Tue, 05 Jan 2021 01:00:08 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id EA84422582; Tue, 5 Jan 2021 01:00:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1609808405; bh=WfWOdvixaL7PMa865MGcKoM8DolWpq728REn/AuPaYQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dEnKyc97TIUF3oqf49aZAhu0hmuRciHyBAbNU+VJkLVoa8gdG7g3Gw8/cKiJcc5YT lPwCgh9WuioAC/uWKRM1Zs5CSKF9nbiWYzuim/9nEOcEofCPI/Emd0VGQlbnl77+ft wRmp8ZXx+GIR9uTC2+SsQ2E5OL+MMPQLBwZukZbJ6UR4dnUOX4sgZ8vV7s69Ee4ys9 NYv//hqOFg8dk90s6QizUw3raRTaPq8Fgb4cKUIZQOJs/MfOj0C3QzCduT39NhfGZd 5LvhFHJ8LJgm/pzy8tzQLrJBjh/SmTAQJVg6cQcmuwINNYmGmbcooPyzt00tOAV/T/ v7giLrsi0qoFA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 4/8] scsi: ide: Do not set the RQF_PREEMPT flag for sense requests Date: Mon, 4 Jan 2021 19:59:55 -0500 Message-Id: <20210105005959.3954510-4-sashal@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210105005959.3954510-1-sashal@kernel.org> References: <20210105005959.3954510-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210104_200006_928013_27983420 X-CRM114-Status: GOOD ( 19.50 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jens Axboe , Sasha Levin , Bart Van Assche , "Martin K . Petersen" , "Rafael J . Wysocki" , Ming Lei , linux-ide@vger.kernel.org, Can Guo , Alan Stern , Hannes Reinecke , linux-mediatek@lists.infradead.org, Stanley Chu , Christoph Hellwig , "David S . Miller" , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org From: Bart Van Assche [ 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 Cc: Alan Stern Cc: Can Guo Cc: Stanley Chu Cc: Ming Lei Cc: Rafael J. Wysocki Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Reviewed-by: Jens Axboe Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- 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 8b2b72b938857..4224c4dd89635 100644 --- a/drivers/ide/ide-atapi.c +++ b/drivers/ide/ide-atapi.c @@ -213,7 +213,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 0d93e0cfbeaf9..4381760846109 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c @@ -527,11 +527,6 @@ void do_ide_request(struct request_queue *q) * 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 _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek