From: Damien Le Moal <damien.lemoal@opensource.wdc.com>
To: Jens Axboe <axboe@kernel.dk>, Ondrej Zary <linux@zary.sk>
Cc: Christoph Hellwig <hch@lst.de>, Tim Waugh <tim@cyberelk.net>,
linux-block@vger.kernel.org, linux-parport@lists.infradead.org,
linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] pata_parport: add driver (PARIDE replacement)
Date: Tue, 15 Mar 2022 13:22:47 +0900 [thread overview]
Message-ID: <8f32b2ed-13d6-c357-e417-b86a57a285db@opensource.wdc.com> (raw)
In-Reply-To: <f8c176d4-74f0-3e4f-446f-2a5f8ace3b28@kernel.dk>
On 3/15/22 05:29, Jens Axboe wrote:
> On 3/14/22 2:25 PM, Ondrej Zary wrote:
>> 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?
>
> The controller would set
>
> ->needs_blocking_queue_rq = true;
>
> or something, and we'd default to false. And if that is set, when the
> blk-mq queue is created, then we'd set BLK_MQ_F_BLOCKING upon creation
> if that flag is true.
>
> That's the block layer side. Then in libata you'd need to ensure that
> you check that same setting and invoke ata_qc_issue() appropriately.
>
> Very top level stuff, there might be more things lurking below. But
> you'll probably find them as you test this stuff...
Yes, the ata_port spinlock being held when calling ata_qc_issue() is
mandatory. But since I am assuming that all the IDE devices connected to
this adapter are QD=1 maximum, there can only be only one command in
flight. So it may be OK to release that lock before calling pi_connect()
and retake it right after it. libsas actually does something similar
(for no good reasons in that case though).
Jens point remain though that since pi_connect() can sleep, marking the
device queue with BLK_MQ_F_BLOCKING is mandatory.
--
Damien Le Moal
Western Digital Research
next prev parent reply other threads:[~2022-03-15 4:22 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-12 14:44 [PATCH] pata_parport: add driver (PARIDE replacement) Ondrej Zary
2022-03-13 19:15 ` Ondrej Zary
2022-03-13 23:19 ` Jens Axboe
2022-03-14 20:25 ` Ondrej Zary
2022-03-14 20:29 ` Jens Axboe
2022-03-15 4:22 ` Damien Le Moal [this message]
2022-03-15 18:44 ` Ondrej Zary
2022-03-15 18:47 ` Jens Axboe
2022-03-15 21:17 ` Ondrej Zary
2022-03-16 0:19 ` Damien Le Moal
2022-03-15 8:24 ` Christoph Hellwig
2022-03-13 20:38 ` Sergey Shtylyov
2022-03-13 21:19 ` Ondrej Zary
2022-03-16 8:50 ` Sergey Shtylyov
2022-03-16 11:28 ` Ondrej Zary
2022-03-16 11:44 ` Damien Le Moal
2022-03-16 12:58 ` Ondrej Zary
2022-10-19 7:34 ` Christoph Hellwig
2022-10-19 18:58 ` Ondrej Zary
2022-11-12 11:17 ` Ondrej Zary
2022-11-13 23:23 ` Damien Le Moal
2022-11-14 7:53 ` Ondrej Zary
2022-11-14 8:03 ` Damien Le Moal
2022-11-14 19:25 ` Ondrej Zary
2022-11-15 3:06 ` Damien Le Moal
2022-11-15 8:04 ` Hannes Reinecke
2022-11-15 14:56 ` Ondrej Zary
2022-11-16 1:30 ` Damien Le Moal
2022-12-12 22:55 ` Ondrej Zary
2022-12-12 23:07 ` Damien Le Moal
2022-12-13 6:22 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8f32b2ed-13d6-c357-e417-b86a57a285db@opensource.wdc.com \
--to=damien.lemoal@opensource.wdc.com \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-parport@lists.infradead.org \
--cc=linux@zary.sk \
--cc=tim@cyberelk.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).