From patchwork Thu Jan 11 11:15:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 1885529 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=k5FZ582u; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=147.75.48.161; helo=sy.mirrors.kernel.org; envelope-from=linux-ide+bounces-246-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org [147.75.48.161]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4T9hsj1c8Dz1yPt for ; Thu, 11 Jan 2024 22:15:21 +1100 (AEDT) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id EF97FB26E8C for ; Thu, 11 Jan 2024 11:15:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3EC6814F8F; Thu, 11 Jan 2024 11:15:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="k5FZ582u" X-Original-To: linux-ide@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0AF4914F8A for ; Thu, 11 Jan 2024 11:15:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 015DCC433F1; Thu, 11 Jan 2024 11:15:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704971714; bh=LzU66jklggjG8F/Xc26nAq75dFH4siY/esxjhKlLSkw=; h=From:To:Subject:Date:From; b=k5FZ582uwZN6z2jSCnj05BQwZYxrtlFAAtABuIE9TBqCAQrRHVoOm1UMH9FyXzvZH owrsNNQjUoJ2wwYT/l3NNpOQ6/CAYco2r0ACbDJ9Ww+9HxqwxLlRu7pjpXOuLt/2+J rMEmgQUe85c3gVkWm4mK6nsCfrNt2BKgQf3oW1bH/oSfz7E1IvG8uo2Hs+6QwBEi9T /q8GUnKySQ5vN3t6M4/BFUebneuNia9njsyulcW06Vz2IRZ3gwuB+EXknTGHW7Z+Nm 754e6bZrmFvHzprk5wqHT/f3rndciIO3Bx5lbJlvn5cYJM9XgM1fk3F0TckVkaM0Bj VZK71Lkf7vIsg== From: Damien Le Moal To: linux-ide@vger.kernel.org, Niklas Cassel Subject: [PATCH] ata: libata-core: Do not try to set sleeping devices to standby Date: Thu, 11 Jan 2024 20:15:12 +0900 Message-ID: <20240111111512.1255875-1-dlemoal@kernel.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-ide@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In ata ata_dev_power_set_standby(), check that the target device is not sleeping. If it is, there is no need to do anything. Fixes: aa3998dbeb3a ("ata: libata-scsi: Disable scsi device manage_system_start_stop") Signed-off-by: Damien Le Moal --- drivers/ata/libata-core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 09ed67772fae..d9f80f4f70f5 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -2017,6 +2017,10 @@ void ata_dev_power_set_standby(struct ata_device *dev) struct ata_taskfile tf; unsigned int err_mask; + /* If the device is already sleeping, do nothing. */ + if (dev->flags & ATA_DFLAG_SLEEPING) + return; + /* * Some odd clown BIOSes issue spindown on power off (ACPI S4 or S5) * causing some drives to spin up and down again. For these, do nothing