Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

PNP SMCf010 quirk: work around Toshiba Portege 4000 ACPI issues

When we enable the SMCf010 IR device, the Toshiba Portege 4000 BIOS claims
the device is working, but it really isn't configured correctly. The BIOS
*will* configure it, but only if we call _SRS after (1) reversing the order
of the SIR and FIR I/O port regions and (2) changing the IRQ from
active-high to active-low.

This patch addresses the 2.6.22 regression:
"no irda0 interface (2.6.21 was OK), smsc does not find chip"

I tested this on a Portege 4000. The smsc-ircc2 driver correctly detects
the device, and "irattach irda0 -s && irdadump" shows transmitted and
received packets.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Andrey Borzenkov <arvidjaar@mail.ru>
Cc: Samuel Ortiz <samuel@sortiz.org>
Cc: "Linus Walleij (LD/EAB)" <linus.walleij@ericsson.com>
Cc: Michal Piotrowski <michal.k.k.piotrowski@gmail.com>
Cc: Adam Belay <ambx1@neo.rr.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Bjorn Helgaas and committed by
Linus Torvalds
41a53114 d57d9731

+54 -9
+54 -9
drivers/pnp/quirks.c
··· 136 136 137 137 static void quirk_smc_enable(struct pnp_dev *dev) 138 138 { 139 - /* 140 - * If the BIOS left the device disabled, or it is enabled and 141 - * responding correctly, we're in good shape. 142 - */ 143 - if (!dev->active || quirk_smc_fir_enabled(dev)) 139 + struct resource fir, sir, irq; 140 + 141 + pnp_activate_dev(dev); 142 + if (quirk_smc_fir_enabled(dev)) 144 143 return; 145 144 146 145 /* ··· 151 152 * this. Fortunately, they do fix things up if we auto-configure 152 153 * the device using its _PRS and _SRS methods. 153 154 */ 154 - dev_err(&dev->dev, "%s device not responding, auto-configuring " 155 - "resources\n", dev->id->id); 155 + dev_err(&dev->dev, "%s not responding at SIR 0x%lx, FIR 0x%lx; " 156 + "auto-configuring\n", dev->id->id, 157 + (unsigned long) pnp_port_start(dev, 0), 158 + (unsigned long) pnp_port_start(dev, 1)); 156 159 157 160 pnp_disable_dev(dev); 158 161 pnp_init_resource_table(&dev->res); 159 162 pnp_auto_config_dev(dev); 160 163 pnp_activate_dev(dev); 164 + if (quirk_smc_fir_enabled(dev)) { 165 + dev_err(&dev->dev, "responds at SIR 0x%lx, FIR 0x%lx\n", 166 + (unsigned long) pnp_port_start(dev, 0), 167 + (unsigned long) pnp_port_start(dev, 1)); 168 + return; 169 + } 161 170 162 - if (!quirk_smc_fir_enabled(dev)) 163 - dev_err(&dev->dev, "giving up; try \"smsc-ircc2.nopnp\"\n"); 171 + /* 172 + * The Toshiba Portege 4000 _CRS reports the FIR region first, 173 + * followed by the SIR region. The BIOS will configure the bridge, 174 + * but only if we call _SRS with SIR first, then FIR. It also 175 + * reports the IRQ as active high, when it is really active low. 176 + */ 177 + dev_err(&dev->dev, "not responding at SIR 0x%lx, FIR 0x%lx; " 178 + "swapping SIR/FIR and reconfiguring\n", 179 + (unsigned long) pnp_port_start(dev, 0), 180 + (unsigned long) pnp_port_start(dev, 1)); 181 + 182 + /* 183 + * Clear IORESOURCE_AUTO so pnp_activate_dev() doesn't reassign 184 + * these resources any more. 185 + */ 186 + fir = dev->res.port_resource[0]; 187 + sir = dev->res.port_resource[1]; 188 + fir.flags &= ~IORESOURCE_AUTO; 189 + sir.flags &= ~IORESOURCE_AUTO; 190 + 191 + irq = dev->res.irq_resource[0]; 192 + irq.flags &= ~IORESOURCE_AUTO; 193 + irq.flags &= ~IORESOURCE_BITS; 194 + irq.flags |= IORESOURCE_IRQ_LOWEDGE; 195 + 196 + pnp_disable_dev(dev); 197 + dev->res.port_resource[0] = sir; 198 + dev->res.port_resource[1] = fir; 199 + dev->res.irq_resource[0] = irq; 200 + pnp_activate_dev(dev); 201 + 202 + if (quirk_smc_fir_enabled(dev)) { 203 + dev_err(&dev->dev, "responds at SIR 0x%lx, FIR 0x%lx\n", 204 + (unsigned long) pnp_port_start(dev, 0), 205 + (unsigned long) pnp_port_start(dev, 1)); 206 + return; 207 + } 208 + 209 + dev_err(&dev->dev, "giving up; try \"smsc-ircc2.nopnp\" and " 210 + "email bjorn.helgaas@hp.com\n"); 164 211 } 165 212 166 213