Skip to contentSkip to conversation

pata_artop: Use ioread8.

PATCH In review Yoshinori Sato 2 participants 3 messages Apr 14, 2016 – Apr 18, 2016 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pata_artop: Use ioread8.

Support for non x86 targets.

---
 drivers/ata/pata_artop.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
drivers/ata/pata_artop.c +13 -3
index 96c05c9..3731dea 100644
@@ -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;
 	}
 
Signature · 1 line
2.7.0
#1 lore raw

Hello,

Quoted 1 line · Yoshinori Sato

Support for non x86 targets.

Being a bit more detailed would be nice.

Quoted 10 lines
---
 drivers/ata/pata_artop.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
drivers/ata/pata_artop.c +0 -0
index 96c05c9..3731dea 100644

drivers/ata/pata_artop.c static void atp8xx_fixup(struct pci_dev *pdev) · line 343

Quoted 4 lines
drivers/ata/pata_artop.c +1 -0
@@ -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.

Signature · 1 line
tejun
#2 lore raw
Quoted 21 lines · Tejun Heo

Hello,

Quoted 1 line · Yoshinori Sato

Support for non x86 targets.

Being a bit more detailed would be nice.

Quoted 13 lines
---
 drivers/ata/pata_artop.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
drivers/ata/pata_artop.c +0 -0
index 96c05c9..3731dea 100644
@@ -340,6 +340,18 @@ static void atp8xx_fixup(struct pci_dev *pdev)
 	}
 }
 
Quoted 5 lines

drivers/ata/pata_artop.c static void atp8xx_fixup(struct pci_dev *pdev) · line 343

Quoted 1 line
drivers/ata/pata_artop.c +1 -0
+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.

Quoted 2 lines
Signature · 1 line
tejun
Signature · 2 lines
Yoshinori Sato
<[email protected]>