Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp864533iog; Mon, 13 Jun 2022 14:49:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwaX7ZmMkNK1Xh3TytbneoHhC+FDene6gTtnL5wiWrGKva+2M9nFpX/nF5JswoOUTUARZqu X-Received: by 2002:a63:1a09:0:b0:3fd:ac2b:3876 with SMTP id a9-20020a631a09000000b003fdac2b3876mr1402976pga.457.1655156946561; Mon, 13 Jun 2022 14:49:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655156946; cv=none; d=google.com; s=arc-20160816; b=FVzOM3yu12AQTTHCOLDf6fpjmIJhPAM8gIDptK46U+9CI3d4kPohv1EQxhD0ZD+bJM aHrYp6y6+65DbPrzfQsIJYOWccflAU6h2ANlCQGUfjyf/+DDjL+SU973q2hmPaFrbjJ5 rHSjEOP1uNNAasqqzPKbvwvDJ+gUIfQzc7TopOsEZQk3Ym59Fk8oYY2KdHuK3IHXWhzD yeQsFEdWv2UdEV1oZ3bdYC2Vt1NfJwZjytH+e2CWC2BsJpmaWj4OYVGQB7zERCQhxFML nRRi6O2Cm+mmy2bF7Cag2Y9rDgqc71L0qdYAkCxRJnpWjG/2qpFfkafSqsXLHMCRfQBu TRZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject; bh=oqf0x+3Up92JIVRmpXekykXhnZTVkRx+HxuxW33LBWM=; b=ERc5Kypjd/xiPkvfFBV01ERbtMV9S/kKOrb9DvXQkK8uAV6Ia8JvscyseUE8BBoHda 7Vu812YuexeVhXEdUtH8lP5G1MPJFuPvRY7Ee8SPWpU4hfd3Q/Km0+C20rknKZwHBXrc ATbPJmN6H6KpKoMo1qBqaRlVaRMl0UkUjycbnE/ANYiz603ALtkovLSuOLgJ8cbTcfP6 0n4qU9fiOM8moa35R3rqzKXzjI4Tqt9F0wWApbM580dv2PBWfZ/Tf0lS28+PelUUFsyF 61Q6lFPshYoOnZgqY70igl9KxPfLesc7dp3UJ0muPDTn9hS1c6sm+2j3xdFOEbWQ5Wvi RflA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l187-20020a6391c4000000b003fcc45747c6si11351410pge.322.2022.06.13.14.48.55; Mon, 13 Jun 2022 14:49:06 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351533AbiFMU6W (ORCPT + 99 others); Mon, 13 Jun 2022 16:58:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348741AbiFMUnW (ORCPT ); Mon, 13 Jun 2022 16:43:22 -0400 Received: from mx01.omp.ru (mx01.omp.ru [90.154.21.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EAB53CFF9; Mon, 13 Jun 2022 12:47:25 -0700 (PDT) Received: from [192.168.1.103] (178.176.74.127) by msexch01.omp.ru (10.188.4.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.986.14; Mon, 13 Jun 2022 22:47:17 +0300 Subject: Re: [PATCH 4.14 208/218] ata: libata-transport: fix {dma|pio|xfer}_mode sysfs files To: Greg Kroah-Hartman , CC: , Damien Le Moal References: <20220613094908.257446132@linuxfoundation.org> <20220613094926.933251321@linuxfoundation.org> From: Sergey Shtylyov Organization: Open Mobile Platform Message-ID: <7089e1f1-b017-85f2-84bf-d6e792011b9e@omp.ru> Date: Mon, 13 Jun 2022 22:47:17 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20220613094926.933251321@linuxfoundation.org> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [178.176.74.127] X-ClientProxiedBy: msexch01.omp.ru (10.188.4.12) To msexch01.omp.ru (10.188.4.12) X-KSE-ServerInfo: msexch01.omp.ru, 9 X-KSE-AntiSpam-Interceptor-Info: scan successful X-KSE-AntiSpam-Version: 5.9.20, Database issued on: 06/13/2022 19:30:34 X-KSE-AntiSpam-Status: KAS_STATUS_NOT_DETECTED X-KSE-AntiSpam-Method: none X-KSE-AntiSpam-Rate: 59 X-KSE-AntiSpam-Info: Lua profiles 171077 [Jun 13 2022] X-KSE-AntiSpam-Info: Version: 5.9.20.0 X-KSE-AntiSpam-Info: Envelope from: s.shtylyov@omp.ru X-KSE-AntiSpam-Info: LuaCore: 489 489 b67d2e276d358fa514f5991440453e6a402e3a26 X-KSE-AntiSpam-Info: {rep_avail} X-KSE-AntiSpam-Info: {Tracking_from_domain_doesnt_match_to} X-KSE-AntiSpam-Info: {relay has no DNS name} X-KSE-AntiSpam-Info: {SMTP from is not routable} X-KSE-AntiSpam-Info: {Found in DNSBL: 178.176.74.127 in (user) b.barracudacentral.org} X-KSE-AntiSpam-Info: 178.176.74.127:7.1.2;omp.ru:7.1.1;127.0.0.199:7.1.2;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1 X-KSE-AntiSpam-Info: ApMailHostAddress: 178.176.74.127 X-KSE-AntiSpam-Info: {DNS response errors} X-KSE-AntiSpam-Info: Rate: 59 X-KSE-AntiSpam-Info: Status: not_detected X-KSE-AntiSpam-Info: Method: none X-KSE-AntiSpam-Info: Auth:dmarc=temperror header.from=omp.ru;spf=temperror smtp.mailfrom=omp.ru;dkim=none X-KSE-Antiphishing-Info: Clean X-KSE-Antiphishing-ScanningType: Heuristic X-KSE-Antiphishing-Method: None X-KSE-Antiphishing-Bases: 06/13/2022 19:33:00 X-KSE-AttachmentFiltering-Interceptor-Info: protection disabled X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: Clean, bases: 6/13/2022 4:53:00 PM X-KSE-BulkMessagesFiltering-Scan-Result: InTheLimit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On 6/13/22 1:11 PM, Greg Kroah-Hartman wrote: > From: Sergey Shtylyov > > commit 72aad489f992871e908ff6d9055b26c6366fb864 upstream. > > The {dma|pio}_mode sysfs files are incorrectly documented as having a > list of the supported DMA/PIO transfer modes, while the corresponding > fields of the *struct* ata_device hold the transfer mode IDs, not masks. > > To match these docs, the {dma|pio}_mode (and even xfer_mode!) sysfs > files are handled by the ata_bitfield_name_match() macro which leads to > reading such kind of nonsense from them: > > $ cat /sys/class/ata_device/dev3.0/pio_mode > XFER_UDMA_7, XFER_UDMA_6, XFER_UDMA_5, XFER_UDMA_4, XFER_MW_DMA_4, > XFER_PIO_6, XFER_PIO_5, XFER_PIO_4, XFER_PIO_3, XFER_PIO_2, XFER_PIO_1, > XFER_PIO_0 > > Using the correct ata_bitfield_name_search() macro fixes that: > > $ cat /sys/class/ata_device/dev3.0/pio_mode > XFER_PIO_4 > > While fixing the file documentation, somewhat reword the {dma|pio}_mode > file doc and add a note about being mostly useful for PATA devices to > the xfer_mode file doc... > > Fixes: d9027470b886 ("[libata] Add ATA transport class") > Signed-off-by: Sergey Shtylyov > Cc: stable@vger.kernel.org > Signed-off-by: Damien Le Moal > Signed-off-by: Greg Kroah-Hartman > --- > Documentation/ABI/testing/sysfs-ata | 5 +++-- > drivers/ata/libata-transport.c | 2 +- > 2 files changed, 4 insertions(+), 3 deletions(-) > > --- a/Documentation/ABI/testing/sysfs-ata > +++ b/Documentation/ABI/testing/sysfs-ata > @@ -59,17 +59,18 @@ class > > dma_mode > > - Transfer modes supported by the device when in DMA mode. > + DMA transfer mode used by the device. > Mostly used by PATA device. > > pio_mode > > - Transfer modes supported by the device when in PIO mode. > + PIO transfer mode used by the device. > Mostly used by PATA device. > > xfer_mode > > Current transfer mode. > + Mostly used by PATA device. Missed s/device/devices/, as I've reported already... MBR, Sergey