linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ondrej Zary <linux@zary.sk>
To: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Cc: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>,
	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: [RFC PATCH] pata_parport: paride replacement
Date: Sat,  5 Mar 2022 21:13:55 +0100	[thread overview]
Message-ID: <20220305201411.501-1-linux@zary.sk> (raw)

Hello,
this is a RFC patch for the new pata_parport libata driver - a paride
replacement.

Protocol driver registration and device creation was changed since the
second preview - no more protocol numbers or parport I/O addresses.

All parports and all protocol drivers are now probed automatically unless
probe=0 parameter is used. So just "modprobe epat" is enough for a Imation
SuperDisk drive to work.

Manual device creation:
echo auto >/sys/bus/pata_parport/new_device
echo "parport0 epat 4" >/sys/bus/pata_parport/new_device
echo "parport0 auto" >/sys/bus/pata_parport/new_device
echo "auto epat" >/sys/bus/pata_parport/new_device

Deleting devices:
echo pata_parport.0 >/sys/bus/pata_parport/delete_device

Haven't found any sane way to hook pi_connect() and pi_disconnect() to
libata. So pi_connect() is called on every protocol driver access and
pi_disconnect() is called by a timer that's activated after protocol driver
access.

Found that the EPP-32 mode is buggy in EPAT - and also in many (all?) other
protocol drivers - they don't handle non-multiple-of-4 block transfers
correctly. I'll fix that later.

The bpck_connect() in bpck driver seems to need to know if a CD drive is
attached (weird) but it's called before device detection. This probably
cannot be fixed without the HW.

I have only two devices and both have the same EPAT chip, unfortunately:
Imation SupserDisk
HP C4381A (drive was dead, replaced by TOSHIBA CD-ROM XM-6202B)

The both work:
# modprobe epat
[  122.635395] pata_parport: protocol epat registered
[  122.738114] epat pata_parport.0: epat, Shuttle EPAT chip c6 at 0x378, mode 5 (EPP-32), delay 1
[  122.789035] scsi host4: pata_parport-epat
[  122.789226] ata5: PATA max PIO0 port parport0 protocol epat
[  127.831534] ata5: link is slow to respond, please be patient (ready=0)
[  132.811623] ata5: device not ready (errno=-16), forcing hardreset
[  133.015024] ata5.00: ATAPI: TOSHIBA CD-ROM XM-6202B, 1108, max MWDMA2
[  133.023016] scsi 4:0:0:0: CD-ROM            TOSHIBA  CD-ROM XM-6202B  1108 PQ: 0 ANSI: 5
[  133.043817] scsi 4:0:0:0: Attached scsi generic sg1 type 5
[  133.088146] sr 4:0:0:0: [sr0] scsi3-mmc drive: 32x/32x cd/rw xa/form2 cdda tray
[  133.088163] cdrom: Uniform CD-ROM driver Revision: 3.20
[  133.125939] sr 4:0:0:0: Attached scsi CD-ROM sr0
# mount /dev/sr0 /mnt
mount: /mnt: WARNING: source write-protected, mounted read-only.
[  157.922575] ISO 9660 Extensions: Microsoft Joliet Level 3
[  157.991030] ISO 9660 Extensions: RRIP_1991A
# hdparm -t --direct /dev/sr0

/dev/sr0:
 Timing O_DIRECT disk reads:   2 MB in  3.08 seconds = 664.47 kB/sec



# modprobe epat
[  448.160910] pata_parport: protocol epat registered
[  448.267068] epat pata_parport.0: epat, Shuttle EPAT chip c6 at 0x378, mode 5 (EPP-32), delay 1
[  448.301624] scsi host4: pata_parport-epat
[  448.301769] ata6: PATA max PIO0 port parport0 protocol epat
[  448.533850] ata6.00: ATAPI: LS-120 COSM   04              UHD Floppy, 0270M09T, max PIO2
[  448.615500] scsi 4:0:0:0: Direct-Access     MATSHITA LS-120 COSM   04 0270 PQ: 0 ANSI: 5
[  448.651279] sd 4:0:0:0: Attached scsi generic sg1 type 0
[  448.686028] sd 4:0:0:0: [sdb] Media removed, stopped polling
[  448.717879] sd 4:0:0:0: [sdb] Attached SCSI removable disk
[  472.259786] sd 4:0:0:0: [sdb] Read Capacity(16) failed: Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
[  472.259805] sd 4:0:0:0: [sdb] Sense not available.
[  483.042442] sd 4:0:0:0: [sdb] 246528 512-byte logical blocks: (126 MB/120 MiB)
[  483.158446] sdb: detected capacity change from 0 to 246528
[  483.309771]  sdb:
# hdparm -t --direct /dev/sdb

/dev/sdb:
 Timing O_DIRECT disk reads:   2 MB in 44.19 seconds =  46.35 kB/sec



             reply	other threads:[~2022-03-05 20:14 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-05 20:13 Ondrej Zary [this message]
2022-03-05 20:13 ` [PATCH 01/16] pata_parport: add core driver (PARIDE replacement) Ondrej Zary
2022-03-07  5:52   ` Damien Le Moal
2022-03-07  8:55     ` Ondrej Zary
2022-03-07  9:42       ` Damien Le Moal
2022-03-07 19:49   ` Sergey Shtylyov
2022-03-08  6:59   ` Christoph Hellwig
2022-03-08 17:52   ` kernel test robot
2022-03-09  8:44   ` kernel test robot
2022-03-05 20:13 ` [PATCH 02/16] pata_parport: add aten protocol driver Ondrej Zary
2022-03-05 20:13 ` [PATCH 03/16] pata_parport: add bpck " Ondrej Zary
2022-03-05 20:13 ` [PATCH 04/16] pata_parport: add bpck6 " Ondrej Zary
2022-03-05 20:14 ` [PATCH 05/16] pata_parport: add comm " Ondrej Zary
2022-03-05 20:14 ` [PATCH 06/16] pata_parport: add dstr " Ondrej Zary
2022-03-05 20:14 ` [PATCH 07/16] pata_parport: add fit2 " Ondrej Zary
2022-03-05 20:14 ` [PATCH 08/16] pata_parport: add fit3 " Ondrej Zary
2022-03-05 20:14 ` [PATCH 09/16] pata_parport: add epat " Ondrej Zary
2022-03-05 20:14 ` [PATCH 10/16] pata_parport: add epia " Ondrej Zary
2022-03-05 20:14 ` [PATCH 11/16] pata_parport: add friq " Ondrej Zary
2022-03-05 20:14 ` [PATCH 12/16] pata_parport: add frpw " Ondrej Zary
2022-03-05 20:14 ` [PATCH 13/16] pata_parport: add kbic " Ondrej Zary
2022-03-05 20:14 ` [PATCH 14/16] pata_parport: add ktti " Ondrej Zary
2022-03-05 20:14 ` [PATCH 15/16] pata_parport: add on20 " Ondrej Zary
2022-03-05 20:14 ` [PATCH 16/16] pata_parport: add on26 " Ondrej Zary
2022-03-06  8:58 ` [RFC PATCH] pata_parport: paride replacement Christoph Hellwig
2022-03-06 10:36   ` Ondrej Zary
2022-03-08  6:54     ` 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=20220305201411.501-1-linux@zary.sk \
    --to=linux@zary.sk \
    --cc=axboe@kernel.dk \
    --cc=damien.lemoal@opensource.wdc.com \
    --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=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).