From patchwork Wed Oct 19 08:30:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 4781 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp215793wrs; Wed, 19 Oct 2022 02:16:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6E0S4vEcmOImZLRQ1IWaEpvsuH1SW39Zy0j8o0GqOHcsFwzUcfNHxxQAJMsZ+pXBLU42f6 X-Received: by 2002:a17:906:5dd8:b0:78d:efa7:f78d with SMTP id p24-20020a1709065dd800b0078defa7f78dmr5924536ejv.641.1666171000034; Wed, 19 Oct 2022 02:16:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666171000; cv=none; d=google.com; s=arc-20160816; b=pKuU6MgfvQq+7vQkOFum+ZYu2WE8oQv1cheDOVnD2HS9ySAilvZ4cF0OmIBfjIfokc ZojhCexQEOFpC52US9o02T8zZJoLMVFCFxqrihHfacTv4F/uP1Q8B1f3zYGtbp/3W7c3 oFqo2TcW4IrNCEtkgNgK/xA1VeP49sLAlZe5E9S4cfgSq00ptGmOZllxELcMTm48gnaz g/Ta1CkxmotbuXVcIHXAQvXziR8xIwnKY2vrbbTWA2YS4LVrzeLIla97cbn+p0oWicAF XV++AbW7rL3la0PUfEYRjL3m4BhDMpsuEbDyaBUE15iyDf6VKSwEltd5AiwtzBY9YRKl sA+g== 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=H03wjafJ3WACh4oOOM6EgQYIdijbqcBjVnN5yuWMMuU9zSVG91RoHa/S3n8v1Wjj25 m67ju74NPDvizxo0+R8POq73xQsfUF05hOo6qVBc4MOQqRAfUFP6Wyy1Z2U0/kEpYL63 LsPysTu7FTXq7f1HivoDx+tV14i+doJ+ab1vL2tHjONlzq1hZgwSv+68YBQFuwhALRbF Gmti0lZIYVx8IgQozOkAMsYd93dcIwv6IP96KvYavUOMUlNk3AmDqx4xWJjWFk4Qy45S 7jpp/Gr1evwoEZlas/XgUdirP6dVFE5QhpkZcLN3sAkAh6A30aCEhkzhLrxV5QsdrAZf wgXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iGmgUa7s; 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 dd17-20020a1709069b9100b0077cfec3a52fsi15072642ejc.839.2022.10.19.02.16.16; Wed, 19 Oct 2022 02:16:40 -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=iGmgUa7s; 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 S233054AbiJSJNt (ORCPT + 99 others); Wed, 19 Oct 2022 05:13:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232776AbiJSJLM (ORCPT ); Wed, 19 Oct 2022 05:11:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE326BBF26; Wed, 19 Oct 2022 02:02:46 -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 391C261840; Wed, 19 Oct 2022 09:02:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 517ECC4314E; Wed, 19 Oct 2022 09:02:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170135; bh=wgTpcZw6pHeLmUWIFLe8Y+4Afsn152FcGu5DNgbGAyI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iGmgUa7sjOEuH9eFuTkiYUZ5S9qu4B1wGNE9Ib56OXFGmMfueNYNqO6IimginnXQP Mb50I8rWI2J3ei6M1wLgwTkfcLWED9nFC8bMr2ONGmdi3EXdnFffrIUjh7Q0HKWuLu 4LkPwtNHn1kFo94dgNFTkeRPApbWKgW5WhuiIcko= 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 6.0 540/862] ata: fix ata_id_has_devslp() Date: Wed, 19 Oct 2022 10:30:27 +0200 Message-Id: <20221019083313.826087970@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 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?1747106922352829814?= X-GMAIL-MSGID: =?utf-8?q?1747106922352829814?= 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))