From patchwork Sat Oct 22 07:25:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7472 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1099084wrr; Sat, 22 Oct 2022 01:12:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5VmgvKmXHGm/UPu2lB8gnTy5xB1Wlf53lBQvzzvBIIMPb6CxXU4uCUfUl8kngdM3Q8bEGa X-Received: by 2002:a65:6e0e:0:b0:434:59e0:27d3 with SMTP id bd14-20020a656e0e000000b0043459e027d3mr19016390pgb.185.1666426356488; Sat, 22 Oct 2022 01:12:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666426356; cv=none; d=google.com; s=arc-20160816; b=sssNMqgR4QrOX6EenfJI50zVw7IsRSwmGiB2M2QU/zJS3ODvYppjnrr1SgXSAwKaNK 6d6fZ5DI5sIKuOW8crTtictw3iamCwNo9jI2MFS4IVaECWvUhCvs6KgecBpTrNj1UMIU wOrnk2ywNUPSdeqITmcTI1fDxBZcsIDkg6LlKRuccN1QGlzrdabHNQf6/+D2fwexkXm1 wGkpuo0tX6hujxX+y6UoCLYcE0yzpwG9jVMMHcmrNY4wTxRMYf55Pw2mlc/s9XfIJHp1 SJ42Ri59K/vvc4sP5DbR6VPMm5NrYLW2NHeu3cDrQr3bvFA3kKYiWlzS7UIWg3abkkqO 1Yfw== 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=Itv99EoVwD5CC0iuKs15PTjSGqpnhHwQxIkFy/4WXGc=; b=yHHqs2G0+Vcx+/XYxzIgb9Dl+Cz6PIh0Zgw5eQekSwRvMwT22dJPO1RETIeIg+MQsM H/OI8goz5J9rL2UxpYHWHKPSNaj1f/wLBNtvWhNWBjJsQz5ZGNl42FFiPW0aSWGdEo+c VKv+eTYLqqHmUfLadspkJVhy+QirOFG2EBbZ2a+mOVAa1eMnXboZEY7mgD6A3tGJxcyP uUDSmrBu2SE4BSEcPzqnCaQJONblswCN9qRu3p25bqFO1h8L9ghXd+OWvoWz75oKilMG 86NvhjZKcfWjh31BZqF/85x1eGowEL8ha58wruCcK1b9WXV2gL5hXESpmAGrLxZKEsOl treg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=S07jfrQ3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ik19-20020a170902ab1300b00176934d4f3dsi23999081plb.468.2022.10.22.01.12.24; Sat, 22 Oct 2022 01:12:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=S07jfrQ3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S233290AbiJVILx (ORCPT + 99 others); Sat, 22 Oct 2022 04:11:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233407AbiJVIJp (ORCPT ); Sat, 22 Oct 2022 04:09:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA9A9DF4A; Sat, 22 Oct 2022 00:54:25 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3584160B45; Sat, 22 Oct 2022 07:53:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C643C433C1; Sat, 22 Oct 2022 07:53:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666425232; bh=wgTpcZw6pHeLmUWIFLe8Y+4Afsn152FcGu5DNgbGAyI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S07jfrQ3wdDYGYgRf8oJdyLNo5iZ7nB4DeKa+waU63wRtnPCqLcSlpjpa6sD554TN asOkTDNhe5NCk3VqAeKY5Ec+kcFqCwFGPV15v16LhFXZUmCJq9yIt7ntF5xTNtPWR+ rsGQnjwYshIv6bfx4ABJ0J+VhptMocZW91/gZ+Tk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Niklas Cassel , Damien Le Moal , Sasha Levin Subject: [PATCH 5.19 435/717] ata: fix ata_id_has_devslp() Date: Sat, 22 Oct 2022 09:25:14 +0200 Message-Id: <20221022072517.638616813@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747374683139927551?= X-GMAIL-MSGID: =?utf-8?q?1747374683139927551?= From: Niklas Cassel [ Upstream commit 9c6e09a434e1317e09b78b3b69cd384022ec9a03 ] ACS-5 section 7.13.6.36 Word 78: Serial ATA features supported states that: If word 76 is not 0000h or FFFFh, word 78 reports the features supported by the device. If this word is not supported, the word shall be cleared to zero. (This text also exists in really old ACS standards, e.g. ACS-3.) Additionally, move the macro to the other ATA_ID_FEATURE_SUPP macros (which already have this check), thus making it more likely that the next ATA_ID_FEATURE_SUPP macro that is added will include this check. Fixes: 65fe1f0f66a5 ("ahci: implement aggressive SATA device sleep support") Signed-off-by: Niklas Cassel Signed-off-by: Damien Le Moal Signed-off-by: Sasha Levin --- include/linux/ata.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/linux/ata.h b/include/linux/ata.h index 868bfd503aee..bc136a43689f 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h @@ -566,6 +566,10 @@ struct ata_bmdma_prd { ((((id)[ATA_ID_SATA_CAPABILITY] != 0x0000) && \ ((id)[ATA_ID_SATA_CAPABILITY] != 0xffff)) && \ ((id)[ATA_ID_FEATURE_SUPP] & (1 << 2))) +#define ata_id_has_devslp(id) \ + ((((id)[ATA_ID_SATA_CAPABILITY] != 0x0000) && \ + ((id)[ATA_ID_SATA_CAPABILITY] != 0xffff)) && \ + ((id)[ATA_ID_FEATURE_SUPP] & (1 << 8))) #define ata_id_iordy_disable(id) ((id)[ATA_ID_CAPABILITY] & (1 << 10)) #define ata_id_has_iordy(id) ((id)[ATA_ID_CAPABILITY] & (1 << 11)) #define ata_id_u32(id,n) \ @@ -578,7 +582,6 @@ struct ata_bmdma_prd { #define ata_id_cdb_intr(id) (((id)[ATA_ID_CONFIG] & 0x60) == 0x20) #define ata_id_has_da(id) ((id)[ATA_ID_SATA_CAPABILITY_2] & (1 << 4)) -#define ata_id_has_devslp(id) ((id)[ATA_ID_FEATURE_SUPP] & (1 << 8)) #define ata_id_has_ncq_autosense(id) \ ((id)[ATA_ID_FEATURE_SUPP] & (1 << 7))