linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pata_artop: Use ioread8.
@ 2016-04-14  7:26 Yoshinori Sato
  2016-04-14 15:45 ` Tejun Heo
  0 siblings, 1 reply; 3+ messages in thread
From: Yoshinori Sato @ 2016-04-14  7:26 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz, Tejun Heo
  Cc: Yoshinori Sato, linux-ide, linux-kernel

Support for non x86 targets.

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
---
 drivers/ata/pata_artop.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/ata/pata_artop.c b/drivers/ata/pata_artop.c
index 96c05c9..3731dea 100644
--- a/drivers/ata/pata_artop.c
+++ b/drivers/ata/pata_artop.c
@@ -340,6 +340,18 @@ static void atp8xx_fixup(struct pci_dev *pdev)
 	}
 }
 
+static int is_fast(struct pci_dev *pdev)
+{
+	int ret = 0;
+	void __iomem *addr;
+
+	addr = pci_iomap(pdev, 4, 1);
+	if (ioread8(addr) & 0x10)
+		ret = 1;
+	pci_iounmap(pdev, addr);
+
+	return ret;
+}
 /**
  *	artop_init_one - Register ARTOP ATA PCI device with kernel services
  *	@pdev: PCI device to register
@@ -398,10 +410,8 @@ static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id)
 	else if (id->driver_data == 1)	/* 6260 */
 		ppi[0] = &info_626x;
 	else if (id->driver_data == 2)	{ /* 6280 or 6280 + fast */
-		unsigned long io = pci_resource_start(pdev, 4);
-
 		ppi[0] = &info_628x;
-		if (inb(io) & 0x10)
+		if (is_fast(pdev))
 			ppi[0] = &info_628x_fast;
 	}
 
-- 
2.7.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] pata_artop: Use ioread8.
  2016-04-14  7:26 [PATCH] pata_artop: Use ioread8 Yoshinori Sato
@ 2016-04-14 15:45 ` Tejun Heo
  2016-04-18  6:33   ` Yoshinori Sato
  0 siblings, 1 reply; 3+ messages in thread
From: Tejun Heo @ 2016-04-14 15:45 UTC (permalink / raw)
  To: Yoshinori Sato; +Cc: Bartlomiej Zolnierkiewicz, linux-ide, linux-kernel

Hello,

On Thu, Apr 14, 2016 at 04:26:03PM +0900, Yoshinori Sato wrote:
> Support for non x86 targets.

Being a bit more detailed would be nice.

> Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
> ---
>  drivers/ata/pata_artop.c | 16 +++++++++++++---
>  1 file changed, 13 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/ata/pata_artop.c b/drivers/ata/pata_artop.c
> index 96c05c9..3731dea 100644
> --- a/drivers/ata/pata_artop.c
> +++ b/drivers/ata/pata_artop.c
> @@ -340,6 +340,18 @@ static void atp8xx_fixup(struct pci_dev *pdev)
>  	}
>  }
>  
> +static int is_fast(struct pci_dev *pdev)

Can you please make the name a bit more descriptive?

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] pata_artop: Use ioread8.
  2016-04-14 15:45 ` Tejun Heo
@ 2016-04-18  6:33   ` Yoshinori Sato
  0 siblings, 0 replies; 3+ messages in thread
From: Yoshinori Sato @ 2016-04-18  6:33 UTC (permalink / raw)
  To: Tejun Heo; +Cc: Bartlomiej Zolnierkiewicz, linux-ide, linux-kernel

On Fri, 15 Apr 2016 00:45:17 +0900,
Tejun Heo wrote:
> 
> Hello,
> 
> On Thu, Apr 14, 2016 at 04:26:03PM +0900, Yoshinori Sato wrote:
> > Support for non x86 targets.
> 
> Being a bit more detailed would be nice.
> 
> > Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
> > ---
> >  drivers/ata/pata_artop.c | 16 +++++++++++++---
> >  1 file changed, 13 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/ata/pata_artop.c b/drivers/ata/pata_artop.c
> > index 96c05c9..3731dea 100644
> > --- a/drivers/ata/pata_artop.c
> > +++ b/drivers/ata/pata_artop.c
> > @@ -340,6 +340,18 @@ static void atp8xx_fixup(struct pci_dev *pdev)
> >  	}
> >  }
> >  
> > +static int is_fast(struct pci_dev *pdev)
> 
> Can you please make the name a bit more descriptive?
> 
> Thanks.

OK.
I tried SuperH and ATP-865 system.
This CPU maps PCI IO space in memory window.
An address translation is needed by this CPU.
But inb not address translation. So can't access register.

> -- 
> tejun

-- 
Yoshinori Sato
<ysato@users.sourceforge.jp>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-04-18  6:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-14  7:26 [PATCH] pata_artop: Use ioread8 Yoshinori Sato
2016-04-14 15:45 ` Tejun Heo
2016-04-18  6:33   ` Yoshinori Sato

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).