Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp483601rdb; Sat, 30 Sep 2023 12:18:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHUSUa4HymkndzwQC+FR5fHP0W3xFFWMcC7x9lu3Imhv+OxCT/BN+w8Uayies+8bZhaRQ7w X-Received: by 2002:a05:6870:858c:b0:1b7:4655:2ac9 with SMTP id f12-20020a056870858c00b001b746552ac9mr8132995oal.6.1696101501402; Sat, 30 Sep 2023 12:18:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696101501; cv=none; d=google.com; s=arc-20160816; b=zfqnCF996QxYQeEiVxqtPMGLPTxAdYOrweTttFCNRw3/f27si2Duwcx8iuNPE3YLuf 5kAk70RBPO81poFUQ29TZY89I1jmttVSeVa6uS/wqox477LEosSrjHd0O7HWAMl3xFNe CgcGWn+NhiBxNOgCq2Gjx07+T+fiPtl6WmZFFkOxObF9avLFFDxXiEI2e6JYdxGxhVIz Ev3Akt0R5JWJZQBb+pPZv7ihyjKjtD9edK2H31nOqac60ovbeitVL6uWMJHQo02mQQkV Uvl00VfHcUWagPge3yslPAx45Bi7Xg7dhpMmfgFuyDouDyQM0IysD/XKu8pqVWENeMEE QOvg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=A8i6FxU4v8ee1Z5Jxk7YJR5B/PSdUwv7Xe5XAhP7brM=; fh=HCzElfjdAw79VJwTPuLT/8QZsv7MtPddOgpBiXtV6sA=; b=OTti1uYzL9e1Ga5kG1YANp+w8kjfCtYsVKr2vheZ4vGVjzJF77c2eKb8jM7FJBJzT5 fENNw8jfQrxVIXILjSVqIlLgdY6PqqZo1+DdeP0nFwUT7wDUDBOeuAvWdkVbtAJFdeX4 WpRqBrmD1nrqvqyiixYF9nqB+M2dpDAGYa2UeJRfMPl4Y8a+UYFOKkYffL9YaqaGrIvm Xd9H8QhQ/2I5wfWDMe16bIMe8YhS0VDDxZPLYcYLaFUfob1TkSuy+9s1brwJ8gElnRoZ DgqVP3tbBUO+7eQdXIRc1cnnZ2vJTSI4v32MTJ0+JAAOc/HRnuaRtXzwoVnPzhoDOU38 BFTQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id a21-20020a63e855000000b0057d7cff25c7si22258386pgk.417.2023.09.30.12.18.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Sep 2023 12:18:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 6FCFA80236CD; Sat, 30 Sep 2023 12:16:08 -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 S234761AbjI3TPh (ORCPT + 99 others); Sat, 30 Sep 2023 15:15:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234735AbjI3TPd (ORCPT ); Sat, 30 Sep 2023 15:15:33 -0400 Received: from hosting.gsystem.sk (hosting.gsystem.sk [212.5.213.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8AC9EE6 for ; Sat, 30 Sep 2023 12:15:30 -0700 (PDT) Received: from gsql.ggedos.sk (off-20.infotel.telecom.sk [212.5.213.20]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by hosting.gsystem.sk (Postfix) with ESMTPSA id 895A57A03C3; Sat, 30 Sep 2023 21:15:28 +0200 (CEST) From: Ondrej Zary To: Damien Le Moal , Sudip Mukherjee Cc: Christoph Hellwig , Sergey Shtylyov , Jens Axboe , Tim Waugh , linux-block@vger.kernel.org, linux-parport@lists.infradead.org, linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/4] pata_parport-fit3: implement IDE command set registers Date: Sat, 30 Sep 2023 21:15:11 +0200 Message-Id: <20230930191511.24994-5-linux@zary.sk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230930191511.24994-1-linux@zary.sk> References: <20230930191511.24994-1-linux@zary.sk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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]); Sat, 30 Sep 2023 12:16:08 -0700 (PDT) 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 @@ -9,11 +9,6 @@ * * The TD-2000 and certain older devices use a different protocol. * Try the fit2 protocol module with them. - * - * NB: The FIT adapters do not appear to support the control - * registers. So, we map ALT_STATUS to STATUS and NO-OP writes - * to the device control register - this means that IDE reset - * will not work on these devices. */ #include @@ -35,10 +30,11 @@ * cont = 1 - access the IDE command set */ +static int cont_map[] = { 0x00, 0x08 }; + static void fit3_write_regr(struct pi_adapter *pi, int cont, int regr, int val) { - if (cont == 1) - return; + regr += cont_map[cont]; 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]; switch (pi->mode) { case 0: -- Ondrej Zary