Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1555085rdb; Mon, 2 Oct 2023 13:21:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHx6WoEcnfSFEbq9JOyR4MUUxz7n34HfnDJAeVTaPz0MeNjVwzk9cFm0w35IocztDY2++1Z X-Received: by 2002:a05:6a00:4143:b0:68f:d35d:217e with SMTP id bv3-20020a056a00414300b0068fd35d217emr10412788pfb.2.1696278064150; Mon, 02 Oct 2023 13:21:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696278064; cv=none; d=google.com; s=arc-20160816; b=ewA7WADZULOJtqn9bJk3niKZYW47F8K/anJvc5ret9dzH68k66wdMQ4FwAl0sSAQzd +RabcYroMMW3ZIV0uxL77cP/lDIu6b1trFjnl6reNMkTUXj63/xNrek+vtgdipr/hj/l zk/G5u5tesi0eFj2RSWu28dVngsho57nDB8fVJSC6CmBTuCukPXUB6bUPXAS2d0leX8f v0KQ6rm4FBNJmJFU4FanvtnLySS0tj9W3lxNg1fuxnqDlsNq9NaacYy+L7ueC0PMMI8b kIEP0DUpFU9nsujaqc3WGFC11gdYjggnAiHXjqhveLDXWAqBC4ToM0VrXccxIQtMF0fu VfZA== 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=4dSMLSaL2qDzvec34NvjqKBwJqgJEE1ltYRsyFF2bs4=; fh=0eQPtHXGm/+c7cbfr+DgnEzE/IWeFhGrWAOGzEZqwik=; b=bFE61uJ5E6Ck4pcxHAmCAHAPWWbQN/kGCAqYk3Dm6FUELnm14qKmZI4TLA1IeeCFmr h8qmIBN7P6Fgy/98NBSUsYmqjnXEYWoj/JSjs1d5b2bRhXdOh5/9pdWdQC5mx16xKqhv NKfgrLKsJzwKWLnYpCoPqx0MXhZymMn0f8YlDhOnVSr+WjMJ/Qa+QbkXI/aPrtJb0ldu 82j04SQRgLOwJS0EGITYvR8mvOg9O97+VcKN9uFJBlqryp8yssOnVrfgS5Bj8FP8KZsd /eNEUnG8ZHp8/U9I6DDyGHc0YG4iQbel4voJKVgFNfIrNkF/pVDs7uN4kC2yjTvMCvXa uaCQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id z14-20020a056a001d8e00b00690c23d353asi27563433pfw.217.2023.10.02.13.21.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 13:21:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id A8638807EDA4; Mon, 2 Oct 2023 13:07:04 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229819AbjJBUHD (ORCPT + 99 others); Mon, 2 Oct 2023 16:07:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229640AbjJBUHB (ORCPT ); Mon, 2 Oct 2023 16:07:01 -0400 Received: from mx01.omp.ru (mx01.omp.ru [90.154.21.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EFC0B7; Mon, 2 Oct 2023 13:06:57 -0700 (PDT) Received: from [192.168.1.103] (178.176.75.5) 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, 2 Oct 2023 23:06:52 +0300 Subject: Re: [PATCH 4/4] pata_parport-fit3: implement IDE command set registers To: Ondrej Zary , Damien Le Moal , Sudip Mukherjee CC: Christoph Hellwig , Jens Axboe , Tim Waugh , , , , References: <20230930191511.24994-1-linux@zary.sk> <20230930191511.24994-5-linux@zary.sk> From: Sergey Shtylyov Organization: Open Mobile Platform Message-ID: Date: Mon, 2 Oct 2023 23:06:52 +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: <20230930191511.24994-5-linux@zary.sk> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [178.176.75.5] 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.59, Database issued on: 10/02/2023 19:49:36 X-KSE-AntiSpam-Status: KAS_STATUS_NOT_DETECTED X-KSE-AntiSpam-Method: none X-KSE-AntiSpam-Rate: 59 X-KSE-AntiSpam-Info: Lua profiles 180294 [Oct 02 2023] X-KSE-AntiSpam-Info: Version: 5.9.59.0 X-KSE-AntiSpam-Info: Envelope from: s.shtylyov@omp.ru X-KSE-AntiSpam-Info: LuaCore: 535 535 da804c0ea8918f802fc60e7a20ba49783d957ba2 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.75.5 in (user) b.barracudacentral.org} X-KSE-AntiSpam-Info: {Found in DNSBL: 178.176.75.5 in (user) dbl.spamhaus.org} X-KSE-AntiSpam-Info: omp.ru:7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;127.0.0.199:7.1.2 X-KSE-AntiSpam-Info: FromAlignment: s X-KSE-AntiSpam-Info: {rdns complete} X-KSE-AntiSpam-Info: {fromrtbl complete} X-KSE-AntiSpam-Info: ApMailHostAddress: 178.176.75.5 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=none header.from=omp.ru;spf=none 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: 10/02/2023 19:54:00 X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: Clean, bases: 10/2/2023 5:26:00 PM X-KSE-Attachment-Filter-Triggered-Rules: Clean X-KSE-Attachment-Filter-Triggered-Filters: Clean X-KSE-BulkMessagesFiltering-Scan-Result: InTheLimit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 02 Oct 2023 13:07:04 -0700 (PDT) On 9/30/23 10:15 PM, Ondrej Zary wrote: > fit3 protocol driver does not support accessing IDE control registers > (device control/altstatus). The DOS driver does not use these registers > either (as observed from DOSEMU trace). But the HW seems to be capable > of accessing these registers - I simply tried bit 3 and it works! > > The control register is required to properly reset ATAPI devices or > they will be detected only once (after a power cycle). > > Tested with EXP Computer CD-865 with MC-1285B EPP cable and > TransDisk 3000. > > Signed-off-by: Ondrej Zary > --- > drivers/ata/pata_parport/fit3.c | 16 ++++------------ > 1 file changed, 4 insertions(+), 12 deletions(-) > > diff --git a/drivers/ata/pata_parport/fit3.c b/drivers/ata/pata_parport/fit3.c > index bad7aa920cdc..86b39966755b 100644 > --- a/drivers/ata/pata_parport/fit3.c > +++ b/drivers/ata/pata_parport/fit3.c [...] > @@ -35,10 +30,11 @@ > * cont = 1 - access the IDE command set > */ > > +static int cont_map[] = { 0x00, 0x08 }; const? > + > static void fit3_write_regr(struct pi_adapter *pi, int cont, int regr, int val) > { > - if (cont == 1) > - return; > + regr += cont_map[cont]; Perhaps regr += cont << 3 instead? > > switch (pi->mode) { > case 0: > @@ -59,11 +55,7 @@ static int fit3_read_regr(struct pi_adapter *pi, int cont, int regr) > { > int a, b; > > - if (cont) { > - if (regr != 6) > - return 0xff; > - regr = 7; > - } > + regr += cont_map[cont]; Likewise here? [...] MBR, Sergey