Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2280300pxb; Mon, 11 Jan 2021 05:58:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJwstUKirG8rSSlVWcVhOqLvYPfEPTqoROx2xyjTM/Lc3XZfx8udqyYIC5XwuFQg2LPssftN X-Received: by 2002:a05:6402:1ad1:: with SMTP id ba17mr13792961edb.51.1610373489782; Mon, 11 Jan 2021 05:58:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610373489; cv=none; d=google.com; s=arc-20160816; b=y0kZXG2naLQx+qDW3w41kivlnKMa3H7wrv1tlwahpj1GthYRG+rlrA8W0r8E4W58fJ kBfGHW+hF7h3RBdqsYzf76KOwjEzcHk2wDqzBMVPqXlw7KDMmNBH/4GGKkvbSr1OFPKD AivUTo3qoP+/sR0QspYyAoAC9dRw+UxkV94MDigr9yn9AchW4KYK+Mz4ybz4mbQY4rLi lzlsH/WArDdrc3dMpARq8raGMnQzLKP0eUL+rwCp1/lB6nfgHCxQdQM3Qwz2Z8Mk7mFG GW/qp6quWZQ3dXjd7rQk1z/xxGof8CJkbTSFeK/TMHJS1ULu+oVaLtXsMT7OVAfXTvpZ LMzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=eK7WCKMCzVWWQVx/GCH7iU8dxSYsxlRyR5QNWaJuOII=; b=L4w85eKBm+Mgq53/HmdcwpVGoKFFN3jqYA5jvZnM81HshSJVoRosqp2sYcaQWQCgQT /btu3GJ5H+UlEmY2X6Rg2u/Yh1y+zCIfMA7DfVzWUoaOURd0No9A8Om41KxWt3ZDz6dn jm+PTrouKHlM0aKgo23C5f0NmtbTdtLXfYhdtGXAQXJn7bTdkGlsMAltGqfAeNKIdIfw SEehVo55piFnRZPIR3uMj86AQuj8WrPDKG+q74xosvXRO0dRDPraD4z16Oqv++11vnaZ 75QxH4NIJbi39B2Jzd6RB6lZvm1rHXt1snEZA3CjmxgYVACNbpvbaAA1ee+5aBUfLKrr 498g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="DgV/k5hD"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q6si6325661ejb.731.2021.01.11.05.57.44; Mon, 11 Jan 2021 05:58:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="DgV/k5hD"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730915AbhAKNyb (ORCPT + 99 others); Mon, 11 Jan 2021 08:54:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:54966 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729014AbhAKNHt (ORCPT ); Mon, 11 Jan 2021 08:07:49 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9DCA122515; Mon, 11 Jan 2021 13:07:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610370453; bh=1TiPWSaZ2BsjA0pf2ejsTyQJsFB2VaC9dCixSX4ErAo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DgV/k5hD8pnrJYCu3n+aIwGjDBt29vv+W0hkMTGMEuKkmMheAjDLHSn8YPV4Kc1jK 8Z2elAWV6NjLz+w4q7wWoVnBxkPVdfk8FjbOQzrCVCZx47AHQQQSJBqa0at7VkB/NP MngSh3T2M1+zlCgfQAJyg6VjHK+rsCPMiIFxdWxY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "David S. Miller" , Alan Stern , Can Guo , Stanley Chu , Ming Lei , "Rafael J. Wysocki" , Christoph Hellwig , Hannes Reinecke , Jens Axboe , Bart Van Assche , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.19 05/77] scsi: ide: Do not set the RQF_PREEMPT flag for sense requests Date: Mon, 11 Jan 2021 14:01:14 +0100 Message-Id: <20210111130036.670555504@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210111130036.414620026@linuxfoundation.org> References: <20210111130036.414620026@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 @@ repeat: * 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