From patchwork Fri Sep 16 12:28:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Cassel X-Patchwork-Id: 1678673 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-ide-owner@vger.kernel.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.a=rsa-sha256 header.s=dkim.wdc.com header.b=Ah0Tf56o; dkim-atps=neutral Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4MTYK52xWsz1yp7 for ; Fri, 16 Sep 2022 22:28:57 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231651AbiIPM2x (ORCPT ); Fri, 16 Sep 2022 08:28:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231656AbiIPM2s (ORCPT ); Fri, 16 Sep 2022 08:28:48 -0400 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EB93B24AA for ; Fri, 16 Sep 2022 05:28:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1663331325; x=1694867325; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6vmPIx6roDANIrbR5KXArLWL3Yr6rQf886XQTFmgVuE=; b=Ah0Tf56o/Wjiat5pYgXWZZJQaheNeVOK5Lk8NvD5X3PNYVgQPKyZwy0z dRXnVyFwIzyOXzT1hSJbNIPhFfKTBs8q6995LVLsvo47BIdwlt9iRyEKB iqZnCqj2COaLzrz8SnvDrgnO2lObYYpKcDFzxYchL26eaaNb0En9kPkEd H4IXq9UWzalo9oUuZso/A1qkKsyrV/ijDLWYgpCxJzwEzDV5L34EHMzyb owePDGOOpILbX1fhvxh3zk3Hsteen6DCmP5+reB1+/p0tBXEKqgpqXZrZ PQgwNaH7NcoMERrCrGgAljpDHqFmcL/y0/km7jbSYAj7/CiIsC4cczkdO Q==; X-IronPort-AV: E=Sophos;i="5.93,320,1654531200"; d="scan'208";a="216701265" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 16 Sep 2022 20:28:45 +0800 IronPort-SDR: AIUVuRrSADTi6xDTMHzoFhyZYtaKiicL6kh5/dgvwPE/wWDmyKm3JctzJqid5ETMqWat64nu/O ncaU/sjWW56NTjgo22+nCzq3QR7IXAptS02omO1fnRsTGs/6t/xqBLVYpU1kL2J4g2l/7U+OI7 TLGR9HfGtXFwCoDmciCEw6lrrDuMuCPb7oAl6I1vqHUsYAoVwI4Za9F2k9JsxM+5ATJTzjV/5k FP0p/yXqTVdyN1VTwul0F7ii8NrUglQkPJzpUWhmb31wWUG1uvoiFdpaw7Xkyb+9iCqVLZx3Sr 3DiHRvs+caqxOtVuP26Z1Cen Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 16 Sep 2022 04:48:55 -0700 IronPort-SDR: jwmgpW45vrj+UMZerckj4jAao+Bz92bI0q2frGdYzUdXdUX1DVTqzKSvu/csLKG4P584PifGNI EN7bmuEpPYZzE65nwrbYm08G33wWsB3mV9oZR4kKIYjwFJ5CokE3mnR4YyorhbDLMJPIGa4cED Kp0C/V4j4UR9mmIjhA6Yd+lVXdryIMJO6kkVs1C7iheqQ2X0aK66jvsSVItXQwWONaTd42sda/ uPz6sbKbgLq7OGnDt/OK+OLSFVfDoQ9oKJOHB0cSip5Jkk4Q1nXrIKOR9gDPxZoqjZlmSestPc JzU= WDCIronportException: Internal Received: from dellx5.wdc.com (HELO x1-carbon.cphwdc) ([10.200.210.81]) by uls-op-cesaip02.wdc.com with ESMTP; 16 Sep 2022 05:28:43 -0700 From: Niklas Cassel To: Damien Le Moal , Hannes Reinecke , Tejun Heo Cc: Niklas Cassel , linux-ide@vger.kernel.org Subject: [PATCH 1/6] ata: fix ata_id_sense_reporting_enabled() and ata_id_has_sense_reporting() Date: Fri, 16 Sep 2022 14:28:32 +0200 Message-Id: <20220916122838.1190628-2-niklas.cassel@wdc.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220916122838.1190628-1-niklas.cassel@wdc.com> References: <20220916122838.1190628-1-niklas.cassel@wdc.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_NONE 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-ide@vger.kernel.org ACS-5 section 7.13.6.41 Words 85..87, 120: Commands and feature sets supported or enabled states that: If bit 15 of word 86 is set to one, bit 14 of word 119 is set to one, and bit 15 of word 119 is cleared to zero, then word 119 is valid. If bit 15 of word 86 is set to one, bit 14 of word 120 is set to one, and bit 15 of word 120 is cleared to zero, then word 120 is valid. (This text also exists in really old ACS standards, e.g. ACS-3.) Currently, ata_id_sense_reporting_enabled() and ata_id_has_sense_reporting() both check bit 15 of word 86, but neither of them check that bit 14 of word 119 is set to one, or that bit 15 of word 119 is cleared to zero. Additionally, make ata_id_sense_reporting_enabled() return false if !ata_id_has_sense_reporting(), similar to how e.g. ata_id_flush_ext_enabled() returns false if !ata_id_has_flush_ext(). Fixes: e87fd28cf9a2 ("libata: Implement support for sense data reporting") Signed-off-by: Niklas Cassel --- include/linux/ata.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/include/linux/ata.h b/include/linux/ata.h index 21292b5bbb55..868bfd503aee 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h @@ -771,16 +771,21 @@ static inline bool ata_id_has_read_log_dma_ext(const u16 *id) static inline bool ata_id_has_sense_reporting(const u16 *id) { - if (!(id[ATA_ID_CFS_ENABLE_2] & (1 << 15))) + if (!(id[ATA_ID_CFS_ENABLE_2] & BIT(15))) + return false; + if ((id[ATA_ID_COMMAND_SET_3] & (BIT(15) | BIT(14))) != BIT(14)) return false; - return id[ATA_ID_COMMAND_SET_3] & (1 << 6); + return id[ATA_ID_COMMAND_SET_3] & BIT(6); } static inline bool ata_id_sense_reporting_enabled(const u16 *id) { - if (!(id[ATA_ID_CFS_ENABLE_2] & (1 << 15))) + if (!ata_id_has_sense_reporting(id)) + return false; + /* ata_id_has_sense_reporting() == true, word 86 must have bit 15 set */ + if ((id[ATA_ID_COMMAND_SET_4] & (BIT(15) | BIT(14))) != BIT(14)) return false; - return id[ATA_ID_COMMAND_SET_4] & (1 << 6); + return id[ATA_ID_COMMAND_SET_4] & BIT(6); } /** From patchwork Fri Sep 16 12:28:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Cassel X-Patchwork-Id: 1678676 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-ide-owner@vger.kernel.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.a=rsa-sha256 header.s=dkim.wdc.com header.b=nNP3I3Ry; dkim-atps=neutral Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4MTYK56LMQz1ypw for ; Fri, 16 Sep 2022 22:28:57 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231652AbiIPM2y (ORCPT ); Fri, 16 Sep 2022 08:28:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231661AbiIPM2s (ORCPT ); Fri, 16 Sep 2022 08:28:48 -0400 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C144B24AE for ; Fri, 16 Sep 2022 05:28:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1663331326; x=1694867326; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=bjxOt5GlRAvBDi+ES/Gbz/FfFJoyH5PD69W64ODuayA=; b=nNP3I3RycgUwjYe55l8s9NE1B7XNBlWJD4hCDoXGErIJei0EsOzz3Bo/ ISV9DLkxhvSel2h8mRfiNg6G9Gqv/j8lRZup8vxUWHb2LLj+D3k3RMAtR BuKRv/QXNDtLFj7hlr3kGg0xZzC3n7KFH5oWLJ22ZG6VhpHlVeBRxNKuz RDm7PpKcaelDbrTCsKFGVUk6t3Ztv0yT9qXvuTOQ34k1NKdo1Iiqgup0F tP8n5bPK8Rrvw1xqFwBpUYe/8n/6ibXkqdAYjP4Mxt7oSwQVh9UiK2MJQ 0IkALMjEppfmDXRN1mZN8Wq0WuAqvgoQ7Bm47NJEe+jpJHiMm1rFnoH0e w==; X-IronPort-AV: E=Sophos;i="5.93,320,1654531200"; d="scan'208";a="216701266" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 16 Sep 2022 20:28:46 +0800 IronPort-SDR: wivw46vyUIGuU1WntjRjpUuXVIDJws+Lur9lG3aNRNC4ZABb7NL5nhMTPJP+he0G0rszQzYqmh imhl92+YhU/mYmsl5OfuYnXRle38hDWjgYzApRtk1PLfry+k6JsdLEaYA7mA5JDdzwxcsvok1/ mBEWKF/202VM8ifsKpNvBfaLH2ag6I9WryjdeMPZykZcg7esaYS8RC5cegyzc22W4yRfgHoUKf iODuWADdWkdSufv24i3Y3UM1FU7G/VcRX8h8uDqA/j5ymEq2RwnJCae5hrvt0OYQF9/hNM9hbX Aim2JFl32ASYavPGZce7XC0e Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 16 Sep 2022 04:48:57 -0700 IronPort-SDR: kT/c/NOPY0jPmIiHtAsqSCLQeT8dQgnn1cWUFo/Nwnv7e3pUfo8wxLBYmPyM71jmwAmIhQLXNC BVVExkZ6JrxvAs97F+v+5/5oM2U+bpKfseFFAoalIcgODYgm5TB0EBZ1Ba9Lvm88P3iDLffI9s /XCQe7OleltLElXGeHCb1frH1DI2jxK7heu09gEYoRZ/0hXdFQbykqe3bj9h5vkdwZuWsK07k0 agSy3XMgAinonIozFlUp5brPCC7w8WiVTMrQfMB+EzxivTHOoIU5Pm3g0iUmLfqOMMpY4lJK/q zPU= WDCIronportException: Internal Received: from dellx5.wdc.com (HELO x1-carbon.cphwdc) ([10.200.210.81]) by uls-op-cesaip02.wdc.com with ESMTP; 16 Sep 2022 05:28:46 -0700 From: Niklas Cassel To: Damien Le Moal , Aaron Lu , Jeff Garzik , Shane Huang Cc: Niklas Cassel , linux-ide@vger.kernel.org Subject: [PATCH 2/6] ata: fix ata_id_has_devslp() Date: Fri, 16 Sep 2022 14:28:33 +0200 Message-Id: <20220916122838.1190628-3-niklas.cassel@wdc.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220916122838.1190628-1-niklas.cassel@wdc.com> References: <20220916122838.1190628-1-niklas.cassel@wdc.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_NONE 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-ide@vger.kernel.org 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 --- 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)) From patchwork Fri Sep 16 12:28:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Cassel X-Patchwork-Id: 1678675 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-ide-owner@vger.kernel.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.a=rsa-sha256 header.s=dkim.wdc.com header.b=R/asADhP; dkim-atps=neutral Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4MTYK62L5cz1ypx for ; Fri, 16 Sep 2022 22:28:58 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231661AbiIPM2z (ORCPT ); Fri, 16 Sep 2022 08:28:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231675AbiIPM2u (ORCPT ); Fri, 16 Sep 2022 08:28:50 -0400 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10066B1B83 for ; Fri, 16 Sep 2022 05:28:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1663331328; x=1694867328; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xUJMkgz/IVMm8VFUSfpopFhoJpW8NPVy6S04t09ELU8=; b=R/asADhPBdxqdaL98ElocwFijVLsbpv3IQ1U5pyQmd3XyZp+Zx8D+ADS bHdt5o2NIhE8qy6wffesLsuud67wjq0K5QbFX7Me7yCwUpVOhYOaX9JPN 5g6ojyuq+OmsF/yM9tbVneuB9m8M1mwckJjDYkzQLQM5Mf82AreEn6a0e 1KDG2lF+W4e/J3uGMslLScOjt5Jk1SVYbu6BH92JBWSs3vZ9Xeu8AWGTa 5TjHOWwqZf8l+yMbqE2NKakvwDvE4QtH2ZYR/FYeJZJhGCXObnTp3UYrx ETDHFLbub6eZ30I6ASAUg+LZsb96pkgpjQff8sum01XuFX46QIHmyy0+0 A==; X-IronPort-AV: E=Sophos;i="5.93,320,1654531200"; d="scan'208";a="216701267" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 16 Sep 2022 20:28:48 +0800 IronPort-SDR: Ht8beljPT2sIaYW4QEzlfgQuHQBX+d9tJLk5gSbJ7Gu5JzsZZzMVbRawdWgScKSUFTg5X4zSG0 0V+l7AFH8S09d8rgJfcwM8y0b+xGNz/Sw4g7Viug0s0ORjRwUvUXUsO45W7r2tAYNDWcmCK1bh oshH3W8lH6KeyvrszEgAuxWjJUZnXtAd/uXppz7bw3/cwPNqMTIB8pXtTPBV7dvRXS1mncfTjF 9S1cScQvwIsA4b2dSh0uT8GUmVNzlnWN5fUFEpb4o9iuDvhsYxec5WcBKDn6dYZ/8AOo9Hc/7k 4PpggNQPDKxlyOdFtXr+xlIM Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 16 Sep 2022 04:48:59 -0700 IronPort-SDR: uPmMzG4aBjpOC5CvEGrC/pdoK9ihGfRMs1imht7/1DQ8f8BvR4porVZuTJ6SrG+WWuvFiH+clS j706+JtrnWYMY8UjOoKdOeISZI3+cJ0dvK3KCvAVW+2Kf/BZzT5t3UDOYM6qLBiDPY4hBR+Amb panYUdQhSjc4pEIkAufpG8lbhphodejWoCQpIhE6YSs3t78gT5yM6HBRXx+N8pmRJIiI1Hb3bv QZfXzPFzCE9h4ca7DoydmMKL6N/zJnmB//6OgsQCd14B7xffSR2pZFnIPse+0IoVtVCjYkZcSt gJc= WDCIronportException: Internal Received: from dellx5.wdc.com (HELO x1-carbon.cphwdc) ([10.200.210.81]) by uls-op-cesaip02.wdc.com with ESMTP; 16 Sep 2022 05:28:48 -0700 From: Niklas Cassel To: Damien Le Moal , Hannes Reinecke , Tejun Heo Cc: Niklas Cassel , linux-ide@vger.kernel.org Subject: [PATCH 3/6] ata: fix ata_id_has_ncq_autosense() Date: Fri, 16 Sep 2022 14:28:34 +0200 Message-Id: <20220916122838.1190628-4-niklas.cassel@wdc.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220916122838.1190628-1-niklas.cassel@wdc.com> References: <20220916122838.1190628-1-niklas.cassel@wdc.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_NONE 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-ide@vger.kernel.org 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: 5b01e4b9efa0 ("libata: Implement NCQ autosense") Signed-off-by: Niklas Cassel --- include/linux/ata.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/linux/ata.h b/include/linux/ata.h index bc136a43689f..4845443e0f08 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h @@ -570,6 +570,10 @@ struct ata_bmdma_prd { ((((id)[ATA_ID_SATA_CAPABILITY] != 0x0000) && \ ((id)[ATA_ID_SATA_CAPABILITY] != 0xffff)) && \ ((id)[ATA_ID_FEATURE_SUPP] & (1 << 8))) +#define ata_id_has_ncq_autosense(id) \ + ((((id)[ATA_ID_SATA_CAPABILITY] != 0x0000) && \ + ((id)[ATA_ID_SATA_CAPABILITY] != 0xffff)) && \ + ((id)[ATA_ID_FEATURE_SUPP] & (1 << 7))) #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) \ @@ -582,8 +586,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_ncq_autosense(id) \ - ((id)[ATA_ID_FEATURE_SUPP] & (1 << 7)) static inline bool ata_id_has_hipm(const u16 *id) { From patchwork Fri Sep 16 12:28:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Cassel X-Patchwork-Id: 1678677 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-ide-owner@vger.kernel.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.a=rsa-sha256 header.s=dkim.wdc.com header.b=Thohbiyv; dkim-atps=neutral Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4MTYK73R7cz1ync for ; Fri, 16 Sep 2022 22:28:59 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231663AbiIPM25 (ORCPT ); Fri, 16 Sep 2022 08:28:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229837AbiIPM2w (ORCPT ); Fri, 16 Sep 2022 08:28:52 -0400 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 436C8B1B83 for ; Fri, 16 Sep 2022 05:28:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1663331330; x=1694867330; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ryyGwkW4FZX+WKKDusTpuBy9xintf8TQcTu8F0R4rLs=; b=ThohbiyvEQynvfMxHoTIOWPWGoHDQkOT36/C06M+G0suPwDJ85/BSWSG Ozl5Pqkk0Fh9EVyr3kRx4lGY5JhxC4G1dK0/CXP8OKOlcpvFeHeYlu0GE ou1qxV49lUloacr1qVvNzHeNZp8T4lNo8n0xFv1NjTTmR5tZS7PZkTUOZ 3J73dO3qMTce8rNlEjmLh9Vs1bd1Qmyge6ilm9dbHuZ2icrOf2hGz/LaT kzE6wiGZ0MOvBA/Wv0GwTaSO3AmrSdzJAaa3/S+TGG/ZbQiayq5alWbjB O8Bkn8JiZVk+x8MPrM4y6eFjEvf8eVntkuvykD+49O8XXmbafaWTOIrPX g==; X-IronPort-AV: E=Sophos;i="5.93,320,1654531200"; d="scan'208";a="216701273" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 16 Sep 2022 20:28:50 +0800 IronPort-SDR: sT/1Cq4MunFHT6g+tml9LIE9kM1Woi3wPbE/h0gIdW3HiAj3aZDU+yZxFhm/kGWdgIzDIHPJHm 2h8D9uk4HlNThjQUdmbmlqMPK5zQnosayYeZ5Ug21QKu0fesKcc4WBRRx8+LecS2CdzhuyaTiX oout2LFtmghBNIrV22lAlC9knDwpeAQ47xA9YTrm27ZDy/nqISuHsjGSyWdg6ZhxDIZ3PVLYbX IRBPVmwaas9JqV26f9dtz/FxeItx/3MVqDYdPuXullyetg6yJRDm0dcso6c23dYLhkDTUhIue8 ILvs0mr0ghR680BTR0kWzZol Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 16 Sep 2022 04:49:02 -0700 IronPort-SDR: NJU/zCd8uJqJqB5xLhS/vsntOm0WwPsAVv7w1ha117ctFVsNskze403uQfaG7al561qEA3b5Iu E37XO0Qn/N2EU925jD/uDQaPkD9uJgp/V80YRp0vUvaxGRUbnRinrLFafRKV/tr8YBoJ/qQlAT NiggJTFD/dOb9otpquS3SfHI0ndFLjmdzZ0la9lrW4NKILep7Lzrt5HBHYdpO8IKltyLo8qANk 9ygHGieXnFsc+Ojm/U1MczZYhaFWdzk02b68cfyHkHZfUalzLKqDRYKeCXAK8zc5GJhYaRE6QZ ogw= WDCIronportException: Internal Received: from dellx5.wdc.com (HELO x1-carbon.cphwdc) ([10.200.210.81]) by uls-op-cesaip02.wdc.com with ESMTP; 16 Sep 2022 05:28:50 -0700 From: Niklas Cassel To: Damien Le Moal , Kristen Carlson Accardi , Jeff Garzik Cc: Niklas Cassel , linux-ide@vger.kernel.org Subject: [PATCH 4/6] ata: fix ata_id_has_dipm() Date: Fri, 16 Sep 2022 14:28:35 +0200 Message-Id: <20220916122838.1190628-5-niklas.cassel@wdc.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220916122838.1190628-1-niklas.cassel@wdc.com> References: <20220916122838.1190628-1-niklas.cassel@wdc.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_NONE 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-ide@vger.kernel.org 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.) The problem with ata_id_has_dipm() is that the while it performs a check against 0 and 0xffff, it performs the check against ATA_ID_FEATURE_SUPP (word 78), the same word where the feature bit is stored. Fix this by performing the check against ATA_ID_SATA_CAPABILITY (word 76), like required by the spec. The feature bit check itself is of course still performed against ATA_ID_FEATURE_SUPP (word 78). 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: ca77329fb713 ("[libata] Link power management infrastructure") Signed-off-by: Niklas Cassel --- include/linux/ata.h | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/include/linux/ata.h b/include/linux/ata.h index 4845443e0f08..e3050e153a71 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h @@ -574,6 +574,10 @@ struct ata_bmdma_prd { ((((id)[ATA_ID_SATA_CAPABILITY] != 0x0000) && \ ((id)[ATA_ID_SATA_CAPABILITY] != 0xffff)) && \ ((id)[ATA_ID_FEATURE_SUPP] & (1 << 7))) +#define ata_id_has_dipm(id) \ + ((((id)[ATA_ID_SATA_CAPABILITY] != 0x0000) && \ + ((id)[ATA_ID_SATA_CAPABILITY] != 0xffff)) && \ + ((id)[ATA_ID_FEATURE_SUPP] & (1 << 3))) #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) \ @@ -597,17 +601,6 @@ static inline bool ata_id_has_hipm(const u16 *id) return val & (1 << 9); } -static inline bool ata_id_has_dipm(const u16 *id) -{ - u16 val = id[ATA_ID_FEATURE_SUPP]; - - if (val == 0 || val == 0xffff) - return false; - - return val & (1 << 3); -} - - static inline bool ata_id_has_fua(const u16 *id) { if ((id[ATA_ID_CFSSE] & 0xC000) != 0x4000) From patchwork Fri Sep 16 12:28:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Cassel X-Patchwork-Id: 1678678 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-ide-owner@vger.kernel.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.a=rsa-sha256 header.s=dkim.wdc.com header.b=oD5AoVnm; dkim-atps=neutral Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4MTYKB0tT6z1ync for ; Fri, 16 Sep 2022 22:29:02 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231495AbiIPM3A (ORCPT ); Fri, 16 Sep 2022 08:29:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231656AbiIPM2z (ORCPT ); Fri, 16 Sep 2022 08:28:55 -0400 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06360B1B83 for ; Fri, 16 Sep 2022 05:28:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1663331332; x=1694867332; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WQplvOiQjEOdLRCGtTe32NS+alg1Yiq6uX5VNstevaw=; b=oD5AoVnm1HnXf5tR8kTKjldCvu5RBwweFD18elVIqeIMA5iqFqlIgchu oYrtPvlMml5MJ+U3YFBO+wNIZNxycUryuk3s2y0ngqrvq1JsarNTnkFD1 /E3e1i6OsXMe8f4iCR0dOFGFTf9NLNRU+ezQC2m/7Kr6zLANy7SvuOYWR rHgiYvLa5niZgMAR5Bw9GCCocsNJOMtEJuPk49pjTb718jeOgcnOEQji1 hJWZliL/ZabDtUcay6vabEc1+z31yZloINCSUiEFtyTZBsuuAZbbnwwBn yONSFXqcahfEKi7hT3uirrFK2pWZdO5Nx1yK5nYuBvc43KQU+ibEpxbu+ w==; X-IronPort-AV: E=Sophos;i="5.93,320,1654531200"; d="scan'208";a="216701275" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 16 Sep 2022 20:28:52 +0800 IronPort-SDR: s0O8+bSXmQV9XeSGegT6nmdEkKJscSBYmOqmb+ziruQHVJ6KRihUiqbFZX9bCGXTjuUBLleuoW X0GwTb/m8bIKUi32nFivIu+UlGC3m57p6W+3oHbWXBAu1UqnsTt59E96LyVQ9rkET6t9S17tcW o2h8OC7/QrOXDxu2y1RIiQSqNehvie15rXT94ihjRZLR13YQZzy10wEyk4ge2tRIURutqslgP1 lNXhbsyhiPRd7wrNYreCuFCO2+JK1E4GqiQ5q+aCc4u2i+8NWDPpUYCbdu/A5mCwBODJArBE+j ehC0SWz1tniptpmSctVrVnKS Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 16 Sep 2022 04:49:03 -0700 IronPort-SDR: EW84Rl5ky2Gcq+oQ5687aFaS6z14EmyY+PWA1u9izHnHbjLAjYqKtl9abxGkqJ5FrUMvTJsaUU 5ZeuOjqueO3Yx0C122NDLanfnEwgvHqhW4kCVvbcVar6kEGc+Ld3+0G8Krr/VrSF7wb8kQCNTK UxYMEsEghzCSHDcO/J17apy9WPZPATi/qSBBLjwM1kR+bclb7E0JsfbAYIQT0kf7Bmd9ZZOUO3 I6IAM6LQAvW2jx8S3ZiokG3TFplE7VS7mR41mN/XGqEo86GutgPUnBKQMLuJ9jc95mp81MjVrh lCM= WDCIronportException: Internal Received: from dellx5.wdc.com (HELO x1-carbon.cphwdc) ([10.200.210.81]) by uls-op-cesaip02.wdc.com with ESMTP; 16 Sep 2022 05:28:52 -0700 From: Niklas Cassel To: Damien Le Moal Cc: Niklas Cassel , linux-ide@vger.kernel.org Subject: [PATCH 5/6] ata: libata: drop superfluous ata_eh_request_sense() parameter Date: Fri, 16 Sep 2022 14:28:36 +0200 Message-Id: <20220916122838.1190628-6-niklas.cassel@wdc.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220916122838.1190628-1-niklas.cassel@wdc.com> References: <20220916122838.1190628-1-niklas.cassel@wdc.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_NONE 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-ide@vger.kernel.org The parameter can easily be derived from struct ata_queued_cmd. Signed-off-by: Niklas Cassel --- drivers/ata/libata-eh.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 7c128c89b454..687f92129a81 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c @@ -1393,7 +1393,6 @@ unsigned int atapi_eh_tur(struct ata_device *dev, u8 *r_sense_key) /** * ata_eh_request_sense - perform REQUEST_SENSE_DATA_EXT * @qc: qc to perform REQUEST_SENSE_SENSE_DATA_EXT to - * @cmd: scsi command for which the sense code should be set * * Perform REQUEST_SENSE_DATA_EXT after the device reported CHECK * SENSE. This function is an EH helper. @@ -1401,9 +1400,9 @@ unsigned int atapi_eh_tur(struct ata_device *dev, u8 *r_sense_key) * LOCKING: * Kernel thread context (may sleep). */ -static void ata_eh_request_sense(struct ata_queued_cmd *qc, - struct scsi_cmnd *cmd) +static void ata_eh_request_sense(struct ata_queued_cmd *qc) { + struct scsi_cmnd *cmd = qc->scsicmd; struct ata_device *dev = qc->dev; struct ata_taskfile tf; unsigned int err_mask; @@ -1579,7 +1578,7 @@ static unsigned int ata_eh_analyze_tf(struct ata_queued_cmd *qc, switch (qc->dev->class) { case ATA_DEV_ZAC: if (stat & ATA_SENSE) - ata_eh_request_sense(qc, qc->scsicmd); + ata_eh_request_sense(qc); fallthrough; case ATA_DEV_ATA: if (err & ATA_ICRC) From patchwork Fri Sep 16 12:28:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Cassel X-Patchwork-Id: 1678679 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-ide-owner@vger.kernel.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.a=rsa-sha256 header.s=dkim.wdc.com header.b=MPP03EtP; dkim-atps=neutral Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4MTYKC2GBGz1ync for ; Fri, 16 Sep 2022 22:29:03 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231494AbiIPM3B (ORCPT ); Fri, 16 Sep 2022 08:29:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231630AbiIPM24 (ORCPT ); Fri, 16 Sep 2022 08:28:56 -0400 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B97B4B1BBE for ; Fri, 16 Sep 2022 05:28:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1663331334; x=1694867334; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=d6Me3ZJCYlcCTqdCTrBcxTLOKt3PwCnG+vj+XEzhMec=; b=MPP03EtPhVaRz2x5SYjBN3HHo3Y4NKkoP98EyMDvrmsbKsS6UFPfkyaG H90+SAa7XUOch0H0xYsi/lxavnZ6zawtELBNynbsf8L7Zb7aZMbi8qSs6 sFtdR5NiCgf6orBchpDZeWj7gGl0JEHOJ4/fUF5XeAcvya8yRbvtWJaFF iKb8a2xLZoV/lbfwz0+fNHV2uEeLsVahIhTeaK2e2GZ8LXrKCKdj6lHPm BF0sazJ/E/bKhbgvScSAHwrXc3TafwDWnH+ZtKIyZdc3c1EMCaneowFqF VDoxRULJZIgCS/v355Nlb11ZQqky+GWFj5vOnGHI2RswTe6OBPbBCqh5C A==; X-IronPort-AV: E=Sophos;i="5.93,320,1654531200"; d="scan'208";a="216701276" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 16 Sep 2022 20:28:54 +0800 IronPort-SDR: 12/SIO0b47N8rEThYeXHJry+gcb/2liMBpfor1qitS30Wu88YCy6KPaY+g3EdqrocMdpzXAUDB t65LD3I531UeVRoN8QFOo4UdUOmbkt/B13SMXowjtzSSbW+uvTU2G2rGSHO5VvGogU1HTmdeek 52iwASUp4DqYaQVsbwBokK0k+/vtyiUA37vsPmlDA4f5qy0hwnBpJLkcX7F5XyFGAmzWgqklgl dYcjT91adEcRMQCTTTSbyTuGhxf6sRLNz7dNYd/eTv1j5zVT3J8xk9RgeD21P59BKw3jmGUZeT lITZTFXvyEC8fAaPr3JMLe25 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 16 Sep 2022 04:49:05 -0700 IronPort-SDR: aRBpAaorzPIOezNlU1N2OpLE9fKDzgfXqEQ9Vj7fyHficr6ZFnMY1r67aiC6MkA+Hah9suCa5l 5QShBuuqn/Os0+VUqKTZIGq7klAuaq0BBWl/ZwE9TdVkpDSOcCkM20CB/8KGlNS+Sb/46y3GFd tmnGS1+D0NKrOG4yzZde/d6pO+ZxLOmHJiEKed+9nxjfC+ep6MuBqjFL0PQk/0khzx1/5IaQk8 d1VcVhg/jVK6s67/Lv3v9baywyDSGl75VZqOM7PKlqY6tDm1KT14MXIvBek7782CikaQ37TpgT NGo= WDCIronportException: Internal Received: from dellx5.wdc.com (HELO x1-carbon.cphwdc) ([10.200.210.81]) by uls-op-cesaip02.wdc.com with ESMTP; 16 Sep 2022 05:28:54 -0700 From: Niklas Cassel To: Damien Le Moal Cc: Niklas Cassel , linux-ide@vger.kernel.org Subject: [PATCH 6/6] ata: libata: drop superfluous ata_eh_analyze_tf() parameter Date: Fri, 16 Sep 2022 14:28:37 +0200 Message-Id: <20220916122838.1190628-7-niklas.cassel@wdc.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220916122838.1190628-1-niklas.cassel@wdc.com> References: <20220916122838.1190628-1-niklas.cassel@wdc.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_NONE 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-ide@vger.kernel.org The parameter can easily be derived from struct ata_queued_cmd. Signed-off-by: Niklas Cassel --- drivers/ata/libata-eh.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 687f92129a81..f2286672e989 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c @@ -1540,7 +1540,6 @@ static void ata_eh_analyze_serror(struct ata_link *link) /** * ata_eh_analyze_tf - analyze taskfile of a failed qc * @qc: qc to analyze - * @tf: Taskfile registers to analyze * * Analyze taskfile of @qc and further determine cause of * failure. This function also requests ATAPI sense data if @@ -1552,9 +1551,9 @@ static void ata_eh_analyze_serror(struct ata_link *link) * RETURNS: * Determined recovery action */ -static unsigned int ata_eh_analyze_tf(struct ata_queued_cmd *qc, - const struct ata_taskfile *tf) +static unsigned int ata_eh_analyze_tf(struct ata_queued_cmd *qc) { + const struct ata_taskfile *tf = &qc->result_tf; unsigned int tmp, action = 0; u8 stat = tf->status, err = tf->error; @@ -1956,7 +1955,7 @@ static void ata_eh_link_autopsy(struct ata_link *link) qc->err_mask |= ehc->i.err_mask; /* analyze TF */ - ehc->i.action |= ata_eh_analyze_tf(qc, &qc->result_tf); + ehc->i.action |= ata_eh_analyze_tf(qc); /* DEV errors are probably spurious in case of ATA_BUS error */ if (qc->err_mask & AC_ERR_ATA_BUS)