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 B0EB4C433DB for ; Tue, 5 Jan 2021 01:01:16 +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 70D8622573 for ; Tue, 5 Jan 2021 01:01:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 70D8622573 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=GykEc5KDe+EIQOm8COKQXudc4rMS1A5HApluKlCUGFs=; b=w189pMgzFE6rOlKvPBQ+ZrtkB zEEhxM5Z9IVBLnKhge26XMh/zH47UKS1YQhR+psgJ9xR23bwlW+jbn3S6bWlRWvTpHEIK1tT7qS/h g6UvIbEmoiDaa40bA+uIZpeZEWTiKGL/6kFAnB7IAswXZ75MQz+7mALRMet2Lnmp0CZuDRnD1k3D8 0tRrtrjAyxREEvdFAEJbCxO9duM6dndYa9VFR/kgFwsq6mtLUF9ncSZ9NcLH33jpKAUUKv3ReQn0h 4CChFb3n/M9wkdnWpJJSu7nmEFc29fGBCCDDbKDWyRbD63AutFMDtUaybiIJBgEQQFz7SD52mjQYb z46pfIbZg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kwaiZ-00062O-Rt; Tue, 05 Jan 2021 01:00:59 +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 1kwahu-0005bs-B7; Tue, 05 Jan 2021 01:00:19 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id C5DB522B2C; Tue, 5 Jan 2021 01:00:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1609808417; bh=LugGHd7ltLq+WkkwWzw7146Hilpdqkmwi/xui8yO2Co=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LyP6tsI26EVMtzOiJRm0y3OrdB/+mBoB3eoqnMMXwrBrTM78eHCYzSd9Ck0vavExK ci17VF4k6ocCGPNYlThhFUcO66v0inDRgC67k1f4hxovLXdK4RzfM+b4b7WlgUXbvL FnJJS6EQLRSnRTRTXshrMLiO2qNLJ1YiL23ztqxErYzYbg6JCm2fDVaBJybhDjOpOE 0CkO4MW9nY6VbUSTdk/sZqAMGkvwoR5Yl2E08Wtp+FQUodIAk6xw0QKiOEwkm8qm2b ichOY2Y8oYVD5bcSdBV+AdaQ+qkKeOgo3AizGoCSsf+tBHlYRjWB7MTG1krWo4rSHV NK96Ki1swO+6g== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 4.14 3/6] scsi: ide: Do not set the RQF_PREEMPT flag for sense requests Date: Mon, 4 Jan 2021 20:00:09 -0500 Message-Id: <20210105010012.3954626-3-sashal@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210105010012.3954626-1-sashal@kernel.org> References: <20210105010012.3954626-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_200018_586782_F79E3EDC 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 0e6bc631a1caf..215558c947def 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 3a234701d92c4..7f34dc49c9b5f 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c @@ -531,11 +531,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