mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
To: Daniel Palmer <daniel@0x0f.com>,
	ysato@users.sourceforge.jp,  dalias@libc.org, dlemoal@kernel.org,
	cassel@kernel.org, linux-sh@vger.kernel.org,
		linux-ide@vger.kernel.org
Cc: geert@linux-m68k.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] ata: pata_artop: read the ATP865 mode register through pci_iomap
Date: Wed, 21 Oct 2026 20:11:56 +0200	[thread overview]
Message-ID: <f5dc8ecb3f7ed091a4deb6447bd9e7c2c801b847.camel@physik.fu-berlin.de> (raw)
In-Reply-To: <20261017041419.311921-2-daniel@0x0f.com>

Hi Daniel,

On Sat, 2026-10-17 at 13:14 +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.
> 
> 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);
>  

Since neither of the two maintainers of this driver has responded yet, I can't
take this patch through my tree. Either Damien or Niklas should ack this change
(according to ./scripts/get_maintainer.pl drivers/ata/pata_artop.c).

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

  parent reply	other threads:[~2026-10-21 18:12 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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-19 13:08   ` Florian Fuchs
2026-10-21 18:11   ` John Paul Adrian Glaubitz [this message]
2026-10-22  7:01   ` Damien Le Moal
2026-10-22  9:17     ` Daniel Palmer
2026-10-22  9:33       ` Damien Le Moal
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
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
2026-10-19 14:07       ` yoshinori.sato
2026-10-21  8:52       ` John Paul Adrian Glaubitz
2026-10-21  1:05 ` Colton Pawielski
2026-10-21  9:01   ` Geert Uytterhoeven
2026-10-21 10:55   ` Daniel Palmer
2026-10-21 23:22     ` Colton Pawielski

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=f5dc8ecb3f7ed091a4deb6447bd9e7c2c801b847.camel@physik.fu-berlin.de \
    --to=glaubitz@physik.fu-berlin.de \
    --cc=cassel@kernel.org \
    --cc=dalias@libc.org \
    --cc=daniel@0x0f.com \
    --cc=dlemoal@kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=ysato@users.sourceforge.jp \
    /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

all inboxes | Powered by JetHome®