From patchwork Mon Oct 24 11:30:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9289 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp463404wru; Mon, 24 Oct 2022 06:47:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5vOTeXSjeQFkvkPvG4NrB34icqybaa0e1UD18jXIkScLUr0QhRqqVBOylUz3/MS+usAYFv X-Received: by 2002:a17:907:9605:b0:6f5:c66:7c13 with SMTP id gb5-20020a170907960500b006f50c667c13mr28630980ejc.66.1666619272219; Mon, 24 Oct 2022 06:47:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666619272; cv=none; d=google.com; s=arc-20160816; b=vbKvf2kUtuyqDJS2aTM5hhYY1rbY/Vy1omssjyAkdfJH6GODETWdQK1aPy7jCnDLOB a3HfAbwyoH2QPac7KrfAMyyxxT/olJ3HPpSI8yiRKzs3L7qDB8tBKs6Mu3MRmm6ncJBT Cj/4jcRmbAvcP2zppvMsX1gIOeOHxhfnc/Tss/GJyiOeFGWVN4QE8h9Vk32X22vI1UD9 dEAMsa/91X+51gv8cg2ljqTgSpATsmnp6uxZTeqr3qzcslY7/kFflJiSwPgf6d8yFScw 0N63ooDopPkHx/Bjg+8GKsNh2sUZnqmqxqJCThUPJXHtvaPPo/VNwjcZ+L6BKaojp3bC tZ4w== 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=cYrSvltH2yTZNaRkugwmHf6xUxP2z6XKXvfql4CvoKo=; b=07EnSskCzxNyCsQgAdRlS6dJRpp/5QxlQyOFGPxPTCtsVixMT69FEO1uMFIuRiWcbh 178UudSvkaZ8897pFgKMxXSSoKasrfnVuVQ7+1uWREKe+IWAobAdKQojaz3CoWdVo6FD oLQ+UOSLzcSB9Yn/ciwzrGZT5cYqTQROZBad2ENDk22NI9wwp+5Em14jrAWWKhXywZVs dHnipOj4coX/38rh2sd2zo1Wnbnz7m11DE4tKOEZ+ssGVo+ACSKjbxp4sBBnOpJBY9xP 0fRRPKnL4jC1MKhCjaULnovAafTYBwHZ323O9pPF/Hq7IVoGdC6NLXULmYeWrAH4j5TF 1qUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="e/oCg/2k"; 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 fk4-20020a056402398400b00459b51c2b25si26737918edb.438.2022.10.24.06.47.27; Mon, 24 Oct 2022 06:47:52 -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="e/oCg/2k"; 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 S236203AbiJXNns (ORCPT + 99 others); Mon, 24 Oct 2022 09:43:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236812AbiJXNlT (ORCPT ); Mon, 24 Oct 2022 09:41:19 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12DD78993B; Mon, 24 Oct 2022 05:38: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 6B03A611B0; Mon, 24 Oct 2022 12:27:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 79A5DC433D6; Mon, 24 Oct 2022 12:27:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614423; bh=MAndz8nMfGWumzgeumXtIyvQC0YhR+/u+DyUw+CVihY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e/oCg/2kcUpRUG4+TwFTAsel+PG1ON5mrSxp82dqNh7p4g1vVkTbS0vgrxgRVKOmL IqHnqtD1dyIyASM4muJQaFGKuFS6dI0VWtZIb7KPLbskEBCIZedAph4giWCv3RpYNz SyvM6/fg8we/EhRea0fj36YyOj1mDZ0EbsSxgyog= 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.10 225/390] ata: fix ata_id_has_devslp() Date: Mon, 24 Oct 2022 13:30:22 +0200 Message-Id: <20221024113032.360887382@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 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?1747576970044110781?= X-GMAIL-MSGID: =?utf-8?q?1747576970044110781?= 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 734cc646ce35..8b884cd3a232 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h @@ -565,6 +565,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) \ @@ -577,7 +581,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))