Re: pata-macio on PowerBook G3: stuck interrupt with MATSHITA CR-174 CD-ROM

2019-07-10 Thread Finn Thain
On Fri, 28 Jun 2019, Finn Thain wrote:

> Hi All,
> 
> I've received a bug report concerning the pata-macio driver, when running 
> on a PowerBook G3 (Wallstreet).
> 
> With CONFIG_PATA_MACIO=n && CONFIG_BLK_DEV_IDE_PMAC=y, everything works.
> 
> With CONFIG_PATA_MACIO=y && CONFIG_BLK_DEV_IDE_PMAC=n, the CD-ROM fails.
> 
> When the CD-ROM mediabay module is swapped for a DVD-ROM mediabay module, 
> everything works (either pata-macio or ide-pmac driver works fine).
> 
> I'm not familiar with ATA device drivers or the "Heathrow" chipset and its 
> ATA interfaces so any hints as to how to debug this would be appreciated.
> 
...
> 
> These logs are from v4.20 but the problem is the same in v5.2-rc2.
> 

In the linux-ide list archive I found the same bug reported in 2.6.33-rc2, 
shortly after the pata-macio driver was merged.

https://lore.kernel.org/linux-ide/19254.17766.674348.933...@pilspetsen.it.uu.se/

That report also involves a Matshita CD-ROM and a Heathrow controller 
(beige G3).

In that thread Ben suggested that the cause may be a firmware bug in the 
drive. Is there a quirk or other workaround for that kind of bug?

I tried removing the controller reset but there was no improvement...

diff --git a/drivers/ata/pata_macio.c b/drivers/ata/pata_macio.c
index 57f2ec71cfc3..b2fd5e20367f 100644
--- a/drivers/ata/pata_macio.c
+++ b/drivers/ata/pata_macio.c
@@ -1096,7 +1096,7 @@ static int pata_macio_common_init(struct pata_macio_priv 
*priv,
priv->host->ports[0]->private_data = priv;
 
/* hard-reset the controller */
-   pata_macio_reset_hw(priv, 0);
+// pata_macio_reset_hw(priv, 0);
pata_macio_apply_timings(priv->host->ports[0], 0);
 
/* Enable bus master if necessary */

-- 


pata-macio on PowerBook G3: stuck interrupt with MATSHITA CR-174 CD-ROM

2019-06-27 Thread Finn Thain
Hi All,

I've received a bug report concerning the pata-macio driver, when running 
on a PowerBook G3 (Wallstreet).

With CONFIG_PATA_MACIO=n && CONFIG_BLK_DEV_IDE_PMAC=y, everything works.

With CONFIG_PATA_MACIO=y && CONFIG_BLK_DEV_IDE_PMAC=n, the CD-ROM fails.

When the CD-ROM mediabay module is swapped for a DVD-ROM mediabay module, 
everything works (either pata-macio or ide-pmac driver works fine).

I'm not familiar with ATA device drivers or the "Heathrow" chipset and its 
ATA interfaces so any hints as to how to debug this would be appreciated.

Here's the log from the CONFIG_PATA_MACIO=y kernel with CD-ROM fitted:

[0.016446] printk: console [ttyS0] enabled
[0.064507] printk: bootconsole [udbg0] disabled
[0.119973] pid_max: default: 32768 minimum: 301
[0.175852] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[0.254862] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[0.343822] rcu: Hierarchical SRCU implementation.
[0.400629] smp: Bringing up secondary CPUs ...
[0.453605] smp: Brought up 1 node, 1 CPU
[0.501683] Using standard scheduler topology
[0.555151] devtmpfs: initialized
[0.594335] Duplicate name in PowerPC,750, renamed to "l2-cache#1"
[0.671377] Duplicate name in pci, renamed to "mac-io#1"
[0.734879] Duplicate name in pci, renamed to "pccard#1"
[0.798672] random: get_random_u32 called from bucket_table_alloc+0x90/0x1a4 
with crng_init=0
[0.900756] clocksource: jiffies: mask: 0x max_cycles: 0x, 
max_idle_ns: 1911260446275 ns
[1.018102] futex hash table entries: 512 (order: 2, 16384 bytes)
[1.091844] NET: Registered protocol family 16
[1.149658] PMU i2c /pci/mac-io/via-pmu
[1.194834]  channel 1 bus 
[1.237542]  channel 2 bus 
[1.283706] PCI: Probing PCI hardware
[1.326481] PCI host bridge to bus :00
[1.374850] pci_bus :00: root bus resource [io  0x-0x7f]
[1.45] pci_bus :00: root bus resource [mem 0xfd00-0xfdff] 
(bus address [0x-0x00ff])
[1.573579] pci_bus :00: root bus resource [mem 0x8000-0xfcff]
[1.656035] pci_bus :00: root bus resource [bus 00-ff]
[1.721896] pci_bus :00: busn_res: [bus 00-ff] end is updated to ff
[1.801465] pci :00:00.0: [1057:0002] type 00 class 0x06
[1.875076] pci :00:0d.0: [106b:0017] type 00 class 0xff
[1.945684] pci :00:0d.0: reg 0x10: [mem 0xf400-0xf407]
[2.021957] pci :00:10.0: [106b:0017] type 00 class 0xff
[2.093150] pci :00:10.0: reg 0x10: [mem 0xf300-0xf307]
[2.169344] pci :00:11.0: [1002:4c50] type 00 class 0x038000
[2.240603] pci :00:11.0: reg 0x10: [mem 0x8200-0x82ff]
[2.315852] pci :00:11.0: reg 0x14: [io  0x0400-0x04ff]
[2.382757] pci :00:11.0: reg 0x18: [mem 0x82fff000-0x82ff]
[2.458076] pci :00:11.0: reg 0x30: [mem 0xfd00-0xfd01 pref]
[2.538627] pci :00:11.0: supports D1 D2
[2.590881] pci :00:13.0: [104c:ac15] type 02 class 0x060700
[2.662054] pci :00:13.0: reg 0x10: [mem 0x81803000-0x81803fff]
[2.738090] pci :00:13.1: [104c:ac15] type 02 class 0x060700
[2.809506] pci :00:13.1: reg 0x10: [mem 0x81802000-0x81802fff]
[2.886775] pci_bus :01: extended config space not accessible
[2.958551] pci_bus :01: busn_res: [bus 01-ff] end is updated to 04
[3.037665] pci_bus :05: extended config space not accessible
[3.111056] pci_bus :05: busn_res: [bus 05-ff] end is updated to 08
[3.190143] pci_bus :00: busn_res: [bus 00-ff] end is updated to 08
[3.269804] PCI: Cannot allocate resource region 2 of device :00:11.0, 
will remap
[3.363779] PCI :00 Cannot reserve Legacy IO [io  0x-0x0fff]
[3.440211] pci :00:13.0: BAR 9: assigned [mem 0x8400-0x87ff 
pref]
[3.526840] pci :00:13.0: BAR 10: assigned [mem 0x8800-0x8bff]
[3.609575] pci :00:13.1: BAR 9: assigned [mem 0x8c00-0x8fff 
pref]
[3.696208] pci :00:13.1: BAR 10: assigned [mem 0x9000-0x93ff]
[3.778818] pci :00:11.0: BAR 6: assigned [mem 0xfd00-0xfd01 
pref]
[3.865615] pci :00:11.0: BAR 2: assigned [mem 0xfd02-0xfd020fff]
[3.947184] pci :00:13.0: BAR 7: assigned [io  0x1000-0x10ff]
[4.020382] pci :00:13.0: BAR 8: assigned [io  0x1100-0x11ff]
[4.093579] pci :00:13.1: BAR 7: assigned [io  0x1200-0x12ff]
[4.166780] pci :00:13.1: BAR 8: assigned [io  0x1300-0x13ff]
[4.239996] pci :00:13.0: CardBus bridge to [bus 01-04]
[4.306908] pci :00:13.0:   bridge window [io  0x1000-0x10ff]
[4.380112] pci :00:13.0:   bridge window [io  0x1100-0x11ff]
[4.453316] pci :00:13.0:   bridge window [mem 0x8400-0x87ff 
pref]
[4.540112] pci :00:13.0:   bridge window [mem 0x8800-0x8bff]
[4.621825] pci :00:13.1: CardBus bri