linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Borzenkov <arvidjaar@mail.ru>
To: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Samuel Ortiz <samuel@sortiz.org>,
	"Linus Walleij (LD/EAB)" <linus.walleij@ericsson.com>,
	linux-kernel@vger.kernel.org,
	Michal Piotrowski <michal.k.k.piotrowski@gmail.com>,
	ambx1@neo.rr.com, linux-pcmcia@lists.infradead.org
Subject: Re: 2.6.22-rc: regression: no irda0 interface (2.6.21 was OK), smsc does not find chip
Date: Sat, 30 Jun 2007 11:16:18 +0400	[thread overview]
Message-ID: <200706301116.19501.arvidjaar@mail.ru> (raw)
In-Reply-To: <200706292041.31291.bjorn.helgaas@hp.com>

[-- Attachment #1: Type: text/plain, Size: 6351 bytes --]

On Saturday 30 June 2007, Bjorn Helgaas wrote:
> [patch] 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 fixes the 2.6.22 regression:
>     "no irda0 interface (2.6.21 was OK), smsc does not find chip"
>

does not work, sorry.

[  958.107142] ACPI: bus type pnp registered
[  958.125652] pnp: Device 00:0a activated.
[  958.125710]  00:0a: SMCf010 not responding at SIR 0x2e800000100, FIR 
0x2e8def5a6d4; auto-configuring
[  958.127243] pnp: Device 00:0a disabled.
[  958.132808] pnp: Device 00:0a activated.
[  958.132837]  00:0a: not responding at SIR 0x2e800000100, FIR 
0xded782bc000002e8; swapping SIR/FIR and reconfiguring
[  958.134350] pnp: Device 00:0a disabled.
[  958.140926] pnp: Device 00:0a activated.
[  958.140954]  00:0a: responds at SIR 0x100000002e8, FIR 0xded782bc000002e8
[  958.148707] pnp: PnP ACPI: found 12 devices

and loading smsc_ircc2

[  524.423280] pnp: Device 00:0a activated.
[  524.426614] smsc_ircc_present(), addr 0x0100 - no device found!
[  524.426614] pnp: Device 00:0a disabled.

as already mentioned, port 100 cannot work:

0100-013f : pcmcia_socket0
{pts/1}% sudo 
cat /sys/class/pcmcia_socket/pcmcia_socket0/available_resources_io
0x00000100 - 0x000003af
0x000003e0 - 0x000004ff
0x00000820 - 0x000008ff
0x00000a00 - 0x00000aff
0x00000c00 - 0x00000cf7

additinally I get these warnings during compile (and output is bogus):

/home/bor/src/linux-git/drivers/pnp/quirks.c: In function ‘quirk_smc_enable’:
/home/bor/src/linux-git/drivers/pnp/quirks.c:154: warning: format ‘%llx’ 
expects type ‘long long unsigned int’, but argument 5 has 
type ‘resource_size_t’
/home/bor/src/linux-git/drivers/pnp/quirks.c:154: warning: format ‘%llx’ 
expects type ‘long long unsigned int’, but argument 6 has 
type ‘resource_size_t’
/home/bor/src/linux-git/drivers/pnp/quirks.c:163: warning: format ‘%llx’ 
expects type ‘long long unsigned int’, but argument 4 has 
type ‘resource_size_t’
/home/bor/src/linux-git/drivers/pnp/quirks.c:163: warning: format ‘%llx’ 
expects type ‘long long unsigned int’, but argument 5 has 
type ‘resource_size_t’
/home/bor/src/linux-git/drivers/pnp/quirks.c:174: warning: format ‘%llx’ 
expects type ‘long long unsigned int’, but argument 4 has 
type ‘resource_size_t’
/home/bor/src/linux-git/drivers/pnp/quirks.c:174: warning: format ‘%llx’ 
expects type ‘long long unsigned int’, but argument 5 has 
type ‘resource_size_t’
/home/bor/src/linux-git/drivers/pnp/quirks.c:199: warning: format ‘%llx’ 
expects type ‘long long unsigned int’, but argument 4 has 
type ‘resource_size_t’
/home/bor/src/linux-git/drivers/pnp/quirks.c:199: warning: format ‘%llx’ 
expects type ‘long long unsigned int’, but argument 5 has 
type ‘resource_size_t’       

-andrey

> 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>
>
> Index: w/drivers/pnp/quirks.c
> ===================================================================
> --- w.orig/drivers/pnp/quirks.c	2007-06-27 20:07:45.000000000 -0600
> +++ w/drivers/pnp/quirks.c	2007-06-29 19:28:02.000000000 -0600
> @@ -136,11 +136,10 @@
>
>  static void quirk_smc_enable(struct pnp_dev *dev)
>  {
> -	/*
> -	 * If the BIOS left the device disabled, or it is enabled and
> -	 * responding correctly, we're in good shape.
> -	 */
> -	if (!dev->active || quirk_smc_fir_enabled(dev))
> +	struct resource fir, sir, irq;
> +
> +	pnp_activate_dev(dev);
> +	if (quirk_smc_fir_enabled(dev))
>  		return;
>
>  	/*
> @@ -152,16 +151,58 @@
>  	 * this.  Fortunately, they do fix things up if we auto-configure
>  	 * the device using its _PRS and _SRS methods.
>  	 */
> -	dev_err(&dev->dev, "%s device not responding, auto-configuring "
> -		"resources\n", dev->id->id);
> +	dev_err(&dev->dev, "%s not responding at SIR 0x%llx, FIR 0x%llx; "
> +		"auto-configuring\n", dev->id->id,
> +		pnp_port_start(dev, 0), pnp_port_start(dev, 1));
>
>  	pnp_disable_dev(dev);
>  	pnp_init_resource_table(&dev->res);
>  	pnp_auto_config_dev(dev);
>  	pnp_activate_dev(dev);
> +	if (quirk_smc_fir_enabled(dev)) {
> +		dev_err(&dev->dev, "responds at SIR 0x%llx, FIR 0x%llx\n",
> +			pnp_port_start(dev, 0), pnp_port_start(dev, 1));
> +		return;
> +	}
> +
> +	/*
> +	 * The Toshiba Portege 4000 _CRS reports the FIR region first,
> +	 * followed by the SIR region.  The BIOS will configure the bridge,
> +	 * but only if we call _SRS with SIR first, then FIR.  It also
> +	 * reports the IRQ as active high, when it is really active low.
> +	 */
> +	dev_err(&dev->dev, "not responding at SIR 0x%llx, FIR 0x%llx; "
> +		"swapping SIR/FIR and reconfiguring\n",
> +		pnp_port_start(dev, 0), pnp_port_start(dev, 1));
> +
> +	/*
> +	 * Clear IORESOURCE_AUTO so pnp_activate_dev() doesn't reassign
> +	 * these resources any more.
> +	 */
> +	fir = dev->res.port_resource[0];
> +	sir = dev->res.port_resource[1];
> +	fir.flags &= ~IORESOURCE_AUTO;
> +	sir.flags &= ~IORESOURCE_AUTO;
> +
> +	irq = dev->res.irq_resource[0];
> +	irq.flags &= ~IORESOURCE_AUTO;
> +	irq.flags &= ~IORESOURCE_BITS;
> +	irq.flags |= IORESOURCE_IRQ_LOWEDGE;
> +
> +	pnp_disable_dev(dev);
> +	dev->res.port_resource[0] = sir;
> +	dev->res.port_resource[1] = fir;
> +	dev->res.irq_resource[0] = irq;
> +	pnp_activate_dev(dev);
> +
> +	if (quirk_smc_fir_enabled(dev)) {
> +		dev_err(&dev->dev, "responds at SIR 0x%llx, FIR 0x%llx\n",
> +			pnp_port_start(dev, 0), pnp_port_start(dev, 1));
> +		return;
> +	}
>
> -	if (!quirk_smc_fir_enabled(dev))
> -		dev_err(&dev->dev, "giving up; try \"smsc-ircc2.nopnp\"\n");
> +	dev_err(&dev->dev, "giving up; try \"smsc-ircc2.nopnp\" and "
> +		"email bjorn.helgaas@hp.com\n");
>  }



[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2007-06-30  7:16 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-03  8:00 2.6.22-rc: regression: no irda0 interface (2.6.21 was OK), smsc does not find chip Andrey Borzenkov
2007-06-03  8:16 ` Andrey Borzenkov
2007-06-03 23:10   ` Samuel Ortiz
2007-06-04  2:33     ` Andrey Borzenkov
2007-06-04 20:44       ` Samuel Ortiz
2007-06-05  3:10         ` Andrey Borzenkov
2007-06-05  7:18           ` Linus Walleij (LD/EAB)
2007-06-05  7:57             ` Samuel Ortiz
2007-06-05 11:57               ` Linus Walleij (LD/EAB)
2007-06-05 13:04                 ` Samuel Ortiz
2007-06-05 23:23                 ` Bjorn Helgaas
2007-06-06  3:29                   ` Andrey Borzenkov
2007-06-06 19:09                     ` Bjorn Helgaas
2007-06-06 20:45                       ` Andrey Borzenkov
2007-06-07 15:52                         ` Bjorn Helgaas
2007-06-07 20:47                           ` Samuel Ortiz
2007-06-10  6:47                             ` Andrey Borzenkov
2007-06-10 21:03                               ` Bjorn Helgaas
2007-06-11 14:04                                 ` Andrey Borzenkov
2007-06-14 21:30                                   ` Bjorn Helgaas
2007-06-15 13:44                                     ` Andrey Borzenkov
2007-06-15 15:19                                       ` Bjorn Helgaas
2007-06-16 16:38                                         ` Andrey Borzenkov
2007-06-19 23:31                                           ` Bjorn Helgaas
2007-06-28  3:56                                             ` Bjorn Helgaas
2007-06-30  2:41                                               ` Bjorn Helgaas
2007-06-30  7:16                                                 ` Andrey Borzenkov [this message]
2007-06-30 11:45                                                   ` Bjorn Helgaas
2007-06-30 14:47                                                     ` Andrey Borzenkov
2007-06-30 21:13                                                       ` Andrey Borzenkov
2007-07-01  3:30                                                         ` Bjorn Helgaas
2007-07-01  7:08                                                           ` Andrey Borzenkov
2007-07-01 13:57                                                             ` Bjorn Helgaas
2007-08-11 18:39                                                     ` Andrey Borzenkov
2007-08-13 16:09                                                       ` Bjorn Helgaas
2007-08-13 17:39                                                         ` Peter Stuge
2007-08-18  6:59                                                         ` Andrey Borzenkov
2007-07-01  0:01                                                 ` Michal Piotrowski
2007-07-01  0:04                                                   ` Michal Piotrowski
2007-06-07 18:34                         ` Bjorn Helgaas
2007-06-08  5:24                           ` Andrey Borzenkov
2007-06-10  8:03                           ` Andrey Borzenkov
2007-06-10 20:04                             ` Bjorn Helgaas
2007-06-07 12:23                   ` Linus Walleij (LD/EAB)
2007-06-07 15:44                     ` Bjorn Helgaas
2007-06-05 12:06         ` Linus Walleij (LD/EAB)
2007-06-04 16:34   ` Bjorn Helgaas
2007-06-05  3:08     ` Andrey Borzenkov

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=200706301116.19501.arvidjaar@mail.ru \
    --to=arvidjaar@mail.ru \
    --cc=akpm@linux-foundation.org \
    --cc=ambx1@neo.rr.com \
    --cc=bjorn.helgaas@hp.com \
    --cc=linus.walleij@ericsson.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pcmcia@lists.infradead.org \
    --cc=michal.k.k.piotrowski@gmail.com \
    --cc=samuel@sortiz.org \
    /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;
as well as URLs for NNTP newsgroup(s).