Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2626952pxp; Mon, 14 Mar 2022 00:58:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMdmGYMyMa0+AnV+GyJDpZzARA58xalgDHz2TuF2ffD1NwfSURKGTgCruUZ/awqi23APGK X-Received: by 2002:a63:ce14:0:b0:381:113d:fd24 with SMTP id y20-20020a63ce14000000b00381113dfd24mr12421744pgf.7.1647244684073; Mon, 14 Mar 2022 00:58:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647244684; cv=none; d=google.com; s=arc-20160816; b=nz0gl7trR83gHo9dQIjpSCZMROG9fFEmmHn8onT7rCiDx2AJczScyKsXLpF53bYX5i l+AJZMZoW6ov76kZEx7XYOyI2D7nAx+33Kzg9MGFXNwUXkchcksy2uYhheW1TmEpnoQD vuVBUF1Qa0dMYLs+RR8nBQ4E+cuPkobmTpqlvlLBequ13RRibrwmJrb7Lhxvbpj9VZA2 DiTpYzNhJVmkzBkdeGorZ+y4ZDqCFL/khwIuu4O6ooSt14QubuUNSxvrPs41PAXKtAeE IdMeal1xvj+9gPkU50TW/pLqOc2HYvGFHRp0ncl2TpIRHV1OoF0kJDSMJY452VaGf4vp TRVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=O+R/kHfFmKvufqO2riNM3OWBvfh7c4oC4bBgk3OU4rs=; b=uXAdlZh00ypaHOxSdUpZZC+gMstnvZgFLt/hMa50gXNjMvq+UPi1UUtMwuIT2Pgs4w PEFgsx9yAdYSAKrM955+QY/80bXPSrH1zy+Onj6Ac0u0ENk4BjS/lxgJBr2Xt2s+JrBO Yo8AtSw1cgw7ta/yQVyTa9JFpwzUkNkl8enR0cgYsidhk+I+uPkqPNYigCovObnZZDQq 5VoXUDU6ZneyhpVADLn2Kd0gFaGpFS7FZ0kKD/KCnQAKHSLn8rd+4Km177EbwJ+epJhj G2Q93UGLACZYU6V8w56qwdie6jE6YB8DY9ilUy/Oy42HhvYGKVA4cE/ISXa93GNHH3c3 mU9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b=k3b9zmBy; 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 a1-20020a170902ecc100b0015384fcab23si971609plh.349.2022.03.14.00.57.50; Mon, 14 Mar 2022 00:58:03 -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; dkim=pass header.i=@kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b=k3b9zmBy; 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 S235645AbiCMXUo (ORCPT + 99 others); Sun, 13 Mar 2022 19:20:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233316AbiCMXUm (ORCPT ); Sun, 13 Mar 2022 19:20:42 -0400 Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com [IPv6:2607:f8b0:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0F2A59A5D for ; Sun, 13 Mar 2022 16:19:32 -0700 (PDT) Received: by mail-pg1-x533.google.com with SMTP id q29so11292135pgn.7 for ; Sun, 13 Mar 2022 16:19:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=O+R/kHfFmKvufqO2riNM3OWBvfh7c4oC4bBgk3OU4rs=; b=k3b9zmByTfeqCsDmj2OjLn7GtvpJQ4h7Qdl6jkXZMEccR9nZgcHG8sJDsQDN8z1IVi ROHqfRcFP9KwmTICy7QqoS2veuIAoNtR7q5pLgURwzE3L94HehTh4ezkD3nz/NmCptbt hIXZdwtmlB/KwhUVUArqvsGFDTVSS55RSDzPC5Nur5ejlMgsq1BR305zCkExbqcwOtQW SMN+L5sJmCJUA6wHWg+i305S0OQAvSceAfHUd13zZQGkzPL6pc6guvhRu8DhRDZvPgrM 6961UYpKQlA5GHHkQN1zUJHNyOnbzmN4I6j3F6q01O5gBD0VXv0WW1QpHldtWDzLXXWK AmmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=O+R/kHfFmKvufqO2riNM3OWBvfh7c4oC4bBgk3OU4rs=; b=B0lba13UM3F5Mga2roNt+1g5ueWrD3+aPMxZu69Gwq7i+Tj4fLgGhflhRGK1qT0h7B 6H6/KkHF/028LPuUEXlPvqEoOE5c/kTOO+abWFPODUJ6j8VmN8Dlg6mUnHpDrEszN7+e IZOV+PEuWBsbLaEpZ5iXfMd0JiQ886UwmlX51IBIaQUtOzJ1yL4X7QzuE7ofLkoAV4u4 MTiWnSf4c0rRbnn1s+0YdoJeq66h56gEDubo+bxHIBfL7Q7Xjlbq4wRxT2+3DQiDph6S dmvzxl8MRrGsGOYJva7rX0QjWdVWKunMZJG22k2Ar+GDTZ4R85vdQnfTmzDj+HIKpydK USXw== X-Gm-Message-State: AOAM5305caMli/04tXz4aq/z3rAnSkAlnyLzcQ9Mf0dcVPxfhnDvX3A7 iJYhWlojzA2qvSzIMbGjImAk3w== X-Received: by 2002:aa7:859a:0:b0:4f6:aaa1:832f with SMTP id w26-20020aa7859a000000b004f6aaa1832fmr21060567pfn.9.1647213572064; Sun, 13 Mar 2022 16:19:32 -0700 (PDT) Received: from [192.168.1.100] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id p15-20020a056a000b4f00b004f7b71f8bd6sm4199082pfo.47.2022.03.13.16.19.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 13 Mar 2022 16:19:31 -0700 (PDT) Message-ID: <5161ed17-5f55-e851-c2e2-5340cc62fa3b@kernel.dk> Date: Sun, 13 Mar 2022 17:19:30 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 Subject: Re: [PATCH] pata_parport: add driver (PARIDE replacement) Content-Language: en-US To: Ondrej Zary , Damien Le Moal Cc: 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> From: Jens Axboe In-Reply-To: <202203132015.18183.linux@zary.sk> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_SBL_CSS, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * 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 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. - 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. -- Jens Axboe