Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp823199rwi; Wed, 19 Oct 2022 03:30:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5+MfubDR8aZsdYDPclAW3VrVMyOow85yOIAxliKy79fnSLs836Ah2G2bqlT65OcjhR8yUi X-Received: by 2002:aa7:d39a:0:b0:458:a612:f805 with SMTP id x26-20020aa7d39a000000b00458a612f805mr6611827edq.49.1666175420512; Wed, 19 Oct 2022 03:30:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666175420; cv=none; d=google.com; s=arc-20160816; b=Q8dy3XuBjkrScWMeBhx5OaLugzPrhJDGpWT9dWSWugjcWHfkyAauET9xhn7fcA4DEh ey8IQsyBxcrqaJKSkS+MSpJumqKRWL7XBnegdZPdYImay3TkKyqhP8jlT1vUZnzrSDI/ Vttpppsg7YjPLk/HkFvqPD9WEok4eZ9tM87NnI2PAC/5+4IFzuO8t/HRwM3Q6w7HMk3c AT9npoeFd1xd59KFyBVdBLE+IhOCWSWiGrZY3gDvFRGHTE3cP4fvFwkPmy5d9wVdD6hu F6RPgnAGKqIeJkUsTDhOh2H8+ge0PugTEvF6c0CODxwSebKlSAIaNnOi3mGHe27DvB5j yFzw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wu13-20020a170906eecd00b0078daf101aa1si13326084ejb.813.2022.10.19.03.29.54; Wed, 19 Oct 2022 03:30:20 -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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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)) -- 2.35.1