* [PATCH v2 1/2] ata: pata_artop: read the ATP865 mode register through pci_iomap
2026-10-25 3:44 [PATCH v2 0/2] sh: Fix IDE on landisk (HDD models) Daniel Palmer
@ 2026-10-25 3:44 ` Daniel Palmer
2026-11-02 10:52 ` Niklas Cassel
2026-10-25 3:44 ` [PATCH v2 2/2] sh: landisk_defconfig: enable PATA_ARTOP for the ATP865 Daniel Palmer
2026-11-02 15:55 ` (subset) [PATCH v2 0/2] sh: Fix IDE on landisk (HDD models) Niklas Cassel
2 siblings, 1 reply; 6+ messages in thread
From: Daniel Palmer @ 2026-10-25 3:44 UTC (permalink / raw)
To: ysato, dalias, glaubitz, dlemoal, cassel, linux-sh, linux-ide
Cc: linux-kernel, Daniel Palmer, Florian Fuchs
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.
Tested-by: Florian Fuchs <fuchsfl@gmail.com> # on PX-EH40L (LANDISK HDL-U, ATP865 1191:0009 rev 10)
Signed-off-by: Daniel Palmer <daniel@0x0f.com>
---
drivers/ata/pata_artop.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/ata/pata_artop.c b/drivers/ata/pata_artop.c
index 9f8d41639a62..7c5e778d19cc 100644
--- a/drivers/ata/pata_artop.c
+++ b/drivers/ata/pata_artop.c
@@ -390,6 +390,8 @@ static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id)
.port_ops = &artop6260_ops,
};
const struct ata_port_info *ppi[] = { NULL, NULL };
+ void __iomem *bmdma;
+ u8 cfg;
int rc;
ata_print_version_once(&pdev->dev, DRV_VERSION);
@@ -406,10 +408,17 @@ static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id)
ppi[0] = &info_626x;
break;
case 2: /* 6280 or 6280 + fast */
- if (inb(pci_resource_start(pdev, 4)) & 0x10)
+ bmdma = pci_iomap(pdev, 4, 1);
+ if (!bmdma)
+ return -ENOMEM;
+
+ cfg = ioread8(bmdma);
+ if (cfg & 0x10)
ppi[0] = &info_628x_fast;
else
ppi[0] = &info_628x;
+
+ pci_iounmap(pdev, bmdma);
break;
}
--
2.55.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH v2 1/2] ata: pata_artop: read the ATP865 mode register through pci_iomap
2026-10-25 3:44 ` [PATCH v2 1/2] ata: pata_artop: read the ATP865 mode register through pci_iomap Daniel Palmer
@ 2026-11-02 10:52 ` Niklas Cassel
2026-11-02 11:16 ` Daniel Palmer
0 siblings, 1 reply; 6+ messages in thread
From: Niklas Cassel @ 2026-11-02 10:52 UTC (permalink / raw)
To: Daniel Palmer
Cc: ysato, dalias, glaubitz, dlemoal, linux-sh, linux-ide,
linux-kernel, Florian Fuchs
Hello Daniel,
On Sun, Oct 25, 2026 at 12:44:09PM +0900, 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.
>
> Tested-by: Florian Fuchs <fuchsfl@gmail.com> # on PX-EH40L (LANDISK HDL-U, ATP865 1191:0009 rev 10)
> Signed-off-by: Daniel Palmer <daniel@0x0f.com>
Since your cover letter says that this fixes a regression,
I think we should add a Fixes-tag.
Kind regards,
Niklas
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 1/2] ata: pata_artop: read the ATP865 mode register through pci_iomap
2026-11-02 10:52 ` Niklas Cassel
@ 2026-11-02 11:16 ` Daniel Palmer
0 siblings, 0 replies; 6+ messages in thread
From: Daniel Palmer @ 2026-11-02 11:16 UTC (permalink / raw)
To: Niklas Cassel
Cc: ysato, dalias, glaubitz, dlemoal, linux-sh, linux-ide,
linux-kernel, Florian Fuchs
Hi Niklas,
On Mon, 2 Nov 2026 at 19:52, Niklas Cassel <cassel@kernel.org> wrote:
> Since your cover letter says that this fixes a regression,
> I think we should add a Fixes-tag.
From what I can tell it's had the inb() from the start and at some
point that inb() started crashing sh and maybe other places.
Maybe:
Fixes: 669a5db411d8 ("[libata] Add a bunch of PATA drivers.")
But this is all the way back in 2.6. I would hope anyone using this
with an LTS kernel would have noticed by now :).
Cheers,
Daniel
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 2/2] sh: landisk_defconfig: enable PATA_ARTOP for the ATP865
2026-10-25 3:44 [PATCH v2 0/2] sh: Fix IDE on landisk (HDD models) Daniel Palmer
2026-10-25 3:44 ` [PATCH v2 1/2] ata: pata_artop: read the ATP865 mode register through pci_iomap Daniel Palmer
@ 2026-10-25 3:44 ` Daniel Palmer
2026-11-02 15:55 ` (subset) [PATCH v2 0/2] sh: Fix IDE on landisk (HDD models) Niklas Cassel
2 siblings, 0 replies; 6+ messages in thread
From: Daniel Palmer @ 2026-10-25 3:44 UTC (permalink / raw)
To: ysato, dalias, glaubitz, dlemoal, cassel, linux-sh, linux-ide
Cc: linux-kernel, Daniel Palmer, Florian Fuchs, Colton Pawielski
The landisk defconfig currently has a similar but incorrect IDE
driver selected so IDE doesn't work out of the box on the models
that use a PCI IDE controller.
Select the right one.
Fixes: b7aaf16d10bd ("sh: remove CONFIG_IDE from most defconfig")
Reviewed-by: Florian Fuchs <fuchsfl@gmail.com>
Tested-by: Colton Pawielski <colton.pawielski@gmail.com> # 3x LANDISK
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 related [flat|nested] 6+ messages in thread* Re: (subset) [PATCH v2 0/2] sh: Fix IDE on landisk (HDD models)
2026-10-25 3:44 [PATCH v2 0/2] sh: Fix IDE on landisk (HDD models) Daniel Palmer
2026-10-25 3:44 ` [PATCH v2 1/2] ata: pata_artop: read the ATP865 mode register through pci_iomap Daniel Palmer
2026-10-25 3:44 ` [PATCH v2 2/2] sh: landisk_defconfig: enable PATA_ARTOP for the ATP865 Daniel Palmer
@ 2026-11-02 15:55 ` Niklas Cassel
2 siblings, 0 replies; 6+ messages in thread
From: Niklas Cassel @ 2026-11-02 15:55 UTC (permalink / raw)
To: ysato, dalias, glaubitz, dlemoal, linux-sh, linux-ide,
Daniel Palmer
Cc: linux-kernel, Geert Uytterhoeven, Florian Fuchs, Colton Pawielski
On Sun, 25 Oct 2026 12:44:08 +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.
>
> [...]
Applied to libata/linux.git (for-7.5), thanks!
[1/2] ata: pata_artop: read the ATP865 mode register through pci_iomap
https://git.kernel.org/libata/linux/c/1a37d8d6
Kind regards,
Niklas
^ permalink raw reply [flat|nested] 6+ messages in thread