* [PATCH 1/2] ata: pata_artop: read the ATP865 mode register through pci_iomap
2026-10-17 4:14 [PATCH 0/2] sh: Fix IDE on landisk Daniel Palmer
@ 2026-10-17 4:14 ` Daniel Palmer
2026-10-19 13:08 ` Florian Fuchs
2026-10-17 4:14 ` [PATCH 2/2] sh: landisk_defconfig: enable PATA_ARTOP for the ATP865 Daniel Palmer
` (2 subsequent siblings)
3 siblings, 1 reply; 10+ messages in thread
From: Daniel Palmer @ 2026-10-17 4:14 UTC (permalink / raw)
To: ysato, dalias, glaubitz, dlemoal, cassel, linux-sh, linux-ide
Cc: geert, linux-kernel, Daniel Palmer
artop_init_one() probes the 6280's "fast" bit with inb() on the raw
start address of BAR 4. That address is a PCI I/O address, which is
only a usable port number on platforms whose I/O port base maps PCI I/O
space one to one. On an SH7751 LANDISK (identity io_port_base, PCI I/O
window at 0xfe240000) the resource starts at 0x1400 and inb(0x1400)
dereferences that address:
BUG: unable to handle kernel paging request at 00001400
PC is at artop_init_one+0x10e/0x170
Map the BAR with pci_iomap() and use ioread8(), as libata-sff does for
the BMDMA registers later on.
Signed-off-by: Daniel Palmer <daniel@0x0f.com>
---
drivers/ata/pata_artop.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/ata/pata_artop.c b/drivers/ata/pata_artop.c
index 9f8d41639a62..351ff4c8e48e 100644
--- a/drivers/ata/pata_artop.c
+++ b/drivers/ata/pata_artop.c
@@ -405,13 +405,21 @@ static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id)
case 1: /* 6260 */
ppi[0] = &info_626x;
break;
- case 2: /* 6280 or 6280 + fast */
- if (inb(pci_resource_start(pdev, 4)) & 0x10)
+ case 2: { /* 6280 or 6280 + fast */
+ void __iomem *bmdma = pci_iomap(pdev, 4, 1);
+ u8 cfg;
+
+ if (!bmdma)
+ return -ENOMEM;
+ cfg = ioread8(bmdma);
+ pci_iounmap(pdev, bmdma);
+ if (cfg & 0x10)
ppi[0] = &info_628x_fast;
else
ppi[0] = &info_628x;
break;
}
+ }
BUG_ON(ppi[0] == NULL);
--
2.55.0
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH 1/2] ata: pata_artop: read the ATP865 mode register through pci_iomap
2026-10-17 4:14 ` [PATCH 1/2] ata: pata_artop: read the ATP865 mode register through pci_iomap Daniel Palmer
@ 2026-10-19 13:08 ` Florian Fuchs
0 siblings, 0 replies; 10+ messages in thread
From: Florian Fuchs @ 2026-10-19 13:08 UTC (permalink / raw)
To: Daniel Palmer
Cc: ysato, dalias, glaubitz, dlemoal, cassel, linux-sh, linux-ide,
geert, linux-kernel
Hi Daniel,
On 17 Oct 13:14, Daniel Palmer wrote:
> artop_init_one() probes the 6280's "fast" bit with inb() on the raw
> start address of BAR 4. That address is a PCI I/O address, which is
> only a usable port number on platforms whose I/O port base maps PCI I/O
> space one to one. On an SH7751 LANDISK (identity io_port_base, PCI I/O
> window at 0xfe240000) the resource starts at 0x1400 and inb(0x1400)
> dereferences that address:
>
> BUG: unable to handle kernel paging request at 00001400
> PC is at artop_init_one+0x10e/0x170
>
> Map the BAR with pci_iomap() and use ioread8(), as libata-sff does for
> the BMDMA registers later on.
>
> Signed-off-by: Daniel Palmer <daniel@0x0f.com>
> ---
> drivers/ata/pata_artop.c | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/ata/pata_artop.c b/drivers/ata/pata_artop.c
> index 9f8d41639a62..351ff4c8e48e 100644
> --- a/drivers/ata/pata_artop.c
> +++ b/drivers/ata/pata_artop.c
> @@ -405,13 +405,21 @@ static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id)
> case 1: /* 6260 */
> ppi[0] = &info_626x;
> break;
> - case 2: /* 6280 or 6280 + fast */
> - if (inb(pci_resource_start(pdev, 4)) & 0x10)
> + case 2: { /* 6280 or 6280 + fast */
> + void __iomem *bmdma = pci_iomap(pdev, 4, 1);
> + u8 cfg;
> +
> + if (!bmdma)
> + return -ENOMEM;
> + cfg = ioread8(bmdma);
> + pci_iounmap(pdev, bmdma);
> + if (cfg & 0x10)
> ppi[0] = &info_628x_fast;
> else
> ppi[0] = &info_628x;
> break;
> }
> + }
>
> BUG_ON(ppi[0] == NULL);
>
> --
> 2.55.0
>
There is a small logic change, where -ENOMEM is returned, when BAR 4 is
unassigned, where libata would fallback to PIO [0], so maybe it
shouldn't fail when BAR 4 is unassigned?
Tested-by: Florian Fuchs <fuchsfl@gmail.com> # on PX-EH40L (LANDISK HDL-U, ATP865 1191:0009 rev 10)
I also tested forced PIO4 mode via libata.force=pio4, which also works
on the device. (ata1.00: FORCE: xfer_mask set to pio4)
[0] https://github.com/torvalds/linux/blob/master/drivers/ata/libata-sff.c#L3088
Regards
Florian
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/2] sh: landisk_defconfig: enable PATA_ARTOP for the ATP865
2026-10-17 4:14 [PATCH 0/2] sh: Fix IDE on landisk Daniel Palmer
2026-10-17 4:14 ` [PATCH 1/2] ata: pata_artop: read the ATP865 mode register through pci_iomap Daniel Palmer
@ 2026-10-17 4:14 ` Daniel Palmer
2026-10-18 19:01 ` Florian Fuchs
2026-10-17 7:48 ` [PATCH 0/2] sh: Fix IDE on landisk John Paul Adrian Glaubitz
2026-10-21 1:05 ` Colton Pawielski
3 siblings, 1 reply; 10+ messages in thread
From: Daniel Palmer @ 2026-10-17 4:14 UTC (permalink / raw)
To: ysato, dalias, glaubitz, dlemoal, cassel, linux-sh, linux-ide
Cc: geert, linux-kernel, Daniel Palmer
The landisk defconfig currently has a similar but incorrect IDE
driver selected so IDE doesn't work out of the box.
Select the right one.
Signed-off-by: Daniel Palmer <daniel@0x0f.com>
---
arch/sh/configs/landisk_defconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/sh/configs/landisk_defconfig b/arch/sh/configs/landisk_defconfig
index 2b7e10c9acee..6b5ec1f3ad71 100644
--- a/arch/sh/configs/landisk_defconfig
+++ b/arch/sh/configs/landisk_defconfig
@@ -28,7 +28,7 @@ CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_RAM=y
CONFIG_ATA=y
CONFIG_ATA_GENERIC=y
-CONFIG_PATA_ATP867X=y
+CONFIG_PATA_ARTOP=y
CONFIG_SCSI=y
CONFIG_BLK_DEV_SD=y
CONFIG_BLK_DEV_SR=y
--
2.55.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] sh: landisk_defconfig: enable PATA_ARTOP for the ATP865
2026-10-17 4:14 ` [PATCH 2/2] sh: landisk_defconfig: enable PATA_ARTOP for the ATP865 Daniel Palmer
@ 2026-10-18 19:01 ` Florian Fuchs
0 siblings, 0 replies; 10+ messages in thread
From: Florian Fuchs @ 2026-10-18 19:01 UTC (permalink / raw)
To: Daniel Palmer
Cc: ysato, dalias, glaubitz, dlemoal, cassel, linux-sh, linux-ide,
geert, linux-kernel
On 17 Oct 13:14, Daniel Palmer wrote:
> The landisk defconfig currently has a similar but incorrect IDE
> driver selected so IDE doesn't work out of the box.
>
> Select the right one.
>
> Signed-off-by: Daniel Palmer <daniel@0x0f.com>
> ---
> arch/sh/configs/landisk_defconfig | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/sh/configs/landisk_defconfig b/arch/sh/configs/landisk_defconfig
> index 2b7e10c9acee..6b5ec1f3ad71 100644
> --- a/arch/sh/configs/landisk_defconfig
> +++ b/arch/sh/configs/landisk_defconfig
> @@ -28,7 +28,7 @@ CONFIG_BLK_DEV_LOOP=y
> CONFIG_BLK_DEV_RAM=y
> CONFIG_ATA=y
> CONFIG_ATA_GENERIC=y
> -CONFIG_PATA_ATP867X=y
> +CONFIG_PATA_ARTOP=y
> CONFIG_SCSI=y
> CONFIG_BLK_DEV_SD=y
> CONFIG_BLK_DEV_SR=y
> --
> 2.55.0
>
I can confirm the PATA_ARTOP is the right option for the Plextor PX-EH40L
(which is like LANDISK HDL-U), the mismatch of options was btw introduced in
Fixes: b7aaf16d10bd ("sh: remove CONFIG_IDE from most defconfig")
which changed CONFIG_BLK_DEV_AEC62XX (which supported ATP865) to
CONFIG_PATA_ATP867X. To my knowledge there is no sh landisk device with
an ATP867 chip.
Reviewed-by: Florian Fuchs <fuchsfl@gmail.com>
My PX-EH40L has btw this lspci:
00:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8100/8101L/8139 PCI Fast Ethernet Adapter (rev 20)
00:01.0 Mass storage controller: Artop Electronic Corp ATP865 (rev 10)
00:02.0 USB controller: NEC Corporation OHCI USB Controller (rev 43)
00:02.1 USB controller: NEC Corporation OHCI USB Controller (rev 43)
00:02.2 USB controller: NEC Corporation uPD72010x USB 2.0 Controller (rev 04)
Regards
Florian
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 0/2] sh: Fix IDE on landisk
2026-10-17 4:14 [PATCH 0/2] sh: Fix IDE on landisk Daniel Palmer
2026-10-17 4:14 ` [PATCH 1/2] ata: pata_artop: read the ATP865 mode register through pci_iomap Daniel Palmer
2026-10-17 4:14 ` [PATCH 2/2] sh: landisk_defconfig: enable PATA_ARTOP for the ATP865 Daniel Palmer
@ 2026-10-17 7:48 ` John Paul Adrian Glaubitz
2026-10-18 14:48 ` Geert Uytterhoeven
2026-10-21 1:05 ` Colton Pawielski
3 siblings, 1 reply; 10+ messages in thread
From: John Paul Adrian Glaubitz @ 2026-10-17 7:48 UTC (permalink / raw)
To: Daniel Palmer, ysato, dalias, dlemoal, cassel, linux-sh, linux-ide
Cc: geert, linux-kernel
Hi Daniel,
On Sat, 2026-10-17 at 13:14 +0900, Daniel Palmer wrote:
> I dug out my landisk to look at kexec for Geert. Since I'm lazy and
> LLMs are good at fixing bitrot I let my LLM work out how to get
> it to boot again.
>
> There are some other issues (perf is apparently borken, there are
> some issues with the decompresor and big kernels..) but this
> seems to be the only thing stopping it booting with the defconfig.
>
> Disclaimer since we don't need to give LLM tags anymore:
> - LLM debugged the issue.
> - It has been checked on real hardware.
> - I have checked the IDE driver patch, cleaned it up and
> cleaned out massive walls of text that LLMs seem to like
> to add but I have left its summary of the issue in the commit
> message.
>
> Daniel Palmer (2):
> ata: pata_artop: read the ATP865 mode register through pci_iomap
> sh: landisk_defconfig: enable PATA_ARTOP for the ATP865
>
> arch/sh/configs/landisk_defconfig | 2 +-
> drivers/ata/pata_artop.c | 12 ++++++++++--
> 2 files changed, 11 insertions(+), 3 deletions(-)
Great, thanks for fixing this. While I have LANDISK hardware myself,
I cannot probably set it up fast enough now to test your patches as
I don't know where I put it after moving places.
I hope Geert can test and review your patches and I'll pick them up
with his Reviewed-by and Tested-by signatures.
Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 0/2] sh: Fix IDE on landisk
2026-10-17 7:48 ` [PATCH 0/2] sh: Fix IDE on landisk John Paul Adrian Glaubitz
@ 2026-10-18 14:48 ` Geert Uytterhoeven
2026-10-18 23:04 ` Daniel Palmer
0 siblings, 1 reply; 10+ messages in thread
From: Geert Uytterhoeven @ 2026-10-18 14:48 UTC (permalink / raw)
To: Daniel Palmer
Cc: John Paul Adrian Glaubitz, dalias, dlemoal, cassel, linux-sh,
linux-ide, linux-kernel, Yoshinori Sato
Hi Daniel,
On Sat, 17 Oct 2026 at 09:48, John Paul Adrian Glaubitz
<glaubitz@physik.fu-berlin.de> wrote:
> On Sat, 2026-10-17 at 13:14 +0900, Daniel Palmer wrote:
> > I dug out my landisk to look at kexec for Geert. Since I'm lazy and
> > LLMs are good at fixing bitrot I let my LLM work out how to get
> > it to boot again.
> >
> > There are some other issues (perf is apparently borken, there are
> > some issues with the decompresor and big kernels..) but this
> > seems to be the only thing stopping it booting with the defconfig.
> >
> > Disclaimer since we don't need to give LLM tags anymore:
> > - LLM debugged the issue.
> > - It has been checked on real hardware.
> > - I have checked the IDE driver patch, cleaned it up and
> > cleaned out massive walls of text that LLMs seem to like
> > to add but I have left its summary of the issue in the commit
> > message.
> >
> > Daniel Palmer (2):
> > ata: pata_artop: read the ATP865 mode register through pci_iomap
> > sh: landisk_defconfig: enable PATA_ARTOP for the ATP865
> >
> > arch/sh/configs/landisk_defconfig | 2 +-
> > drivers/ata/pata_artop.c | 12 ++++++++++--
> > 2 files changed, 11 insertions(+), 3 deletions(-)
>
> Great, thanks for fixing this. While I have LANDISK hardware myself,
> I cannot probably set it up fast enough now to test your patches as
> I don't know where I put it after moving places.
>
> I hope Geert can test and review your patches and I'll pick them up
> with his Reviewed-by and Tested-by signatures.
Sorry, I must have different hardware, as mine doesn't have an
ATP865 PCI device:
# lspci
00:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd.
RTL-8139/8139C/8139C+ (rev 20)
00:02.0 USB Controller: NEC Corporation USB (rev 43)
00:02.1 USB Controller: NEC Corporation USB (rev 43)
00:02.2 USB Controller: NEC Corporation USB 2.0 (rev 04)
My CF rootfs uses pata_platform, which is enabled in my working .config.
landisk_defconfig lacks CONFIG_PATA_PLATFORM=y, so it hangs during
boot. After enabling that, the boot gets further, but it still hangs:
INIT: Id "1" respawning too fast: disabled for 5 minutes
INIT: Id "2" respawning too fast: disabled for 5 minutes
INIT: no more processes left in this runlevel
Adding
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
to landisk_defconfig fixes that.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH 0/2] sh: Fix IDE on landisk
2026-10-18 14:48 ` Geert Uytterhoeven
@ 2026-10-18 23:04 ` Daniel Palmer
2026-10-19 14:07 ` yoshinori.sato
0 siblings, 1 reply; 10+ messages in thread
From: Daniel Palmer @ 2026-10-18 23:04 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: John Paul Adrian Glaubitz, dalias, dlemoal, cassel, linux-sh,
linux-ide, linux-kernel, Yoshinori Sato, fuchsfl
Hi Geert,
On Sun, 18 Oct 2026 at 23:48, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> > I hope Geert can test and review your patches and I'll pick them up
> > with his Reviewed-by and Tested-by signatures.
>
> Sorry, I must have different hardware, as mine doesn't have an
> ATP865 PCI device:
>
> # lspci
> 00:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd.
> RTL-8139/8139C/8139C+ (rev 20)
> 00:02.0 USB Controller: NEC Corporation USB (rev 43)
> 00:02.1 USB Controller: NEC Corporation USB (rev 43)
> 00:02.2 USB Controller: NEC Corporation USB 2.0 (rev 04)
>
> My CF rootfs uses pata_platform, which is enabled in my working .config.
> landisk_defconfig lacks CONFIG_PATA_PLATFORM=y, so it hangs during
> boot. After enabling that, the boot gets further, but it still hangs:
I guess you have something like the USL-5P that uses the SH's onboard
CF interface.
Since Florian has confirmed their hardware has the PCI IDE controller
like mine and reviewed the change I think we're good.
Daniel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 0/2] sh: Fix IDE on landisk
2026-10-18 23:04 ` Daniel Palmer
@ 2026-10-19 14:07 ` yoshinori.sato
0 siblings, 0 replies; 10+ messages in thread
From: yoshinori.sato @ 2026-10-19 14:07 UTC (permalink / raw)
To: Daniel Palmer
Cc: Geert Uytterhoeven, John Paul Adrian Glaubitz, dalias, dlemoal,
cassel, linux-sh, linux-ide, linux-kernel, fuchsfl
On Mon, 19 Oct 2026 08:04:46 +0900,
Daniel Palmer wrote:
>
> Hi Geert,
>
> On Sun, 18 Oct 2026 at 23:48, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> > > I hope Geert can test and review your patches and I'll pick them up
> > > with his Reviewed-by and Tested-by signatures.
> >
> > Sorry, I must have different hardware, as mine doesn't have an
> > ATP865 PCI device:
> >
> > # lspci
> > 00:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd.
> > RTL-8139/8139C/8139C+ (rev 20)
> > 00:02.0 USB Controller: NEC Corporation USB (rev 43)
> > 00:02.1 USB Controller: NEC Corporation USB (rev 43)
> > 00:02.2 USB Controller: NEC Corporation USB 2.0 (rev 04)
> >
> > My CF rootfs uses pata_platform, which is enabled in my working .config.
> > landisk_defconfig lacks CONFIG_PATA_PLATFORM=y, so it hangs during
> > boot. After enabling that, the boot gets further, but it still hangs:
>
> I guess you have something like the USL-5P that uses the SH's onboard
> CF interface.
> Since Florian has confirmed their hardware has the PCI IDE controller
> like mine and reviewed the change I think we're good.
>
> Daniel
Yes.
LANDISK and USL-5P have almost the same hardware configuration,
but the only difference is the IDE part.
This issue needs to be confirmed with LANDISK hardware.
The LANDISK that I have cannot be used immediately, but here is qemu
that can emulate LANDISK hardware.
https://gitlab.com/yoshinori.sato/qemu/-/tree/landisk?ref_type=heads
This will allow you to check if it is not broken.
--
Yosinori Sato
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 0/2] sh: Fix IDE on landisk
2026-10-17 4:14 [PATCH 0/2] sh: Fix IDE on landisk Daniel Palmer
` (2 preceding siblings ...)
2026-10-17 7:48 ` [PATCH 0/2] sh: Fix IDE on landisk John Paul Adrian Glaubitz
@ 2026-10-21 1:05 ` Colton Pawielski
3 siblings, 0 replies; 10+ messages in thread
From: Colton Pawielski @ 2026-10-21 1:05 UTC (permalink / raw)
To: Daniel Palmer
Cc: ysato, dalias, glaubitz, dlemoal, cassel, linux-sh, linux-ide,
geert, linux-kernel, fuchsfl
Hi Daniel,
This is my first message to the mailing list so please correct me if I've
done anything improper or non-standard.
I tested this series on three I-O DATA LANDISK HDL-U boards (v7.3 +
this series, landisk_defconfig + DEVTMPFS as mentioned by Geert).
All three boot from disk, and the ATP865 is detected as
"PATA max UDMA/100".
I have different drives in each of my LANDISK devices:
- Maxtor 7Y250P0 (native PATA): UDMA/100
- SATA SSD behind a PATA-SATA adapter: UDMA/66 (my adapter
gives ICRC errors at UDMA/100)
- CF card in a CF-IDE adapter: UDMA/33
lspci from two of them:
00:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd.
RTL-8100/8101L/8139 PCI Fast Ethernet Adapter (rev 20)
00:01.0 Mass storage controller: Artop Electronic Corp ATP865 (rev 07)
00:02.0 USB controller: NEC Corporation OHCI USB Controller (rev 43)
00:02.1 USB controller: NEC Corporation OHCI USB Controller (rev 43)
00:02.2 USB controller: NEC Corporation uPD72010x USB 2.0 Controller (rev 04)
The third is identical except for the ATP865 revision:
00:01.0 Mass storage controller: Artop Electronic Corp ATP865 (rev 06)
In testing I could often lock up the board when transferring data over
SSH. I don't believe it's related to this series and am fairly sure it's
in the 8139cp driver. I have a candidate fix that I plan to send in
a couple of days once I've tested it further and there's no more
lockups on my hardware.
Tested-by: Colton Pawielski <colton.pawielski@gmail.com> # 3x LANDISK
HDL-U, ATP865 rev 06/07
Thanks,
Colton
^ permalink raw reply [flat|nested] 10+ messages in thread