Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp67855pxp; Wed, 16 Mar 2022 00:05:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwH+qIhHX6/t79LeoQjC6NaVRiwW9gO99CElykE0/gK4tDk/0BfrzLofv98yRGjC6gIkrOY X-Received: by 2002:a05:6402:50d0:b0:416:a2a6:5443 with SMTP id h16-20020a05640250d000b00416a2a65443mr28783016edb.410.1647414338122; Wed, 16 Mar 2022 00:05:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647414338; cv=none; d=google.com; s=arc-20160816; b=JJ1XjMg/ems4W8xvmBDH354Zo61JKNcBhbXt95FvXjTRy1KVYxVZNY+KK1sRGxyxci KXel0qKYmOPuprIKd1ZpWmY1fImUoNAZQa1b+pBvCyR1/Mw1jJzkLaPTxha4CFaEoHxQ YDOPZ1OgGF0mqutguc3Qccrs6ycPNuOfcQJXSZ7Rd5kHyrsKuYE2MXEO66rbKlybLGRX bvfrycKR5zAHs68+SDBaePQfnXbqwzK3E6Dx8VifdszaWw33gBZOLorne/TLSyUuVnux vxeGy2O/NAVa4VoPnuPFZqvvmC1fSB0MzGRd4MuiUaRZpUNAQdEXOefvXXXaBSCnU/PQ VedQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:content-disposition :content-transfer-encoding:mime-version:in-reply-to:references:cc :user-agent:date:subject:to:from; bh=p7E6Qfau5UXY5ZZpe/w2Y08F+yzEHqzWMyYw+2TNZVE=; b=bNi7ArL3bxFOBBYiHMKIKzJt2UnBg4bMjgaOOYDLkoAst0cFChZu5WkpvkWGuzy4YG HiEZshRuGUWMEJDserhkXMU1smVv/AZgEg1jOS3zbJHAYsEeJdTlGEP0OI8YhKMzqdmy WFoiZnF08uoQ7+i0ciQfO3YTesYFdQC2F1f1VwLH3fk1w3rxfMfw6oeuS6aW2/bCubv9 mxWiX2+GWrMBY/Vhrnjj6Ql3RKs5Z1DtisAIqbPz0touRTvKeue633XEtjPxAdXXqUAp YiRBEh0XbdWul8AdZX9r5IDnsLwpm/l0tnDKyebjz6i8JElNb+MtWA6fM1a3qKtMNC+i RbTw== 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 y18-20020a056402441200b004169121693fsi1048155eda.51.2022.03.16.00.05.03; Wed, 16 Mar 2022 00:05:38 -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 S238096AbiCNU05 (ORCPT + 99 others); Mon, 14 Mar 2022 16:26:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232959AbiCNU04 (ORCPT ); Mon, 14 Mar 2022 16:26:56 -0400 Received: from hosting.gsystem.sk (hosting.gsystem.sk [212.5.213.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E1F383917E; Mon, 14 Mar 2022 13:25:45 -0700 (PDT) Received: from [192.168.0.2] (chello089173232159.chello.sk [89.173.232.159]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by hosting.gsystem.sk (Postfix) with ESMTPSA id 88CEF7A00E3; Mon, 14 Mar 2022 21:25:43 +0100 (CET) From: Ondrej Zary To: Jens Axboe Subject: Re: [PATCH] pata_parport: add driver (PARIDE replacement) Date: Mon, 14 Mar 2022 21:25:40 +0100 User-Agent: KMail/1.9.10 Cc: Damien Le Moal , Christoph Hellwig , Tim Waugh , linux-block@vger.kernel.org, linux-parport@lists.infradead.org, linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org References: <20220312144415.20010-1-linux@zary.sk> <202203132015.18183.linux@zary.sk> <5161ed17-5f55-e851-c2e2-5340cc62fa3b@kernel.dk> In-Reply-To: <5161ed17-5f55-e851-c2e2-5340cc62fa3b@kernel.dk> X-KMail-QuotePrefix: > MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <202203142125.40532.linux@zary.sk> X-Spam-Status: No, score=-1.9 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 Monday 14 March 2022 00:19:30 Jens Axboe wrote: > On 3/13/22 1:15 PM, Ondrej Zary wrote: > > On Saturday 12 March 2022 15:44:15 Ondrej Zary wrote: > >> The pata_parport is a libata-based replacement of the old PARIDE > >> subsystem - driver for parallel port IDE devices. > >> It uses the original paride low-level protocol drivers but does not > >> need the high-level drivers (pd, pcd, pf, pt, pg). The IDE devices > >> behind parallel port adapters are handled by the ATA layer. > >> > >> This will allow paride and its high-level drivers to be removed. > >> > >> paride and pata_parport are mutually exclusive because the compiled > >> protocol drivers are incompatible. > >> > >> Tested with Imation SuperDisk LS-120 and HP C4381A (both use EPAT > >> chip). > >> > >> Note: EPP-32 mode is buggy in EPAT - and also in all other protocol > >> drivers - they don't handle non-multiple-of-4 block transfers > >> correctly. This causes problems with LS-120 drive. > >> There is also another bug in EPAT: EPP modes don't work unless a 4-bit > >> or 8-bit mode is used first (probably some initialization missing?). > >> Once the device is initialized, EPP works until power cycle. > >> > >> So after device power on, you have to: > >> echo "parport0 epat 0" >/sys/bus/pata_parport/new_device > >> echo pata_parport.0 >/sys/bus/pata_parport/delete_device > >> echo "parport0 epat 4" >/sys/bus/pata_parport/new_device > >> (autoprobe will initialize correctly as it tries the slowest modes > >> first but you'll get the broken EPP-32 mode) > > > > Found a bug - the same device can be registered multiple times. Fix > > will be in v2. But this revealed a bigger problem: pi_connect can > > sleep (uses parport_claim_or_block) and libata does not like that. Any > > ideas how to fix this? > > I think you'd need two things here: > > - The blk-mq queue should be registered with BLK_MQ_F_BLOCKING, which > will allow blocking off the queue_rq path. My knowledge about blk-mq is exactly zero. After grepping the code, I guess that BLK_MQ_F_BLOCKING should be used by the block device drivers - sd and sr? > - You need to look at making libata safe wrt calling ata_qc_issue() > outside the lock. Should probably be fine if you just gate that on > whether or not the queue was setup in blocking mode, as that doesn't > currently exist in libata. > -- Ondrej Zary