From linux at dominikbrodowski.net  Mon Mar  1 11:55:05 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 1 Mar 2010 17:55:05 +0100
Subject: [PATCH kernel 2.6.33] pd6729: remove irq_list parameter
In-Reply-To: <20100228153933.f6fe6f81.komurojun-mbn@nifty.com>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<1257971899-9274-9-git-send-email-linux@dominikbrodowski.net>
	<20091213212556.03d83e1f.komurojun-mbn@nifty.com>
	<20100228153933.f6fe6f81.komurojun-mbn@nifty.com>
Message-ID: <20100301165505.GA26368@comet.dominikbrodowski.net>

Hey,

On Sun, Feb 28, 2010 at 03:39:33PM +0900, Komuro wrote:
> pd6729: 
>  remove irq_list parameter.
>  it should be set by /etc/pcmcia/config.opts.
> 
> 
> Signed-off-by: Komuro <komurojun-mbn at nifty.com>

Applied, thanks.

Best,
	Dominik


From manuel.lauss at googlemail.com  Mon Mar  1 11:58:38 2010
From: manuel.lauss at googlemail.com (Manuel Lauss)
Date: Mon,  1 Mar 2010 17:58:38 +0100
Subject: [PATCH] pcmcia: alchemy: fixup wrong comments
Message-ID: <1267462718-17383-1-git-send-email-manuel.lauss@gmail.com>

Commit 11b897cf84c37e6522db914793677e933ef311fb  changed expected
pcmcia area addresses from the 32bit pseudo to the real 36bit
addresses, but did not update the comments.
---
Applies to current linus-git.

 drivers/pcmcia/db1xxx_ss.c  |   19 ++++---------------
 drivers/pcmcia/xxs1500_ss.c |   16 +++-------------
 2 files changed, 7 insertions(+), 28 deletions(-)

diff --git a/drivers/pcmcia/db1xxx_ss.c b/drivers/pcmcia/db1xxx_ss.c
index 3889cf0..9254ab0 100644
--- a/drivers/pcmcia/db1xxx_ss.c
+++ b/drivers/pcmcia/db1xxx_ss.c
@@ -42,7 +42,6 @@ struct db1x_pcmcia_sock {
 	int		nr;		/* socket number */
 	void		*virt_io;
 
-	/* the "pseudo" addresses of the PCMCIA space. */
 	phys_addr_t	phys_io;
 	phys_addr_t	phys_attr;
 	phys_addr_t	phys_mem;
@@ -437,7 +436,7 @@ static int __devinit db1x_pcmcia_socket_probe(struct platform_device *pdev)
 	 * This includes IRQs for Carddetection/ejection, the card
 	 *  itself and optional status change detection.
 	 * Also, the memory areas covered by a socket.  For these
-	 *  we require the 32bit "pseudo" addresses (see the au1000.h
+	 *  we require the real 36bit addresses (see the au1000.h
 	 *  header for more information).
 	 */
 
@@ -459,11 +458,7 @@ static int __devinit db1x_pcmcia_socket_probe(struct platform_device *pdev)
 
 	ret = -ENODEV;
 
-	/*
-	 * pseudo-attr:  The 32bit address of the PCMCIA attribute space
-	 * for this socket (usually the 36bit address shifted 4 to the
-	 * right).
-	 */
+	/* 36bit PCMCIA Attribute area address */
 	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-attr");
 	if (!r) {
 		printk(KERN_ERR "pcmcia%d has no 'pseudo-attr' resource!\n",
@@ -472,10 +467,7 @@ static int __devinit db1x_pcmcia_socket_probe(struct platform_device *pdev)
 	}
 	sock->phys_attr = r->start;
 
-	/*
-	 * pseudo-mem:  The 32bit address of the PCMCIA memory space for
-	 * this socket (usually the 36bit address shifted 4 to the right)
-	 */
+	/* 36bit PCMCIA Memory area address */
 	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-mem");
 	if (!r) {
 		printk(KERN_ERR "pcmcia%d has no 'pseudo-mem' resource!\n",
@@ -484,10 +476,7 @@ static int __devinit db1x_pcmcia_socket_probe(struct platform_device *pdev)
 	}
 	sock->phys_mem = r->start;
 
-	/*
-	 * pseudo-io:  The 32bit address of the PCMCIA IO space for this
-	 * socket (usually the 36bit address shifted 4 to the right).
-	 */
+	/* 36bit PCMCIA IO area address */
 	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-io");
 	if (!r) {
 		printk(KERN_ERR "pcmcia%d has no 'pseudo-io' resource!\n",
diff --git a/drivers/pcmcia/xxs1500_ss.c b/drivers/pcmcia/xxs1500_ss.c
index 61560cd..f9009d3 100644
--- a/drivers/pcmcia/xxs1500_ss.c
+++ b/drivers/pcmcia/xxs1500_ss.c
@@ -218,11 +218,7 @@ static int __devinit xxs1500_pcmcia_probe(struct platform_device *pdev)
 
 	ret = -ENODEV;
 
-	/*
-	 * pseudo-attr:  The 32bit address of the PCMCIA attribute space
-	 * for this socket (usually the 36bit address shifted 4 to the
-	 * right).
-	 */
+	/* 36bit PCMCIA Attribute area address */
 	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-attr");
 	if (!r) {
 		dev_err(&pdev->dev, "missing 'pcmcia-attr' resource!\n");
@@ -230,10 +226,7 @@ static int __devinit xxs1500_pcmcia_probe(struct platform_device *pdev)
 	}
 	sock->phys_attr = r->start;
 
-	/*
-	 * pseudo-mem:  The 32bit address of the PCMCIA memory space for
-	 * this socket (usually the 36bit address shifted 4 to the right)
-	 */
+	/* 36bit PCMCIA Memory area address */
 	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-mem");
 	if (!r) {
 		dev_err(&pdev->dev, "missing 'pcmcia-mem' resource!\n");
@@ -241,10 +234,7 @@ static int __devinit xxs1500_pcmcia_probe(struct platform_device *pdev)
 	}
 	sock->phys_mem = r->start;
 
-	/*
-	 * pseudo-io:  The 32bit address of the PCMCIA IO space for this
-	 * socket (usually the 36bit address shifted 4 to the right).
-	 */
+	/* 36bit PCMCIA IO area address */
 	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-io");
 	if (!r) {
 		dev_err(&pdev->dev, "missing 'pcmcia-io' resource!\n");
-- 
1.7.0



From linux at dominikbrodowski.net  Mon Mar  1 14:39:17 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 1 Mar 2010 20:39:17 +0100
Subject: [PATCH] pcmcia: alchemy: fixup wrong comments
In-Reply-To: <1267462718-17383-1-git-send-email-manuel.lauss@gmail.com>
References: <1267462718-17383-1-git-send-email-manuel.lauss@gmail.com>
Message-ID: <20100301193917.GA28486@comet.dominikbrodowski.net>

Hey Manuel,

On Mon, Mar 01, 2010 at 05:58:38PM +0100, Manuel Lauss wrote:
> Commit 11b897cf84c37e6522db914793677e933ef311fb  changed expected
> pcmcia area addresses from the 32bit pseudo to the real 36bit
> addresses, but did not update the comments.

thanks for the patch. Could you add your Signed-off-by (as per
Documentation/SubmittingPatches), please?

Thanks
	Dominik


From manuel.lauss at googlemail.com  Mon Mar  1 15:40:56 2010
From: manuel.lauss at googlemail.com (Manuel Lauss)
Date: Mon,  1 Mar 2010 21:40:56 +0100
Subject: [PATCH resend] pcmcia: alchemy: fixup wrong comments
Message-ID: <1267476056-28668-1-git-send-email-manuel.lauss@gmail.com>

Commit 11b897cf84c37e6522db914793677e933ef311fb  changed expected
pcmcia area addresses from the 32bit pseudo to the real 36bit
addresses, but did not update the comments.

Signed-off-by: Manuel Lauss <manuel.lauss at gmail.com>
---
Applies to current linus-git.
This time with s-o-b.

 drivers/pcmcia/db1xxx_ss.c  |   19 ++++---------------
 drivers/pcmcia/xxs1500_ss.c |   16 +++-------------
 2 files changed, 7 insertions(+), 28 deletions(-)

diff --git a/drivers/pcmcia/db1xxx_ss.c b/drivers/pcmcia/db1xxx_ss.c
index 3889cf0..9254ab0 100644
--- a/drivers/pcmcia/db1xxx_ss.c
+++ b/drivers/pcmcia/db1xxx_ss.c
@@ -42,7 +42,6 @@ struct db1x_pcmcia_sock {
 	int		nr;		/* socket number */
 	void		*virt_io;
 
-	/* the "pseudo" addresses of the PCMCIA space. */
 	phys_addr_t	phys_io;
 	phys_addr_t	phys_attr;
 	phys_addr_t	phys_mem;
@@ -437,7 +436,7 @@ static int __devinit db1x_pcmcia_socket_probe(struct platform_device *pdev)
 	 * This includes IRQs for Carddetection/ejection, the card
 	 *  itself and optional status change detection.
 	 * Also, the memory areas covered by a socket.  For these
-	 *  we require the 32bit "pseudo" addresses (see the au1000.h
+	 *  we require the real 36bit addresses (see the au1000.h
 	 *  header for more information).
 	 */
 
@@ -459,11 +458,7 @@ static int __devinit db1x_pcmcia_socket_probe(struct platform_device *pdev)
 
 	ret = -ENODEV;
 
-	/*
-	 * pseudo-attr:  The 32bit address of the PCMCIA attribute space
-	 * for this socket (usually the 36bit address shifted 4 to the
-	 * right).
-	 */
+	/* 36bit PCMCIA Attribute area address */
 	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-attr");
 	if (!r) {
 		printk(KERN_ERR "pcmcia%d has no 'pseudo-attr' resource!\n",
@@ -472,10 +467,7 @@ static int __devinit db1x_pcmcia_socket_probe(struct platform_device *pdev)
 	}
 	sock->phys_attr = r->start;
 
-	/*
-	 * pseudo-mem:  The 32bit address of the PCMCIA memory space for
-	 * this socket (usually the 36bit address shifted 4 to the right)
-	 */
+	/* 36bit PCMCIA Memory area address */
 	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-mem");
 	if (!r) {
 		printk(KERN_ERR "pcmcia%d has no 'pseudo-mem' resource!\n",
@@ -484,10 +476,7 @@ static int __devinit db1x_pcmcia_socket_probe(struct platform_device *pdev)
 	}
 	sock->phys_mem = r->start;
 
-	/*
-	 * pseudo-io:  The 32bit address of the PCMCIA IO space for this
-	 * socket (usually the 36bit address shifted 4 to the right).
-	 */
+	/* 36bit PCMCIA IO area address */
 	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-io");
 	if (!r) {
 		printk(KERN_ERR "pcmcia%d has no 'pseudo-io' resource!\n",
diff --git a/drivers/pcmcia/xxs1500_ss.c b/drivers/pcmcia/xxs1500_ss.c
index 61560cd..f9009d3 100644
--- a/drivers/pcmcia/xxs1500_ss.c
+++ b/drivers/pcmcia/xxs1500_ss.c
@@ -218,11 +218,7 @@ static int __devinit xxs1500_pcmcia_probe(struct platform_device *pdev)
 
 	ret = -ENODEV;
 
-	/*
-	 * pseudo-attr:  The 32bit address of the PCMCIA attribute space
-	 * for this socket (usually the 36bit address shifted 4 to the
-	 * right).
-	 */
+	/* 36bit PCMCIA Attribute area address */
 	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-attr");
 	if (!r) {
 		dev_err(&pdev->dev, "missing 'pcmcia-attr' resource!\n");
@@ -230,10 +226,7 @@ static int __devinit xxs1500_pcmcia_probe(struct platform_device *pdev)
 	}
 	sock->phys_attr = r->start;
 
-	/*
-	 * pseudo-mem:  The 32bit address of the PCMCIA memory space for
-	 * this socket (usually the 36bit address shifted 4 to the right)
-	 */
+	/* 36bit PCMCIA Memory area address */
 	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-mem");
 	if (!r) {
 		dev_err(&pdev->dev, "missing 'pcmcia-mem' resource!\n");
@@ -241,10 +234,7 @@ static int __devinit xxs1500_pcmcia_probe(struct platform_device *pdev)
 	}
 	sock->phys_mem = r->start;
 
-	/*
-	 * pseudo-io:  The 32bit address of the PCMCIA IO space for this
-	 * socket (usually the 36bit address shifted 4 to the right).
-	 */
+	/* 36bit PCMCIA IO area address */
 	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-io");
 	if (!r) {
 		dev_err(&pdev->dev, "missing 'pcmcia-io' resource!\n");
-- 
1.7.0



From linux at dominikbrodowski.net  Mon Mar  1 16:05:30 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 1 Mar 2010 22:05:30 +0100
Subject: [PATCH resend] pcmcia: alchemy: fixup wrong comments
In-Reply-To: <1267476056-28668-1-git-send-email-manuel.lauss@gmail.com>
References: <1267476056-28668-1-git-send-email-manuel.lauss@gmail.com>
Message-ID: <20100301210530.GA31849@comet.dominikbrodowski.net>

Applied, thanks.

On Mon, Mar 01, 2010 at 09:40:56PM +0100, Manuel Lauss wrote:
> Commit 11b897cf84c37e6522db914793677e933ef311fb  changed expected
> pcmcia area addresses from the 32bit pseudo to the real 36bit
> addresses, but did not update the comments.
> 
> Signed-off-by: Manuel Lauss <manuel.lauss at gmail.com>
> ---
> Applies to current linus-git.
> This time with s-o-b.
> 
>  drivers/pcmcia/db1xxx_ss.c  |   19 ++++---------------
>  drivers/pcmcia/xxs1500_ss.c |   16 +++-------------
>  2 files changed, 7 insertions(+), 28 deletions(-)
> 
> diff --git a/drivers/pcmcia/db1xxx_ss.c b/drivers/pcmcia/db1xxx_ss.c
> index 3889cf0..9254ab0 100644
> --- a/drivers/pcmcia/db1xxx_ss.c
> +++ b/drivers/pcmcia/db1xxx_ss.c
> @@ -42,7 +42,6 @@ struct db1x_pcmcia_sock {
>  	int		nr;		/* socket number */
>  	void		*virt_io;
>  
> -	/* the "pseudo" addresses of the PCMCIA space. */
>  	phys_addr_t	phys_io;
>  	phys_addr_t	phys_attr;
>  	phys_addr_t	phys_mem;
> @@ -437,7 +436,7 @@ static int __devinit db1x_pcmcia_socket_probe(struct platform_device *pdev)
>  	 * This includes IRQs for Carddetection/ejection, the card
>  	 *  itself and optional status change detection.
>  	 * Also, the memory areas covered by a socket.  For these
> -	 *  we require the 32bit "pseudo" addresses (see the au1000.h
> +	 *  we require the real 36bit addresses (see the au1000.h
>  	 *  header for more information).
>  	 */
>  
> @@ -459,11 +458,7 @@ static int __devinit db1x_pcmcia_socket_probe(struct platform_device *pdev)
>  
>  	ret = -ENODEV;
>  
> -	/*
> -	 * pseudo-attr:  The 32bit address of the PCMCIA attribute space
> -	 * for this socket (usually the 36bit address shifted 4 to the
> -	 * right).
> -	 */
> +	/* 36bit PCMCIA Attribute area address */
>  	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-attr");
>  	if (!r) {
>  		printk(KERN_ERR "pcmcia%d has no 'pseudo-attr' resource!\n",
> @@ -472,10 +467,7 @@ static int __devinit db1x_pcmcia_socket_probe(struct platform_device *pdev)
>  	}
>  	sock->phys_attr = r->start;
>  
> -	/*
> -	 * pseudo-mem:  The 32bit address of the PCMCIA memory space for
> -	 * this socket (usually the 36bit address shifted 4 to the right)
> -	 */
> +	/* 36bit PCMCIA Memory area address */
>  	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-mem");
>  	if (!r) {
>  		printk(KERN_ERR "pcmcia%d has no 'pseudo-mem' resource!\n",
> @@ -484,10 +476,7 @@ static int __devinit db1x_pcmcia_socket_probe(struct platform_device *pdev)
>  	}
>  	sock->phys_mem = r->start;
>  
> -	/*
> -	 * pseudo-io:  The 32bit address of the PCMCIA IO space for this
> -	 * socket (usually the 36bit address shifted 4 to the right).
> -	 */
> +	/* 36bit PCMCIA IO area address */
>  	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-io");
>  	if (!r) {
>  		printk(KERN_ERR "pcmcia%d has no 'pseudo-io' resource!\n",
> diff --git a/drivers/pcmcia/xxs1500_ss.c b/drivers/pcmcia/xxs1500_ss.c
> index 61560cd..f9009d3 100644
> --- a/drivers/pcmcia/xxs1500_ss.c
> +++ b/drivers/pcmcia/xxs1500_ss.c
> @@ -218,11 +218,7 @@ static int __devinit xxs1500_pcmcia_probe(struct platform_device *pdev)
>  
>  	ret = -ENODEV;
>  
> -	/*
> -	 * pseudo-attr:  The 32bit address of the PCMCIA attribute space
> -	 * for this socket (usually the 36bit address shifted 4 to the
> -	 * right).
> -	 */
> +	/* 36bit PCMCIA Attribute area address */
>  	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-attr");
>  	if (!r) {
>  		dev_err(&pdev->dev, "missing 'pcmcia-attr' resource!\n");
> @@ -230,10 +226,7 @@ static int __devinit xxs1500_pcmcia_probe(struct platform_device *pdev)
>  	}
>  	sock->phys_attr = r->start;
>  
> -	/*
> -	 * pseudo-mem:  The 32bit address of the PCMCIA memory space for
> -	 * this socket (usually the 36bit address shifted 4 to the right)
> -	 */
> +	/* 36bit PCMCIA Memory area address */
>  	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-mem");
>  	if (!r) {
>  		dev_err(&pdev->dev, "missing 'pcmcia-mem' resource!\n");
> @@ -241,10 +234,7 @@ static int __devinit xxs1500_pcmcia_probe(struct platform_device *pdev)
>  	}
>  	sock->phys_mem = r->start;
>  
> -	/*
> -	 * pseudo-io:  The 32bit address of the PCMCIA IO space for this
> -	 * socket (usually the 36bit address shifted 4 to the right).
> -	 */
> +	/* 36bit PCMCIA IO area address */
>  	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-io");
>  	if (!r) {
>  		dev_err(&pdev->dev, "missing 'pcmcia-io' resource!\n");
> -- 
> 1.7.0
> 
> 
> _______________________________________________
> Linux PCMCIA reimplementation list
> http://lists.infradead.org/mailman/listinfo/linux-pcmcia


From linux at dominikbrodowski.net  Wed Mar  3 02:59:44 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Wed, 3 Mar 2010 08:59:44 +0100
Subject: [git pull] more PCMCIA updates for 2.6.34 (including ioctl
	deprecation)
Message-ID: <20100303075944.GA23354@comet.dominikbrodowski.net>

Linus,

a few more PCMCIA patches for 2.6.34 are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git master

The diffstat and list of changes is below, the individual diffs are sent
(at least) to the linux-pcmcia list. This patchset includes one
controversial patch, titled:

      pcmcia: disable pcmcia ioctl for !ARM, prepare for removal

Most notably, Russell King objects to it for reasons spelled out e.g. at
http://lkml.org/lkml/2008/2/27/291 . I suspect the platform he is referring
to actually does work with the PCMCIA ioctl disabled; Russell's offer from
2008 to

   "spend some time [...] working out what it requires from the ioctl
   interface - maybe we can have a cut-down ioctl interface that bolts straight
   on as an "add on" to the new controls without being too invasive, while
   still allowing its PCMCIA bits to work."
   (http://lists.infradead.org/pipermail/linux-pcmcia/2008-April/005450.html)

hasn't lead to any result so far; he has indicated he won't get to spending
time on it soon. Because of the lack of progress in this regard, and for the
other reasons spelled out in the patch, I picked up Alan's suggestion to

   "[...] push[ing] it. If it matters someone will then fix up the problem
   platform. If it isn't pushed then it lets one obscure platform stall
   progress for everyone else."
  (http://lists.infradead.org/pipermail/linux-pcmcia/2008-April/005453.html)

Please pull from that location insofar as you agree to continue with the
deprecation of the PCMCIA ioctl. Otherwise, I can prepare a branch
_without_ this controversial patch to pull from.

Thanks,
        Dominik


Dominik Brodowski (2):
      pcmcia: CodingStyle fixes
      pcmcia: disable pcmcia ioctl for !ARM, prepare for removal

Komuro (1):
      pcmcia: remove irq_list parameter from pd6729

Manuel Lauss (1):
      pcmcia: alchemy: fixup wrong comments

Michal Pecio (1):
      yenta_socket: ENE CB712 CardBus bridge needs special treatment with Echo Audio Indigo soundcards

 Documentation/feature-removal-schedule.txt |   12 +-
 drivers/pcmcia/Kconfig                     |   14 +-
 drivers/pcmcia/cardbus.c                   |    2 +-
 drivers/pcmcia/cistpl.c                    | 1908 ++++++++++++++--------------
 drivers/pcmcia/db1xxx_ss.c                 |   19 +-
 drivers/pcmcia/pd6729.c                    |   18 +-
 drivers/pcmcia/rsrc_mgr.c                  |    3 +-
 drivers/pcmcia/xxs1500_ss.c                |   16 +-
 drivers/pcmcia/yenta_socket.c              |    8 +-
 9 files changed, 973 insertions(+), 1027 deletions(-)


From linux at dominikbrodowski.net  Wed Mar  3 03:00:48 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Wed,  3 Mar 2010 09:00:48 +0100
Subject: [PATCH 5/5] pcmcia: disable pcmcia ioctl for !ARM, prepare for removal
In-Reply-To: <20100303075944.GA23354@comet.dominikbrodowski.net>
References: <20100303075944.GA23354@comet.dominikbrodowski.net>
Message-ID: <1267603248-23866-5-git-send-email-linux@dominikbrodowski.net>

The PCMCIA ioctl -- deprecated for years -- suffers from insufficient
locking. As it already has been deprecated for years, with its removal
long overdue, limit it to !SMP and !PREEMPT.

Furthermore, the last legitimate use of the ioctl to be reported
relates to the ARM architecture in 2008.[1] Attempts to resolve
this issue turned out unsuccessful so far.[2] Other usages have only
been reported as hear-say. If there are any legitiate and necessary
use-cases remaining, please speak out before the end of the grace
period until 2.6.3{5,6}(-rc1).

[1] http://lists.infradead.org/pipermail/linux-pcmcia/2008-April/005440.html
    see also: http://lkml.org/lkml/2008/2/27/291
[2] http://lists.infradead.org/pipermail/linux-pcmcia/2008-April/005450.html
    http://lists.infradead.org/pipermail/linux-pcmcia/2010-January/006740.html
    see also: http://lists.infradead.org/pipermail/linux-pcmcia/2008-April/005453.html

CC: Russell King <rmk+kernel at arm.linux.org.uk>
CC: Alan Cox <alan at lxorguk.ukuu.org.uk>
CC: Robert P. J. Day <rpjday at crashcourse.ca>
CC: Jaswinder Singh Rajput <jaswinder at kernel.org>
CC: linux-kernel at vger.kernel.org
Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 Documentation/feature-removal-schedule.txt |   12 +++++++++---
 drivers/pcmcia/Kconfig                     |   14 ++++++++++----
 2 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
index 732b1fa..3e57a75 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -138,19 +138,25 @@ Who:	Mauro Carvalho Chehab <mchehab at infradead.org>
 ---------------------------
 
 What:	PCMCIA control ioctl (needed for pcmcia-cs [cardmgr, cardctl])
-When:	November 2005
+When:	2.6.35/2.6.36
 Files:	drivers/pcmcia/: pcmcia_ioctl.c
 Why:	With the 16-bit PCMCIA subsystem now behaving (almost) like a
 	normal hotpluggable bus, and with it using the default kernel
 	infrastructure (hotplug, driver core, sysfs) keeping the PCMCIA
 	control ioctl needed by cardmgr and cardctl from pcmcia-cs is
-	unnecessary, and makes further cleanups and integration of the
+	unnecessary and potentially harmful (it does not provide for
+	proper locking), and makes further cleanups and integration of the
 	PCMCIA subsystem into the Linux kernel device driver model more
 	difficult. The features provided by cardmgr and cardctl are either
 	handled by the kernel itself now or are available in the new
 	pcmciautils package available at
 	http://kernel.org/pub/linux/utils/kernel/pcmcia/
-Who:	Dominik Brodowski <linux at brodo.de>
+
+	For all architectures except ARM, the associated config symbol
+	has been removed from kernel 2.6.34; for ARM, it will be likely
+	be removed from kernel 2.6.35. The actual code will then likely
+	be removed from kernel 2.6.36.
+Who:	Dominik Brodowski <linux at dominikbrodowski.net>
 
 ---------------------------
 
diff --git a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig
index 0a6601c..d189e47 100644
--- a/drivers/pcmcia/Kconfig
+++ b/drivers/pcmcia/Kconfig
@@ -51,17 +51,23 @@ config PCMCIA_LOAD_CIS
 
 config PCMCIA_IOCTL
 	bool "PCMCIA control ioctl (obsolete)"
-	depends on PCMCIA
+	depends on PCMCIA && ARM && !SMP && !PREEMPT
 	default y
 	help
 	  If you say Y here, the deprecated ioctl interface to the PCMCIA
-	  subsystem will be built. It is needed by cardmgr and cardctl
-	  (pcmcia-cs) to function properly.
+	  subsystem will be built. It is needed by the deprecated pcmcia-cs
+	  tools (cardmgr, cardctl) to function properly.
 
 	  You should use the new pcmciautils package instead (see
 	  <file:Documentation/Changes> for location and details).
 
-	  If unsure, say Y.
+	  This config option will most likely be removed from kernel 2.6.35,
+	  the associated code from kernel 2.6.36.
+
+	  As the PCMCIA ioctl is not locking safe, it depends on !SMP and
+	  !PREEMPT.
+
+	  If unsure, say N.
 
 config CARDBUS
 	bool "32-bit CardBus support"
-- 
1.6.3.3



From linux at dominikbrodowski.net  Wed Mar  3 03:00:44 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Wed,  3 Mar 2010 09:00:44 +0100
Subject: [PATCH 1/5] yenta_socket: ENE CB712 CardBus bridge needs special
	treatment with Echo Audio Indigo soundcards
In-Reply-To: <20100303075944.GA23354@comet.dominikbrodowski.net>
References: <20100303075944.GA23354@comet.dominikbrodowski.net>
Message-ID: <1267603248-23866-1-git-send-email-linux@dominikbrodowski.net>

From: Michal Pecio <michal.pecio at gmail.com>

Indigos are well known for distortions when running on some buggy ENE
controllers.  There is a workaround in the yenta driver, but for some
reason it isn't activated on CB712.  However, I own a laptop with such
chip and it seems that it also is affected - I can clearly hear occasional
cracks, especially under heavy network load, and in Windows XP the card is
completely unusable.

This simple change fixed things for me.

Addresses http://bugzilla.kernel.org/show_bug.cgi?id=15191

[linux at dominikbrodowski.net: extend it to the other ENE bridges]
Signed-off-by: Michal Pecio <michal.pecio at gmail.com>
Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 drivers/pcmcia/yenta_socket.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
index b85375f..967c766 100644
--- a/drivers/pcmcia/yenta_socket.c
+++ b/drivers/pcmcia/yenta_socket.c
@@ -1408,10 +1408,10 @@ static struct pci_device_id yenta_table[] = {
 	CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_7510, TI12XX),
 	CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_7610, TI12XX),
 
-	CB_ID(PCI_VENDOR_ID_ENE, PCI_DEVICE_ID_ENE_710, TI12XX),
-	CB_ID(PCI_VENDOR_ID_ENE, PCI_DEVICE_ID_ENE_712, TI12XX),
-	CB_ID(PCI_VENDOR_ID_ENE, PCI_DEVICE_ID_ENE_720, TI12XX),
-	CB_ID(PCI_VENDOR_ID_ENE, PCI_DEVICE_ID_ENE_722, TI12XX),
+	CB_ID(PCI_VENDOR_ID_ENE, PCI_DEVICE_ID_ENE_710, ENE),
+	CB_ID(PCI_VENDOR_ID_ENE, PCI_DEVICE_ID_ENE_712, ENE),
+	CB_ID(PCI_VENDOR_ID_ENE, PCI_DEVICE_ID_ENE_720, ENE),
+	CB_ID(PCI_VENDOR_ID_ENE, PCI_DEVICE_ID_ENE_722, ENE),
 	CB_ID(PCI_VENDOR_ID_ENE, PCI_DEVICE_ID_ENE_1211, ENE),
 	CB_ID(PCI_VENDOR_ID_ENE, PCI_DEVICE_ID_ENE_1225, ENE),
 	CB_ID(PCI_VENDOR_ID_ENE, PCI_DEVICE_ID_ENE_1410, ENE),
-- 
1.6.3.3



From linux at dominikbrodowski.net  Wed Mar  3 03:00:45 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Wed,  3 Mar 2010 09:00:45 +0100
Subject: [PATCH 2/5] pcmcia: remove irq_list parameter from pd6729
In-Reply-To: <20100303075944.GA23354@comet.dominikbrodowski.net>
References: <20100303075944.GA23354@comet.dominikbrodowski.net>
Message-ID: <1267603248-23866-2-git-send-email-linux@dominikbrodowski.net>

From: Komuro <komurojun-mbn at nifty.com>

Remoe the irq_list parameter from pd6729, as it can and should be set
via sysfs (and -- if available -- pcmciautils, which reads the information
from /etc/pcmcia/config.opts )

[linux at dominikbrodowski.net: updated commit message]
Signed-off-by: Komuro <komurojun-mbn at nifty.com>
Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 drivers/pcmcia/pd6729.c |   18 +-----------------
 1 files changed, 1 insertions(+), 17 deletions(-)

diff --git a/drivers/pcmcia/pd6729.c b/drivers/pcmcia/pd6729.c
index e1741cd..7c20491 100644
--- a/drivers/pcmcia/pd6729.c
+++ b/drivers/pcmcia/pd6729.c
@@ -48,23 +48,13 @@ MODULE_AUTHOR("Jun Komuro <komurojun-mbn at nifty.com>");
  *     Specifies the interrupt delivery mode.  The default (1) is to use PCI
  *     interrupts; a value of 0 selects ISA interrupts. This must be set for
  *     correct operation of PCI card readers.
- *
- *  irq_list=i,j,...
- *     This list limits the set of interrupts that can be used by PCMCIA
- *     cards.
- *     The default list is 3,4,5,7,9,10,11.
- *     (irq_list parameter is not used, if irq_mode = 1)
  */
 
 static int irq_mode = 1; /* 0 = ISA interrupt, 1 = PCI interrupt */
-static int irq_list[16];
-static unsigned int irq_list_count = 0;
 
 module_param(irq_mode, int, 0444);
-module_param_array(irq_list, int, &irq_list_count, 0444);
 MODULE_PARM_DESC(irq_mode,
 		"interrupt delivery mode. 0 = ISA, 1 = PCI. default is 1");
-MODULE_PARM_DESC(irq_list, "interrupts that can be used by PCMCIA cards");
 
 static DEFINE_SPINLOCK(port_lock);
 
@@ -605,13 +595,7 @@ static u_int __devinit pd6729_isa_scan(void)
 		return 0;
 	}
 
-	if (irq_list_count == 0)
-		mask0 = 0xffff;
-	else
-		for (i = mask0 = 0; i < irq_list_count; i++)
-			mask0 |= (1<<irq_list[i]);
-
-	mask0 &= PD67_MASK;
+	mask0 = PD67_MASK;
 
 	/* just find interrupts that aren't in use */
 	for (i = 0; i < 16; i++)
-- 
1.6.3.3



From linux at dominikbrodowski.net  Wed Mar  3 03:00:46 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Wed,  3 Mar 2010 09:00:46 +0100
Subject: [PATCH 3/5] pcmcia: alchemy: fixup wrong comments
In-Reply-To: <20100303075944.GA23354@comet.dominikbrodowski.net>
References: <20100303075944.GA23354@comet.dominikbrodowski.net>
Message-ID: <1267603248-23866-3-git-send-email-linux@dominikbrodowski.net>

From: Manuel Lauss <manuel.lauss at googlemail.com>

Commit 11b897cf84c37e6522db914793677e933ef311fb  changed expected
pcmcia area addresses from the 32bit pseudo to the real 36bit
addresses, but did not update the comments.

Signed-off-by: Manuel Lauss <manuel.lauss at gmail.com>
Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 drivers/pcmcia/db1xxx_ss.c  |   19 ++++---------------
 drivers/pcmcia/xxs1500_ss.c |   16 +++-------------
 2 files changed, 7 insertions(+), 28 deletions(-)

diff --git a/drivers/pcmcia/db1xxx_ss.c b/drivers/pcmcia/db1xxx_ss.c
index 3889cf0..9254ab0 100644
--- a/drivers/pcmcia/db1xxx_ss.c
+++ b/drivers/pcmcia/db1xxx_ss.c
@@ -42,7 +42,6 @@ struct db1x_pcmcia_sock {
 	int		nr;		/* socket number */
 	void		*virt_io;
 
-	/* the "pseudo" addresses of the PCMCIA space. */
 	phys_addr_t	phys_io;
 	phys_addr_t	phys_attr;
 	phys_addr_t	phys_mem;
@@ -437,7 +436,7 @@ static int __devinit db1x_pcmcia_socket_probe(struct platform_device *pdev)
 	 * This includes IRQs for Carddetection/ejection, the card
 	 *  itself and optional status change detection.
 	 * Also, the memory areas covered by a socket.  For these
-	 *  we require the 32bit "pseudo" addresses (see the au1000.h
+	 *  we require the real 36bit addresses (see the au1000.h
 	 *  header for more information).
 	 */
 
@@ -459,11 +458,7 @@ static int __devinit db1x_pcmcia_socket_probe(struct platform_device *pdev)
 
 	ret = -ENODEV;
 
-	/*
-	 * pseudo-attr:  The 32bit address of the PCMCIA attribute space
-	 * for this socket (usually the 36bit address shifted 4 to the
-	 * right).
-	 */
+	/* 36bit PCMCIA Attribute area address */
 	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-attr");
 	if (!r) {
 		printk(KERN_ERR "pcmcia%d has no 'pseudo-attr' resource!\n",
@@ -472,10 +467,7 @@ static int __devinit db1x_pcmcia_socket_probe(struct platform_device *pdev)
 	}
 	sock->phys_attr = r->start;
 
-	/*
-	 * pseudo-mem:  The 32bit address of the PCMCIA memory space for
-	 * this socket (usually the 36bit address shifted 4 to the right)
-	 */
+	/* 36bit PCMCIA Memory area address */
 	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-mem");
 	if (!r) {
 		printk(KERN_ERR "pcmcia%d has no 'pseudo-mem' resource!\n",
@@ -484,10 +476,7 @@ static int __devinit db1x_pcmcia_socket_probe(struct platform_device *pdev)
 	}
 	sock->phys_mem = r->start;
 
-	/*
-	 * pseudo-io:  The 32bit address of the PCMCIA IO space for this
-	 * socket (usually the 36bit address shifted 4 to the right).
-	 */
+	/* 36bit PCMCIA IO area address */
 	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-io");
 	if (!r) {
 		printk(KERN_ERR "pcmcia%d has no 'pseudo-io' resource!\n",
diff --git a/drivers/pcmcia/xxs1500_ss.c b/drivers/pcmcia/xxs1500_ss.c
index 61560cd..f9009d3 100644
--- a/drivers/pcmcia/xxs1500_ss.c
+++ b/drivers/pcmcia/xxs1500_ss.c
@@ -218,11 +218,7 @@ static int __devinit xxs1500_pcmcia_probe(struct platform_device *pdev)
 
 	ret = -ENODEV;
 
-	/*
-	 * pseudo-attr:  The 32bit address of the PCMCIA attribute space
-	 * for this socket (usually the 36bit address shifted 4 to the
-	 * right).
-	 */
+	/* 36bit PCMCIA Attribute area address */
 	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-attr");
 	if (!r) {
 		dev_err(&pdev->dev, "missing 'pcmcia-attr' resource!\n");
@@ -230,10 +226,7 @@ static int __devinit xxs1500_pcmcia_probe(struct platform_device *pdev)
 	}
 	sock->phys_attr = r->start;
 
-	/*
-	 * pseudo-mem:  The 32bit address of the PCMCIA memory space for
-	 * this socket (usually the 36bit address shifted 4 to the right)
-	 */
+	/* 36bit PCMCIA Memory area address */
 	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-mem");
 	if (!r) {
 		dev_err(&pdev->dev, "missing 'pcmcia-mem' resource!\n");
@@ -241,10 +234,7 @@ static int __devinit xxs1500_pcmcia_probe(struct platform_device *pdev)
 	}
 	sock->phys_mem = r->start;
 
-	/*
-	 * pseudo-io:  The 32bit address of the PCMCIA IO space for this
-	 * socket (usually the 36bit address shifted 4 to the right).
-	 */
+	/* 36bit PCMCIA IO area address */
 	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-io");
 	if (!r) {
 		dev_err(&pdev->dev, "missing 'pcmcia-io' resource!\n");
-- 
1.6.3.3



From linux at dominikbrodowski.net  Wed Mar  3 03:00:47 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Wed,  3 Mar 2010 09:00:47 +0100
Subject: [PATCH 4/5] pcmcia: CodingStyle fixes
In-Reply-To: <20100303075944.GA23354@comet.dominikbrodowski.net>
References: <20100303075944.GA23354@comet.dominikbrodowski.net>
Message-ID: <1267603248-23866-4-git-send-email-linux@dominikbrodowski.net>

Fix most of the remaining CodingStyle issues in drivers/pcmcia , which
related to wrong indent -- PCMCIA historically used 4 spaces. Also, remove
a custom min() implementation with the generic one.

Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 drivers/pcmcia/cardbus.c  |    2 +-
 drivers/pcmcia/cistpl.c   | 1908 ++++++++++++++++++++++-----------------------
 drivers/pcmcia/rsrc_mgr.c |    3 +-
 3 files changed, 942 insertions(+), 971 deletions(-)

diff --git a/drivers/pcmcia/cardbus.c b/drivers/pcmcia/cardbus.c
index ac0686e..e6ab2a4 100644
--- a/drivers/pcmcia/cardbus.c
+++ b/drivers/pcmcia/cardbus.c
@@ -71,7 +71,7 @@ int __ref cb_alloc(struct pcmcia_socket *s)
 	unsigned int max, pass;
 
 	s->functions = pci_scan_slot(bus, PCI_DEVFN(0, 0));
-	pci_fixup_cardbus(bus); 
+	pci_fixup_cardbus(bus);
 
 	max = bus->secondary;
 	for (pass = 0; pass < 2; pass++)
diff --git a/drivers/pcmcia/cistpl.c b/drivers/pcmcia/cistpl.c
index 2f3622d..f230f65 100644
--- a/drivers/pcmcia/cistpl.c
+++ b/drivers/pcmcia/cistpl.c
@@ -54,46 +54,44 @@ static const u_int exponent[] = {
 /* Upper limit on reasonable # of tuples */
 #define MAX_TUPLES		200
 
-/*====================================================================*/
-
-/* Parameters that can be set with 'insmod' */
-
 /* 16-bit CIS? */
 static int cis_width;
 module_param(cis_width, int, 0444);
 
 void release_cis_mem(struct pcmcia_socket *s)
 {
-    mutex_lock(&s->ops_mutex);
-    if (s->cis_mem.flags & MAP_ACTIVE) {
-	s->cis_mem.flags &= ~MAP_ACTIVE;
-	s->ops->set_mem_map(s, &s->cis_mem);
-	if (s->cis_mem.res) {
-	    release_resource(s->cis_mem.res);
-	    kfree(s->cis_mem.res);
-	    s->cis_mem.res = NULL;
+	mutex_lock(&s->ops_mutex);
+	if (s->cis_mem.flags & MAP_ACTIVE) {
+		s->cis_mem.flags &= ~MAP_ACTIVE;
+		s->ops->set_mem_map(s, &s->cis_mem);
+		if (s->cis_mem.res) {
+			release_resource(s->cis_mem.res);
+			kfree(s->cis_mem.res);
+			s->cis_mem.res = NULL;
+		}
+		iounmap(s->cis_virt);
+		s->cis_virt = NULL;
 	}
-	iounmap(s->cis_virt);
-	s->cis_virt = NULL;
-    }
-    mutex_unlock(&s->ops_mutex);
+	mutex_unlock(&s->ops_mutex);
 }
 
-/*
- * Map the card memory at "card_offset" into virtual space.
+/**
+ * set_cis_map() - map the card memory at "card_offset" into virtual space.
+ *
  * If flags & MAP_ATTRIB, map the attribute space, otherwise
  * map the memory space.
  *
  * Must be called with ops_mutex held.
  */
-static void __iomem *
-set_cis_map(struct pcmcia_socket *s, unsigned int card_offset, unsigned int flags)
+static void __iomem *set_cis_map(struct pcmcia_socket *s,
+				unsigned int card_offset, unsigned int flags)
 {
 	pccard_mem_map *mem = &s->cis_mem;
 	int ret;
 
 	if (!(s->features & SS_CAP_STATIC_MAP) && (mem->res == NULL)) {
-		mem->res = pcmcia_find_mem_region(0, s->map_size, s->map_size, 0, s);
+		mem->res = pcmcia_find_mem_region(0, s->map_size,
+						s->map_size, 0, s);
 		if (mem->res == NULL) {
 			dev_printk(KERN_NOTICE, &s->dev,
 				   "cs: unable to map card memory!\n");
@@ -124,165 +122,170 @@ set_cis_map(struct pcmcia_socket *s, unsigned int card_offset, unsigned int flag
 	return s->cis_virt;
 }
 
-/*======================================================================
-
-    Low-level functions to read and write CIS memory.  I think the
-    write routine is only useful for writing one-byte registers.
-
-======================================================================*/
 
 /* Bits in attr field */
 #define IS_ATTR		1
 #define IS_INDIRECT	8
 
+/**
+ * pcmcia_read_cis_mem() - low-level function to read CIS memory
+ */
 int pcmcia_read_cis_mem(struct pcmcia_socket *s, int attr, u_int addr,
 		 u_int len, void *ptr)
 {
-    void __iomem *sys, *end;
-    unsigned char *buf = ptr;
-
-    dev_dbg(&s->dev, "pcmcia_read_cis_mem(%d, %#x, %u)\n", attr, addr, len);
-
-    mutex_lock(&s->ops_mutex);
-    if (attr & IS_INDIRECT) {
-	/* Indirect accesses use a bunch of special registers at fixed
-	   locations in common memory */
-	u_char flags = ICTRL0_COMMON|ICTRL0_AUTOINC|ICTRL0_BYTEGRAN;
-	if (attr & IS_ATTR) {
-	    addr *= 2;
-	    flags = ICTRL0_AUTOINC;
-	}
+	void __iomem *sys, *end;
+	unsigned char *buf = ptr;
 
-	sys = set_cis_map(s, 0, MAP_ACTIVE | ((cis_width) ? MAP_16BIT : 0));
-	if (!sys) {
-	    dev_dbg(&s->dev, "could not map memory\n");
-	    memset(ptr, 0xff, len);
-	    mutex_unlock(&s->ops_mutex);
-	    return -1;
-	}
+	dev_dbg(&s->dev, "pcmcia_read_cis_mem(%d, %#x, %u)\n", attr, addr, len);
 
-	writeb(flags, sys+CISREG_ICTRL0);
-	writeb(addr & 0xff, sys+CISREG_IADDR0);
-	writeb((addr>>8) & 0xff, sys+CISREG_IADDR1);
-	writeb((addr>>16) & 0xff, sys+CISREG_IADDR2);
-	writeb((addr>>24) & 0xff, sys+CISREG_IADDR3);
-	for ( ; len > 0; len--, buf++)
-	    *buf = readb(sys+CISREG_IDATA0);
-    } else {
-	u_int inc = 1, card_offset, flags;
-
-	if (addr > CISTPL_MAX_CIS_SIZE)
-		dev_dbg(&s->dev, "attempt to read CIS mem at addr %#x", addr);
-
-	flags = MAP_ACTIVE | ((cis_width) ? MAP_16BIT : 0);
-	if (attr) {
-	    flags |= MAP_ATTRIB;
-	    inc++;
-	    addr *= 2;
-	}
+	mutex_lock(&s->ops_mutex);
+	if (attr & IS_INDIRECT) {
+		/* Indirect accesses use a bunch of special registers at fixed
+		   locations in common memory */
+		u_char flags = ICTRL0_COMMON|ICTRL0_AUTOINC|ICTRL0_BYTEGRAN;
+		if (attr & IS_ATTR) {
+			addr *= 2;
+			flags = ICTRL0_AUTOINC;
+		}
 
-	card_offset = addr & ~(s->map_size-1);
-	while (len) {
-	    sys = set_cis_map(s, card_offset, flags);
-	    if (!sys) {
-		dev_dbg(&s->dev, "could not map memory\n");
-		memset(ptr, 0xff, len);
-		mutex_unlock(&s->ops_mutex);
-		return -1;
-	    }
-	    end = sys + s->map_size;
-	    sys = sys + (addr & (s->map_size-1));
-	    for ( ; len > 0; len--, buf++, sys += inc) {
-		if (sys == end)
-		    break;
-		*buf = readb(sys);
-	    }
-	    card_offset += s->map_size;
-	    addr = 0;
+		sys = set_cis_map(s, 0, MAP_ACTIVE |
+				((cis_width) ? MAP_16BIT : 0));
+		if (!sys) {
+			dev_dbg(&s->dev, "could not map memory\n");
+			memset(ptr, 0xff, len);
+			mutex_unlock(&s->ops_mutex);
+			return -1;
+		}
+
+		writeb(flags, sys+CISREG_ICTRL0);
+		writeb(addr & 0xff, sys+CISREG_IADDR0);
+		writeb((addr>>8) & 0xff, sys+CISREG_IADDR1);
+		writeb((addr>>16) & 0xff, sys+CISREG_IADDR2);
+		writeb((addr>>24) & 0xff, sys+CISREG_IADDR3);
+		for ( ; len > 0; len--, buf++)
+			*buf = readb(sys+CISREG_IDATA0);
+	} else {
+		u_int inc = 1, card_offset, flags;
+
+		if (addr > CISTPL_MAX_CIS_SIZE)
+			dev_dbg(&s->dev,
+				"attempt to read CIS mem at addr %#x", addr);
+
+		flags = MAP_ACTIVE | ((cis_width) ? MAP_16BIT : 0);
+		if (attr) {
+			flags |= MAP_ATTRIB;
+			inc++;
+			addr *= 2;
+		}
+
+		card_offset = addr & ~(s->map_size-1);
+		while (len) {
+			sys = set_cis_map(s, card_offset, flags);
+			if (!sys) {
+				dev_dbg(&s->dev, "could not map memory\n");
+				memset(ptr, 0xff, len);
+				mutex_unlock(&s->ops_mutex);
+				return -1;
+			}
+			end = sys + s->map_size;
+			sys = sys + (addr & (s->map_size-1));
+			for ( ; len > 0; len--, buf++, sys += inc) {
+				if (sys == end)
+					break;
+				*buf = readb(sys);
+			}
+			card_offset += s->map_size;
+			addr = 0;
+		}
 	}
-    }
-    mutex_unlock(&s->ops_mutex);
-    dev_dbg(&s->dev, "  %#2.2x %#2.2x %#2.2x %#2.2x ...\n",
-	  *(u_char *)(ptr+0), *(u_char *)(ptr+1),
-	  *(u_char *)(ptr+2), *(u_char *)(ptr+3));
-    return 0;
+	mutex_unlock(&s->ops_mutex);
+	dev_dbg(&s->dev, "  %#2.2x %#2.2x %#2.2x %#2.2x ...\n",
+		*(u_char *)(ptr+0), *(u_char *)(ptr+1),
+		*(u_char *)(ptr+2), *(u_char *)(ptr+3));
+	return 0;
 }
 
 
+/**
+ * pcmcia_write_cis_mem() - low-level function to write CIS memory
+ *
+ * Probably only useful for writing one-byte registers.
+ */
 void pcmcia_write_cis_mem(struct pcmcia_socket *s, int attr, u_int addr,
 		   u_int len, void *ptr)
 {
-    void __iomem *sys, *end;
-    unsigned char *buf = ptr;
-
-    dev_dbg(&s->dev, "pcmcia_write_cis_mem(%d, %#x, %u)\n", attr, addr, len);
-
-    mutex_lock(&s->ops_mutex);
-    if (attr & IS_INDIRECT) {
-	/* Indirect accesses use a bunch of special registers at fixed
-	   locations in common memory */
-	u_char flags = ICTRL0_COMMON|ICTRL0_AUTOINC|ICTRL0_BYTEGRAN;
-	if (attr & IS_ATTR) {
-	    addr *= 2;
-	    flags = ICTRL0_AUTOINC;
-	}
+	void __iomem *sys, *end;
+	unsigned char *buf = ptr;
 
-	sys = set_cis_map(s, 0, MAP_ACTIVE | ((cis_width) ? MAP_16BIT : 0));
-	if (!sys) {
-		dev_dbg(&s->dev, "could not map memory\n");
-		mutex_unlock(&s->ops_mutex);
-		return; /* FIXME: Error */
-	}
+	dev_dbg(&s->dev,
+		"pcmcia_write_cis_mem(%d, %#x, %u)\n", attr, addr, len);
 
-	writeb(flags, sys+CISREG_ICTRL0);
-	writeb(addr & 0xff, sys+CISREG_IADDR0);
-	writeb((addr>>8) & 0xff, sys+CISREG_IADDR1);
-	writeb((addr>>16) & 0xff, sys+CISREG_IADDR2);
-	writeb((addr>>24) & 0xff, sys+CISREG_IADDR3);
-	for ( ; len > 0; len--, buf++)
-	    writeb(*buf, sys+CISREG_IDATA0);
-    } else {
-	u_int inc = 1, card_offset, flags;
-
-	flags = MAP_ACTIVE | ((cis_width) ? MAP_16BIT : 0);
-	if (attr & IS_ATTR) {
-	    flags |= MAP_ATTRIB;
-	    inc++;
-	    addr *= 2;
-	}
+	mutex_lock(&s->ops_mutex);
+	if (attr & IS_INDIRECT) {
+		/* Indirect accesses use a bunch of special registers at fixed
+		   locations in common memory */
+		u_char flags = ICTRL0_COMMON|ICTRL0_AUTOINC|ICTRL0_BYTEGRAN;
+		if (attr & IS_ATTR) {
+			addr *= 2;
+			flags = ICTRL0_AUTOINC;
+		}
 
-	card_offset = addr & ~(s->map_size-1);
-	while (len) {
-	    sys = set_cis_map(s, card_offset, flags);
-	    if (!sys) {
-		dev_dbg(&s->dev, "could not map memory\n");
-		mutex_unlock(&s->ops_mutex);
-		return; /* FIXME: error */
-	    }
-
-	    end = sys + s->map_size;
-	    sys = sys + (addr & (s->map_size-1));
-	    for ( ; len > 0; len--, buf++, sys += inc) {
-		if (sys == end)
-		    break;
-		writeb(*buf, sys);
-	    }
-	    card_offset += s->map_size;
-	    addr = 0;
-	}
-    }
-    mutex_unlock(&s->ops_mutex);
-}
+		sys = set_cis_map(s, 0, MAP_ACTIVE |
+				((cis_width) ? MAP_16BIT : 0));
+		if (!sys) {
+			dev_dbg(&s->dev, "could not map memory\n");
+			mutex_unlock(&s->ops_mutex);
+			return; /* FIXME: Error */
+		}
+
+		writeb(flags, sys+CISREG_ICTRL0);
+		writeb(addr & 0xff, sys+CISREG_IADDR0);
+		writeb((addr>>8) & 0xff, sys+CISREG_IADDR1);
+		writeb((addr>>16) & 0xff, sys+CISREG_IADDR2);
+		writeb((addr>>24) & 0xff, sys+CISREG_IADDR3);
+		for ( ; len > 0; len--, buf++)
+			writeb(*buf, sys+CISREG_IDATA0);
+	} else {
+		u_int inc = 1, card_offset, flags;
 
+		flags = MAP_ACTIVE | ((cis_width) ? MAP_16BIT : 0);
+		if (attr & IS_ATTR) {
+			flags |= MAP_ATTRIB;
+			inc++;
+			addr *= 2;
+		}
 
-/*======================================================================
+		card_offset = addr & ~(s->map_size-1);
+		while (len) {
+			sys = set_cis_map(s, card_offset, flags);
+			if (!sys) {
+				dev_dbg(&s->dev, "could not map memory\n");
+				mutex_unlock(&s->ops_mutex);
+				return; /* FIXME: error */
+			}
 
-    This is a wrapper around read_cis_mem, with the same interface,
-    but which caches information, for cards whose CIS may not be
-    readable all the time.
+			end = sys + s->map_size;
+			sys = sys + (addr & (s->map_size-1));
+			for ( ; len > 0; len--, buf++, sys += inc) {
+				if (sys == end)
+					break;
+				writeb(*buf, sys);
+			}
+			card_offset += s->map_size;
+			addr = 0;
+		}
+	}
+	mutex_unlock(&s->ops_mutex);
+}
 
-======================================================================*/
 
+/**
+ * read_cis_cache() - read CIS memory or its associated cache
+ *
+ * This is a wrapper around read_cis_mem, with the same interface,
+ * but which caches information, for cards whose CIS may not be
+ * readable all the time.
+ */
 static int read_cis_cache(struct pcmcia_socket *s, int attr, u_int addr,
 			size_t len, void *ptr)
 {
@@ -353,7 +356,6 @@ remove_cis_cache(struct pcmcia_socket *s, int attr, u_int addr, u_int len)
  * This destroys the CIS cache but keeps any fake CIS alive. Must be
  * called with ops_mutex held.
  */
-
 void destroy_cis_cache(struct pcmcia_socket *s)
 {
 	struct list_head *l, *n;
@@ -366,13 +368,9 @@ void destroy_cis_cache(struct pcmcia_socket *s)
 	}
 }
 
-/*======================================================================
-
-    This verifies if the CIS of a card matches what is in the CIS
-    cache.
-
-======================================================================*/
-
+/**
+ * verify_cis_cache() - does the CIS match what is in the CIS cache?
+ */
 int verify_cis_cache(struct pcmcia_socket *s)
 {
 	struct cis_cache_entry *cis;
@@ -404,13 +402,12 @@ int verify_cis_cache(struct pcmcia_socket *s)
 	return 0;
 }
 
-/*======================================================================
-
-    For really bad cards, we provide a facility for uploading a
-    replacement CIS.
-
-======================================================================*/
-
+/**
+ * pcmcia_replace_cis() - use a replacement CIS instead of the card's CIS
+ *
+ * For really bad cards, we provide a facility for uploading a
+ * replacement CIS.
+ */
 int pcmcia_replace_cis(struct pcmcia_socket *s,
 		       const u8 *data, const size_t len)
 {
@@ -433,17 +430,13 @@ int pcmcia_replace_cis(struct pcmcia_socket *s,
 	return 0;
 }
 
-/*======================================================================
-
-    The high-level CIS tuple services
-
-======================================================================*/
+/* The high-level CIS tuple services */
 
 typedef struct tuple_flags {
-    u_int		link_space:4;
-    u_int		has_link:1;
-    u_int		mfc_fn:3;
-    u_int		space:4;
+	u_int		link_space:4;
+	u_int		has_link:1;
+	u_int		mfc_fn:3;
+	u_int		space:4;
 } tuple_flags;
 
 #define LINK_SPACE(f)	(((tuple_flags *)(&(f)))->link_space)
@@ -451,982 +444,961 @@ typedef struct tuple_flags {
 #define MFC_FN(f)	(((tuple_flags *)(&(f)))->mfc_fn)
 #define SPACE(f)	(((tuple_flags *)(&(f)))->space)
 
-int pccard_get_first_tuple(struct pcmcia_socket *s, unsigned int function, tuple_t *tuple)
+int pccard_get_first_tuple(struct pcmcia_socket *s, unsigned int function,
+			tuple_t *tuple)
 {
-    if (!s)
-	return -EINVAL;
-
-    if (!(s->state & SOCKET_PRESENT) || (s->state & SOCKET_CARDBUS))
-	return -ENODEV;
-    tuple->TupleLink = tuple->Flags = 0;
-
-    /* Assume presence of a LONGLINK_C to address 0 */
-    tuple->CISOffset = tuple->LinkOffset = 0;
-    SPACE(tuple->Flags) = HAS_LINK(tuple->Flags) = 1;
-
-    if ((s->functions > 1) && !(tuple->Attributes & TUPLE_RETURN_COMMON)) {
-	cisdata_t req = tuple->DesiredTuple;
-	tuple->DesiredTuple = CISTPL_LONGLINK_MFC;
-	if (pccard_get_next_tuple(s, function, tuple) == 0) {
-	    tuple->DesiredTuple = CISTPL_LINKTARGET;
-	    if (pccard_get_next_tuple(s, function, tuple) != 0)
-		return -ENOSPC;
-	} else
-	    tuple->CISOffset = tuple->TupleLink = 0;
-	tuple->DesiredTuple = req;
-    }
-    return pccard_get_next_tuple(s, function, tuple);
+	if (!s)
+		return -EINVAL;
+
+	if (!(s->state & SOCKET_PRESENT) || (s->state & SOCKET_CARDBUS))
+		return -ENODEV;
+	tuple->TupleLink = tuple->Flags = 0;
+
+	/* Assume presence of a LONGLINK_C to address 0 */
+	tuple->CISOffset = tuple->LinkOffset = 0;
+	SPACE(tuple->Flags) = HAS_LINK(tuple->Flags) = 1;
+
+	if ((s->functions > 1) && !(tuple->Attributes & TUPLE_RETURN_COMMON)) {
+		cisdata_t req = tuple->DesiredTuple;
+		tuple->DesiredTuple = CISTPL_LONGLINK_MFC;
+		if (pccard_get_next_tuple(s, function, tuple) == 0) {
+			tuple->DesiredTuple = CISTPL_LINKTARGET;
+			if (pccard_get_next_tuple(s, function, tuple) != 0)
+				return -ENOSPC;
+		} else
+			tuple->CISOffset = tuple->TupleLink = 0;
+		tuple->DesiredTuple = req;
+	}
+	return pccard_get_next_tuple(s, function, tuple);
 }
 
 static int follow_link(struct pcmcia_socket *s, tuple_t *tuple)
 {
-    u_char link[5];
-    u_int ofs;
-    int ret;
-
-    if (MFC_FN(tuple->Flags)) {
-	/* Get indirect link from the MFC tuple */
-	ret = read_cis_cache(s, LINK_SPACE(tuple->Flags),
-		       tuple->LinkOffset, 5, link);
-	if (ret)
+	u_char link[5];
+	u_int ofs;
+	int ret;
+
+	if (MFC_FN(tuple->Flags)) {
+		/* Get indirect link from the MFC tuple */
+		ret = read_cis_cache(s, LINK_SPACE(tuple->Flags),
+				tuple->LinkOffset, 5, link);
+		if (ret)
+			return -1;
+		ofs = get_unaligned_le32(link + 1);
+		SPACE(tuple->Flags) = (link[0] == CISTPL_MFC_ATTR);
+		/* Move to the next indirect link */
+		tuple->LinkOffset += 5;
+		MFC_FN(tuple->Flags)--;
+	} else if (HAS_LINK(tuple->Flags)) {
+		ofs = tuple->LinkOffset;
+		SPACE(tuple->Flags) = LINK_SPACE(tuple->Flags);
+		HAS_LINK(tuple->Flags) = 0;
+	} else
 		return -1;
-	ofs = get_unaligned_le32(link + 1);
-	SPACE(tuple->Flags) = (link[0] == CISTPL_MFC_ATTR);
-	/* Move to the next indirect link */
-	tuple->LinkOffset += 5;
-	MFC_FN(tuple->Flags)--;
-    } else if (HAS_LINK(tuple->Flags)) {
-	ofs = tuple->LinkOffset;
-	SPACE(tuple->Flags) = LINK_SPACE(tuple->Flags);
-	HAS_LINK(tuple->Flags) = 0;
-    } else {
-	return -1;
-    }
-    if (SPACE(tuple->Flags)) {
-	/* This is ugly, but a common CIS error is to code the long
-	   link offset incorrectly, so we check the right spot... */
+
+	if (SPACE(tuple->Flags)) {
+		/* This is ugly, but a common CIS error is to code the long
+		   link offset incorrectly, so we check the right spot... */
+		ret = read_cis_cache(s, SPACE(tuple->Flags), ofs, 5, link);
+		if (ret)
+			return -1;
+		if ((link[0] == CISTPL_LINKTARGET) && (link[1] >= 3) &&
+			(strncmp(link+2, "CIS", 3) == 0))
+			return ofs;
+		remove_cis_cache(s, SPACE(tuple->Flags), ofs, 5);
+		/* Then, we try the wrong spot... */
+		ofs = ofs >> 1;
+	}
 	ret = read_cis_cache(s, SPACE(tuple->Flags), ofs, 5, link);
 	if (ret)
 		return -1;
 	if ((link[0] == CISTPL_LINKTARGET) && (link[1] >= 3) &&
-	    (strncmp(link+2, "CIS", 3) == 0))
-	    return ofs;
+		(strncmp(link+2, "CIS", 3) == 0))
+		return ofs;
 	remove_cis_cache(s, SPACE(tuple->Flags), ofs, 5);
-	/* Then, we try the wrong spot... */
-	ofs = ofs >> 1;
-    }
-    ret = read_cis_cache(s, SPACE(tuple->Flags), ofs, 5, link);
-    if (ret)
-	    return -1;
-    if ((link[0] == CISTPL_LINKTARGET) && (link[1] >= 3) &&
-	(strncmp(link+2, "CIS", 3) == 0))
-	return ofs;
-    remove_cis_cache(s, SPACE(tuple->Flags), ofs, 5);
-    return -1;
+	return -1;
 }
 
-int pccard_get_next_tuple(struct pcmcia_socket *s, unsigned int function, tuple_t *tuple)
+int pccard_get_next_tuple(struct pcmcia_socket *s, unsigned int function,
+			tuple_t *tuple)
 {
-    u_char link[2], tmp;
-    int ofs, i, attr;
-    int ret;
-
-    if (!s)
-	return -EINVAL;
-    if (!(s->state & SOCKET_PRESENT) || (s->state & SOCKET_CARDBUS))
-	return -ENODEV;
-
-    link[1] = tuple->TupleLink;
-    ofs = tuple->CISOffset + tuple->TupleLink;
-    attr = SPACE(tuple->Flags);
-
-    for (i = 0; i < MAX_TUPLES; i++) {
-	if (link[1] == 0xff) {
-	    link[0] = CISTPL_END;
-	} else {
-	    ret = read_cis_cache(s, attr, ofs, 2, link);
-	    if (ret)
-		    return -1;
-	    if (link[0] == CISTPL_NULL) {
-		ofs++; continue;
-	    }
-	}
+	u_char link[2], tmp;
+	int ofs, i, attr;
+	int ret;
 
-	/* End of chain?  Follow long link if possible */
-	if (link[0] == CISTPL_END) {
-	    ofs = follow_link(s, tuple);
-	    if (ofs < 0)
-		return -ENOSPC;
-	    attr = SPACE(tuple->Flags);
-	    ret = read_cis_cache(s, attr, ofs, 2, link);
-	    if (ret)
-		    return -1;
-	}
+	if (!s)
+		return -EINVAL;
+	if (!(s->state & SOCKET_PRESENT) || (s->state & SOCKET_CARDBUS))
+		return -ENODEV;
 
-	/* Is this a link tuple?  Make a note of it */
-	if ((link[0] == CISTPL_LONGLINK_A) ||
-	    (link[0] == CISTPL_LONGLINK_C) ||
-	    (link[0] == CISTPL_LONGLINK_MFC) ||
-	    (link[0] == CISTPL_LINKTARGET) ||
-	    (link[0] == CISTPL_INDIRECT) ||
-	    (link[0] == CISTPL_NO_LINK)) {
-	    switch (link[0]) {
-	    case CISTPL_LONGLINK_A:
-		HAS_LINK(tuple->Flags) = 1;
-		LINK_SPACE(tuple->Flags) = attr | IS_ATTR;
-		ret = read_cis_cache(s, attr, ofs+2, 4, &tuple->LinkOffset);
-		if (ret)
-			return -1;
-		break;
-	    case CISTPL_LONGLINK_C:
-		HAS_LINK(tuple->Flags) = 1;
-		LINK_SPACE(tuple->Flags) = attr & ~IS_ATTR;
-		ret = read_cis_cache(s, attr, ofs+2, 4, &tuple->LinkOffset);
-		if (ret)
-			return -1;
-		break;
-	    case CISTPL_INDIRECT:
-		HAS_LINK(tuple->Flags) = 1;
-		LINK_SPACE(tuple->Flags) = IS_ATTR | IS_INDIRECT;
-		tuple->LinkOffset = 0;
-		break;
-	    case CISTPL_LONGLINK_MFC:
-		tuple->LinkOffset = ofs + 3;
-		LINK_SPACE(tuple->Flags) = attr;
-		if (function == BIND_FN_ALL) {
-		    /* Follow all the MFC links */
-		    ret = read_cis_cache(s, attr, ofs+2, 1, &tmp);
-		    if (ret)
-			    return -1;
-		    MFC_FN(tuple->Flags) = tmp;
-		} else {
-		    /* Follow exactly one of the links */
-		    MFC_FN(tuple->Flags) = 1;
-		    tuple->LinkOffset += function * 5;
+	link[1] = tuple->TupleLink;
+	ofs = tuple->CISOffset + tuple->TupleLink;
+	attr = SPACE(tuple->Flags);
+
+	for (i = 0; i < MAX_TUPLES; i++) {
+		if (link[1] == 0xff)
+			link[0] = CISTPL_END;
+		else {
+			ret = read_cis_cache(s, attr, ofs, 2, link);
+			if (ret)
+				return -1;
+			if (link[0] == CISTPL_NULL) {
+				ofs++;
+				continue;
+			}
 		}
-		break;
-	    case CISTPL_NO_LINK:
-		HAS_LINK(tuple->Flags) = 0;
-		break;
-	    }
-	    if ((tuple->Attributes & TUPLE_RETURN_LINK) &&
-		(tuple->DesiredTuple == RETURN_FIRST_TUPLE))
-		break;
-	} else
-	    if (tuple->DesiredTuple == RETURN_FIRST_TUPLE)
-		break;
 
-	if (link[0] == tuple->DesiredTuple)
-	    break;
-	ofs += link[1] + 2;
-    }
-    if (i == MAX_TUPLES) {
-	dev_dbg(&s->dev, "cs: overrun in pcmcia_get_next_tuple\n");
-	return -ENOSPC;
-    }
-
-    tuple->TupleCode = link[0];
-    tuple->TupleLink = link[1];
-    tuple->CISOffset = ofs + 2;
-    return 0;
-}
+		/* End of chain?  Follow long link if possible */
+		if (link[0] == CISTPL_END) {
+			ofs = follow_link(s, tuple);
+			if (ofs < 0)
+				return -ENOSPC;
+			attr = SPACE(tuple->Flags);
+			ret = read_cis_cache(s, attr, ofs, 2, link);
+			if (ret)
+				return -1;
+		}
 
-/*====================================================================*/
+		/* Is this a link tuple?  Make a note of it */
+		if ((link[0] == CISTPL_LONGLINK_A) ||
+			(link[0] == CISTPL_LONGLINK_C) ||
+			(link[0] == CISTPL_LONGLINK_MFC) ||
+			(link[0] == CISTPL_LINKTARGET) ||
+			(link[0] == CISTPL_INDIRECT) ||
+			(link[0] == CISTPL_NO_LINK)) {
+			switch (link[0]) {
+			case CISTPL_LONGLINK_A:
+				HAS_LINK(tuple->Flags) = 1;
+				LINK_SPACE(tuple->Flags) = attr | IS_ATTR;
+				ret = read_cis_cache(s, attr, ofs+2, 4,
+						&tuple->LinkOffset);
+				if (ret)
+					return -1;
+				break;
+			case CISTPL_LONGLINK_C:
+				HAS_LINK(tuple->Flags) = 1;
+				LINK_SPACE(tuple->Flags) = attr & ~IS_ATTR;
+				ret = read_cis_cache(s, attr, ofs+2, 4,
+						&tuple->LinkOffset);
+				if (ret)
+					return -1;
+				break;
+			case CISTPL_INDIRECT:
+				HAS_LINK(tuple->Flags) = 1;
+				LINK_SPACE(tuple->Flags) = IS_ATTR |
+					IS_INDIRECT;
+				tuple->LinkOffset = 0;
+				break;
+			case CISTPL_LONGLINK_MFC:
+				tuple->LinkOffset = ofs + 3;
+				LINK_SPACE(tuple->Flags) = attr;
+				if (function == BIND_FN_ALL) {
+					/* Follow all the MFC links */
+					ret = read_cis_cache(s, attr, ofs+2,
+							1, &tmp);
+					if (ret)
+						return -1;
+					MFC_FN(tuple->Flags) = tmp;
+				} else {
+					/* Follow exactly one of the links */
+					MFC_FN(tuple->Flags) = 1;
+					tuple->LinkOffset += function * 5;
+				}
+				break;
+			case CISTPL_NO_LINK:
+				HAS_LINK(tuple->Flags) = 0;
+				break;
+			}
+			if ((tuple->Attributes & TUPLE_RETURN_LINK) &&
+				(tuple->DesiredTuple == RETURN_FIRST_TUPLE))
+				break;
+		} else
+			if (tuple->DesiredTuple == RETURN_FIRST_TUPLE)
+				break;
+
+		if (link[0] == tuple->DesiredTuple)
+			break;
+		ofs += link[1] + 2;
+	}
+	if (i == MAX_TUPLES) {
+		dev_dbg(&s->dev, "cs: overrun in pcmcia_get_next_tuple\n");
+		return -ENOSPC;
+	}
 
-#define _MIN(a, b)		(((a) < (b)) ? (a) : (b))
+	tuple->TupleCode = link[0];
+	tuple->TupleLink = link[1];
+	tuple->CISOffset = ofs + 2;
+	return 0;
+}
 
 int pccard_get_tuple_data(struct pcmcia_socket *s, tuple_t *tuple)
 {
-    u_int len;
-    int ret;
+	u_int len;
+	int ret;
 
-    if (!s)
-	return -EINVAL;
+	if (!s)
+		return -EINVAL;
 
-    if (tuple->TupleLink < tuple->TupleOffset)
-	return -ENOSPC;
-    len = tuple->TupleLink - tuple->TupleOffset;
-    tuple->TupleDataLen = tuple->TupleLink;
-    if (len == 0)
+	if (tuple->TupleLink < tuple->TupleOffset)
+		return -ENOSPC;
+	len = tuple->TupleLink - tuple->TupleOffset;
+	tuple->TupleDataLen = tuple->TupleLink;
+	if (len == 0)
+		return 0;
+	ret = read_cis_cache(s, SPACE(tuple->Flags),
+			tuple->CISOffset + tuple->TupleOffset,
+			min(len, (u_int) tuple->TupleDataMax),
+			tuple->TupleData);
+	if (ret)
+		return -1;
 	return 0;
-    ret = read_cis_cache(s, SPACE(tuple->Flags),
-		   tuple->CISOffset + tuple->TupleOffset,
-		   _MIN(len, tuple->TupleDataMax), tuple->TupleData);
-    if (ret)
-	    return -1;
-    return 0;
 }
 
 
-/*======================================================================
-
-    Parsing routines for individual tuples
-
-======================================================================*/
+/* Parsing routines for individual tuples */
 
 static int parse_device(tuple_t *tuple, cistpl_device_t *device)
 {
-    int i;
-    u_char scale;
-    u_char *p, *q;
+	int i;
+	u_char scale;
+	u_char *p, *q;
 
-    p = (u_char *)tuple->TupleData;
-    q = p + tuple->TupleDataLen;
+	p = (u_char *)tuple->TupleData;
+	q = p + tuple->TupleDataLen;
 
-    device->ndev = 0;
-    for (i = 0; i < CISTPL_MAX_DEVICES; i++) {
+	device->ndev = 0;
+	for (i = 0; i < CISTPL_MAX_DEVICES; i++) {
 
-	if (*p == 0xff)
-		break;
-	device->dev[i].type = (*p >> 4);
-	device->dev[i].wp = (*p & 0x08) ? 1 : 0;
-	switch (*p & 0x07) {
-	case 0:
-		device->dev[i].speed = 0;
-		break;
-	case 1:
-		device->dev[i].speed = 250;
-		break;
-	case 2:
-		device->dev[i].speed = 200;
-		break;
-	case 3:
-		device->dev[i].speed = 150;
-		break;
-	case 4:
-		device->dev[i].speed = 100;
-		break;
-	case 7:
-		if (++p == q)
-			return -EINVAL;
-		device->dev[i].speed = SPEED_CVT(*p);
-		while (*p & 0x80)
+		if (*p == 0xff)
+			break;
+		device->dev[i].type = (*p >> 4);
+		device->dev[i].wp = (*p & 0x08) ? 1 : 0;
+		switch (*p & 0x07) {
+		case 0:
+			device->dev[i].speed = 0;
+			break;
+		case 1:
+			device->dev[i].speed = 250;
+			break;
+		case 2:
+			device->dev[i].speed = 200;
+			break;
+		case 3:
+			device->dev[i].speed = 150;
+			break;
+		case 4:
+			device->dev[i].speed = 100;
+			break;
+		case 7:
 			if (++p == q)
 				return -EINVAL;
-		break;
-	default:
-		return -EINVAL;
-	}
+			device->dev[i].speed = SPEED_CVT(*p);
+			while (*p & 0x80)
+				if (++p == q)
+					return -EINVAL;
+			break;
+		default:
+			return -EINVAL;
+		}
 
-	if (++p == q)
-		return -EINVAL;
-	if (*p == 0xff)
-		break;
-	scale = *p & 7;
-	if (scale == 7)
-		return -EINVAL;
-	device->dev[i].size = ((*p >> 3) + 1) * (512 << (scale*2));
-	device->ndev++;
-	if (++p == q)
-		break;
-    }
+		if (++p == q)
+			return -EINVAL;
+		if (*p == 0xff)
+			break;
+		scale = *p & 7;
+		if (scale == 7)
+			return -EINVAL;
+		device->dev[i].size = ((*p >> 3) + 1) * (512 << (scale*2));
+		device->ndev++;
+		if (++p == q)
+			break;
+	}
 
-    return 0;
+	return 0;
 }
 
-/*====================================================================*/
 
 static int parse_checksum(tuple_t *tuple, cistpl_checksum_t *csum)
 {
-    u_char *p;
-    if (tuple->TupleDataLen < 5)
-	return -EINVAL;
-    p = (u_char *) tuple->TupleData;
-    csum->addr = tuple->CISOffset + get_unaligned_le16(p) - 2;
-    csum->len = get_unaligned_le16(p + 2);
-    csum->sum = *(p + 4);
-    return 0;
+	u_char *p;
+	if (tuple->TupleDataLen < 5)
+		return -EINVAL;
+	p = (u_char *) tuple->TupleData;
+	csum->addr = tuple->CISOffset + get_unaligned_le16(p) - 2;
+	csum->len = get_unaligned_le16(p + 2);
+	csum->sum = *(p + 4);
+	return 0;
 }
 
-/*====================================================================*/
 
 static int parse_longlink(tuple_t *tuple, cistpl_longlink_t *link)
 {
-    if (tuple->TupleDataLen < 4)
-	return -EINVAL;
-    link->addr = get_unaligned_le32(tuple->TupleData);
-    return 0;
+	if (tuple->TupleDataLen < 4)
+		return -EINVAL;
+	link->addr = get_unaligned_le32(tuple->TupleData);
+	return 0;
 }
 
-/*====================================================================*/
 
-static int parse_longlink_mfc(tuple_t *tuple,
-			      cistpl_longlink_mfc_t *link)
+static int parse_longlink_mfc(tuple_t *tuple, cistpl_longlink_mfc_t *link)
 {
-    u_char *p;
-    int i;
-
-    p = (u_char *)tuple->TupleData;
-
-    link->nfn = *p; p++;
-    if (tuple->TupleDataLen <= link->nfn*5)
-	return -EINVAL;
-    for (i = 0; i < link->nfn; i++) {
-	link->fn[i].space = *p; p++;
-	link->fn[i].addr = get_unaligned_le32(p);
-	p += 4;
-    }
-    return 0;
+	u_char *p;
+	int i;
+
+	p = (u_char *)tuple->TupleData;
+
+	link->nfn = *p; p++;
+	if (tuple->TupleDataLen <= link->nfn*5)
+		return -EINVAL;
+	for (i = 0; i < link->nfn; i++) {
+		link->fn[i].space = *p; p++;
+		link->fn[i].addr = get_unaligned_le32(p);
+		p += 4;
+	}
+	return 0;
 }
 
-/*====================================================================*/
 
 static int parse_strings(u_char *p, u_char *q, int max,
 			 char *s, u_char *ofs, u_char *found)
 {
-    int i, j, ns;
+	int i, j, ns;
 
-    if (p == q)
-	    return -EINVAL;
-    ns = 0; j = 0;
-    for (i = 0; i < max; i++) {
-	if (*p == 0xff)
-		break;
-	ofs[i] = j;
-	ns++;
-	for (;;) {
-	    s[j++] = (*p == 0xff) ? '\0' : *p;
-	    if ((*p == '\0') || (*p == 0xff))
-		    break;
-	    if (++p == q)
-		    return -EINVAL;
+	if (p == q)
+		return -EINVAL;
+	ns = 0; j = 0;
+	for (i = 0; i < max; i++) {
+		if (*p == 0xff)
+			break;
+		ofs[i] = j;
+		ns++;
+		for (;;) {
+			s[j++] = (*p == 0xff) ? '\0' : *p;
+			if ((*p == '\0') || (*p == 0xff))
+				break;
+			if (++p == q)
+				return -EINVAL;
+		}
+		if ((*p == 0xff) || (++p == q))
+			break;
 	}
-	if ((*p == 0xff) || (++p == q))
-		break;
-    }
-    if (found) {
-	*found = ns;
-	return 0;
-    } else {
+	if (found) {
+		*found = ns;
+		return 0;
+	}
+
 	return (ns == max) ? 0 : -EINVAL;
-    }
 }
 
-/*====================================================================*/
 
 static int parse_vers_1(tuple_t *tuple, cistpl_vers_1_t *vers_1)
 {
-    u_char *p, *q;
+	u_char *p, *q;
 
-    p = (u_char *)tuple->TupleData;
-    q = p + tuple->TupleDataLen;
+	p = (u_char *)tuple->TupleData;
+	q = p + tuple->TupleDataLen;
 
-    vers_1->major = *p; p++;
-    vers_1->minor = *p; p++;
-    if (p >= q)
-	    return -EINVAL;
+	vers_1->major = *p; p++;
+	vers_1->minor = *p; p++;
+	if (p >= q)
+		return -EINVAL;
 
-    return parse_strings(p, q, CISTPL_VERS_1_MAX_PROD_STRINGS,
-			 vers_1->str, vers_1->ofs, &vers_1->ns);
+	return parse_strings(p, q, CISTPL_VERS_1_MAX_PROD_STRINGS,
+			vers_1->str, vers_1->ofs, &vers_1->ns);
 }
 
-/*====================================================================*/
 
 static int parse_altstr(tuple_t *tuple, cistpl_altstr_t *altstr)
 {
-    u_char *p, *q;
+	u_char *p, *q;
 
-    p = (u_char *)tuple->TupleData;
-    q = p + tuple->TupleDataLen;
+	p = (u_char *)tuple->TupleData;
+	q = p + tuple->TupleDataLen;
 
-    return parse_strings(p, q, CISTPL_MAX_ALTSTR_STRINGS,
-			 altstr->str, altstr->ofs, &altstr->ns);
+	return parse_strings(p, q, CISTPL_MAX_ALTSTR_STRINGS,
+			altstr->str, altstr->ofs, &altstr->ns);
 }
 
-/*====================================================================*/
 
 static int parse_jedec(tuple_t *tuple, cistpl_jedec_t *jedec)
 {
-    u_char *p, *q;
-    int nid;
+	u_char *p, *q;
+	int nid;
 
-    p = (u_char *)tuple->TupleData;
-    q = p + tuple->TupleDataLen;
+	p = (u_char *)tuple->TupleData;
+	q = p + tuple->TupleDataLen;
 
-    for (nid = 0; nid < CISTPL_MAX_DEVICES; nid++) {
-	if (p > q-2)
-		break;
-	jedec->id[nid].mfr = p[0];
-	jedec->id[nid].info = p[1];
-	p += 2;
-    }
-    jedec->nid = nid;
-    return 0;
+	for (nid = 0; nid < CISTPL_MAX_DEVICES; nid++) {
+		if (p > q-2)
+			break;
+		jedec->id[nid].mfr = p[0];
+		jedec->id[nid].info = p[1];
+		p += 2;
+	}
+	jedec->nid = nid;
+	return 0;
 }
 
-/*====================================================================*/
 
 static int parse_manfid(tuple_t *tuple, cistpl_manfid_t *m)
 {
-    if (tuple->TupleDataLen < 4)
-	return -EINVAL;
-    m->manf = get_unaligned_le16(tuple->TupleData);
-    m->card = get_unaligned_le16(tuple->TupleData + 2);
-    return 0;
+	if (tuple->TupleDataLen < 4)
+		return -EINVAL;
+	m->manf = get_unaligned_le16(tuple->TupleData);
+	m->card = get_unaligned_le16(tuple->TupleData + 2);
+	return 0;
 }
 
-/*====================================================================*/
 
 static int parse_funcid(tuple_t *tuple, cistpl_funcid_t *f)
 {
-    u_char *p;
-    if (tuple->TupleDataLen < 2)
-	return -EINVAL;
-    p = (u_char *)tuple->TupleData;
-    f->func = p[0];
-    f->sysinit = p[1];
-    return 0;
+	u_char *p;
+	if (tuple->TupleDataLen < 2)
+		return -EINVAL;
+	p = (u_char *)tuple->TupleData;
+	f->func = p[0];
+	f->sysinit = p[1];
+	return 0;
 }
 
-/*====================================================================*/
 
 static int parse_funce(tuple_t *tuple, cistpl_funce_t *f)
 {
-    u_char *p;
-    int i;
-    if (tuple->TupleDataLen < 1)
-	return -EINVAL;
-    p = (u_char *)tuple->TupleData;
-    f->type = p[0];
-    for (i = 1; i < tuple->TupleDataLen; i++)
-	f->data[i-1] = p[i];
-    return 0;
+	u_char *p;
+	int i;
+	if (tuple->TupleDataLen < 1)
+		return -EINVAL;
+	p = (u_char *)tuple->TupleData;
+	f->type = p[0];
+	for (i = 1; i < tuple->TupleDataLen; i++)
+		f->data[i-1] = p[i];
+	return 0;
 }
 
-/*====================================================================*/
 
 static int parse_config(tuple_t *tuple, cistpl_config_t *config)
 {
-    int rasz, rmsz, i;
-    u_char *p;
-
-    p = (u_char *)tuple->TupleData;
-    rasz = *p & 0x03;
-    rmsz = (*p & 0x3c) >> 2;
-    if (tuple->TupleDataLen < rasz+rmsz+4)
-	return -EINVAL;
-    config->last_idx = *(++p);
-    p++;
-    config->base = 0;
-    for (i = 0; i <= rasz; i++)
-	config->base += p[i] << (8*i);
-    p += rasz+1;
-    for (i = 0; i < 4; i++)
-	config->rmask[i] = 0;
-    for (i = 0; i <= rmsz; i++)
-	config->rmask[i>>2] += p[i] << (8*(i%4));
-    config->subtuples = tuple->TupleDataLen - (rasz+rmsz+4);
-    return 0;
+	int rasz, rmsz, i;
+	u_char *p;
+
+	p = (u_char *)tuple->TupleData;
+	rasz = *p & 0x03;
+	rmsz = (*p & 0x3c) >> 2;
+	if (tuple->TupleDataLen < rasz+rmsz+4)
+		return -EINVAL;
+	config->last_idx = *(++p);
+	p++;
+	config->base = 0;
+	for (i = 0; i <= rasz; i++)
+		config->base += p[i] << (8*i);
+	p += rasz+1;
+	for (i = 0; i < 4; i++)
+		config->rmask[i] = 0;
+	for (i = 0; i <= rmsz; i++)
+		config->rmask[i>>2] += p[i] << (8*(i%4));
+	config->subtuples = tuple->TupleDataLen - (rasz+rmsz+4);
+	return 0;
 }
 
-/*======================================================================
+/* The following routines are all used to parse the nightmarish
+ * config table entries.
+ */
+
+static u_char *parse_power(u_char *p, u_char *q, cistpl_power_t *pwr)
+{
+	int i;
+	u_int scale;
 
-    The following routines are all used to parse the nightmarish
-    config table entries.
+	if (p == q)
+		return NULL;
+	pwr->present = *p;
+	pwr->flags = 0;
+	p++;
+	for (i = 0; i < 7; i++)
+		if (pwr->present & (1<<i)) {
+			if (p == q)
+				return NULL;
+			pwr->param[i] = POWER_CVT(*p);
+			scale = POWER_SCALE(*p);
+			while (*p & 0x80) {
+				if (++p == q)
+					return NULL;
+				if ((*p & 0x7f) < 100)
+					pwr->param[i] +=
+						(*p & 0x7f) * scale / 100;
+				else if (*p == 0x7d)
+					pwr->flags |= CISTPL_POWER_HIGHZ_OK;
+				else if (*p == 0x7e)
+					pwr->param[i] = 0;
+				else if (*p == 0x7f)
+					pwr->flags |= CISTPL_POWER_HIGHZ_REQ;
+				else
+					return NULL;
+			}
+			p++;
+		}
+	return p;
+}
 
-======================================================================*/
 
-static u_char *parse_power(u_char *p, u_char *q,
-			   cistpl_power_t *pwr)
+static u_char *parse_timing(u_char *p, u_char *q, cistpl_timing_t *timing)
 {
-    int i;
-    u_int scale;
-
-    if (p == q)
-	    return NULL;
-    pwr->present = *p;
-    pwr->flags = 0;
-    p++;
-    for (i = 0; i < 7; i++)
-	if (pwr->present & (1<<i)) {
-	    if (p == q)
-		    return NULL;
-	    pwr->param[i] = POWER_CVT(*p);
-	    scale = POWER_SCALE(*p);
-	    while (*p & 0x80) {
+	u_char scale;
+
+	if (p == q)
+		return NULL;
+	scale = *p;
+	if ((scale & 3) != 3) {
 		if (++p == q)
 			return NULL;
-		if ((*p & 0x7f) < 100)
-		    pwr->param[i] += (*p & 0x7f) * scale / 100;
-		else if (*p == 0x7d)
-		    pwr->flags |= CISTPL_POWER_HIGHZ_OK;
-		else if (*p == 0x7e)
-		    pwr->param[i] = 0;
-		else if (*p == 0x7f)
-		    pwr->flags |= CISTPL_POWER_HIGHZ_REQ;
-		else
-		    return NULL;
-	    }
-	    p++;
-	}
-    return p;
+		timing->wait = SPEED_CVT(*p);
+		timing->waitscale = exponent[scale & 3];
+	} else
+		timing->wait = 0;
+	scale >>= 2;
+	if ((scale & 7) != 7) {
+		if (++p == q)
+			return NULL;
+		timing->ready = SPEED_CVT(*p);
+		timing->rdyscale = exponent[scale & 7];
+	} else
+		timing->ready = 0;
+	scale >>= 3;
+	if (scale != 7) {
+		if (++p == q)
+			return NULL;
+		timing->reserved = SPEED_CVT(*p);
+		timing->rsvscale = exponent[scale];
+	} else
+		timing->reserved = 0;
+	p++;
+	return p;
 }
 
-/*====================================================================*/
 
-static u_char *parse_timing(u_char *p, u_char *q,
-			    cistpl_timing_t *timing)
+static u_char *parse_io(u_char *p, u_char *q, cistpl_io_t *io)
 {
-    u_char scale;
+	int i, j, bsz, lsz;
 
-    if (p == q)
-	    return NULL;
-    scale = *p;
-    if ((scale & 3) != 3) {
-	if (++p == q)
-		return NULL;
-	timing->wait = SPEED_CVT(*p);
-	timing->waitscale = exponent[scale & 3];
-    } else
-	timing->wait = 0;
-    scale >>= 2;
-    if ((scale & 7) != 7) {
-	if (++p == q)
+	if (p == q)
 		return NULL;
-	timing->ready = SPEED_CVT(*p);
-	timing->rdyscale = exponent[scale & 7];
-    } else
-	timing->ready = 0;
-    scale >>= 3;
-    if (scale != 7) {
+	io->flags = *p;
+
+	if (!(*p & 0x80)) {
+		io->nwin = 1;
+		io->win[0].base = 0;
+		io->win[0].len = (1 << (io->flags & CISTPL_IO_LINES_MASK));
+		return p+1;
+	}
+
 	if (++p == q)
 		return NULL;
-	timing->reserved = SPEED_CVT(*p);
-	timing->rsvscale = exponent[scale];
-    } else
-	timing->reserved = 0;
-    p++;
-    return p;
-}
-
-/*====================================================================*/
+	io->nwin = (*p & 0x0f) + 1;
+	bsz = (*p & 0x30) >> 4;
+	if (bsz == 3)
+		bsz++;
+	lsz = (*p & 0xc0) >> 6;
+	if (lsz == 3)
+		lsz++;
+	p++;
 
-static u_char *parse_io(u_char *p, u_char *q, cistpl_io_t *io)
-{
-    int i, j, bsz, lsz;
-
-    if (p == q)
-	    return NULL;
-    io->flags = *p;
-
-    if (!(*p & 0x80)) {
-	io->nwin = 1;
-	io->win[0].base = 0;
-	io->win[0].len = (1 << (io->flags & CISTPL_IO_LINES_MASK));
-	return p+1;
-    }
-
-    if (++p == q)
-	    return NULL;
-    io->nwin = (*p & 0x0f) + 1;
-    bsz = (*p & 0x30) >> 4;
-    if (bsz == 3)
-	    bsz++;
-    lsz = (*p & 0xc0) >> 6;
-    if (lsz == 3)
-	    lsz++;
-    p++;
-
-    for (i = 0; i < io->nwin; i++) {
-	io->win[i].base = 0;
-	io->win[i].len = 1;
-	for (j = 0; j < bsz; j++, p++) {
-	    if (p == q)
-		    return NULL;
-	    io->win[i].base += *p << (j*8);
-	}
-	for (j = 0; j < lsz; j++, p++) {
-	    if (p == q)
-		    return NULL;
-	    io->win[i].len += *p << (j*8);
+	for (i = 0; i < io->nwin; i++) {
+		io->win[i].base = 0;
+		io->win[i].len = 1;
+		for (j = 0; j < bsz; j++, p++) {
+			if (p == q)
+				return NULL;
+			io->win[i].base += *p << (j*8);
+		}
+		for (j = 0; j < lsz; j++, p++) {
+			if (p == q)
+				return NULL;
+			io->win[i].len += *p << (j*8);
+		}
 	}
-    }
-    return p;
+	return p;
 }
 
-/*====================================================================*/
 
 static u_char *parse_mem(u_char *p, u_char *q, cistpl_mem_t *mem)
 {
-    int i, j, asz, lsz, has_ha;
-    u_int len, ca, ha;
-
-    if (p == q)
-	    return NULL;
-
-    mem->nwin = (*p & 0x07) + 1;
-    lsz = (*p & 0x18) >> 3;
-    asz = (*p & 0x60) >> 5;
-    has_ha = (*p & 0x80);
-    if (++p == q)
-	    return NULL;
-
-    for (i = 0; i < mem->nwin; i++) {
-	len = ca = ha = 0;
-	for (j = 0; j < lsz; j++, p++) {
-	    if (p == q)
-		    return NULL;
-	    len += *p << (j*8);
-	}
-	for (j = 0; j < asz; j++, p++) {
-	    if (p == q)
-		    return NULL;
-	    ca += *p << (j*8);
+	int i, j, asz, lsz, has_ha;
+	u_int len, ca, ha;
+
+	if (p == q)
+		return NULL;
+
+	mem->nwin = (*p & 0x07) + 1;
+	lsz = (*p & 0x18) >> 3;
+	asz = (*p & 0x60) >> 5;
+	has_ha = (*p & 0x80);
+	if (++p == q)
+		return NULL;
+
+	for (i = 0; i < mem->nwin; i++) {
+		len = ca = ha = 0;
+		for (j = 0; j < lsz; j++, p++) {
+			if (p == q)
+				return NULL;
+			len += *p << (j*8);
+		}
+		for (j = 0; j < asz; j++, p++) {
+			if (p == q)
+				return NULL;
+			ca += *p << (j*8);
+		}
+		if (has_ha)
+			for (j = 0; j < asz; j++, p++) {
+				if (p == q)
+					return NULL;
+				ha += *p << (j*8);
+			}
+		mem->win[i].len = len << 8;
+		mem->win[i].card_addr = ca << 8;
+		mem->win[i].host_addr = ha << 8;
 	}
-	if (has_ha)
-	    for (j = 0; j < asz; j++, p++) {
-		if (p == q)
-			return NULL;
-		ha += *p << (j*8);
-	    }
-	mem->win[i].len = len << 8;
-	mem->win[i].card_addr = ca << 8;
-	mem->win[i].host_addr = ha << 8;
-    }
-    return p;
+	return p;
 }
 
-/*====================================================================*/
 
 static u_char *parse_irq(u_char *p, u_char *q, cistpl_irq_t *irq)
 {
-    if (p == q)
-	    return NULL;
-    irq->IRQInfo1 = *p; p++;
-    if (irq->IRQInfo1 & IRQ_INFO2_VALID) {
-	if (p+2 > q)
+	if (p == q)
 		return NULL;
-	irq->IRQInfo2 = (p[1]<<8) + p[0];
-	p += 2;
-    }
-    return p;
+	irq->IRQInfo1 = *p; p++;
+	if (irq->IRQInfo1 & IRQ_INFO2_VALID) {
+		if (p+2 > q)
+			return NULL;
+		irq->IRQInfo2 = (p[1]<<8) + p[0];
+		p += 2;
+	}
+	return p;
 }
 
-/*====================================================================*/
 
 static int parse_cftable_entry(tuple_t *tuple,
 			       cistpl_cftable_entry_t *entry)
 {
-    u_char *p, *q, features;
-
-    p = tuple->TupleData;
-    q = p + tuple->TupleDataLen;
-    entry->index = *p & 0x3f;
-    entry->flags = 0;
-    if (*p & 0x40)
-	entry->flags |= CISTPL_CFTABLE_DEFAULT;
-    if (*p & 0x80) {
-	if (++p == q)
-		return -EINVAL;
-	if (*p & 0x10)
-	    entry->flags |= CISTPL_CFTABLE_BVDS;
-	if (*p & 0x20)
-	    entry->flags |= CISTPL_CFTABLE_WP;
+	u_char *p, *q, features;
+
+	p = tuple->TupleData;
+	q = p + tuple->TupleDataLen;
+	entry->index = *p & 0x3f;
+	entry->flags = 0;
 	if (*p & 0x40)
-	    entry->flags |= CISTPL_CFTABLE_RDYBSY;
-	if (*p & 0x80)
-	    entry->flags |= CISTPL_CFTABLE_MWAIT;
-	entry->interface = *p & 0x0f;
-    } else
-	entry->interface = 0;
-
-    /* Process optional features */
-    if (++p == q)
-	    return -EINVAL;
-    features = *p; p++;
-
-    /* Power options */
-    if ((features & 3) > 0) {
-	p = parse_power(p, q, &entry->vcc);
-	if (p == NULL)
-		return -EINVAL;
-    } else
-	entry->vcc.present = 0;
-    if ((features & 3) > 1) {
-	p = parse_power(p, q, &entry->vpp1);
-	if (p == NULL)
-		return -EINVAL;
-    } else
-	entry->vpp1.present = 0;
-    if ((features & 3) > 2) {
-	p = parse_power(p, q, &entry->vpp2);
-	if (p == NULL)
-		return -EINVAL;
-    } else
-	entry->vpp2.present = 0;
+		entry->flags |= CISTPL_CFTABLE_DEFAULT;
+	if (*p & 0x80) {
+		if (++p == q)
+			return -EINVAL;
+		if (*p & 0x10)
+			entry->flags |= CISTPL_CFTABLE_BVDS;
+		if (*p & 0x20)
+			entry->flags |= CISTPL_CFTABLE_WP;
+		if (*p & 0x40)
+			entry->flags |= CISTPL_CFTABLE_RDYBSY;
+		if (*p & 0x80)
+			entry->flags |= CISTPL_CFTABLE_MWAIT;
+		entry->interface = *p & 0x0f;
+	} else
+		entry->interface = 0;
 
-    /* Timing options */
-    if (features & 0x04) {
-	p = parse_timing(p, q, &entry->timing);
-	if (p == NULL)
-		return -EINVAL;
-    } else {
-	entry->timing.wait = 0;
-	entry->timing.ready = 0;
-	entry->timing.reserved = 0;
-    }
-
-    /* I/O window options */
-    if (features & 0x08) {
-	p = parse_io(p, q, &entry->io);
-	if (p == NULL)
+	/* Process optional features */
+	if (++p == q)
 		return -EINVAL;
-    } else
-	entry->io.nwin = 0;
+	features = *p; p++;
 
-    /* Interrupt options */
-    if (features & 0x10) {
-	p = parse_irq(p, q, &entry->irq);
-	if (p == NULL)
-		return -EINVAL;
-    } else
-	entry->irq.IRQInfo1 = 0;
-
-    switch (features & 0x60) {
-    case 0x00:
-	entry->mem.nwin = 0;
-	break;
-    case 0x20:
-	entry->mem.nwin = 1;
-	entry->mem.win[0].len = get_unaligned_le16(p) << 8;
-	entry->mem.win[0].card_addr = 0;
-	entry->mem.win[0].host_addr = 0;
-	p += 2;
-	if (p > q)
-		return -EINVAL;
-	break;
-    case 0x40:
-	entry->mem.nwin = 1;
-	entry->mem.win[0].len = get_unaligned_le16(p) << 8;
-	entry->mem.win[0].card_addr = get_unaligned_le16(p + 2) << 8;
-	entry->mem.win[0].host_addr = 0;
-	p += 4;
-	if (p > q)
-		return -EINVAL;
-	break;
-    case 0x60:
-	p = parse_mem(p, q, &entry->mem);
-	if (p == NULL)
-		return -EINVAL;
-	break;
-    }
+	/* Power options */
+	if ((features & 3) > 0) {
+		p = parse_power(p, q, &entry->vcc);
+		if (p == NULL)
+			return -EINVAL;
+	} else
+		entry->vcc.present = 0;
+	if ((features & 3) > 1) {
+		p = parse_power(p, q, &entry->vpp1);
+		if (p == NULL)
+			return -EINVAL;
+	} else
+		entry->vpp1.present = 0;
+	if ((features & 3) > 2) {
+		p = parse_power(p, q, &entry->vpp2);
+		if (p == NULL)
+			return -EINVAL;
+	} else
+		entry->vpp2.present = 0;
 
-    /* Misc features */
-    if (features & 0x80) {
-	if (p == q)
-		return -EINVAL;
-	entry->flags |= (*p << 8);
-	while (*p & 0x80)
-	    if (++p == q)
-		    return -EINVAL;
-	p++;
-    }
+	/* Timing options */
+	if (features & 0x04) {
+		p = parse_timing(p, q, &entry->timing);
+		if (p == NULL)
+			return -EINVAL;
+	} else {
+		entry->timing.wait = 0;
+		entry->timing.ready = 0;
+		entry->timing.reserved = 0;
+	}
 
-    entry->subtuples = q-p;
+	/* I/O window options */
+	if (features & 0x08) {
+		p = parse_io(p, q, &entry->io);
+		if (p == NULL)
+			return -EINVAL;
+	} else
+		entry->io.nwin = 0;
+
+	/* Interrupt options */
+	if (features & 0x10) {
+		p = parse_irq(p, q, &entry->irq);
+		if (p == NULL)
+			return -EINVAL;
+	} else
+		entry->irq.IRQInfo1 = 0;
+
+	switch (features & 0x60) {
+	case 0x00:
+		entry->mem.nwin = 0;
+		break;
+	case 0x20:
+		entry->mem.nwin = 1;
+		entry->mem.win[0].len = get_unaligned_le16(p) << 8;
+		entry->mem.win[0].card_addr = 0;
+		entry->mem.win[0].host_addr = 0;
+		p += 2;
+		if (p > q)
+			return -EINVAL;
+		break;
+	case 0x40:
+		entry->mem.nwin = 1;
+		entry->mem.win[0].len = get_unaligned_le16(p) << 8;
+		entry->mem.win[0].card_addr = get_unaligned_le16(p + 2) << 8;
+		entry->mem.win[0].host_addr = 0;
+		p += 4;
+		if (p > q)
+			return -EINVAL;
+		break;
+	case 0x60:
+		p = parse_mem(p, q, &entry->mem);
+		if (p == NULL)
+			return -EINVAL;
+		break;
+	}
+
+	/* Misc features */
+	if (features & 0x80) {
+		if (p == q)
+			return -EINVAL;
+		entry->flags |= (*p << 8);
+		while (*p & 0x80)
+			if (++p == q)
+				return -EINVAL;
+		p++;
+	}
+
+	entry->subtuples = q-p;
 
-    return 0;
+	return 0;
 }
 
-/*====================================================================*/
 
 static int parse_device_geo(tuple_t *tuple, cistpl_device_geo_t *geo)
 {
-    u_char *p, *q;
-    int n;
+	u_char *p, *q;
+	int n;
 
-    p = (u_char *)tuple->TupleData;
-    q = p + tuple->TupleDataLen;
+	p = (u_char *)tuple->TupleData;
+	q = p + tuple->TupleDataLen;
 
-    for (n = 0; n < CISTPL_MAX_DEVICES; n++) {
-	if (p > q-6)
-		break;
-	geo->geo[n].buswidth = p[0];
-	geo->geo[n].erase_block = 1 << (p[1]-1);
-	geo->geo[n].read_block  = 1 << (p[2]-1);
-	geo->geo[n].write_block = 1 << (p[3]-1);
-	geo->geo[n].partition   = 1 << (p[4]-1);
-	geo->geo[n].interleave  = 1 << (p[5]-1);
-	p += 6;
-    }
-    geo->ngeo = n;
-    return 0;
+	for (n = 0; n < CISTPL_MAX_DEVICES; n++) {
+		if (p > q-6)
+			break;
+		geo->geo[n].buswidth = p[0];
+		geo->geo[n].erase_block = 1 << (p[1]-1);
+		geo->geo[n].read_block  = 1 << (p[2]-1);
+		geo->geo[n].write_block = 1 << (p[3]-1);
+		geo->geo[n].partition   = 1 << (p[4]-1);
+		geo->geo[n].interleave  = 1 << (p[5]-1);
+		p += 6;
+	}
+	geo->ngeo = n;
+	return 0;
 }
 
-/*====================================================================*/
 
 static int parse_vers_2(tuple_t *tuple, cistpl_vers_2_t *v2)
 {
-    u_char *p, *q;
-
-    if (tuple->TupleDataLen < 10)
-	return -EINVAL;
-
-    p = tuple->TupleData;
-    q = p + tuple->TupleDataLen;
-
-    v2->vers = p[0];
-    v2->comply = p[1];
-    v2->dindex = get_unaligned_le16(p + 2);
-    v2->vspec8 = p[6];
-    v2->vspec9 = p[7];
-    v2->nhdr = p[8];
-    p += 9;
-    return parse_strings(p, q, 2, v2->str, &v2->vendor, NULL);
+	u_char *p, *q;
+
+	if (tuple->TupleDataLen < 10)
+		return -EINVAL;
+
+	p = tuple->TupleData;
+	q = p + tuple->TupleDataLen;
+
+	v2->vers = p[0];
+	v2->comply = p[1];
+	v2->dindex = get_unaligned_le16(p + 2);
+	v2->vspec8 = p[6];
+	v2->vspec9 = p[7];
+	v2->nhdr = p[8];
+	p += 9;
+	return parse_strings(p, q, 2, v2->str, &v2->vendor, NULL);
 }
 
-/*====================================================================*/
 
 static int parse_org(tuple_t *tuple, cistpl_org_t *org)
 {
-    u_char *p, *q;
-    int i;
-
-    p = tuple->TupleData;
-    q = p + tuple->TupleDataLen;
-    if (p == q)
-	    return -EINVAL;
-    org->data_org = *p;
-    if (++p == q)
-	    return -EINVAL;
-    for (i = 0; i < 30; i++) {
-	org->desc[i] = *p;
-	if (*p == '\0')
-		break;
+	u_char *p, *q;
+	int i;
+
+	p = tuple->TupleData;
+	q = p + tuple->TupleDataLen;
+	if (p == q)
+		return -EINVAL;
+	org->data_org = *p;
 	if (++p == q)
 		return -EINVAL;
-    }
-    return 0;
+	for (i = 0; i < 30; i++) {
+		org->desc[i] = *p;
+		if (*p == '\0')
+			break;
+		if (++p == q)
+			return -EINVAL;
+	}
+	return 0;
 }
 
-/*====================================================================*/
 
 static int parse_format(tuple_t *tuple, cistpl_format_t *fmt)
 {
-    u_char *p;
+	u_char *p;
 
-    if (tuple->TupleDataLen < 10)
-	return -EINVAL;
+	if (tuple->TupleDataLen < 10)
+		return -EINVAL;
 
-    p = tuple->TupleData;
+	p = tuple->TupleData;
 
-    fmt->type = p[0];
-    fmt->edc = p[1];
-    fmt->offset = get_unaligned_le32(p + 2);
-    fmt->length = get_unaligned_le32(p + 6);
+	fmt->type = p[0];
+	fmt->edc = p[1];
+	fmt->offset = get_unaligned_le32(p + 2);
+	fmt->length = get_unaligned_le32(p + 6);
 
-    return 0;
+	return 0;
 }
 
-/*====================================================================*/
 
 int pcmcia_parse_tuple(tuple_t *tuple, cisparse_t *parse)
 {
-    int ret = 0;
-
-    if (tuple->TupleDataLen > tuple->TupleDataMax)
-	return -EINVAL;
-    switch (tuple->TupleCode) {
-    case CISTPL_DEVICE:
-    case CISTPL_DEVICE_A:
-	ret = parse_device(tuple, &parse->device);
-	break;
-    case CISTPL_CHECKSUM:
-	ret = parse_checksum(tuple, &parse->checksum);
-	break;
-    case CISTPL_LONGLINK_A:
-    case CISTPL_LONGLINK_C:
-	ret = parse_longlink(tuple, &parse->longlink);
-	break;
-    case CISTPL_LONGLINK_MFC:
-	ret = parse_longlink_mfc(tuple, &parse->longlink_mfc);
-	break;
-    case CISTPL_VERS_1:
-	ret = parse_vers_1(tuple, &parse->version_1);
-	break;
-    case CISTPL_ALTSTR:
-	ret = parse_altstr(tuple, &parse->altstr);
-	break;
-    case CISTPL_JEDEC_A:
-    case CISTPL_JEDEC_C:
-	ret = parse_jedec(tuple, &parse->jedec);
-	break;
-    case CISTPL_MANFID:
-	ret = parse_manfid(tuple, &parse->manfid);
-	break;
-    case CISTPL_FUNCID:
-	ret = parse_funcid(tuple, &parse->funcid);
-	break;
-    case CISTPL_FUNCE:
-	ret = parse_funce(tuple, &parse->funce);
-	break;
-    case CISTPL_CONFIG:
-	ret = parse_config(tuple, &parse->config);
-	break;
-    case CISTPL_CFTABLE_ENTRY:
-	ret = parse_cftable_entry(tuple, &parse->cftable_entry);
-	break;
-    case CISTPL_DEVICE_GEO:
-    case CISTPL_DEVICE_GEO_A:
-	ret = parse_device_geo(tuple, &parse->device_geo);
-	break;
-    case CISTPL_VERS_2:
-	ret = parse_vers_2(tuple, &parse->vers_2);
-	break;
-    case CISTPL_ORG:
-	ret = parse_org(tuple, &parse->org);
-	break;
-    case CISTPL_FORMAT:
-    case CISTPL_FORMAT_A:
-	ret = parse_format(tuple, &parse->format);
-	break;
-    case CISTPL_NO_LINK:
-    case CISTPL_LINKTARGET:
-	ret = 0;
-	break;
-    default:
-	ret = -EINVAL;
-	break;
-    }
-    if (ret)
-	    pr_debug("parse_tuple failed %d\n", ret);
-    return ret;
+	int ret = 0;
+
+	if (tuple->TupleDataLen > tuple->TupleDataMax)
+		return -EINVAL;
+	switch (tuple->TupleCode) {
+	case CISTPL_DEVICE:
+	case CISTPL_DEVICE_A:
+		ret = parse_device(tuple, &parse->device);
+		break;
+	case CISTPL_CHECKSUM:
+		ret = parse_checksum(tuple, &parse->checksum);
+		break;
+	case CISTPL_LONGLINK_A:
+	case CISTPL_LONGLINK_C:
+		ret = parse_longlink(tuple, &parse->longlink);
+		break;
+	case CISTPL_LONGLINK_MFC:
+		ret = parse_longlink_mfc(tuple, &parse->longlink_mfc);
+		break;
+	case CISTPL_VERS_1:
+		ret = parse_vers_1(tuple, &parse->version_1);
+		break;
+	case CISTPL_ALTSTR:
+		ret = parse_altstr(tuple, &parse->altstr);
+		break;
+	case CISTPL_JEDEC_A:
+	case CISTPL_JEDEC_C:
+		ret = parse_jedec(tuple, &parse->jedec);
+		break;
+	case CISTPL_MANFID:
+		ret = parse_manfid(tuple, &parse->manfid);
+		break;
+	case CISTPL_FUNCID:
+		ret = parse_funcid(tuple, &parse->funcid);
+		break;
+	case CISTPL_FUNCE:
+		ret = parse_funce(tuple, &parse->funce);
+		break;
+	case CISTPL_CONFIG:
+		ret = parse_config(tuple, &parse->config);
+		break;
+	case CISTPL_CFTABLE_ENTRY:
+		ret = parse_cftable_entry(tuple, &parse->cftable_entry);
+		break;
+	case CISTPL_DEVICE_GEO:
+	case CISTPL_DEVICE_GEO_A:
+		ret = parse_device_geo(tuple, &parse->device_geo);
+		break;
+	case CISTPL_VERS_2:
+		ret = parse_vers_2(tuple, &parse->vers_2);
+		break;
+	case CISTPL_ORG:
+		ret = parse_org(tuple, &parse->org);
+		break;
+	case CISTPL_FORMAT:
+	case CISTPL_FORMAT_A:
+		ret = parse_format(tuple, &parse->format);
+		break;
+	case CISTPL_NO_LINK:
+	case CISTPL_LINKTARGET:
+		ret = 0;
+		break;
+	default:
+		ret = -EINVAL;
+		break;
+	}
+	if (ret)
+		pr_debug("parse_tuple failed %d\n", ret);
+	return ret;
 }
 EXPORT_SYMBOL(pcmcia_parse_tuple);
 
-/*======================================================================
 
-    This is used internally by Card Services to look up CIS stuff.
-
-======================================================================*/
-
-int pccard_read_tuple(struct pcmcia_socket *s, unsigned int function, cisdata_t code, void *parse)
+/**
+ * pccard_read_tuple() - internal CIS tuple access
+ * @s:		the struct pcmcia_socket where the card is inserted
+ * @function:	the device function we loop for
+ * @code:	which CIS code shall we look for?
+ * @parse:	buffer where the tuple shall be parsed (or NULL, if no parse)
+ *
+ * pccard_read_tuple() reads out one tuple and attempts to parse it
+ */
+int pccard_read_tuple(struct pcmcia_socket *s, unsigned int function,
+		cisdata_t code, void *parse)
 {
-    tuple_t tuple;
-    cisdata_t *buf;
-    int ret;
-
-    buf = kmalloc(256, GFP_KERNEL);
-    if (buf == NULL) {
-	    dev_printk(KERN_WARNING, &s->dev, "no memory to read tuple\n");
-	    return -ENOMEM;
-    }
-    tuple.DesiredTuple = code;
-    tuple.Attributes = 0;
-    if (function == BIND_FN_ALL)
-	    tuple.Attributes = TUPLE_RETURN_COMMON;
-    ret = pccard_get_first_tuple(s, function, &tuple);
-    if (ret != 0)
-	    goto done;
-    tuple.TupleData = buf;
-    tuple.TupleOffset = 0;
-    tuple.TupleDataMax = 255;
-    ret = pccard_get_tuple_data(s, &tuple);
-    if (ret != 0)
-	    goto done;
-    ret = pcmcia_parse_tuple(&tuple, parse);
+	tuple_t tuple;
+	cisdata_t *buf;
+	int ret;
+
+	buf = kmalloc(256, GFP_KERNEL);
+	if (buf == NULL) {
+		dev_printk(KERN_WARNING, &s->dev, "no memory to read tuple\n");
+		return -ENOMEM;
+	}
+	tuple.DesiredTuple = code;
+	tuple.Attributes = 0;
+	if (function == BIND_FN_ALL)
+		tuple.Attributes = TUPLE_RETURN_COMMON;
+	ret = pccard_get_first_tuple(s, function, &tuple);
+	if (ret != 0)
+		goto done;
+	tuple.TupleData = buf;
+	tuple.TupleOffset = 0;
+	tuple.TupleDataMax = 255;
+	ret = pccard_get_tuple_data(s, &tuple);
+	if (ret != 0)
+		goto done;
+	ret = pcmcia_parse_tuple(&tuple, parse);
 done:
-    kfree(buf);
-    return ret;
+	kfree(buf);
+	return ret;
 }
 
 
diff --git a/drivers/pcmcia/rsrc_mgr.c b/drivers/pcmcia/rsrc_mgr.c
index e6f7d41..452c83b 100644
--- a/drivers/pcmcia/rsrc_mgr.c
+++ b/drivers/pcmcia/rsrc_mgr.c
@@ -79,9 +79,8 @@ static resource_size_t pcmcia_align(void *align_data,
 
 #ifdef CONFIG_X86
 	if (res->flags & IORESOURCE_IO) {
-		if (start & 0x300) {
+		if (start & 0x300)
 			start = (start + 0x3ff) & ~0x3ff;
-		}
 	}
 #endif
 
-- 
1.6.3.3



From rmk+lkml at arm.linux.org.uk  Wed Mar  3 03:30:11 2010
From: rmk+lkml at arm.linux.org.uk (Russell King)
Date: Wed, 3 Mar 2010 08:30:11 +0000
Subject: [git pull] more PCMCIA updates for 2.6.34 (including ioctl
	deprecation)
In-Reply-To: <20100303075944.GA23354@comet.dominikbrodowski.net>
References: <20100303075944.GA23354@comet.dominikbrodowski.net>
Message-ID: <20100303083010.GA22928@flint.arm.linux.org.uk>

On Wed, Mar 03, 2010 at 08:59:44AM +0100, Dominik Brodowski wrote:
> Please pull from that location insofar as you agree to continue with the
> deprecation of the PCMCIA ioctl. Otherwise, I can prepare a branch
> _without_ this controversial patch to pull from.

So you believe that disabling the button in the graphical environment
to allow PCMCIA cards to be removed (such as CF cards) - leaving the
user to merely pull out the CF card, while the FS is mounted, is a
good idea?

Sounds to me like a data loss scenario.

User APIs changing always breaks stuff.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:


From linux at dominikbrodowski.net  Wed Mar  3 03:43:37 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Wed, 3 Mar 2010 09:43:37 +0100
Subject: [git pull] more PCMCIA updates for 2.6.34 (including ioctl
	deprecation)
In-Reply-To: <20100303083010.GA22928@flint.arm.linux.org.uk>
References: <20100303075944.GA23354@comet.dominikbrodowski.net>
	<20100303083010.GA22928@flint.arm.linux.org.uk>
Message-ID: <20100303084337.GA24920@comet.dominikbrodowski.net>

Russell,

On Wed, Mar 03, 2010 at 08:30:11AM +0000, Russell King wrote:
> On Wed, Mar 03, 2010 at 08:59:44AM +0100, Dominik Brodowski wrote:
> > Please pull from that location insofar as you agree to continue with the
> > deprecation of the PCMCIA ioctl. Otherwise, I can prepare a branch
> > _without_ this controversial patch to pull from.
> 
> So you believe that disabling the button in the graphical environment
> to allow PCMCIA cards to be removed (such as CF cards) - leaving the
> user to merely pull out the CF card, while the FS is mounted, is a
> good idea?

In which graphical environment specifically?`Which graphical environment
failed to update how to issue card removal events[1] even though the old
interface has been marked as deprecated since July 2005, and clear and bold
warnings have been visible in dmesg since September 2005?

Thanks,
	Dominik

[1] Either
# echo 1 > /sys/class/pcmcia_socket/pcmcia_socket{0,1,...}/card_eject
or, if pcmciautils are used,
# pccardctl eject [socket]


From Jens.Kuenzer at fpga.homeip.net  Thu Mar  4 03:28:41 2010
From: Jens.Kuenzer at fpga.homeip.net (=?ISO-8859-1?Q?Jens_K=FCnzer?=)
Date: Thu, 04 Mar 2010 09:28:41 +0100
Subject: [RFC] [PATCH] pcmcia/yenta ti113x route irq to isa
In-Reply-To: <20100302164752.GA4840@comet.dominikbrodowski.net>
References: <441883D0.7090508@fpga.homeip.net>
	<20060331205943.GA31742@dominikbrodowski.de>
	<20100302164752.GA4840@comet.dominikbrodowski.net>
Message-ID: <4B8F6F39.1040702@fpga.homeip.net>

Resubmitting this with hopefully proper signoff:

This is a patch for a old IBM Thinkpad 760ED notebook.

The pci irq pin of the ti1130 pcmcia bridge is not connected.
To use the cardbus, the irq has to be routed to an isa irq.
This patch detects an valid irq and route cardbus interupts to isa instead of pci.
(If a valid pci irq is detected it should use it and not the isa irq.)

I have tested it in my laptop only. I tested a ethernet and a usb cardbus card. Both OK
I also inserted but don't realy used a old pcmcia modem card. It detected the irq correct.

Maybe some of you can test this patch on other hardware.
And please review the changes, especially those in yenta_socket.c
I am not sure about these changes not breaking other ti pcmcia bridges.

        Signed-off-by: Jens Kuenzer <Jens.Kuenzer at fpga.homeip.net>


diff -u linux-2.6.15.1/drivers/pcmcia/i82365.h linux-2.6.15.1-jck/drivers/pcmcia/i82365.h
--- linux-2.6.15.1/drivers/pcmcia/i82365.h	2006-01-15 07:16:02.000000000 +0100
+++ linux-2.6.15.1-jck/drivers/pcmcia/i82365.h	2006-02-18 17:34:35.000000000 +0100
@@ -88,13 +88,14 @@
 #define I365_IRQ_MASK	0x0F
 
 /* Flags for I365_CSC and I365_CSCINT*/
-#define I365_CSC_BVD1	0x01
-#define I365_CSC_STSCHG	0x01
-#define I365_CSC_BVD2	0x02
-#define I365_CSC_READY	0x04
-#define I365_CSC_DETECT	0x08
-#define I365_CSC_ANY	0x0F
-#define I365_CSC_GPI	0x10
+#define I365_CSC_BVD1		0x01
+#define I365_CSC_STSCHG		0x01
+#define I365_CSC_BVD2		0x02
+#define I365_CSC_READY		0x04
+#define I365_CSC_DETECT		0x08
+#define I365_CSC_ANY		0x0F
+#define I365_CSC_GPI		0x10
+#define I365_CSC_IRQ_MASK	0xF0
 
 /* Flags for I365_ADDRWIN */
 #define I365_ENA_IO(map)	(0x40 << (map))
diff -u linux-2.6.15.1/drivers/pcmcia/ti113x.h linux-2.6.15.1-jck/drivers/pcmcia/ti113x.h
--- linux-2.6.15.1/drivers/pcmcia/ti113x.h	2006-01-15 07:16:02.000000000 +0100
+++ linux-2.6.15.1-jck/drivers/pcmcia/ti113x.h	2006-03-15 10:13:32.000000000 +0100
@@ -304,6 +304,18 @@
 	return 0;
 }
 
+static int ti113x_init(struct yenta_socket *socket)
+{
+        u8 new, reg = exca_readb(socket, I365_INTCTL);
+
+        new = reg & ~I365_INTR_ENA;
+        if ( socket->dev->irq ) /* PCI IRQ */
+                new |= I365_INTR_ENA;
+        if (new != reg)
+                exca_writeb(socket, I365_INTCTL, new);
+        return 0;
+}
+
 static int ti_override(struct yenta_socket *socket)
 {
 	u8 new, reg = exca_readb(socket, I365_INTCTL);
@@ -317,14 +329,42 @@
 	return 0;
 }
 
+static void ti113x_use_isa_irq(struct yenta_socket *socket)
+{
+	int isa_irq;
+	u8 intctl;
+	u32 isa_irq_mask;
+
+	/* get a free isa int */
+	isa_irq_mask = 0;
+        if (isa_probe)
+                isa_irq_mask = yenta_probe_irq(socket, 0x0ef8); /* 0x0ef8 => only common isa irqs */
+	if ( !(isa_irq_mask & 0xFFFF) ) return; /* no useable isa irq found */
+	for(isa_irq = -1 ; isa_irq_mask ; isa_irq++ ) /* choose highest available */
+		isa_irq_mask >>= 1;
+
+	exca_writeb(socket, I365_CSCINT, (isa_irq << 4) );  /* CSC */
+
+	socket->cb_irq = isa_irq;
+
+	intctl = exca_readb(socket, I365_INTCTL);
+	intctl &= ~(I365_INTR_ENA | I365_IRQ_MASK);	/* CSC Enable */
+	exca_writeb(socket, I365_INTCTL, intctl );
+
+        printk(KERN_INFO "Yenta TI113x: using isa irq %d\n", isa_irq);
+}
+
 static int ti113x_override(struct yenta_socket *socket)
 {
 	u8 cardctl;
 
 	cardctl = config_readb(socket, TI113X_CARD_CONTROL);
 	cardctl &= ~(TI113X_CCR_PCI_IRQ_ENA | TI113X_CCR_PCI_IREQ | TI113X_CCR_PCI_CSC);
-	if (socket->cb_irq)
+	if (socket->dev->irq)
 		cardctl |= TI113X_CCR_PCI_IRQ_ENA | TI113X_CCR_PCI_CSC | TI113X_CCR_PCI_IREQ;
+	else
+		ti113x_use_isa_irq(socket);
+
 	config_writeb(socket, TI113X_CARD_CONTROL, cardctl);
 
 	return ti_override(socket);
diff -u linux-2.6.15.1/drivers/pcmcia/yenta_socket.c linux-2.6.15.1-jck/drivers/pcmcia/yenta_socket.c
--- linux-2.6.15.1/drivers/pcmcia/yenta_socket.c	2006-01-15 07:16:02.000000000 +0100
+++ linux-2.6.15.1-jck/drivers/pcmcia/yenta_socket.c	2006-03-12 01:05:34.000000000 +0100
@@ -50,7 +50,7 @@
 #define to_ns(cycles)	((cycles)*120)
 
 static int yenta_probe_cb_irq(struct yenta_socket *socket);
-
+static unsigned int yenta_probe_irq(struct yenta_socket *socket, u32 isa_irq_mask);
 
 static unsigned int override_bios;
 module_param(override_bios, uint, 0000);
@@ -379,9 +379,12 @@
 
 		/* ISA interrupt control? */
 		intr = exca_readb(socket, I365_INTCTL);
-		intr = (intr & ~0xf);
-		if (!socket->cb_irq) {
-			intr |= state->io_irq;
+		intr &= ~(I365_IRQ_MASK);
+		if (!socket->dev->irq) {  /* is there a valid pci irq ? */
+			if(socket->cb_irq)
+				intr |= socket->cb_irq;
+			else
+				intr |= socket->io_irq;
 			bridge |= CB_BRIDGE_INTR;
 		}
 		exca_writeb(socket, I365_INTCTL, intr);
@@ -391,7 +394,7 @@
 		reg = exca_readb(socket, I365_INTCTL) & (I365_RING_ENA | I365_INTR_ENA);
 		reg |= (state->flags & SS_RESET) ? 0 : I365_PC_RESET;
 		reg |= (state->flags & SS_IOCARD) ? I365_PC_IOCARD : 0;
-		if (state->io_irq != socket->cb_irq) {
+		if (state->io_irq) {
 			reg |= state->io_irq;
 			bridge |= CB_BRIDGE_INTR;
 		}
@@ -404,8 +407,10 @@
 		if (exca_readb(socket, I365_POWER) != reg)
 			exca_writeb(socket, I365_POWER, reg);
 
-		/* CSC interrupt: no ISA irq for CSC */
-		reg = I365_CSC_DETECT;
+		reg = exca_readb(socket, I365_CSCINT);  /*keep isa IRQs for CSC*/
+		reg &= I365_CSC_IRQ_MASK;
+		reg |= I365_CSC_DETECT;
+
 		if (state->flags & SS_IOCARD) {
 			if (state->csc_mask & SS_STSCHG) reg |= I365_CSC_STSCHG;
 		} else {
@@ -868,7 +873,7 @@
 		.override	= ti113x_override,
 		.save_state	= ti_save_state,
 		.restore_state	= ti_restore_state,
-		.sock_init	= ti_init,
+		.sock_init	= ti113x_init,
 	},
 	[CARDBUS_TYPE_TI12XX]	= {
 		.override	= ti12xx_override,
@@ -922,6 +927,7 @@
 	int i;
 	unsigned long val;
 	u32 mask;
+	u8 reg;
 
 	/*
 	 * Probe for usable interrupts using the force
@@ -929,6 +935,7 @@
 	 */
 	cb_writel(socket, CB_SOCKET_EVENT, -1);
 	cb_writel(socket, CB_SOCKET_MASK, CB_CSTSMASK);
+	reg = exca_readb(socket, I365_CSCINT); /* save */
 	exca_writeb(socket, I365_CSCINT, 0);
 	val = probe_irq_on() & isa_irq_mask;
 	for (i = 1; i < 16; i++) {
@@ -940,7 +947,7 @@
 		cb_writel(socket, CB_SOCKET_EVENT, -1);
 	}
 	cb_writel(socket, CB_SOCKET_MASK, 0);
-	exca_writeb(socket, I365_CSCINT, 0);
+	exca_writeb(socket, I365_CSCINT, reg); /* restore */
 
 	mask = probe_irq_mask(val) & 0xffff;
 
@@ -971,6 +978,8 @@
 /* probes the PCI interrupt, use only on override functions */
 static int yenta_probe_cb_irq(struct yenta_socket *socket)
 {
+	u8 reg;
+
 	if (!socket->cb_irq)
 		return -1;
 
@@ -982,7 +991,9 @@
 	}
 
 	/* generate interrupt, wait */
-	exca_writeb(socket, I365_CSCINT, I365_CSC_STSCHG);
+	reg = exca_readb(socket, I365_CSCINT); /* save */
+	exca_writeb(socket, I365_CSCINT, reg | I365_CSC_STSCHG);
+
 	cb_writel(socket, CB_SOCKET_EVENT, -1);
 	cb_writel(socket, CB_SOCKET_MASK, CB_CSTSMASK);
 	cb_writel(socket, CB_SOCKET_FORCE, CB_FCARDSTS);
@@ -991,7 +1002,7 @@
 
 	/* disable interrupts */
 	cb_writel(socket, CB_SOCKET_MASK, 0);
-	exca_writeb(socket, I365_CSCINT, 0);
+	exca_writeb(socket, I365_CSCINT, reg); /* restore */
 	cb_writel(socket, CB_SOCKET_EVENT, -1);
 	exca_readb(socket, I365_CSC);




From alan at lxorguk.ukuu.org.uk  Fri Mar  5 07:07:46 2010
From: alan at lxorguk.ukuu.org.uk (Alan Cox)
Date: Fri, 5 Mar 2010 12:07:46 +0000
Subject: [git pull] more PCMCIA updates for 2.6.34 (including ioctl
	deprecation)
In-Reply-To: <20100303083010.GA22928@flint.arm.linux.org.uk>
References: <20100303075944.GA23354@comet.dominikbrodowski.net>
	<20100303083010.GA22928@flint.arm.linux.org.uk>
Message-ID: <20100305120746.646126b9@lxorguk.ukuu.org.uk>

> So you believe that disabling the button in the graphical environment
> to allow PCMCIA cards to be removed (such as CF cards) - leaving the
> user to merely pull out the CF card, while the FS is mounted, is a
> good idea?

Do any graphical environments even support the ancient user space
pcmcica helper stuff ? I can't find any evidence they do but I realise
Russell you get to deal with assorted crazy ARM embedded setups.

Alan


From w.sang at pengutronix.de  Fri Mar  5 07:57:33 2010
From: w.sang at pengutronix.de (Wolfram Sang)
Date: Fri, 5 Mar 2010 13:57:33 +0100
Subject: [git pull] more PCMCIA updates for 2.6.34 (including ioctl
	deprecation)
In-Reply-To: <20100305120746.646126b9@lxorguk.ukuu.org.uk>
References: <20100303075944.GA23354@comet.dominikbrodowski.net>
	<20100303083010.GA22928@flint.arm.linux.org.uk>
	<20100305120746.646126b9@lxorguk.ukuu.org.uk>
Message-ID: <20100305125732.GA23456@pengutronix.de>

> Do any graphical environments even support the ancient user space
> pcmcica helper stuff ? I can't find any evidence they do but I realise
> Russell you get to deal with assorted crazy ARM embedded setups.

FWIW, a few months ago I searched the web for the warning about the usage of
the deprectaed pcmcia-ioctls. The vast majority came from Debian's discover
which seems to be no issue according to:

http://article.gmane.org/gmane.linux.kernel/885286

The other occurences I found have been fixed meanwhile. (I understand that I
might have missed rare cases this way)

Regards,

   Wolfram

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-pcmcia/attachments/20100305/3201c637/attachment.sig>

From rmk+lkml at arm.linux.org.uk  Fri Mar  5 16:41:59 2010
From: rmk+lkml at arm.linux.org.uk (Russell King)
Date: Fri, 5 Mar 2010 21:41:59 +0000
Subject: [git pull] more PCMCIA updates for 2.6.34 (including ioctl
	deprecation)
In-Reply-To: <20100305120746.646126b9@lxorguk.ukuu.org.uk>
References: <20100303075944.GA23354@comet.dominikbrodowski.net>
	<20100303083010.GA22928@flint.arm.linux.org.uk>
	<20100305120746.646126b9@lxorguk.ukuu.org.uk>
Message-ID: <20100305214159.GB2994@flint.arm.linux.org.uk>

On Fri, Mar 05, 2010 at 12:07:46PM +0000, Alan Cox wrote:
> > So you believe that disabling the button in the graphical environment
> > to allow PCMCIA cards to be removed (such as CF cards) - leaving the
> > user to merely pull out the CF card, while the FS is mounted, is a
> > good idea?
> 
> Do any graphical environments even support the ancient user space
> pcmcica helper stuff ? I can't find any evidence they do but I realise
> Russell you get to deal with assorted crazy ARM embedded setups.

I believe so - the platform I have is based around the Open Embedded
stuff, and there's a button on the desktop which communicates with the
kernel via the PCMCIA ioctls.  One of the things it offers is to allow
media (eg, CF) to be safely ejected without ending up pulling the card
out while the FS is still mounted.

If the button can't communicate with the kernel PCMCIA driver, it doesn't
know that a CF card is in place, so it can't offer to eject the media.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:


From peter at stuge.se  Fri Mar  5 21:44:50 2010
From: peter at stuge.se (Peter Stuge)
Date: Sat, 6 Mar 2010 03:44:50 +0100
Subject: [git pull] more PCMCIA updates for 2.6.34 (including ioctl
	deprecation)
In-Reply-To: <20100305214159.GB2994@flint.arm.linux.org.uk>
References: <20100303075944.GA23354@comet.dominikbrodowski.net>
	<20100303083010.GA22928@flint.arm.linux.org.uk>
	<20100305120746.646126b9@lxorguk.ukuu.org.uk>
	<20100305214159.GB2994@flint.arm.linux.org.uk>
Message-ID: <20100306024450.29072.qmail@stuge.se>

Russell King wrote:
> > Do any graphical environments even support the ancient user space
> > pcmcica helper stuff ?
> 
> I believe so - the platform I have is based around the Open Embedded
> stuff, and there's a button on the desktop which communicates with the
> kernel via the PCMCIA ioctls.  One of the things it offers is to allow
> media (eg, CF) to be safely ejected without ending up pulling the card
> out while the FS is still mounted.

So if you upgrade that system to a kernel without that call I guess
you may have to either also upgrade that GUI software, or install a
.so to wrap ioctl() and provide backwards compatibility for the app?


//Peter


From linux at dominikbrodowski.net  Sat Mar  6 02:35:41 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Sat,  6 Mar 2010 08:35:41 +0100
Subject: [PATCH 1/3] pcmcia: honor saved flags in yenta_socket's I365_CSCINT
	register
In-Reply-To: <20100306073336.GA29369@comet.dominikbrodowski.net>
References: <20100306073336.GA29369@comet.dominikbrodowski.net>
Message-ID: <1267860943-29664-1-git-send-email-linux@dominikbrodowski.net>

From: Jens K?nzer <Jens.Kuenzer at fpga.homeip.net>

Part 1 of a series to allow the ISA irq to be used for Cardbus devices
if the socket's PCI irq is unusable.

[linux at dominikbrodowski.net: split up the original patch, commit message]

Signed-off-by: Jens Kuenzer <Jens.Kuenzer at fpga.homeip.net>
Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 drivers/pcmcia/i82365.h       |    1 +
 drivers/pcmcia/yenta_socket.c |   15 +++++++++++----
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/pcmcia/i82365.h b/drivers/pcmcia/i82365.h
index 849ef1b..3f84d7a 100644
--- a/drivers/pcmcia/i82365.h
+++ b/drivers/pcmcia/i82365.h
@@ -95,6 +95,7 @@
 #define I365_CSC_DETECT	0x08
 #define I365_CSC_ANY	0x0F
 #define I365_CSC_GPI	0x10
+#define I365_CSC_IRQ_MASK	0xF0
 
 /* Flags for I365_ADDRWIN */
 #define I365_ENA_IO(map)	(0x40 << (map))
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
index 967c766..42f6763 100644
--- a/drivers/pcmcia/yenta_socket.c
+++ b/drivers/pcmcia/yenta_socket.c
@@ -356,7 +356,9 @@ static int yenta_set_socket(struct pcmcia_socket *sock, socket_state_t *state)
 			exca_writeb(socket, I365_POWER, reg);
 
 		/* CSC interrupt: no ISA irq for CSC */
-		reg = I365_CSC_DETECT;
+		reg = exca_readb(socket, I365_CSCINT);
+		reg &= I365_CSC_IRQ_MASK;
+		reg |= I365_CSC_DETECT;
 		if (state->flags & SS_IOCARD) {
 			if (state->csc_mask & SS_STSCHG)
 				reg |= I365_CSC_STSCHG;
@@ -912,6 +914,7 @@ static unsigned int yenta_probe_irq(struct yenta_socket *socket, u32 isa_irq_mas
 	int i;
 	unsigned long val;
 	u32 mask;
+	u8 reg;
 
 	/*
 	 * Probe for usable interrupts using the force
@@ -919,6 +922,7 @@ static unsigned int yenta_probe_irq(struct yenta_socket *socket, u32 isa_irq_mas
 	 */
 	cb_writel(socket, CB_SOCKET_EVENT, -1);
 	cb_writel(socket, CB_SOCKET_MASK, CB_CSTSMASK);
+	reg = exca_readb(socket, I365_CSCINT);
 	exca_writeb(socket, I365_CSCINT, 0);
 	val = probe_irq_on() & isa_irq_mask;
 	for (i = 1; i < 16; i++) {
@@ -930,7 +934,7 @@ static unsigned int yenta_probe_irq(struct yenta_socket *socket, u32 isa_irq_mas
 		cb_writel(socket, CB_SOCKET_EVENT, -1);
 	}
 	cb_writel(socket, CB_SOCKET_MASK, 0);
-	exca_writeb(socket, I365_CSCINT, 0);
+	exca_writeb(socket, I365_CSCINT, reg);
 
 	mask = probe_irq_mask(val) & 0xffff;
 
@@ -967,6 +971,8 @@ static irqreturn_t yenta_probe_handler(int irq, void *dev_id)
 /* probes the PCI interrupt, use only on override functions */
 static int yenta_probe_cb_irq(struct yenta_socket *socket)
 {
+	u8 reg;
+
 	if (!socket->cb_irq)
 		return -1;
 
@@ -979,7 +985,8 @@ static int yenta_probe_cb_irq(struct yenta_socket *socket)
 	}
 
 	/* generate interrupt, wait */
-	exca_writeb(socket, I365_CSCINT, I365_CSC_STSCHG);
+	reg = exca_readb(socket, I365_CSCINT);
+	exca_writeb(socket, I365_CSCINT, reg | I365_CSC_STSCHG);
 	cb_writel(socket, CB_SOCKET_EVENT, -1);
 	cb_writel(socket, CB_SOCKET_MASK, CB_CSTSMASK);
 	cb_writel(socket, CB_SOCKET_FORCE, CB_FCARDSTS);
@@ -988,7 +995,7 @@ static int yenta_probe_cb_irq(struct yenta_socket *socket)
 
 	/* disable interrupts */
 	cb_writel(socket, CB_SOCKET_MASK, 0);
-	exca_writeb(socket, I365_CSCINT, 0);
+	exca_writeb(socket, I365_CSCINT, reg);
 	cb_writel(socket, CB_SOCKET_EVENT, -1);
 	exca_readb(socket, I365_CSC);
 
-- 
1.6.3.3



From linux at dominikbrodowski.net  Sat Mar  6 02:35:43 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Sat,  6 Mar 2010 08:35:43 +0100
Subject: [PATCH 3/3] pcmcia: re-route Cardbus IRQ to ISA on ti1130 bridges if
	necessary
In-Reply-To: <20100306073336.GA29369@comet.dominikbrodowski.net>
References: <20100306073336.GA29369@comet.dominikbrodowski.net>
Message-ID: <1267860943-29664-3-git-send-email-linux@dominikbrodowski.net>

From: Jens K?nzer <Jens.Kuenzer at fpga.homeip.net>

As the PCI irq pin of the ti1130 pcmcia bridge is not connected (at
least on some old IBM Thinkpad 760ED notebooks), the Cardbus IRQ has
to be routed to an ISA irq.

[linux at dominikbrodowski.net: split up the original patch, commit message,
 cleanup]

Signed-off-by: Jens Kuenzer <Jens.Kuenzer at fpga.homeip.net>
Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 drivers/pcmcia/ti113x.h       |   37 +++++++++++++++++++++++++++++++++++--
 drivers/pcmcia/yenta_socket.c |   24 +++++++++++++-----------
 2 files changed, 48 insertions(+), 13 deletions(-)

diff --git a/drivers/pcmcia/ti113x.h b/drivers/pcmcia/ti113x.h
index aaa7022..9ffa97d 100644
--- a/drivers/pcmcia/ti113x.h
+++ b/drivers/pcmcia/ti113x.h
@@ -296,7 +296,7 @@ static int ti_init(struct yenta_socket *socket)
 	u8 new, reg = exca_readb(socket, I365_INTCTL);
 
 	new = reg & ~I365_INTR_ENA;
-	if (socket->cb_irq)
+	if (socket->dev->irq)
 		new |= I365_INTR_ENA;
 	if (new != reg)
 		exca_writeb(socket, I365_INTCTL, new);
@@ -316,14 +316,47 @@ static int ti_override(struct yenta_socket *socket)
 	return 0;
 }
 
+static void ti113x_use_isa_irq(struct yenta_socket *socket)
+{
+	int isa_irq = -1;
+	u8 intctl;
+	u32 isa_irq_mask = 0;
+
+	if (!isa_probe)
+		return;
+
+	/* get a free isa int */
+	isa_irq_mask = yenta_probe_irq(socket, isa_interrupts);
+	if (!isa_irq_mask)
+		return; /* no useable isa irq found */
+
+	/* choose highest available */
+	for (; isa_irq_mask; isa_irq++)
+		isa_irq_mask >>= 1;
+	socket->cb_irq = isa_irq;
+
+	exca_writeb(socket, I365_CSCINT, (isa_irq << 4));
+
+	intctl = exca_readb(socket, I365_INTCTL);
+	intctl &= ~(I365_INTR_ENA | I365_IRQ_MASK);     /* CSC Enable */
+	exca_writeb(socket, I365_INTCTL, intctl);
+
+	dev_info(&socket->dev->dev,
+		"Yenta TI113x: using isa irq %d for CardBus\n", isa_irq);
+}
+
+
 static int ti113x_override(struct yenta_socket *socket)
 {
 	u8 cardctl;
 
 	cardctl = config_readb(socket, TI113X_CARD_CONTROL);
 	cardctl &= ~(TI113X_CCR_PCI_IRQ_ENA | TI113X_CCR_PCI_IREQ | TI113X_CCR_PCI_CSC);
-	if (socket->cb_irq)
+	if (socket->dev->irq)
 		cardctl |= TI113X_CCR_PCI_IRQ_ENA | TI113X_CCR_PCI_CSC | TI113X_CCR_PCI_IREQ;
+	else
+		ti113x_use_isa_irq(socket);
+
 	config_writeb(socket, TI113X_CARD_CONTROL, cardctl);
 
 	return ti_override(socket);
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
index 51ee68d..d3afeaa 100644
--- a/drivers/pcmcia/yenta_socket.c
+++ b/drivers/pcmcia/yenta_socket.c
@@ -42,6 +42,18 @@ module_param_string(o2_speedup, o2_speedup, sizeof(o2_speedup), 0444);
 MODULE_PARM_DESC(o2_speedup, "Use prefetch/burst for O2-bridges: 'on', 'off' "
 	"or 'default' (uses recommended behaviour for the detected bridge)");
 
+/*
+ * Only probe "regular" interrupts, don't
+ * touch dangerous spots like the mouse irq,
+ * because there are mice that apparently
+ * get really confused if they get fondled
+ * too intimately.
+ *
+ * Default to 11, 10, 9, 7, 6, 5, 4, 3.
+ */
+static u32 isa_interrupts = 0x0ef8;
+
+
 #define debug(x, s, args...) dev_dbg(&s->dev->dev, x, ##args)
 
 /* Don't ask.. */
@@ -54,6 +66,7 @@ MODULE_PARM_DESC(o2_speedup, "Use prefetch/burst for O2-bridges: 'on', 'off' "
  */
 #ifdef CONFIG_YENTA_TI
 static int yenta_probe_cb_irq(struct yenta_socket *socket);
+static unsigned int yenta_probe_irq(struct yenta_socket *socket, u32 isa_irq_mask);
 #endif
 
 
@@ -898,17 +911,6 @@ static struct cardbus_type cardbus_type[] = {
 };
 
 
-/*
- * Only probe "regular" interrupts, don't
- * touch dangerous spots like the mouse irq,
- * because there are mice that apparently
- * get really confused if they get fondled
- * too intimately.
- *
- * Default to 11, 10, 9, 7, 6, 5, 4, 3.
- */
-static u32 isa_interrupts = 0x0ef8;
-
 static unsigned int yenta_probe_irq(struct yenta_socket *socket, u32 isa_irq_mask)
 {
 	int i;
-- 
1.6.3.3



From linux at dominikbrodowski.net  Sat Mar  6 02:35:42 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Sat,  6 Mar 2010 08:35:42 +0100
Subject: [PATCH 2/3] pcmcia: allow for cb_irq to differ from pci_dev's irq in
	yenta_socket
In-Reply-To: <20100306073336.GA29369@comet.dominikbrodowski.net>
References: <20100306073336.GA29369@comet.dominikbrodowski.net>
Message-ID: <1267860943-29664-2-git-send-email-linux@dominikbrodowski.net>

From: Jens K?nzer <Jens.Kuenzer at fpga.homeip.net>

Part 2 of a series to allow the ISA irq to be used for Cardbus devices
if the socket's PCI irq is unusable.

[linux at dominikbrodowski.net: split up the original patch, commit message]

Signed-off-by: Jens Kuenzer <Jens.Kuenzer at fpga.homeip.net>
Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 drivers/pcmcia/yenta_socket.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
index 42f6763..51ee68d 100644
--- a/drivers/pcmcia/yenta_socket.c
+++ b/drivers/pcmcia/yenta_socket.c
@@ -329,8 +329,8 @@ static int yenta_set_socket(struct pcmcia_socket *sock, socket_state_t *state)
 		/* ISA interrupt control? */
 		intr = exca_readb(socket, I365_INTCTL);
 		intr = (intr & ~0xf);
-		if (!socket->cb_irq) {
-			intr |= state->io_irq;
+		if (!socket->dev->irq) {
+			intr |= socket->cb_irq ? socket->cb_irq : state->io_irq;
 			bridge |= CB_BRIDGE_INTR;
 		}
 		exca_writeb(socket, I365_INTCTL, intr);
@@ -340,7 +340,7 @@ static int yenta_set_socket(struct pcmcia_socket *sock, socket_state_t *state)
 		reg = exca_readb(socket, I365_INTCTL) & (I365_RING_ENA | I365_INTR_ENA);
 		reg |= (state->flags & SS_RESET) ? 0 : I365_PC_RESET;
 		reg |= (state->flags & SS_IOCARD) ? I365_PC_IOCARD : 0;
-		if (state->io_irq != socket->cb_irq) {
+		if (state->io_irq != socket->dev->irq) {
 			reg |= state->io_irq;
 			bridge |= CB_BRIDGE_INTR;
 		}
-- 
1.6.3.3



From linux at dominikbrodowski.net  Sat Mar  6 02:33:36 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Sat, 6 Mar 2010 08:33:36 +0100
Subject: [RFC] [PATCH] pcmcia/yenta ti113x route irq to isa
In-Reply-To: <4B8F6F39.1040702@fpga.homeip.net>
References: <441883D0.7090508@fpga.homeip.net>
	<20060331205943.GA31742@dominikbrodowski.de>
	<20100302164752.GA4840@comet.dominikbrodowski.net>
	<4B8F6F39.1040702@fpga.homeip.net>
Message-ID: <20100306073336.GA29369@comet.dominikbrodowski.net>

On Thu, Mar 04, 2010 at 09:28:41AM +0100, Jens K?nzer wrote:
> Resubmitting this with hopefully proper signoff:
> 
> This is a patch for a old IBM Thinkpad 760ED notebook.
> 
> The pci irq pin of the ti1130 pcmcia bridge is not connected.
> To use the cardbus, the irq has to be routed to an isa irq.
> This patch detects an valid irq and route cardbus interupts to isa instead of pci.
> (If a valid pci irq is detected it should use it and not the isa irq.)
> 
> I have tested it in my laptop only. I tested a ethernet and a usb cardbus card. Both OK
> I also inserted but don't realy used a old pcmcia modem card. It detected the irq correct.
> 
> Maybe some of you can test this patch on other hardware.
> And please review the changes, especially those in yenta_socket.c
> I am not sure about these changes not breaking other ti pcmcia bridges.
> 
>        Signed-off-by: Jens Kuenzer <Jens.Kuenzer at fpga.homeip.net>

Many thanks! I've split it up into three parts and only made a few cleanups.
It would be great if you (and others) could check those out.

Best,
	Dominik


From w.sang at pengutronix.de  Sat Mar  6 07:50:34 2010
From: w.sang at pengutronix.de (Wolfram Sang)
Date: Sat, 6 Mar 2010 13:50:34 +0100
Subject: [RFC] [PATCH] pcmcia/yenta ti113x route irq to isa
In-Reply-To: <20100306073336.GA29369@comet.dominikbrodowski.net>
References: <441883D0.7090508@fpga.homeip.net>
	<20060331205943.GA31742@dominikbrodowski.de>
	<20100302164752.GA4840@comet.dominikbrodowski.net>
	<4B8F6F39.1040702@fpga.homeip.net>
	<20100306073336.GA29369@comet.dominikbrodowski.net>
Message-ID: <20100306125034.GA8670@pengutronix.de>


> Many thanks! I've split it up into three parts and only made a few cleanups.
> It would be great if you (and others) could check those out.

The commit-messages of part 1+2 could be a bit more explicit about what that
part actually does.

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-pcmcia/attachments/20100306/c6c52d92/attachment-0001.sig>

From bugzilla-daemon at bugzilla.kernel.org  Sat Mar  6 09:07:50 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Sat, 6 Mar 2010 14:07:50 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@http.bugzilla.kernel.org/>
References: <bug-7304-4463@http.bugzilla.kernel.org/>
Message-ID: <201003061407.o26E7oBU018428@demeter.kernel.org>

http://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #51 from Dominik Brodowski <linux at brodo.de>  2010-03-06 14:07:42 ---
Hm, it looks to me that the PCI IRQ pins are routed to IRQ #11. So what about
trying out (at first) some workaround: Could you replace the line in
drivers/pcmcia/yenta_socket.c - function yenta_probe() which states:
    socket->cb_irq = dev->irq;
with:
    socket->cb_irq = 11;
?

Also, some quite new patches (see:
http://www.mail-archive.com/linux-pcmcia at lists.infradead.org/msg02903.html
http://www.mail-archive.com/linux-pcmcia at lists.infradead.org/msg02904.html
http://www.mail-archive.com/linux-pcmcia at lists.infradead.org/msg02906.html
) which currently are only for some TI bridge might be generalized to work also
in other cases where the PCI IRQ is 0. I'll dig into that later.

-- 
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From bugzilla-daemon at bugzilla.kernel.org  Sat Mar  6 09:09:45 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Sat, 6 Mar 2010 14:09:45 GMT
Subject: [Bug 15191] ENE CB712 CardBus bridge needs special treatment with
	Echo Audio Indigo soundcards
In-Reply-To: <bug-15191-4463@http.bugzilla.kernel.org/>
References: <bug-15191-4463@http.bugzilla.kernel.org/>
Message-ID: <201003061409.o26E9jMn019233@demeter.kernel.org>

http://bugzilla.kernel.org/show_bug.cgi?id=15191


Dominik Brodowski <linux at brodo.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |linux at brodo.de
         AssignedTo|linux-pcmcia at lists.infradea |linux at brodo.de
                   |d.org                       |




--- Comment #2 from Dominik Brodowski <linux at brodo.de>  2010-03-06 14:09:40 ---
Bugfix merged f3d4ae431d819200bb61e943cb23572b10744e93 -- closing this bug.

-- 
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From bugzilla-daemon at bugzilla.kernel.org  Sat Mar  6 09:12:11 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Sat, 6 Mar 2010 14:12:11 GMT
Subject: [Bug 14149] irq 11: nobody cared (try booting with the "irqpoll"
	option)
In-Reply-To: <bug-14149-4463@http.bugzilla.kernel.org/>
References: <bug-14149-4463@http.bugzilla.kernel.org/>
Message-ID: <201003061412.o26ECBhf020081@demeter.kernel.org>

http://bugzilla.kernel.org/show_bug.cgi?id=14149


Dominik Brodowski <linux at brodo.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |linux at brodo.de




--- Comment #2 from Dominik Brodowski <linux at brodo.de>  2010-03-06 14:12:08 ---
It seems like the socket driver at least thought the card was re-inserted:

pcmcia_socket pcmcia_socket1: pccard: card ejected from slot 1
...
pcmcia_socket pcmcia_socket1: pccard: CardBus card inserted into slot 1

Unless you can reproduce this with recent kernels, I'd prefer to close this bug
with INSUFFICIENT_DATA.

-- 
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From bugzilla-daemon at bugzilla.kernel.org  Sat Mar  6 09:34:16 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Sat, 6 Mar 2010 14:34:16 GMT
Subject: [Bug 7116] pcnet_cs no longer works after linux-2.6.16-git20 (Too
	much work at interrupt)
In-Reply-To: <bug-7116-4463@http.bugzilla.kernel.org/>
References: <bug-7116-4463@http.bugzilla.kernel.org/>
Message-ID: <201003061434.o26EYG33029611@demeter.kernel.org>

http://bugzilla.kernel.org/show_bug.cgi?id=7116





--- Comment #47 from Dominik Brodowski <linux at brodo.de>  2010-03-06 14:34:11 ---
Even better would be trying out 2.6.34-rc1, once it gets out in a few days...

-- 
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From madamego54mez at gmail.com  Sat Mar  6 01:23:26 2010
From: madamego54mez at gmail.com (Amina Ego Hussein Mohammed)
Date: Sat, 6 Mar 2010 06:23:26 +0000
Subject: From:Amina Ego Hussein Mohammed
Message-ID: <201003060623.o266N2iq025153@tpma01.evervisionlcd.com>

Dear Mr
     I'm Mrs Amina Ego Hussein,the wife of the minister of finance whom is late right now(Abdel-Rahim Mohamed Hussein).My husband died some time ago during a political tussle in our country ivory coast.My husband happens to be late Abdel-Rahim Mohamed Hussein that has been killed along with at least 21 other and i must say that am very sorry if this mail will sound like a disturbance to you.I will never have contacted you if everything was alright like it used to be when my husband wasalife.I'm a mother of 2 kids a boy and a girls but presently i am only left with my son because my only daughter was killed along side with his father.

  The reason why i am contacting you through this mail,is as a result of the occurance of the untimly death of my beloved husband and the situation at hand.My husband died on the 18th Jan 2009 during an attack from husband died on the 18th Jan 2009 during an attack from his political opponet.Immediatly after the death of my husband,his brothers came as a sheepin lion clothening and i been a woman that i am,i never knew that i can be easily decieved.A family meeting was made that i have to bring the will of my husband to the family and as a faithful wife that i am i did but after some few days i was told to let go of all properties that was owned by my late husband and they all drove me out to nothing with a treat of to kill me if i return back to any of the houses that he built.I thought that is the shock of the death of my husband their brother that was the cause but never knew that they had a motive of claiming all asset thet belongs to my husband and beening that they hav!
 e the will of my beloved husband,they now have access to his bank as well as all his properties.On the 6th of march,my own inlaws killed my only son who is supposed to inherrite  his own fathers property.After the incident i was made to know that i am the next, of which my God will never let that happen to me.

  3 years ago my husband told me that he has a plan to deposit some money in a security company,.I supported him because it's a good decision and he personaly handed the document of ownership to me,since am the only one that is aware of the deposition of the $12.5Million.I decided to run down to morocco to seek refuge under the united nation and i was accepted here in morocco.The money was deposited in a security company for safe keeping.Right now,please i will need your help,for you to help me invest the money in your country and i would want to come down to your country after the investment for the safety of my life.I hope that i will hear from you soon so that i will know what to do because my my only surviving son also here with me,i need to give him a better life and a good future as well.i am ready to give you %10 of the total money for appreciation.I hope to hear from you.
Your's Sincerly,
Amina Ego Hussein Mohammed
+212676481708


From bugzilla-daemon at bugzilla.kernel.org  Sun Mar  7 13:05:03 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Sun, 7 Mar 2010 18:05:03 GMT
Subject: [Bug 14149] irq 11: nobody cared (try booting with the "irqpoll"
	option)
In-Reply-To: <bug-14149-4463@http.bugzilla.kernel.org/>
References: <bug-14149-4463@http.bugzilla.kernel.org/>
Message-ID: <201003071805.o27I53LT029563@demeter.kernel.org>

http://bugzilla.kernel.org/show_bug.cgi?id=14149





--- Comment #3 from Martin Mokrejs <mmokrejs at ribosome.natur.cuni.cz>  2010-03-07 18:05:00 ---
(In reply to comment #2)
> It seems like the socket driver at least thought the card was re-inserted:
> 
> pcmcia_socket pcmcia_socket1: pccard: card ejected from slot 1
> ...
> pcmcia_socket pcmcia_socket1: pccard: CardBus card inserted into slot 1
> 
> Unless you can reproduce this with recent kernels, I'd prefer to close this bug
> with INSUFFICIENT_DATA.


Yes, this is what I really did. What I wanted to report is that removal of the
card crashed the kernel. I can try to reproduce in the meantime,

-- 
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From manuel.lauss at googlemail.com  Tue Mar  9 14:45:29 2010
From: manuel.lauss at googlemail.com (Manuel Lauss)
Date: Tue,  9 Mar 2010 20:45:29 +0100
Subject: [PATCH] pcmcia: db1xxx-ss: suspend/resume fix
Message-ID: <1268163929-16164-1-git-send-email-manuel.lauss@gmail.com>

This patch adds more pm method callbacks to the db1xxx-ss socket
driver, which fixes spurious interrupts and dead cards upon resume
from STR.

Tested on DB1200 with CF card (tons of spurious interrupts resulting
in card interrupt being disabled) and a 3c509 card (this one was
just dead after resume).

Signed-off-by: Manuel Lauss <manuel.lauss at gmail.com>
---
 drivers/pcmcia/db1xxx_ss.c |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/drivers/pcmcia/db1xxx_ss.c b/drivers/pcmcia/db1xxx_ss.c
index 9254ab0..8b49e49 100644
--- a/drivers/pcmcia/db1xxx_ss.c
+++ b/drivers/pcmcia/db1xxx_ss.c
@@ -559,21 +559,31 @@ static int __devexit db1x_pcmcia_socket_remove(struct platform_device *pdev)
 }
 
 #ifdef CONFIG_PM
-static int db1x_pcmcia_suspend(struct device *dev)
+static int db1x_pcmcia_suspend_noirq(struct device *dev)
 {
 	return pcmcia_socket_dev_suspend(dev);
 }
 
+static int db1x_pcmcia_resume_noirq(struct device *dev)
+{
+	pcmcia_socket_dev_early_resume(dev);
+	return 0;
+}
+
 static int db1x_pcmcia_resume(struct device *dev)
 {
-	return pcmcia_socket_dev_resume(dev);
+	pcmcia_socket_dev_late_resume(dev);
+	return 0;
 }
 
 static struct dev_pm_ops db1x_pcmcia_pmops = {
 	.resume		= db1x_pcmcia_resume,
-	.suspend	= db1x_pcmcia_suspend,
+	.resume_noirq	= db1x_pcmcia_resume_noirq,
+	.suspend	= db1x_pcmcia_suspend_noirq,
+	.suspend_noirq	= db1x_pcmcia_suspend_noirq,
 	.thaw		= db1x_pcmcia_resume,
-	.freeze		= db1x_pcmcia_suspend,
+	.thaw_noirq	= db1x_pcmcia_resume_noirq,
+	.freeze		= db1x_pcmcia_suspend_noirq,
 };
 
 #define DB1XXX_SS_PMOPS &db1x_pcmcia_pmops
-- 
1.7.0.2



From raraks at gmail.com  Tue Mar  9 19:16:28 2010
From: raraks at gmail.com (raraks)
Date: Tue, 9 Mar 2010 16:16:28 -0800
Subject: PCMCIA cards not detected
References: <1268163929-16164-1-git-send-email-manuel.lauss@gmail.com>
Message-ID: <106BA2A1BF8C4C8EA837CC398D35EC77@spyrus.com>

I am trying to develop a driver for a 16-bit PCMCIA card on Ubuntu 
(v2.6.31-17) and have a desktop machine with an ActionTec PCI card to pcmcia 
adapter. So far I havent gotten anywhere with it. It appears that the card 
is not even identified correctly and I dont know what options to change or 
set. I would expect that at least the card identification information like 
manufacturer would be read correctly .. but I get nothing. This appears to 
be the case for every single card that I insert.

dmesg indicates that a card was inserted or removed .. but nothing else 
happens.

So how do I go about debugging this ? Any help would be appreciated.

Thanks

Relevant Outputs  from pccardctl, lspci, etc. follow:
-------------------------------------------------------------------------------------------------------
sudo pccardctl ident
Socket 0:
no product info available
Socket 1:
no product info available

-------------------------------------------------------------------------------------------------------

sudo pccardctl status
Socket 0:
5.0V 16-bit PC Card
Socket 1:
no card
------------------------------------------------------------------------------------------------------------

sudo cat /proc/iomem gives the foll:

00000000-00000fff : System RAM

00001000-00005fff : reserved

00006000-0008efff : System RAM

0008f000-0009ffff : reserved

000c0000-000dffff : pnp 00:01

000e0000-000fffff : reserved

00100000-ce5fafff : System RAM

01000000-01530f79 : Kernel code

01530f7a-018236ef : Kernel data

018d5000-019e4ccb : Kernel bss

ce5fb000-ce68ffff : ACPI Non-volatile Storage

ce690000-cf612fff : System RAM

cf613000-cf61efff : reserved

cf61f000-cf692fff : System RAM

cf693000-cf6e7fff : ACPI Non-volatile Storage

cf6e8000-cf6ebfff : System RAM

cf6ec000-cf6f0fff : ACPI Tables

cf6f1000-cf6f1fff : System RAM

cf6f2000-cf6fefff : ACPI Tables

cf6ff000-cf6fffff : System RAM

cf700000-cfffffff : reserved

d0000000-dfffffff : 0000:00:02.0

e0000000-e3ffffff : PCI Bus 0000:04

e0000000-e3ffffff : PCI CardBus 0000:05

e4000000-e80fffff : PCI Bus 0000:04

e4000000-e7ffffff : PCI CardBus 0000:05

e8000000-e8000fff : 0000:04:03.1

e8000000-e8000fff : yenta_socket

e8001000-e8001fff : 0000:04:03.0

e8001000-e8001fff : yenta_socket

e8100000-e81fffff : 0000:00:02.1

e8200000-e82fffff : 0000:00:02.0

e8300000-e831ffff : 0000:00:19.0

e8300000-e831ffff : e1000e

e8320000-e8320fff : 0000:00:19.0

e8320000-e8320fff : e1000e

e8321000-e83213ff : 0000:00:1d.7

e8321000-e83213ff : ehci_hcd

e8321400-e83217ff : 0000:00:1a.7

e8321400-e83217ff : ehci_hcd

e8321800-e83218ff : 0000:00:1f.3

e8322000-e8322fff : Intel Flush Page

e8400000-e84fffff : PCI Bus 0000:03

e8400000-e840ffff : 0000:03:00.0

ec000000-efffffff : PCI CardBus 0000:06

f0000000-f7ffffff : PCI MMCONFIG 0 [00-7f]

f0000000-f7ffffff : pnp 00:01

f8000000-fbffffff : PCI CardBus 0000:06

fec00000-fec00fff : IOAPIC 0

fed13000-fed13fff : pnp 00:01

fed14000-fed17fff : pnp 00:01

fed18000-fed18fff : pnp 00:01

fed19000-fed19fff : pnp 00:01

fed1c000-fed1ffff : pnp 00:01

fed20000-fed3ffff : pnp 00:01

fed45000-fed99fff : pnp 00:01

fee00000-fee00fff : Local APIC

fff00000-ffffffff : reserved

100000000-12fffffff : System RAM

-------------------------------------------------------------------------------------------------------
lspci -vvv

00:00.0 Host bridge: Intel Corporation 82G35 Express DRAM Controller (rev 
03)

Subsystem: Intel Corporation Device d701

Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B- DisINTx-

Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- 
<MAbort+ >SERR- <PERR- INTx-

Latency: 0

Capabilities: [e0] Vendor Specific Information <?>

Kernel driver in use: agpgart-intel

Kernel modules: intel-agp

00:02.0 VGA compatible controller: Intel Corporation 82G35 Express 
Integrated Graphics Controller (rev 03)

Subsystem: Intel Corporation Device d701

Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B- DisINTx+

Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- 
<MAbort- >SERR- <PERR- INTx-

Latency: 0

Interrupt: pin A routed to IRQ 28

Region 0: Memory at e8200000 (32-bit, non-prefetchable) [size=1M]

Region 2: Memory at d0000000 (64-bit, prefetchable) [size=256M]

Region 4: I/O ports at 3440 [size=8]

Capabilities: [90] Message Signalled Interrupts: Mask- 64bit- Queue=0/0 
Enable+

Address: fee0f00c Data: 41a1

Capabilities: [d0] Power Management version 2

Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)

Status: D0 PME-Enable- DSel=0 DScale=0 PME-

Kernel driver in use: i915

Kernel modules: i915

00:02.1 Display controller: Intel Corporation 82G35 Express Integrated 
Graphics Controller (rev 03)

Subsystem: Intel Corporation Device d701

Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B- DisINTx-

Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- 
<MAbort- >SERR- <PERR- INTx-

Latency: 0

Region 0: Memory at e8100000 (32-bit, non-prefetchable) [size=1M]

Capabilities: [d0] Power Management version 2

Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)

Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:19.0 Ethernet controller: Intel Corporation 82566DC Gigabit Network 
Connection (rev 02)

Subsystem: Intel Corporation Device d701

Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B- DisINTx+

Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- 
<MAbort- >SERR- <PERR- INTx-

Latency: 0

Interrupt: pin A routed to IRQ 27

Region 0: Memory at e8300000 (32-bit, non-prefetchable) [size=128K]

Region 1: Memory at e8320000 (32-bit, non-prefetchable) [size=4K]

Region 2: I/O ports at 30c0 [size=32]

Capabilities: [c8] Power Management version 2

Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold+)

Status: D0 PME-Enable- DSel=0 DScale=1 PME-

Capabilities: [d0] Message Signalled Interrupts: Mask- 64bit+ Queue=0/0 
Enable+

Address: 00000000fee0f00c Data: 41b1

Kernel driver in use: e1000e

Kernel modules: e1000e

00:1a.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI 
Controller #4 (rev 02)

Subsystem: Intel Corporation Device d701

Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B- DisINTx-

Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- 
<MAbort- >SERR- <PERR- INTx-

Latency: 0

Interrupt: pin A routed to IRQ 16

Region 4: I/O ports at 30a0 [size=32]

Kernel driver in use: uhci_hcd

00:1a.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI 
Controller #5 (rev 02)

Subsystem: Intel Corporation Device d701

Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B- DisINTx-

Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- 
<MAbort- >SERR- <PERR- INTx-

Latency: 0

Interrupt: pin B routed to IRQ 21

Region 4: I/O ports at 3080 [size=32]

Kernel driver in use: uhci_hcd

00:1a.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI 
Controller #2 (rev 02) (prog-if 20)

Subsystem: Intel Corporation Device d701

Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B- DisINTx-

Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- 
<MAbort- >SERR- <PERR- INTx-

Latency: 0

Interrupt: pin C routed to IRQ 18

Region 0: Memory at e8321400 (32-bit, non-prefetchable) [size=1K]

Capabilities: [50] Power Management version 2

Flags: PMEClk- DSI- D1- D2- AuxCurrent=375mA PME(D0+,D1-,D2-,D3hot+,D3cold+)

Status: D0 PME-Enable- DSel=0 DScale=0 PME-

Capabilities: [58] Debug port: BAR=1 offset=00a0

Kernel driver in use: ehci_hcd

00:1c.0 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 
1 (rev 02)

Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B- DisINTx+

Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- 
<MAbort- >SERR- <PERR- INTx-

Latency: 0, Cache Line Size: 64 bytes

Bus: primary=00, secondary=01, subordinate=01, sec-latency=0

I/O behind bridge: 0000f000-00000fff

Memory behind bridge: fff00000-000fffff

Prefetchable memory behind bridge: fffffffffff00000-00000000000fffff

Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- 
<MAbort+ <SERR- <PERR-

BridgeCtl: Parity- SERR- NoISA+ VGA- MAbort- >Reset- FastB2B-

PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-

Capabilities: [40] Express (v1) Root Port (Slot+), MSI 00

DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s unlimited, L1 
unlimited

ExtTag- RBE+ FLReset-

DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-

RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-

MaxPayload 128 bytes, MaxReadReq 128 bytes

DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr+ TransPend-

LnkCap: Port #1, Speed 2.5GT/s, Width x1, ASPM L0s L1, Latency L0 <1us, L1 
<4us

ClockPM- Suprise- LLActRep+ BwNot-

LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk-

ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-

LnkSta: Speed 2.5GT/s, Width x0, TrErr- Train- SlotClk+ DLActive- BWMgmt- 
ABWMgmt-

SltCap: AttnBtn- PwrCtrl- MRL- AttnInd- PwrInd- HotPlug+ Surpise+

Slot # 1, PowerLimit 10.000000; Interlock- NoCompl-

SltCtl: Enable: AttnBtn- PwrFlt- MRL- PresDet- CmdCplt- HPIrq- LinkChg-

Control: AttnInd Unknown, PwrInd Unknown, Power- Interlock-

SltSta: Status: AttnBtn- PowerFlt- MRL- CmdCplt- PresDet- Interlock-

Changed: MRL- PresDet- LinkState-

RootCtl: ErrCorrectable- ErrNon-Fatal- ErrFatal- PMEIntEna- CRSVisible-

RootCap: CRSVisible-

RootSta: PME ReqID 0000, PMEStatus- PMEPending-

Capabilities: [80] Message Signalled Interrupts: Mask- 64bit- Queue=0/0 
Enable+

Address: fee0f00c Data: 4161

Capabilities: [90] Subsystem: Gammagraphx, Inc. (or missing ID) Device 0000

Capabilities: [a0] Power Management version 2

Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold+)

Status: D0 PME-Enable- DSel=0 DScale=0 PME-

Capabilities: [100] Virtual Channel <?>

Capabilities: [180] Root Complex Link <?>

Kernel driver in use: pcieport-driver

Kernel modules: shpchp

00:1c.1 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 
2 (rev 02)

Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B- DisINTx+

Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- 
<MAbort- >SERR- <PERR- INTx-

Latency: 0, Cache Line Size: 64 bytes

Bus: primary=00, secondary=02, subordinate=02, sec-latency=0

I/O behind bridge: 0000f000-00000fff

Memory behind bridge: fff00000-000fffff

Prefetchable memory behind bridge: fffffffffff00000-00000000000fffff

Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- 
<MAbort+ <SERR- <PERR-

BridgeCtl: Parity- SERR- NoISA+ VGA- MAbort- >Reset- FastB2B-

PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-

Capabilities: [40] Express (v1) Root Port (Slot+), MSI 00

DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s unlimited, L1 
unlimited

ExtTag- RBE+ FLReset-

DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-

RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-

MaxPayload 128 bytes, MaxReadReq 128 bytes

DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr+ TransPend-

LnkCap: Port #2, Speed 2.5GT/s, Width x1, ASPM L0s L1, Latency L0 <1us, L1 
<4us

ClockPM- Suprise- LLActRep+ BwNot-

LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk-

ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-

LnkSta: Speed 2.5GT/s, Width x0, TrErr- Train- SlotClk+ DLActive- BWMgmt- 
ABWMgmt-

SltCap: AttnBtn- PwrCtrl- MRL- AttnInd- PwrInd- HotPlug+ Surpise+

Slot # 2, PowerLimit 10.000000; Interlock- NoCompl-

SltCtl: Enable: AttnBtn- PwrFlt- MRL- PresDet- CmdCplt- HPIrq- LinkChg-

Control: AttnInd Unknown, PwrInd Unknown, Power- Interlock-

SltSta: Status: AttnBtn- PowerFlt- MRL- CmdCplt- PresDet- Interlock-

Changed: MRL- PresDet- LinkState-

RootCtl: ErrCorrectable- ErrNon-Fatal- ErrFatal- PMEIntEna- CRSVisible-

RootCap: CRSVisible-

RootSta: PME ReqID 0000, PMEStatus- PMEPending-

Capabilities: [80] Message Signalled Interrupts: Mask- 64bit- Queue=0/0 
Enable+

Address: fee0f00c Data: 4169

Capabilities: [90] Subsystem: Gammagraphx, Inc. (or missing ID) Device 0000

Capabilities: [a0] Power Management version 2

Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold+)

Status: D0 PME-Enable- DSel=0 DScale=0 PME-

Capabilities: [100] Virtual Channel <?>

Capabilities: [180] Root Complex Link <?>

Kernel driver in use: pcieport-driver

Kernel modules: shpchp

00:1c.2 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 
3 (rev 02)

Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B- DisINTx+

Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- 
<MAbort- >SERR- <PERR- INTx-

Latency: 0, Cache Line Size: 64 bytes

Bus: primary=00, secondary=03, subordinate=03, sec-latency=0

I/O behind bridge: 00002000-00002fff

Memory behind bridge: fff00000-000fffff

Prefetchable memory behind bridge: ffffffffe8400000-00000000e84fffff

Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- 
<MAbort- <SERR- <PERR-

BridgeCtl: Parity- SERR- NoISA+ VGA- MAbort- >Reset- FastB2B-

PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-

Capabilities: [40] Express (v1) Root Port (Slot+), MSI 00

DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s unlimited, L1 
unlimited

ExtTag- RBE+ FLReset-

DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-

RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-

MaxPayload 128 bytes, MaxReadReq 128 bytes

DevSta: CorrErr+ UncorrErr- FatalErr- UnsuppReq- AuxPwr+ TransPend-

LnkCap: Port #3, Speed 2.5GT/s, Width x1, ASPM L0s L1, Latency L0 <1us, L1 
<4us

ClockPM- Suprise- LLActRep+ BwNot-

LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk-

ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-

LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive+ BWMgmt- 
ABWMgmt-

SltCap: AttnBtn- PwrCtrl- MRL- AttnInd- PwrInd- HotPlug+ Surpise+

Slot # 3, PowerLimit 10.000000; Interlock- NoCompl-

SltCtl: Enable: AttnBtn- PwrFlt- MRL- PresDet- CmdCplt- HPIrq- LinkChg-

Control: AttnInd Unknown, PwrInd Unknown, Power- Interlock-

SltSta: Status: AttnBtn- PowerFlt- MRL- CmdCplt- PresDet+ Interlock-

Changed: MRL- PresDet+ LinkState+

RootCtl: ErrCorrectable- ErrNon-Fatal- ErrFatal- PMEIntEna- CRSVisible-

RootCap: CRSVisible-

RootSta: PME ReqID 0000, PMEStatus- PMEPending-

Capabilities: [80] Message Signalled Interrupts: Mask- 64bit- Queue=0/0 
Enable+

Address: fee0f00c Data: 4171

Capabilities: [90] Subsystem: Gammagraphx, Inc. (or missing ID) Device 0000

Capabilities: [a0] Power Management version 2

Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold+)

Status: D0 PME-Enable- DSel=0 DScale=0 PME-

Capabilities: [100] Virtual Channel <?>

Capabilities: [180] Root Complex Link <?>

Kernel driver in use: pcieport-driver

Kernel modules: shpchp

00:1d.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI 
Controller #1 (rev 02)

Subsystem: Intel Corporation Device d701

Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B- DisINTx-

Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- 
<MAbort- >SERR- <PERR- INTx-

Latency: 0

Interrupt: pin A routed to IRQ 23

Region 4: I/O ports at 3060 [size=32]

Kernel driver in use: uhci_hcd

00:1d.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI 
Controller #2 (rev 02)

Subsystem: Intel Corporation Device d701

Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B- DisINTx-

Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- 
<MAbort- >SERR- <PERR- INTx-

Latency: 0

Interrupt: pin B routed to IRQ 19

Region 4: I/O ports at 3040 [size=32]

Kernel driver in use: uhci_hcd

00:1d.2 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI 
Controller #3 (rev 02)

Subsystem: Intel Corporation Device d701

Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B- DisINTx-

Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- 
<MAbort- >SERR- <PERR- INTx-

Latency: 0

Interrupt: pin C routed to IRQ 18

Region 4: I/O ports at 3020 [size=32]

Kernel driver in use: uhci_hcd

00:1d.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI 
Controller #1 (rev 02) (prog-if 20)

Subsystem: Intel Corporation Device d701

Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B- DisINTx-

Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- 
<MAbort- >SERR- <PERR- INTx-

Latency: 0

Interrupt: pin A routed to IRQ 23

Region 0: Memory at e8321000 (32-bit, non-prefetchable) [size=1K]

Capabilities: [50] Power Management version 2

Flags: PMEClk- DSI- D1- D2- AuxCurrent=375mA PME(D0+,D1-,D2-,D3hot+,D3cold+)

Status: D0 PME-Enable- DSel=0 DScale=0 PME-

Capabilities: [58] Debug port: BAR=1 offset=00a0

Kernel driver in use: ehci_hcd

00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev f2) (prog-if 01)

Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B- DisINTx-

Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- 
<MAbort- >SERR- <PERR- INTx-

Latency: 0

Bus: primary=00, secondary=04, subordinate=09, sec-latency=32

I/O behind bridge: 00001000-00001fff

Memory behind bridge: e4000000-e80fffff

Prefetchable memory behind bridge: 00000000e0000000-00000000e3ffffff

Secondary status: 66MHz- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- 
<MAbort+ <SERR- <PERR-

BridgeCtl: Parity- SERR- NoISA+ VGA- MAbort- >Reset- FastB2B-

PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-

Capabilities: [50] Subsystem: Intel Corporation Device d701

00:1f.0 ISA bridge: Intel Corporation 82801HB/HR (ICH8/R) LPC Interface 
Controller (rev 02)

Subsystem: Intel Corporation Device d701

Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B- DisINTx-

Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- 
<MAbort- >SERR- <PERR- INTx-

Latency: 0

Capabilities: [e0] Vendor Specific Information <?>

Kernel modules: iTCO_wdt

00:1f.2 IDE interface: Intel Corporation 82801H (ICH8 Family) 4 port SATA 
IDE Controller (rev 02) (prog-if 8a [Master SecP PriP])

Subsystem: Intel Corporation Device d701

Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B- DisINTx-

Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- 
<MAbort- >SERR- <PERR- INTx-

Latency: 0

Interrupt: pin A routed to IRQ 19

Region 0: I/O ports at 01f0 [size=8]

Region 1: I/O ports at 03f4 [size=1]

Region 2: I/O ports at 0170 [size=8]

Region 3: I/O ports at 0374 [size=1]

Region 4: I/O ports at 3410 [size=16]

Region 5: I/O ports at 3400 [size=16]

Capabilities: [70] Power Management version 3

Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot+,D3cold-)

Status: D0 PME-Enable- DSel=0 DScale=0 PME-

Kernel driver in use: ata_piix

00:1f.3 SMBus: Intel Corporation 82801H (ICH8 Family) SMBus Controller (rev 
02)

Subsystem: Intel Corporation Device d701

Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B- DisINTx-

Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- 
<MAbort- >SERR- <PERR- INTx-

Interrupt: pin B routed to IRQ 10

Region 0: Memory at e8321800 (32-bit, non-prefetchable) [size=256]

Region 4: I/O ports at 3000 [size=32]

Kernel modules: i2c-i801

00:1f.5 IDE interface: Intel Corporation 82801H (ICH8 Family) 2 port SATA 
IDE Controller (rev 02) (prog-if 85 [Master SecO PriO])

Subsystem: Intel Corporation Device d701

Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B- DisINTx-

Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- 
<MAbort- >SERR- <PERR- INTx-

Latency: 0

Interrupt: pin A routed to IRQ 19

Region 0: I/O ports at 3428 [size=8]

Region 1: I/O ports at 344c [size=4]

Region 2: I/O ports at 3420 [size=8]

Region 3: I/O ports at 3448 [size=4]

Region 4: I/O ports at 30f0 [size=16]

Region 5: I/O ports at 30e0 [size=16]

Capabilities: [70] Power Management version 3

Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot+,D3cold-)

Status: D0 PME-Enable- DSel=0 DScale=0 PME-

Kernel driver in use: ata_piix

03:00.0 IDE interface: JMicron Technology Corp. JMB368 IDE controller 
(prog-if 85 [Master SecO PriO])

Subsystem: JMicron Technology Corp. JMB368 IDE controller

Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B- DisINTx-

Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- 
<MAbort- >SERR- <PERR- INTx-

Latency: 0, Cache Line Size: 64 bytes

Interrupt: pin A routed to IRQ 18

Region 0: I/O ports at 2018 [size=8]

Region 1: I/O ports at 2024 [size=4]

Region 2: I/O ports at 2010 [size=8]

Region 3: I/O ports at 2020 [size=4]

Region 4: I/O ports at 2000 [size=16]

Expansion ROM at e8400000 [disabled] [size=64K]

Capabilities: [68] Power Management version 2

Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)

Status: D0 PME-Enable- DSel=0 DScale=0 PME-

Capabilities: [50] Express (v1) Legacy Endpoint, MSI 01

DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s <64ns, L1 <1us

ExtTag- AttnBtn- AttnInd- PwrInd- RBE- FLReset-

DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-

RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-

MaxPayload 128 bytes, MaxReadReq 512 bytes

DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend-

LnkCap: Port #1, Speed 2.5GT/s, Width x1, ASPM L0s, Latency L0 unlimited, L1 
unlimited

ClockPM- Suprise- LLActRep- BwNot-

LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk-

ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-

LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive- BWMgmt- 
ABWMgmt-

Capabilities: [70] Message Signalled Interrupts: Mask- 64bit- Queue=0/0 
Enable-

Address: 00000000 Data: 0000

Kernel driver in use: pata_jmicron

04:03.0 CardBus bridge: Texas Instruments PCI1225 (rev 01)

Subsystem: Actiontec Electronics Inc Device 0293

Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B- DisINTx-

Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- 
<MAbort- >SERR- <PERR- INTx-

Latency: 168, Cache Line Size: 64 bytes

Interrupt: pin A routed to IRQ 17

Region 0: Memory at e8001000 (32-bit, non-prefetchable) [size=4K]

Bus: primary=04, secondary=05, subordinate=05, sec-latency=176

Memory window 0: e0000000-e3fff000 (prefetchable)

Memory window 1: e4000000-e7fff000

I/O window 0: 00001000-000010ff

I/O window 1: 00001400-000014ff

BridgeCtl: Parity- SERR- ISA- VGA- MAbort- >Reset+ 16bInt+ PostWrite+

16-bit legacy interface ports at 0001

Kernel driver in use: yenta_cardbus

Kernel modules: yenta_socket

04:03.1 CardBus bridge: Texas Instruments PCI1225 (rev 01)

Subsystem: Actiontec Electronics Inc Device 0293

Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B- DisINTx-

Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- 
<MAbort- >SERR- <PERR- INTx-

Latency: 168, Cache Line Size: 64 bytes

Interrupt: pin B routed to IRQ 18

Region 0: Memory at e8000000 (32-bit, non-prefetchable) [size=4K]

Bus: primary=04, secondary=06, subordinate=09, sec-latency=176

Memory window 0: ec000000-effff000 (prefetchable)

Memory window 1: f8000000-fbfff000

I/O window 0: 00001800-000018ff

I/O window 1: 00001c00-00001cff

BridgeCtl: Parity- SERR- ISA- VGA- MAbort- >Reset+ 16bInt+ PostWrite+

16-bit legacy interface ports at 0001

Kernel driver in use: yenta_cardbus

Kernel modules: yenta_socket







From yuasa at linux-mips.org  Wed Mar 10 01:57:56 2010
From: yuasa at linux-mips.org (Yoichi Yuasa)
Date: Wed, 10 Mar 2010 15:57:56 +0900
Subject: [PATCH] pcmcia/vrc4171: use local spinlock for device local lock.
Message-ID: <20100310155756.496e2bbf.yuasa@linux-mips.org>

struct pcmcia_socket lock had been used before.

Signed-off-by: Yoichi Yuasa <yuasa at linux-mips.org>
---
 drivers/pcmcia/vrc4171_card.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/pcmcia/vrc4171_card.c b/drivers/pcmcia/vrc4171_card.c
index c9fcbdc..aaccdb9 100644
--- a/drivers/pcmcia/vrc4171_card.c
+++ b/drivers/pcmcia/vrc4171_card.c
@@ -105,6 +105,7 @@ typedef struct vrc4171_socket {
 	char name[24];
 	int csc_irq;
 	int io_irq;
+	spinlock_t lock;
 } vrc4171_socket_t;
 
 static vrc4171_socket_t vrc4171_sockets[CARD_MAX_SLOTS];
@@ -327,7 +328,7 @@ static int pccard_set_socket(struct pcmcia_socket *sock, socket_state_t *state)
 	slot = sock->sock;
 	socket = &vrc4171_sockets[slot];
 
-	spin_lock_irq(&sock->lock);
+	spin_lock_irq(&socket->lock);
 
 	voltage = set_Vcc_value(state->Vcc);
 	exca_write_byte(slot, CARD_VOLTAGE_SELECT, voltage);
@@ -370,7 +371,7 @@ static int pccard_set_socket(struct pcmcia_socket *sock, socket_state_t *state)
 		cscint |= I365_CSC_DETECT;
         exca_write_byte(slot, I365_CSCINT, cscint);
 
-	spin_unlock_irq(&sock->lock);
+	spin_unlock_irq(&socket->lock);
 
 	return 0;
 }
-- 
1.7.0.2



From linux at dominikbrodowski.net  Wed Mar 10 15:42:34 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Wed, 10 Mar 2010 21:42:34 +0100
Subject: PCMCIA cards not detected
In-Reply-To: <106BA2A1BF8C4C8EA837CC398D35EC77@spyrus.com>
References: <1268163929-16164-1-git-send-email-manuel.lauss@gmail.com>
	<106BA2A1BF8C4C8EA837CC398D35EC77@spyrus.com>
Message-ID: <20100310204234.GB5922@comet.dominikbrodowski.net>

Hey,

On Tue, Mar 09, 2010 at 04:16:28PM -0800, raraks wrote:
> sudo cat /proc/iomem gives the foll:
> 
> 00000000-00000fff : System RAM
> 00001000-00005fff : reserved
> 00006000-0008efff : System RAM
> 0008f000-0009ffff : reserved
> 000c0000-000dffff : pnp 00:01
> 000e0000-000fffff : reserved
> 00100000-ce5fafff : System RAM
> 01000000-01530f79 : Kernel code
> 01530f7a-018236ef : Kernel data
> 018d5000-019e4ccb : Kernel bss
> ce5fb000-ce68ffff : ACPI Non-volatile Storage
> ce690000-cf612fff : System RAM
> cf613000-cf61efff : reserved
> cf61f000-cf692fff : System RAM
> cf693000-cf6e7fff : ACPI Non-volatile Storage
> cf6e8000-cf6ebfff : System RAM
> cf6ec000-cf6f0fff : ACPI Tables
> cf6f1000-cf6f1fff : System RAM
> cf6f2000-cf6fefff : ACPI Tables
> cf6ff000-cf6fffff : System RAM
> cf700000-cfffffff : reserved
> d0000000-dfffffff : 0000:00:02.0
> e0000000-e3ffffff : PCI Bus 0000:04
> e0000000-e3ffffff : PCI CardBus 0000:05
> e4000000-e80fffff : PCI Bus 0000:04
> e4000000-e7ffffff : PCI CardBus 0000:05
> e8000000-e8000fff : 0000:04:03.1
> e8000000-e8000fff : yenta_socket
> e8001000-e8001fff : 0000:04:03.0
> e8001000-e8001fff : yenta_socket
> e8100000-e81fffff : 0000:00:02.1
> e8200000-e82fffff : 0000:00:02.0
> e8300000-e831ffff : 0000:00:19.0
> e8300000-e831ffff : e1000e
> e8320000-e8320fff : 0000:00:19.0
> e8320000-e8320fff : e1000e
> e8321000-e83213ff : 0000:00:1d.7
> e8321000-e83213ff : ehci_hcd
> e8321400-e83217ff : 0000:00:1a.7
> e8321400-e83217ff : ehci_hcd
> e8321800-e83218ff : 0000:00:1f.3
> e8322000-e8322fff : Intel Flush Page
> e8400000-e84fffff : PCI Bus 0000:03
> e8400000-e840ffff : 0000:03:00.0
> ec000000-efffffff : PCI CardBus 0000:06
> f0000000-f7ffffff : PCI MMCONFIG 0 [00-7f]
> f0000000-f7ffffff : pnp 00:01
> f8000000-fbffffff : PCI CardBus 0000:06
> fec00000-fec00fff : IOAPIC 0
> fed13000-fed13fff : pnp 00:01
> fed14000-fed17fff : pnp 00:01
> fed18000-fed18fff : pnp 00:01
> fed19000-fed19fff : pnp 00:01
> fed1c000-fed1ffff : pnp 00:01
> fed20000-fed3ffff : pnp 00:01
> fed45000-fed99fff : pnp 00:01
> fee00000-fee00fff : Local APIC
> fff00000-ffffffff : reserved
> 100000000-12fffffff : System RAM

Whoa... there isn't _any_ iomem free and available to use below 0xffffffff.
And IIRC that's the upper limit for use by the Cardbus bridge. Therefore, we
can't allocate a memory window, which is needed to read out the CIS ...

Now, I have no clue at all on how to reduce the iomem usage by other
devices... maybe linux-pci can help in this regard? Or twiddling with some
BIOS settings?

Best,
	Dominik


From linux at dominikbrodowski.net  Wed Mar 10 15:44:16 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Wed, 10 Mar 2010 21:44:16 +0100
Subject: [PATCH] pcmcia: db1xxx-ss: suspend/resume fix
In-Reply-To: <1268163929-16164-1-git-send-email-manuel.lauss@gmail.com>
References: <1268163929-16164-1-git-send-email-manuel.lauss@gmail.com>
Message-ID: <20100310204416.GC5922@comet.dominikbrodowski.net>

Hey,

On Tue, Mar 09, 2010 at 08:45:29PM +0100, Manuel Lauss wrote:
> +	.suspend	= db1x_pcmcia_suspend_noirq,
> +	.suspend_noirq	= db1x_pcmcia_suspend_noirq,

Do we need both?

Best,
	Dominik


From linux at dominikbrodowski.net  Wed Mar 10 15:35:34 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Wed, 10 Mar 2010 21:35:34 +0100
Subject: [PATCH] pcmcia/vrc4171: use local spinlock for device local lock.
In-Reply-To: <20100310155756.496e2bbf.yuasa@linux-mips.org>
References: <20100310155756.496e2bbf.yuasa@linux-mips.org>
Message-ID: <20100310203534.GA5922@comet.dominikbrodowski.net>

Hey,

On Wed, Mar 10, 2010 at 03:57:56PM +0900, Yoichi Yuasa wrote:
> struct pcmcia_socket lock had been used before.

Applied, thanks.

	Dominik


From manuel.lauss at googlemail.com  Wed Mar 10 15:46:14 2010
From: manuel.lauss at googlemail.com (Manuel Lauss)
Date: Wed, 10 Mar 2010 21:46:14 +0100
Subject: [PATCH] pcmcia: db1xxx-ss: suspend/resume fix
In-Reply-To: <20100310204416.GC5922@comet.dominikbrodowski.net>
References: <1268163929-16164-1-git-send-email-manuel.lauss@gmail.com>
	<20100310204416.GC5922@comet.dominikbrodowski.net>
Message-ID: <f861ec6f1003101246g2586e94dn2e63a5aa1037de92@mail.gmail.com>

On Wed, Mar 10, 2010 at 9:44 PM, Dominik Brodowski
<linux at dominikbrodowski.net> wrote:
> Hey,
>
> On Tue, Mar 09, 2010 at 08:45:29PM +0100, Manuel Lauss wrote:
>> + ? ? .suspend ? ? ? ?= db1x_pcmcia_suspend_noirq,
>> + ? ? .suspend_noirq ?= db1x_pcmcia_suspend_noirq,

Not sure (I used yenta_socket as "inspiration"), let me test that...

Manuel


From pavel at ucw.cz  Wed Mar 10 15:45:46 2010
From: pavel at ucw.cz (Pavel Machek)
Date: Wed, 10 Mar 2010 21:45:46 +0100
Subject: [git pull] more PCMCIA updates for 2.6.34 (including ioctl
	deprecation)
In-Reply-To: <20100305120746.646126b9@lxorguk.ukuu.org.uk>
References: <20100303075944.GA23354@comet.dominikbrodowski.net>
	<20100303083010.GA22928@flint.arm.linux.org.uk>
	<20100305120746.646126b9@lxorguk.ukuu.org.uk>
Message-ID: <20100310204546.GA1394@ucw.cz>

Hi!

> > So you believe that disabling the button in the graphical environment
> > to allow PCMCIA cards to be removed (such as CF cards) - leaving the
> > user to merely pull out the CF card, while the FS is mounted, is a
> > good idea?
> 
> Do any graphical environments even support the ancient user space
> pcmcica helper stuff ? I can't find any evidence they do but I realise

Yes; qtopia shipped with zaurus sl-5500 (collie), and very probably
opie and gpe...

Sharp needed operating system for the handheld, and yes it supported
all the hw.

								Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


From peter at stuge.se  Wed Mar 10 15:52:26 2010
From: peter at stuge.se (Peter Stuge)
Date: Wed, 10 Mar 2010 21:52:26 +0100
Subject: PCMCIA cards not detected
In-Reply-To: <20100310204234.GB5922@comet.dominikbrodowski.net>
References: <1268163929-16164-1-git-send-email-manuel.lauss@gmail.com>
	<106BA2A1BF8C4C8EA837CC398D35EC77@spyrus.com>
	<20100310204234.GB5922@comet.dominikbrodowski.net>
Message-ID: <20100310205226.21805.qmail@stuge.se>

Dominik Brodowski wrote:
> > e8400000-e84fffff : PCI Bus 0000:03
> > e8400000-e840ffff : 0000:03:00.0
> > ec000000-efffffff : PCI CardBus 0000:06
> 
> Whoa... there isn't _any_ iomem free and available to use below
> 0xffffffff.

Looks like there's some room from e8500000 to ebffffff.


//Peter


From linux at dominikbrodowski.net  Wed Mar 10 15:56:04 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Wed, 10 Mar 2010 21:56:04 +0100
Subject: PCMCIA cards not detected
In-Reply-To: <20100310205226.21805.qmail@stuge.se>
References: <1268163929-16164-1-git-send-email-manuel.lauss@gmail.com>
	<106BA2A1BF8C4C8EA837CC398D35EC77@spyrus.com>
	<20100310204234.GB5922@comet.dominikbrodowski.net>
	<20100310205226.21805.qmail@stuge.se>
Message-ID: <20100310205604.GA16230@isilmar.linta.de>


On Wed, Mar 10, 2010 at 09:52:26PM +0100, Peter Stuge wrote:
> Dominik Brodowski wrote:
> > > e8400000-e84fffff : PCI Bus 0000:03
> > > e8400000-e840ffff : 0000:03:00.0
> > > ec000000-efffffff : PCI CardBus 0000:06
> > 
> > Whoa... there isn't _any_ iomem free and available to use below
> > 0xffffffff.
> 
> Looks like there's some room from e8500000 to ebffffff.

ACK. Does

# echo "+ 0xe8500000 - 0xebffffff" > /sys/class/pcmcia_socket/pcmcia_socket0/available_resources_mem
# echo "+ 0xe8500000 - 0xebffffff" > /sys/class/pcmcia_socket/pcmcia_socket1/available_resources_mem

before inserting the card help?

Best,
	Dominik


From linux at dominikbrodowski.net  Wed Mar 10 16:00:15 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Wed, 10 Mar 2010 22:00:15 +0100
Subject: [git pull] more PCMCIA updates for 2.6.34 (including ioctl
	deprecation)
In-Reply-To: <20100310204546.GA1394@ucw.cz>
References: <20100303075944.GA23354@comet.dominikbrodowski.net>
	<20100303083010.GA22928@flint.arm.linux.org.uk>
	<20100305120746.646126b9@lxorguk.ukuu.org.uk>
	<20100310204546.GA1394@ucw.cz>
Message-ID: <20100310210015.GB16230@isilmar.linta.de>

Hey,

On Wed, Mar 10, 2010 at 09:45:46PM +0100, Pavel Machek wrote:
> Hi!
> 
> > > So you believe that disabling the button in the graphical environment
> > > to allow PCMCIA cards to be removed (such as CF cards) - leaving the
> > > user to merely pull out the CF card, while the FS is mounted, is a
> > > good idea?
> > 
> > Do any graphical environments even support the ancient user space
> > pcmcica helper stuff ? I can't find any evidence they do but I realise
> 
> Yes; qtopia shipped with zaurus sl-5500 (collie), and very probably
> opie and gpe...
> 
> Sharp needed operating system for the handheld, and yes it supported
> all the hw.

So qtopia still uses the PCMCIA ioctl? Or is it some custom add-on code by
zaurus? I'd very much like to see some more source code, what parts of
the IOCTL it uses etc. pp. Or at least some pointers...

Thanks,
	Dominik


From linux at dominikbrodowski.net  Wed Mar 10 16:03:41 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Wed, 10 Mar 2010 22:03:41 +0100
Subject: [PATCH] pcmcia: db1xxx-ss: suspend/resume fix
In-Reply-To: <f861ec6f1003101246g2586e94dn2e63a5aa1037de92@mail.gmail.com>
References: <1268163929-16164-1-git-send-email-manuel.lauss@gmail.com>
	<20100310204416.GC5922@comet.dominikbrodowski.net>
	<f861ec6f1003101246g2586e94dn2e63a5aa1037de92@mail.gmail.com>
Message-ID: <20100310210341.GA17969@isilmar.linta.de>

Hey,

On Wed, Mar 10, 2010 at 09:46:14PM +0100, Manuel Lauss wrote:
> On Wed, Mar 10, 2010 at 9:44 PM, Dominik Brodowski
> <linux at dominikbrodowski.net> wrote:
> > Hey,
> >
> > On Tue, Mar 09, 2010 at 08:45:29PM +0100, Manuel Lauss wrote:
> >> + ? ? .suspend ? ? ? ?= db1x_pcmcia_suspend_noirq,
> >> + ? ? .suspend_noirq ?= db1x_pcmcia_suspend_noirq,
> 
> Not sure (I used yenta_socket as "inspiration"), let me test that...

Well, yenta_socket only contains .suspend_noirq ...

Best,
	Dominik


From raraks at gmail.com  Wed Mar 10 16:53:07 2010
From: raraks at gmail.com (raraks)
Date: Wed, 10 Mar 2010 13:53:07 -0800
Subject: PCMCIA cards not detected
References: <1268163929-16164-1-git-send-email-manuel.lauss@gmail.com>
	<106BA2A1BF8C4C8EA837CC398D35EC77@spyrus.com>
	<20100310204234.GB5922@comet.dominikbrodowski.net>
	<20100310205226.21805.qmail@stuge.se>
Message-ID: <86361B80062F4F349C77C016B15A933F@spyrus.com>

Thanks Peter/Dominik

disabling some devices in the BIOS and adding that range to config.opts 
worked. pccardctl ident etc. now return information on the card inserted.

Now, for some dumb questions perhaps - there are IO windows vs memory 
windows .. and the cards use one or the other or both.
- Is there something in the card signalling that indicates one or the other 
?
- How does the system know the size of window to use to read the CIS 
information ? is this always fixed depending on the type of card ?

Thanks again
-R



----- Original Message ----- 
From: "Peter Stuge" <peter at stuge.se>
To: <linux-pcmcia at lists.infradead.org>
Cc: "raraks" <raraks at gmail.com>
Sent: Wednesday, March 10, 2010 12:52 PM
Subject: Re: PCMCIA cards not detected


> Dominik Brodowski wrote:
>> > e8400000-e84fffff : PCI Bus 0000:03
>> > e8400000-e840ffff : 0000:03:00.0
>> > ec000000-efffffff : PCI CardBus 0000:06
>>
>> Whoa... there isn't _any_ iomem free and available to use below
>> 0xffffffff.
>
> Looks like there's some room from e8500000 to ebffffff.
>
>
> //Peter 



From linux at dominikbrodowski.net  Wed Mar 10 16:54:55 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Wed, 10 Mar 2010 22:54:55 +0100
Subject: PCMCIA cards not detected
In-Reply-To: <86361B80062F4F349C77C016B15A933F@spyrus.com>
References: <1268163929-16164-1-git-send-email-manuel.lauss@gmail.com>
	<106BA2A1BF8C4C8EA837CC398D35EC77@spyrus.com>
	<20100310204234.GB5922@comet.dominikbrodowski.net>
	<20100310205226.21805.qmail@stuge.se>
	<86361B80062F4F349C77C016B15A933F@spyrus.com>
Message-ID: <20100310215455.GA24272@isilmar.linta.de>

Hey,

On Wed, Mar 10, 2010 at 01:53:07PM -0800, raraks wrote:
> disabling some devices in the BIOS and adding that range to config.opts 
> worked. pccardctl ident etc. now return information on the card inserted.
> 
> Now, for some dumb questions perhaps - there are IO windows vs memory 
> windows .. and the cards use one or the other or both.
> - Is there something in the card signalling that indicates one or the other 
> ?

Extract the CIS (you can read it out of
/sys/class/pcmcia_socket/pcmcia_socket0/cis ) and run it through "dump_cis"
(part of pcmciautils, enable the debug tools). That should provide you with
valuable information

> - How does the system know the size of window to use to read the CIS 
> information ? is this always fixed depending on the type of card ?

That's fixed, yes.

Best,
	Dominik


From pavel at ucw.cz  Sat Mar 13 01:52:55 2010
From: pavel at ucw.cz (Pavel Machek)
Date: Sat, 13 Mar 2010 07:52:55 +0100
Subject: [git pull] more PCMCIA updates for 2.6.34 (including ioctl
	deprecation)
In-Reply-To: <20100310210015.GB16230@isilmar.linta.de>
References: <20100303075944.GA23354@comet.dominikbrodowski.net>
	<20100303083010.GA22928@flint.arm.linux.org.uk>
	<20100305120746.646126b9@lxorguk.ukuu.org.uk>
	<20100310204546.GA1394@ucw.cz>
	<20100310210015.GB16230@isilmar.linta.de>
Message-ID: <20100313065254.GF12554@elf.ucw.cz>

On Wed 2010-03-10 22:00:15, Dominik Brodowski wrote:
> Hey,
> 
> On Wed, Mar 10, 2010 at 09:45:46PM +0100, Pavel Machek wrote:
> > Hi!
> > 
> > > > So you believe that disabling the button in the graphical environment
> > > > to allow PCMCIA cards to be removed (such as CF cards) - leaving the
> > > > user to merely pull out the CF card, while the FS is mounted, is a
> > > > good idea?
> > > 
> > > Do any graphical environments even support the ancient user space
> > > pcmcica helper stuff ? I can't find any evidence they do but I realise
> > 
> > Yes; qtopia shipped with zaurus sl-5500 (collie), and very probably
> > opie and gpe...
> > 
> > Sharp needed operating system for the handheld, and yes it supported
> > all the hw.
> 
> So qtopia still uses the PCMCIA ioctl? Or is it some custom add-on code by
> zaurus? I'd very much like to see some more source code, what parts of
> the IOCTL it uses etc. pp. Or at least some pointers...

Well, Alan asked about "any graphical environments even support the
ancient user space pcmcica helper stuff", and yes I believe there are
some. I probably have one on ancient collie that's lying
somewhere. Not sure about sources, I never used those heavily.

								Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


From bugzilla-daemon at bugzilla.kernel.org  Sat Mar 13 03:30:38 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Sat, 13 Mar 2010 08:30:38 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@http.bugzilla.kernel.org/>
References: <bug-7304-4463@http.bugzilla.kernel.org/>
Message-ID: <201003130830.o2D8Uc36019181@demeter.kernel.org>

http://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #52 from Thomas Nemeth <nemeth.thomas at gmail.com>  2010-03-13 08:29:02 ---
> --- Comment #51 from Dominik Brodowski <linux at brodo.de> ?2010-03-06 14:07:42 ---
> Hm, it looks to me that the PCI IRQ pins are routed to IRQ #11. So what about
> trying out (at first) some workaround: Could you replace the line in
> drivers/pcmcia/yenta_socket.c - function yenta_probe() which states:
> ? ?socket->cb_irq = dev->irq;
> with:
> ? ?socket->cb_irq = 11;
> ?

    It seems that forcing the irq number does not change anything :(
    I tested that oneliner on the 2.6.25.6 (since it's the one I already had
    under my hand at that time) and there are still the same messages.


> Also, some quite new patches (see:
> http://www.mail-archive.com/linux-pcmcia at lists.infradead.org/msg02903.html
> http://www.mail-archive.com/linux-pcmcia at lists.infradead.org/msg02904.html
> http://www.mail-archive.com/linux-pcmcia at lists.infradead.org/msg02906.html
> ) which currently are only for some TI bridge might be generalized to work also
> in other cases where the PCI IRQ is 0. I'll dig into that later.

    Should I use a more recent kernel or can I continue going on with 2.6.25.6
?

    Using a recent kernel may take me some time since there's no network on
    that machine (the network only comes through pcmcia :( ).

    Anyway, thank you very much ! I was desperating that someone might have
    a look at my problem...


Thomas.

-- 
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

From bugzilla-daemon at bugzilla.kernel.org  Sat Mar 13 04:36:40 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Sat, 13 Mar 2010 09:36:40 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@http.bugzilla.kernel.org/>
References: <bug-7304-4463@http.bugzilla.kernel.org/>
Message-ID: <201003130936.o2D9aeTB001304@demeter.kernel.org>

http://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #53 from Thomas Nemeth <nemeth.thomas at gmail.com>  2010-03-13 09:35:19 ---
I was wrong.

It indeed changed something. My PCMCIA eth device has been recognized once I
inserted the yenta_socket module. Still the IRQ at boot time is not detected,
but now, at least, I have something close to a working state. The eth device
seems to be recognized but the network refuses to communicate.

Moreover the patches don't apply to either 2.6.32.9 or 2.6.33 (there are some
badly placed newlines in the webpages containing the patches. I tried to
correct most of them but I don't know if I did them all).

I'll send you some more boot logs with 2.6.25.6 and 2.6.33, and then I'll
try to apply the patches by hand.

-- 
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From bugzilla-daemon at bugzilla.kernel.org  Sat Mar 13 04:49:13 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Sat, 13 Mar 2010 09:49:13 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@http.bugzilla.kernel.org/>
References: <bug-7304-4463@http.bugzilla.kernel.org/>
Message-ID: <201003130949.o2D9nDkt004061@demeter.kernel.org>

http://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #54 from Thomas Nemeth <nemeth.thomas at gmail.com>  2010-03-13 09:47:53 ---
Created an attachment (id=25494)
 --> (http://bugzilla.kernel.org/attachment.cgi?id=25494)
Boot messages for 2.6.25.6 with IRQ forced to 11.

Here is the bootlog of the 2.6.25.6 kernel with the yenta_socket IRQ forced to
11. There is clearly some improvements here since I can have an ethernet device
when I plugin the pcmcia eth card. However I still cannot send pings through
the
network.

-- 
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From bugzilla-daemon at bugzilla.kernel.org  Sat Mar 13 05:46:05 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Sat, 13 Mar 2010 10:46:05 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@http.bugzilla.kernel.org/>
References: <bug-7304-4463@http.bugzilla.kernel.org/>
Message-ID: <201003131046.o2DAk5cj016051@demeter.kernel.org>

http://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #55 from Dominik Brodowski <linux at brodo.de>  2010-03-13 10:31:45 ---
What happens if you eject and insert the card multiple times? Is this
recognized?

--- Comment #56 from Thomas Nemeth <nemeth.thomas at gmail.com>  2010-03-13 10:45:02 ---
Created an attachment (id=25495)
 --> (http://bugzilla.kernel.org/attachment.cgi?id=25495)
Boot messages for 2.6.33 with IRQ forced to 11.

-- 
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From bugzilla-daemon at bugzilla.kernel.org  Sat Mar 13 05:49:15 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Sat, 13 Mar 2010 10:49:15 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@http.bugzilla.kernel.org/>
References: <bug-7304-4463@http.bugzilla.kernel.org/>
Message-ID: <201003131049.o2DAnFHu017068@demeter.kernel.org>

http://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #57 from Thomas Nemeth <nemeth.thomas at gmail.com>  2010-03-13 10:49:04 ---
Created an attachment (id=25496)
 --> (http://bugzilla.kernel.org/attachment.cgi?id=25496)
Boot messages for 2.6.33 with IRQ forced to 3...

As in the previous kernels messages I had seen that the IRQ used was IRQ3,
this time, instead of 11, I forced the IRQ to 3. However, this did not
worked as expected :)

-- 
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From bugzilla-daemon at bugzilla.kernel.org  Sat Mar 13 06:24:53 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Sat, 13 Mar 2010 11:24:53 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@http.bugzilla.kernel.org/>
References: <bug-7304-4463@http.bugzilla.kernel.org/>
Message-ID: <201003131124.o2DBOrpp024534@demeter.kernel.org>

http://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #58 from Thomas Nemeth <nemeth.thomas at gmail.com>  2010-03-13 11:24:39 ---
(In reply to comment #55)
> What happens if you eject and insert the card multiple times? Is this
> recognized?

    Yes. Each time I insert back the card, eth0 is recognized the same.

-- 
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From komurojun-mbn at nifty.com  Sat Mar 13 07:04:30 2010
From: komurojun-mbn at nifty.com (Komuro)
Date: Sat, 13 Mar 2010 21:04:30 +0900
Subject: [Another BUG?  kernel 2.6.34-rc1] cs: warning: no high memory space
	available!
In-Reply-To: <20100228153933.f6fe6f81.komurojun-mbn@nifty.com>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<1257971899-9274-9-git-send-email-linux@dominikbrodowski.net>
	<20091213212556.03d83e1f.komurojun-mbn@nifty.com>
	<20100228153933.f6fe6f81.komurojun-mbn@nifty.com>
Message-ID: <20100313210430.7e155bf4.komurojun-mbn@nifty.com>

Hi,

At kernel 2.6.34-rc1, pd6729 can not find high memory.
At kernel 2.6.33, there is no problem.

[kernel 2.6.34-rc1]
pcmcia_socket pcmcia_socket1: cs: IO port probe 0x100-0x3af: clean.
pcmcia_socket pcmcia_socket1: cs: IO port probe 0x3e0-0x4ff: clean.
pcmcia_socket pcmcia_socket1: cs: IO port probe 0x820-0x8ff: clean.
pcmcia_socket pcmcia_socket1: cs: IO port probe 0xc00-0xcf7: clean.
pcmcia_socket pcmcia_socket1: cs: memory probe 0x0c0000-0x0fffff: excluding 0xc0000-0xc7fff 0xe4000-0xfffff
pcmcia_socket pcmcia_socket1: cs: memory probe 0xa0000000-0xa0ffffff: excluding 0xa0000000-0xa0ffffff
pcmcia_socket pcmcia_socket1: cs: memory probe 0x60000000-0x60ffffff: excluding 0x60000000-0x60ffffff
pcmcia_socket pcmcia_socket1: cs: IO port probe 0xa00-0xaff: clean.
pcmcia_socket pcmcia_socket1: cs: warning: no high memory space available!

[kernel 2.6.33]
pcmcia_socket pcmcia_socket1: cs: IO port probe 0x100-0x3af: excluding 0x378-0x37f
pcmcia_socket pcmcia_socket1: cs: IO port probe 0x3e0-0x4ff: clean.
pcmcia_socket pcmcia_socket1: cs: IO port probe 0x820-0x8ff: clean.
pcmcia_socket pcmcia_socket1: cs: IO port probe 0xc00-0xcf7: clean.
pcmcia_socket pcmcia_socket1: cs: memory probe 0x0c0000-0x0fffff: excluding 0xc0000-0xc7fff 0xe4000-0xfffff
pcmcia_socket pcmcia_socket1: cs: memory probe 0xa0000000-0xa0ffffff: clean.
pcmcia_socket pcmcia_socket1: cs: memory probe 0x60000000-0x60ffffff: clean.
pcmcia_socket pcmcia_socket1: cs: IO port probe 0xa00-0xaff: clean.

Best Regards
Komuro


From linux at dominikbrodowski.net  Sat Mar 13 07:29:19 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Sat, 13 Mar 2010 13:29:19 +0100
Subject: [Another BUG? kernel 2.6.34-rc1] cs: warning: no high memory
	space available!
In-Reply-To: <20100313210430.7e155bf4.komurojun-mbn@nifty.com>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<1257971899-9274-9-git-send-email-linux@dominikbrodowski.net>
	<20091213212556.03d83e1f.komurojun-mbn@nifty.com>
	<20100228153933.f6fe6f81.komurojun-mbn@nifty.com>
	<20100313210430.7e155bf4.komurojun-mbn@nifty.com>
Message-ID: <20100313122919.GA16845@isilmar.linta.de>

Hey,

a) do the cards still work?
b) what's the output of cat /proc/iomem (2.6.34-rc1)?

Best,
	Dominik


From linux at dominikbrodowski.net  Sat Mar 13 07:35:28 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Sat, 13 Mar 2010 13:35:28 +0100
Subject: [Another BUG? kernel 2.6.34-rc1] cs: warning: no high memory
	space available!
In-Reply-To: <20100313122919.GA16845@isilmar.linta.de>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<1257971899-9274-9-git-send-email-linux@dominikbrodowski.net>
	<20091213212556.03d83e1f.komurojun-mbn@nifty.com>
	<20100228153933.f6fe6f81.komurojun-mbn@nifty.com>
	<20100313210430.7e155bf4.komurojun-mbn@nifty.com>
	<20100313122919.GA16845@isilmar.linta.de>
Message-ID: <20100313123528.GA17489@isilmar.linta.de>

On Sat, Mar 13, 2010 at 01:29:19PM +0100, Dominik Brodowski wrote:
> a) do the cards still work?
> b) what's the output of cat /proc/iomem (2.6.34-rc1)?

... and a full dmesg output, if possible.

Best,
	Dominik


From bugzilla-daemon at bugzilla.kernel.org  Sat Mar 13 07:58:35 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Sat, 13 Mar 2010 12:58:35 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@http.bugzilla.kernel.org/>
References: <bug-7304-4463@http.bugzilla.kernel.org/>
Message-ID: <201003131258.o2DCwZ5n012788@demeter.kernel.org>

http://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #59 from Thomas Nemeth <nemeth.thomas at gmail.com>  2010-03-13 12:58:19 ---
Created an attachment (id=25497)
 --> (http://bugzilla.kernel.org/attachment.cgi?id=25497)
Boot messages for 2.6.33 with the 3 pcmcia specified patches in comment #51

I applied by hand the patches from comment #51, but the result is a bit
buggy. From the context shown in the original patches, I can see that the
code from 2.6.33 is not the one these patches apply on.

I'll make my patches available in another attachment if needed.

-- 
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From komurojun-mbn at nifty.com  Sat Mar 13 08:05:48 2010
From: komurojun-mbn at nifty.com (Komuro)
Date: Sat, 13 Mar 2010 22:05:48 +0900
Subject: [Another BUG?  kernel 2.6.34-rc1] cs: warning: no high memory
	space available!
In-Reply-To: <20100313210430.7e155bf4.komurojun-mbn@nifty.com>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<1257971899-9274-9-git-send-email-linux@dominikbrodowski.net>
	<20091213212556.03d83e1f.komurojun-mbn@nifty.com>
	<20100228153933.f6fe6f81.komurojun-mbn@nifty.com>
	<20100313210430.7e155bf4.komurojun-mbn@nifty.com>
Message-ID: <20100313220548.aabcf854.komurojun-mbn@nifty.com>

Hi,

>a) do the cards still work?

They do _not_ work on pd6729.

>b) what's the output of cat /proc/iomem (2.6.34-rc1)?

The difference is "40000000-ffffffff : PCI Bus #00"

[2.6.34-rc1]
00000000-0000ffff : reserved
00010000-0009fbff : System RAM
0009fc00-0009ffff : reserved
000a0000-000bffff : PCI Bus #00
  000a0000-000bffff : Video RAM area
000c0000-000c7fff : Video ROM
000e4000-000fffff : reserved
  000f0000-000fffff : System ROM
00100000-3ffaffff : System RAM
  00400000-0062100b : Kernel code
  0062100c-00788d63 : Kernel data
  007e7000-0086ca93 : Kernel bss
3ffb0000-3ffbffff : ACPI Tables
3ffc0000-3ffeffff : ACPI Non-volatile Storage
3fff0000-3fffffff : reserved
40000000-ffffffff : PCI Bus #00
  40000000-43ffffff : PCI CardBus 0000:04
  44000000-47ffffff : PCI CardBus 0000:04
  48000000-4bffffff : PCI CardBus 0000:08
  4c000000-4fffffff : PCI CardBus 0000:08
  50000000-50000fff : 0000:00:0c.0
    50000000-50000fff : yenta_socket
  50001000-50001fff : 0000:00:0c.1
    50001000-50001fff : yenta_socket
  dc000000-dfffffff : 0000:00:00.0
  e0000000-f8ffffff : PCI Bus 0000:03
    e0000000-efffffff : 0000:03:00.0
  f9b00000-f9b1ffff : 0000:00:0a.0
  f9c00000-f9c03fff : 0000:00:0a.0
  f9e00000-f9e000ff : 0000:00:10.4
  f9f00000-fbffffff : PCI Bus 0000:03
    f9f00000-f9f1ffff : 0000:03:00.0
    fa000000-faffffff : 0000:03:00.0
    fb000000-fbffffff : 0000:03:00.0
  fec00000-fec003ff : IOAPIC 0
  fee00000-fee00fff : Local APIC
    fee00000-fee00fff : pnp 00:0b
  ff780000-ffffffff : reserved
    fff80000-ffffffff : pnp 00:0b

[2.6.33]
00000000-0000ffff : reserved
00010000-0009fbff : System RAM
0009fc00-0009ffff : reserved
000a0000-000bffff : Video RAM area
000c0000-000c7fff : Video ROM
000e4000-000fffff : reserved
  000f0000-000fffff : System ROM
00100000-3ffaffff : System RAM
  00400000-0061e383 : Kernel code
  0061e384-0078857f : Kernel data
  007e6000-00868333 : Kernel bss
3ffb0000-3ffbffff : ACPI Tables
3ffc0000-3ffeffff : ACPI Non-volatile Storage
3fff0000-3fffffff : reserved
40000000-43ffffff : PCI CardBus 0000:04
44000000-47ffffff : PCI CardBus 0000:04
48000000-4bffffff : PCI CardBus 0000:08
4c000000-4fffffff : PCI CardBus 0000:08
50000000-50000fff : 0000:00:0c.0
  50000000-50000fff : yenta_socket
50001000-50001fff : 0000:00:0c.1
  50001000-50001fff : yenta_socket
50002000-50002fff : pcmcia_socket1
dc000000-dfffffff : 0000:00:00.0
e0000000-f8ffffff : PCI Bus 0000:03
  e0000000-efffffff : 0000:03:00.0
f9b00000-f9b1ffff : 0000:00:0a.0
f9c00000-f9c03fff : 0000:00:0a.0
f9e00000-f9e000ff : 0000:00:10.4
f9f00000-fbffffff : PCI Bus 0000:03
  f9f00000-f9f1ffff : 0000:03:00.0
  fa000000-faffffff : 0000:03:00.0
  fb000000-fbffffff : 0000:03:00.0
fec00000-fec003ff : IOAPIC 0
fee00000-fee00fff : Local APIC
  fee00000-fee00fff : pnp 00:0b
ff780000-ffffffff : reserved
  fff80000-ffffffff : pnp 00:0b


From komurojun-mbn at nifty.com  Sat Mar 13 08:13:02 2010
From: komurojun-mbn at nifty.com (Komuro)
Date: Sat, 13 Mar 2010 22:13:02 +0900
Subject: [Another BUG?  kernel 2.6.34-rc1] cs: warning: no high memory
	space available!
In-Reply-To: <20100313220548.aabcf854.komurojun-mbn@nifty.com>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<1257971899-9274-9-git-send-email-linux@dominikbrodowski.net>
	<20091213212556.03d83e1f.komurojun-mbn@nifty.com>
	<20100228153933.f6fe6f81.komurojun-mbn@nifty.com>
	<20100313210430.7e155bf4.komurojun-mbn@nifty.com>
	<20100313220548.aabcf854.komurojun-mbn@nifty.com>
Message-ID: <20100313221302.74d1b211.komurojun-mbn@nifty.com>

Hi,

>... and a full dmesg output, if possible.

Note: In my PC, pd6729 and yenta_socket are installed.

[2.6.34-rc1]
Linux version 2.6.34-rc1 (root at localhost.localdomain) (gcc version 4.1.2 20070502 (Red Hat 4.1.2-12)) #1 SMP Sat Mar 13 09:59:12 JST 2010
BIOS-provided physical RAM map:
 BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
 BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
 BIOS-e820: 00000000000e4000 - 0000000000100000 (reserved)
 BIOS-e820: 0000000000100000 - 000000003ffb0000 (usable)
 BIOS-e820: 000000003ffb0000 - 000000003ffc0000 (ACPI data)
 BIOS-e820: 000000003ffc0000 - 000000003fff0000 (ACPI NVS)
 BIOS-e820: 000000003fff0000 - 0000000040000000 (reserved)
 BIOS-e820: 00000000ff780000 - 0000000100000000 (reserved)
Notice: NX (Execute Disable) protection cannot be enabled: non-PAE kernel!
DMI 2.3 present.
AMI BIOS detected: BIOS may corrupt low RAM, working around it.
e820 update range: 0000000000000000 - 0000000000010000 (usable) ==> (reserved)
e820 update range: 0000000000000000 - 0000000000001000 (usable) ==> (reserved)
e820 remove range: 00000000000a0000 - 0000000000100000 (usable)
last_pfn = 0x3ffb0 max_arch_pfn = 0x100000
MTRR default type: uncachable
MTRR fixed ranges enabled:
  00000-9FFFF write-back
  A0000-EFFFF uncachable
  F0000-FFFFF write-protect
MTRR variable ranges enabled:
  0 base 0000000000 mask FFC0000000 write-back
  1 base 00DC000000 mask FFFC000000 write-combining
  2 disabled
  3 disabled
  4 disabled
  5 disabled
  6 disabled
  7 disabled
x86 PAT enabled: cpu 0, old 0x7040600070406, new 0x7010600070106
initial memory mapped : 0 - 00c00000
found SMP MP-table at [c00ff780] ff780
init_memory_mapping: 0000000000000000-00000000377fe000
 0000000000 - 0000400000 page 4k
 0000400000 - 0037400000 page 2M
 0037400000 - 00377fe000 page 4k
kernel direct mapping tables up to 377fe000 @ 15000-1a000
RAMDISK: 37d33000 - 37fef945
Allocated new RAMDISK: 00100000 - 003bc945
Move RAMDISK from 0000000037d33000 - 0000000037fef944 to 00100000 - 003bc944
ACPI: RSDP 000fa850 00021 (v02 ACPIAM)
ACPI: XSDT 3ffb0100 0003C (v01 A M I  OEMXSDT  03000615 MSFT 00000097)
ACPI: FACP 3ffb0290 000F4 (v03 A M I  OEMFACP  03000615 MSFT 00000097)
ACPI: DSDT 3ffb03f0 0391B (v01  A0277 A0277001 00000001 MSFT 0100000D)
ACPI: FACS 3ffc0000 00040
ACPI: APIC 3ffb0390 00052 (v01 A M I  OEMAPIC  03000615 MSFT 00000097)
ACPI: OEMB 3ffc0040 0003F (v01 A M I  OEMBIOS  03000615 MSFT 00000097)
ACPI: Local APIC address 0xfee00000
135MB HIGHMEM available.
887MB LOWMEM available.
  mapped low ram: 0 - 377fe000
  low ram: 0 - 377fe000
Zone PFN ranges:
  DMA      0x00000010 -> 0x00001000
  Normal   0x00001000 -> 0x000377fe
  HighMem  0x000377fe -> 0x0003ffb0
Movable zone start PFN for each node
early_node_map[2] active PFN ranges
    0: 0x00000010 -> 0x0000009f
    0: 0x00000100 -> 0x0003ffb0
On node 0 totalpages: 261951
free_area_init_node: node 0, pgdat c0780480, node_mem_map c1001200
  DMA zone: 32 pages used for memmap
  DMA zone: 0 pages reserved
  DMA zone: 3951 pages, LIFO batch:0
  Normal zone: 1744 pages used for memmap
  Normal zone: 221486 pages, LIFO batch:31
  HighMem zone: 272 pages used for memmap
  HighMem zone: 34466 pages, LIFO batch:7
Using APIC driver default
Detected use of extended apic ids on hypertransport bus
ACPI: PM-Timer IO Port: 0x808
ACPI: Local APIC address 0xfee00000
ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)
ACPI: LAPIC (acpi_id[0x02] lapic_id[0x01] enabled)
ACPI: IOAPIC (id[0x02] address[0xfec00000] gsi_base[0])
IOAPIC[0]: apic_id 2, version 3, address 0xfec00000, GSI 0-23
ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
ACPI: IRQ0 used by override.
ACPI: IRQ2 used by override.
ACPI: IRQ9 used by override.
Using ACPI (MADT) for SMP configuration information
SMP: Allowing 2 CPUs, 0 hotplug CPUs
nr_irqs_gsi: 24
early_res array is doubled to 64 at [16000 - 167ff]
Allocating PCI resources starting at 40000000 (gap: 40000000:bf780000)
setup_percpu: NR_CPUS:8 nr_cpumask_bits:8 nr_cpu_ids:2 nr_node_ids:1
PERCPU: Embedded 16 pages/cpu @c1c00000 s41108 r0 d24428 u2097152
pcpu-alloc: s41108 r0 d24428 u2097152 alloc=1*4194304
pcpu-alloc: [0] 0 1 
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 259903
Kernel command line: ro root=LABEL=/1 rhgb quiet
PID hash table entries: 4096 (order: 2, 16384 bytes)
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Enabling fast FPU save and restore... done.
Enabling unmasked SIMD FPU exception support... done.
Initializing CPU#0
Subtract (44 early reservations)
  #1 [0000001000 - 0000002000]   EX TRAMPOLINE
  #2 [0000400000 - 000086ca94]   TEXT DATA BSS
  #3 [000086d000 - 000087021c]             BRK
  #4 [00000ff790 - 0000100000]   BIOS reserved
  #5 [00000ff780 - 00000ff790]    MP-table mpf
  #6 [000009fc00 - 00000e0250]   BIOS reserved
  #7 [00000e03bc - 00000ff780]   BIOS reserved
  #8 [00000e0250 - 00000e03bc]    MP-table mpc
  #9 [0000010000 - 0000011000]      TRAMPOLINE
  #10 [0000011000 - 0000015000]     ACPI WAKEUP
  #11 [0000015000 - 0000016000]         PGTABLE
  #12 [0000100000 - 00003bc945]     NEW RAMDISK
  #13 [0001000000 - 0001001000]         BOOTMEM
  #14 [0001001000 - 0001801000]         BOOTMEM
  #15 [0001801000 - 0001801004]         BOOTMEM
  #16 [0001801040 - 0001801100]         BOOTMEM
  #17 [0001801100 - 0001801154]         BOOTMEM
  #18 [0001801180 - 0001804180]         BOOTMEM
  #19 [0001804180 - 0001804190]         BOOTMEM
  #20 [00018041c0 - 0001804dc0]         BOOTMEM
  #21 [0001804dc0 - 0001804de7]         BOOTMEM
  #22 [0001804e00 - 0001804efc]         BOOTMEM
  #23 [0001804f00 - 0001804f40]         BOOTMEM
  #24 [0001804f40 - 0001804f80]         BOOTMEM
  #25 [0001804f80 - 0001804fc0]         BOOTMEM
  #26 [0001804fc0 - 0001805000]         BOOTMEM
  #27 [0001805000 - 0001805040]         BOOTMEM
  #28 [0001805040 - 0001805080]         BOOTMEM
  #29 [0001805080 - 00018050c0]         BOOTMEM
  #30 [00018050c0 - 0001805100]         BOOTMEM
  #31 [0001805100 - 000180511c]         BOOTMEM
  #32 [0001805140 - 000180515c]         BOOTMEM
  #33 [0001c00000 - 0001c10000]         BOOTMEM
  #34 [0001e00000 - 0001e10000]         BOOTMEM
  #35 [0001807180 - 0001807184]         BOOTMEM
  #36 [00018071c0 - 00018071c4]         BOOTMEM
  #37 [0001807200 - 0001807208]         BOOTMEM
  #38 [0001807240 - 0001807248]         BOOTMEM
  #39 [0001807280 - 0001807328]         BOOTMEM
  #40 [0001807340 - 00018073a8]         BOOTMEM
  #41 [00018073c0 - 000180b3c0]         BOOTMEM
  #42 [000180b3c0 - 000188b3c0]         BOOTMEM
  #43 [000188b3c0 - 00018cb3c0]         BOOTMEM
 16 20 - 80 9f
 3bd 3c0 - 400 400
 871 880 - 1000 1000
 1806 - 1807
 18cc 18e0 - 1c00 1c00
 1c10 1c20 - 1e00 1e00
 1e10 1e20 - 377e0 377fe
Initializing HighMem for node 0 (000377fe:0003ffb0)
Memory: 1031296k/1048256k available (2180k kernel code, 16508k reserved, 1439k data, 356k init, 138952k highmem)
virtual kernel memory layout:
    fixmap  : 0xffe7f000 - 0xfffff000   (1536 kB)
    pkmap   : 0xff800000 - 0xffc00000   (4096 kB)
    vmalloc : 0xf7ffe000 - 0xff7fe000   ( 120 MB)
    lowmem  : 0xc0000000 - 0xf77fe000   ( 887 MB)
      .init : 0xc0789000 - 0xc07e2000   ( 356 kB)
      .data : 0xc062100c - 0xc0788d64   (1439 kB)
      .text : 0xc0400000 - 0xc062100c   (2180 kB)
Checking if this processor honours the WP bit even in supervisor mode...Ok.
Hierarchical RCU implementation.
NR_IRQS:512
CPU 0 irqstacks, hard=c1c00000 soft=c1c01000
Extended CMOS year: 2000
Console: colour VGA+ 80x25
console [tty0] enabled
Fast TSC calibration using PIT
Detected 2202.451 MHz processor.
Calibrating delay loop (skipped), value calculated using timer frequency.. 4404.90 BogoMIPS (lpj=2202451)
Mount-cache hash table entries: 512
CPU: Physical Processor ID: 0
CPU: Processor Core ID: 0
mce: CPU supports 5 MCE banks
Performance Events: AMD PMU driver.
... version:                0
... bit width:              48
... generic registers:      4
... value mask:             0000ffffffffffff
... max period:             00007fffffffffff
... fixed-purpose events:   0
... event mask:             000000000000000f
Checking 'hlt' instruction... OK.
ACPI: Core revision 20100121
Enabling APIC mode:  Flat.  Using 1 I/O APICs
..TIMER: vector=0x30 apic1=0 pin1=2 apic2=0 pin2=0
CPU0: AMD Athlon(tm) 64 X2 Dual Core Processor 4200+ stepping 02
CPU 1 irqstacks, hard=c1e00000 soft=c1e01000
Booting Node   0, Processors  #1 Ok.
Initializing CPU#1
Brought up 2 CPUs
Total of 2 processors activated (8809.89 BogoMIPS).
khelper used greatest stack depth: 3504 bytes left
NET: Registered protocol family 16
khelper used greatest stack depth: 3444 bytes left
node 0 link 0: io port [1000, ffffff]
TOM: 0000000040000000 aka 1024M
node 0 link 0: mmio [a0000, bffff]
node 0 link 0: mmio [40000000, ffffffff]
bus: [00, ff] on node 0 link 0
bus: 00 index 0 [io  0x0000-0xffff]
bus: 00 index 1 [mem 0x000a0000-0x000bffff]
bus: 00 index 2 [mem 0x40000000-0xffffffff]
ACPI: bus type pci registered
PCI: PCI BIOS revision 2.10 entry at 0xf0031, last bus=3
PCI: Using configuration type 1 for base access
khelper used greatest stack depth: 3256 bytes left
bio: create slab <bio-0> at 0
ACPI: EC: Look up EC in DSDT
ACPI: Executed 1 blocks of module-level executable AML code
ACPI: Interpreter enabled
ACPI: (supports S0 S1 S3 S5)
ACPI: Using IOAPIC for interrupt routing
ACPI Warning: Incorrect checksum in table [OEMB] - F4, should be E7 (20100121/tbutils-314)
ACPI: No dock devices found.
PCI: Ignoring host bridge windows from ACPI; if necessary, use "pci=use_crs" and report a bug
ACPI: PCI Root Bridge [PCI0] (0000:00)
pci_root PNP0A03:00: host bridge window [io  0x0000-0x0cf7] (ignored)
pci_root PNP0A03:00: host bridge window [io  0x0d00-0xffff] (ignored)
pci_root PNP0A03:00: host bridge window [mem 0x000a0000-0x000bffff] (ignored)
pci_root PNP0A03:00: host bridge window [mem 0x40000000-0xffffffff] (ignored)
pci 0000:00:00.0: reg 10: [mem 0xdc000000-0xdfffffff pref]
pci 0000:00:01.0: supports D1
pci 0000:00:09.0: reg 10: [io  0xa800-0xa803]
pci 0000:00:0a.0: reg 10: [mem 0xf9c00000-0xf9c03fff]
pci 0000:00:0a.0: reg 14: [io  0xb000-0xb0ff]
pci 0000:00:0a.0: reg 30: [mem 0xf9b00000-0xf9b1ffff pref]
pci 0000:00:0a.0: supports D1 D2
pci 0000:00:0a.0: PME# supported from D0 D1 D2 D3hot D3cold
pci 0000:00:0a.0: PME# disabled
pci 0000:00:0c.0: reg 10: [mem 0x00000000-0x00000fff]
pci 0000:00:0c.0: supports D1 D2
pci 0000:00:0c.0: PME# supported from D0 D1 D2 D3hot
pci 0000:00:0c.0: PME# disabled
pci 0000:00:0c.1: reg 10: [mem 0x00000000-0x00000fff]
pci 0000:00:0c.1: supports D1 D2
pci 0000:00:0c.1: PME# supported from D0 D1 D2 D3hot
pci 0000:00:0c.1: PME# disabled
pci 0000:00:0f.0: reg 10: [io  0xd000-0xd007]
pci 0000:00:0f.0: reg 14: [io  0xc800-0xc803]
pci 0000:00:0f.0: reg 18: [io  0xc400-0xc407]
pci 0000:00:0f.0: reg 1c: [io  0xc000-0xc003]
pci 0000:00:0f.0: reg 20: [io  0xb800-0xb80f]
pci 0000:00:0f.0: reg 24: [io  0xb400-0xb4ff]
pci 0000:00:0f.1: reg 20: [io  0xfc00-0xfc0f]
pci 0000:00:10.0: reg 20: [io  0xd400-0xd41f]
pci 0000:00:10.0: supports D1 D2
pci 0000:00:10.0: PME# supported from D0 D1 D2 D3hot D3cold
pci 0000:00:10.0: PME# disabled
pci 0000:00:10.1: reg 20: [io  0xd800-0xd81f]
pci 0000:00:10.1: supports D1 D2
pci 0000:00:10.1: PME# supported from D0 D1 D2 D3hot D3cold
pci 0000:00:10.1: PME# disabled
pci 0000:00:10.2: reg 20: [io  0xe000-0xe01f]
pci 0000:00:10.2: supports D1 D2
pci 0000:00:10.2: PME# supported from D0 D1 D2 D3hot D3cold
pci 0000:00:10.2: PME# disabled
pci 0000:00:10.3: reg 20: [io  0xe400-0xe41f]
pci 0000:00:10.3: supports D1 D2
pci 0000:00:10.3: PME# supported from D0 D1 D2 D3hot D3cold
pci 0000:00:10.3: PME# disabled
pci 0000:00:10.4: reg 10: [mem 0xf9e00000-0xf9e000ff]
pci 0000:00:10.4: supports D1 D2
pci 0000:00:10.4: PME# supported from D0 D1 D2 D3hot D3cold
pci 0000:00:10.4: PME# disabled
HPET not enabled in BIOS. You might try hpet=force boot option
pci 0000:00:11.0: Enabled onboard AC97/MC97 devices
pci 0000:00:11.5: reg 10: [io  0xe800-0xe8ff]
pci 0000:00:11.5: supports D1 D2
pci 0000:00:11.6: reg 10: [io  0x0000-0x00ff]
PCI: peer root bus 00 res updated from pci conf
pci 0000:03:00.0: reg 10: [mem 0xfb000000-0xfbffffff]
pci 0000:03:00.0: reg 14: [mem 0xe0000000-0xefffffff pref]
pci 0000:03:00.0: reg 18: [mem 0xfa000000-0xfaffffff]
pci 0000:03:00.0: reg 30: [mem 0xf9f00000-0xf9f1ffff pref]
pci 0000:00:01.0: PCI bridge to [bus 03-03]
pci 0000:00:01.0:   bridge window [io  f000 - 0000] reg reading
pci 0000:00:01.0:   bridge window [mem 0xf9f00000-0xfbffffff]
pci 0000:00:01.0:   bridge window [mem 0xe0000000-0xf8ffffff pref]
pci_bus 0000:00: on NUMA node 0
ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT]
ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 7 10 *11 14 15)
ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 7 *10 11 14 15)
ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 *5 7 10 11 14 15)
ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 7 10 11 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LNKE] (IRQs 3 4 5 7 10 11 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LNKF] (IRQs 3 4 5 7 10 11 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LNKG] (IRQs 3 4 5 7 10 11 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LNKH] (IRQs 3 4 5 7 10 11 14 15) *0, disabled.
vgaarb: device added: PCI:0000:03:00.0,decodes=io+mem,owns=io+mem,locks=none
vgaarb: loaded
PCI: Using ACPI for IRQ routing
PCI: pci_cache_line_size set to 64 bytes
reserve RAM buffer: 000000000009fc00 - 000000000009ffff 
reserve RAM buffer: 000000003ffb0000 - 000000003fffffff 
Switching to clocksource jiffies
pnp: PnP ACPI init
ACPI: bus type pnp registered
pnp 00:0a: disabling [io  0x0010-0x001f] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x0022-0x003f] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x0044-0x005f] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x0062-0x0063] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x0065-0x006f] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x0072-0x007f] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x0080] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x0084-0x0086] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x0088] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x008c-0x008e] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x0090-0x009f] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x00a2-0x00bf] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x00e0-0x00ef] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp: PnP ACPI: found 14 devices
ACPI: ACPI bus type pnp unregistered
system 00:09: [io  0x0680-0x06ff] has been reserved
system 00:09: [io  0x0290-0x0297] has been reserved
system 00:0a: [io  0x03e1-0x03e7] has been reserved
system 00:0a: [io  0x04d0-0x04d1] has been reserved
system 00:0a: [io  0x0800-0x087f] has been reserved
system 00:0a: [io  0x0400-0x041f] has been reserved
system 00:0b: [mem 0xfec00000-0xfec00fff] could not be reserved
system 00:0b: [mem 0xfee00000-0xfee00fff] has been reserved
system 00:0b: [mem 0xfff80000-0xffffffff] has been reserved
system 00:0d: [mem 0x00000000-0x0009ffff] could not be reserved
system 00:0d: [mem 0x000c0000-0x000dffff] could not be reserved
system 00:0d: [mem 0x000e0000-0x000fffff] could not be reserved
system 00:0d: [mem 0x00100000-0x3ffeffff] could not be reserved
Switching to clocksource acpi_pm
PCI: max bus depth: 1 pci_try_num: 2
pci 0000:00:0c.0: BAR 9: assigned [mem 0x40000000-0x43ffffff pref]
pci 0000:00:0c.0: BAR 10: assigned [mem 0x44000000-0x47ffffff]
pci 0000:00:0c.1: BAR 9: assigned [mem 0x48000000-0x4bffffff pref]
pci 0000:00:0c.1: BAR 10: assigned [mem 0x4c000000-0x4fffffff]
pci 0000:00:0c.0: BAR 0: assigned [mem 0x50000000-0x50000fff]
pci 0000:00:0c.0: BAR 0: set to [mem 0x50000000-0x50000fff] (PCI address [0x50000000-0x50000fff]
pci 0000:00:0c.1: BAR 0: assigned [mem 0x50001000-0x50001fff]
pci 0000:00:0c.1: BAR 0: set to [mem 0x50001000-0x50001fff] (PCI address [0x50001000-0x50001fff]
pci 0000:00:0c.0: BAR 7: assigned [io  0x1000-0x10ff]
pci 0000:00:0c.0: BAR 8: assigned [io  0x1400-0x14ff]
pci 0000:00:0c.1: BAR 7: assigned [io  0x1800-0x18ff]
pci 0000:00:0c.1: BAR 8: assigned [io  0x1c00-0x1cff]
pci 0000:00:11.6: BAR 0: assigned [io  0x2000-0x20ff]
pci 0000:00:11.6: BAR 0: set to [io  0x2000-0x20ff] (PCI address [0x2000-0x20ff]
pci 0000:00:01.0: PCI bridge to [bus 03-03]
pci 0000:00:01.0:   bridge window [io  disabled]
pci 0000:00:01.0:   bridge window [mem 0xf9f00000-0xfbffffff]
pci 0000:00:01.0:   bridge window [mem 0xe0000000-0xf8ffffff pref]
pci 0000:00:0c.0: CardBus bridge to [bus 04-07]
pci 0000:00:0c.0:   bridge window [io  0x1000-0x10ff]
pci 0000:00:0c.0:   bridge window [io  0x1400-0x14ff]
pci 0000:00:0c.0:   bridge window [mem 0x40000000-0x43ffffff pref]
pci 0000:00:0c.0:   bridge window [mem 0x44000000-0x47ffffff]
pci 0000:00:0c.1: CardBus bridge to [bus 08-0b]
pci 0000:00:0c.1:   bridge window [io  0x1800-0x18ff]
pci 0000:00:0c.1:   bridge window [io  0x1c00-0x1cff]
pci 0000:00:0c.1:   bridge window [mem 0x48000000-0x4bffffff pref]
pci 0000:00:0c.1:   bridge window [mem 0x4c000000-0x4fffffff]
pci 0000:00:01.0: setting latency timer to 64
pci 0000:00:0c.0: enabling device (0140 -> 0143)
pci 0000:00:0c.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
pci 0000:00:0c.1: enabling device (0140 -> 0143)
pci 0000:00:0c.1: PCI INT B -> GSI 18 (level, low) -> IRQ 18
pci_bus 0000:00: resource 4 [io  0x0000-0xffff]
pci_bus 0000:00: resource 5 [mem 0x000a0000-0x000bffff]
pci_bus 0000:00: resource 6 [mem 0x40000000-0xffffffff]
pci_bus 0000:03: resource 1 [mem 0xf9f00000-0xfbffffff]
pci_bus 0000:03: resource 2 [mem 0xe0000000-0xf8ffffff pref]
pci_bus 0000:04: resource 0 [io  0x1000-0x10ff]
pci_bus 0000:04: resource 1 [io  0x1400-0x14ff]
pci_bus 0000:04: resource 2 [mem 0x40000000-0x43ffffff pref]
pci_bus 0000:04: resource 3 [mem 0x44000000-0x47ffffff]
pci_bus 0000:08: resource 0 [io  0x1800-0x18ff]
pci_bus 0000:08: resource 1 [io  0x1c00-0x1cff]
pci_bus 0000:08: resource 2 [mem 0x48000000-0x4bffffff pref]
pci_bus 0000:08: resource 3 [mem 0x4c000000-0x4fffffff]
NET: Registered protocol family 2
IP route cache hash table entries: 32768 (order: 5, 131072 bytes)
TCP established hash table entries: 131072 (order: 8, 1048576 bytes)
TCP bind hash table entries: 65536 (order: 7, 524288 bytes)
TCP: Hash tables configured (established 131072 bind 65536)
TCP reno registered
UDP hash table entries: 512 (order: 2, 16384 bytes)
UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
NET: Registered protocol family 1
pci 0000:00:01.0: disabling DAC on VIA PCI bridge
pci 0000:00:10.4: EHCI: BIOS handoff failed (BIOS bug?) 01010001
pci 0000:03:00.0: Boot video device
PCI: CLS 64 bytes, default 64
Trying to unpack rootfs image as initramfs...
Freeing initrd memory: 2802k freed
audit: initializing netlink socket (disabled)
type=2000 audit(1268517310.342:1): initialized
highmem bounce pool size: 64 pages
HugeTLB registered 4 MB page size, pre-allocated 0 pages
msgmni has been set to 1748
cryptomgr_test used greatest stack depth: 2972 bytes left
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
isapnp: Scanning for PnP cards...
isapnp: No Plug & Play device found
Non-volatile memory driver v1.3
Linux agpgart interface v0.103
Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
00:0c: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
brd: module loaded
loop: module loaded
PNP: PS/2 Controller [PNP0303:PS2K,PNP0f03:PS2M] at 0x60,0x64 irq 1,12
serio: i8042 KBD port at 0x60,0x64 irq 1
serio: i8042 AUX port at 0x60,0x64 irq 12
mice: PS/2 mouse device common for all mice
input: PC Speaker as /class/input/input0
cpuidle: using governor ladder
cpuidle: using governor menu
TCP cubic registered
Initializing XFRM netlink socket
NET: Registered protocol family 10
NET: Registered protocol family 17
Using IPI No-Shortcut mode
registered taskstats version 1
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
Freeing unused kernel memory: 356k freed
Write protecting the kernel text: 2184k
Write protecting the kernel read-only data: 1180k
input: AT Translated Set 2 keyboard as /class/input/input1
SCSI subsystem initialized
insmod used greatest stack depth: 2944 bytes left
libata version 3.00 loaded.
pata_via 0000:00:0f.1: version 0.3.4
pata_via 0000:00:0f.1: PCI INT A -> GSI 20 (level, low) -> IRQ 20
scsi0 : pata_via
scsi1 : pata_via
ata1: PATA max UDMA/133 cmd 0x1f0 ctl 0x3f6 bmdma 0xfc00 irq 14
ata2: PATA max UDMA/133 cmd 0x170 ctl 0x376 bmdma 0xfc08 irq 15
ata1.00: ATA-7: ST3120814A, 3.AAD, max UDMA/100
ata1.00: 234441648 sectors, multi 16: LBA48 
ata1.01: ATAPI: _NEC DVD_RW ND-3550A, 1.20, max UDMA/33
ata1.00: configured for UDMA/100
ata1.01: configured for UDMA/33
scsi 0:0:0:0: Direct-Access     ATA      ST3120814A       3.AA PQ: 0 ANSI: 5
sd 0:0:0:0: [sda] 234441648 512-byte logical blocks: (120 GB/111 GiB)
scsi 0:0:1:0: CD-ROM            _NEC     DVD_RW ND-3550A  1.20 PQ: 0 ANSI: 5
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
 sda:
input: ImPS/2 Generic Wheel Mouse as /class/input/input2
 sda1 sda2 sda3
sd 0:0:0:0: [sda] Attached SCSI disk
insmod used greatest stack depth: 2692 bytes left
sata_via 0000:00:0f.0: version 2.6
sata_via 0000:00:0f.0: PCI INT B -> GSI 20 (level, low) -> IRQ 20
sata_via 0000:00:0f.0: routed to hard irq line 10
scsi2 : sata_via
scsi3 : sata_via
ata3: SATA max UDMA/133 cmd 0xd000 ctl 0xc800 bmdma 0xb800 irq 20
ata4: SATA max UDMA/133 cmd 0xc400 ctl 0xc000 bmdma 0xb808 irq 20
ata3: SATA link down 1.5 Gbps (SStatus 0 SControl 300)
ata4: SATA link down 1.5 Gbps (SStatus 0 SControl 300)
kjournald starting.  Commit interval 5 seconds
EXT3-fs (sda2): mounted filesystem with writeback data mode
modprobe used greatest stack depth: 2224 bytes left
sd 0:0:0:0: Attached scsi generic sg0 type 0
scsi 0:0:1:0: Attached scsi generic sg1 type 5
Floppy drive(s): fd0 is 1.44M
FDC 0 is a post-1991 82077
yenta_cardbus 0000:00:0c.0: CardBus bridge found [1195:02a2]
yenta_cardbus 0000:00:0c.0: Enabling burst memory read transactions
yenta_cardbus 0000:00:0c.0: Using CSCINT to route CSC interrupts to PCI
yenta_cardbus 0000:00:0c.0: Routing CardBus interrupts to PCI
yenta_cardbus 0000:00:0c.0: TI: mfunc 0x0cb91522, devctl 0x66
input: Power Button as /class/input/input3
ACPI: Power Button [PWRB]
input: Sleep Button as /class/input/input4
ACPI: Sleep Button [SLPB]
input: Power Button as /class/input/input5
ACPI: Power Button [PWRF]
yenta_cardbus 0000:00:0c.0: ISA IRQ mask 0x0000, PCI irq 17
yenta_cardbus 0000:00:0c.0: Socket status: 30000006
pd6729 0000:00:09.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
pd6729 0000:00:09.0: Cirrus PD6729 PCI to PCMCIA Bridge at 0xa800 on irq 16
pd6729: PCI card interrupts, PCI status changes
yenta_cardbus 0000:00:0c.1: CardBus bridge found [1195:02a2]
yenta_cardbus 0000:00:0c.1: Using CSCINT to route CSC interrupts to PCI
yenta_cardbus 0000:00:0c.1: Routing CardBus interrupts to PCI
yenta_cardbus 0000:00:0c.1: TI: mfunc 0x0cb91522, devctl 0x66
pcmcia_socket pcmcia_socket1: cs: IO port probe 0x100-0x3af:
pcmcia_socket pcmcia_socket2: cs: IO port probe 0x100-0x3af: clean.
 clean.
pcmcia_socket pcmcia_socket1: cs: IO port probe 0x3e0-0x4ff: clean.
pcmcia_socket pcmcia_socket2: cs: IO port probe 0x3e0-0x4ff: clean.
pcmcia_socket pcmcia_socket1: cs: IO port probe 0x820-0x8ff: clean.
pcmcia_socket pcmcia_socket2: cs: IO port probe 0x820-0x8ff: clean.
pcmcia_socket pcmcia_socket1: cs: IO port probe 0xc00-0xcf7: clean.
pcmcia_socket pcmcia_socket2: cs: IO port probe 0xc00-0xcf7: clean.
pcmcia_socket pcmcia_socket1: cs: memory probe 0x0c0000-0x0fffff: excluding 0xc0000-0xc7fff 0xe4000-0xfffff
pcmcia_socket pcmcia_socket2: cs: memory probe 0x0c0000-0x0fffff: excluding 0xc0000-0xc7fff 0xe4000-0xfffff
pcmcia_socket pcmcia_socket1: cs: memory probe 0xa0000000-0xa0ffffff: excluding 0xa0000000-0xa0ffffff
pcmcia_socket pcmcia_socket2: cs: memory probe 0xa0000000-0xa0ffffff: excluding 0xa0000000-0xa0ffffff
pcmcia_socket pcmcia_socket1: cs: memory probe 0x60000000-0x60ffffff: excluding 0x60000000-0x60ffffff
pcmcia_socket pcmcia_socket2: cs: memory probe 0x60000000-0x60ffffff: excluding 0x60000000-0x60ffffff
pcmcia_socket pcmcia_socket1: cs: IO port probe 0xa00-0xaff:
pcmcia_socket pcmcia_socket2: cs: IO port probe 0xa00-0xaff: clean.
 clean.
yenta_cardbus 0000:00:0c.1: ISA IRQ mask 0x0000, PCI irq 18
yenta_cardbus 0000:00:0c.1: Socket status: 30000006
pcmcia_socket pcmcia_socket0: cs: IO port probe 0x100-0x3af: clean.
pcmcia_socket pcmcia_socket0: cs: IO port probe 0x3e0-0x4ff: clean.
pcmcia_socket pcmcia_socket0: cs: IO port probe 0x820-0x8ff: clean.
pcmcia_socket pcmcia_socket0: cs: IO port probe 0xc00-0xcf7: clean.
pcmcia_socket pcmcia_socket0: cs: memory probe 0x0c0000-0x0fffff: excluding 0xc0000-0xfffff
pcmcia_socket pcmcia_socket0: cs: memory probe 0xa0000000-0xa0ffffff: clean.
pcmcia_socket pcmcia_socket0: cs: memory probe 0x60000000-0x60ffffff: clean.
pcmcia_socket pcmcia_socket0: cs: IO port probe 0xa00-0xaff: clean.
pcmcia_socket pcmcia_socket3: cs: IO port probe 0x100-0x3af: clean.
pcmcia_socket pcmcia_socket3: cs: IO port probe 0x3e0-0x4ff: clean.
pcmcia_socket pcmcia_socket3: cs: IO port probe 0x820-0x8ff: clean.
pcmcia_socket pcmcia_socket3: cs: IO port probe 0xc00-0xcf7: clean.
pcmcia_socket pcmcia_socket3: cs: memory probe 0x0c0000-0x0fffff: excluding 0xc0000-0xfffff
pcmcia_socket pcmcia_socket3: cs: memory probe 0xa0000000-0xa0ffffff: clean.
pcmcia_socket pcmcia_socket3: cs: memory probe 0x60000000-0x60ffffff: clean.
pcmcia_socket pcmcia_socket3: cs: IO port probe 0xa00-0xaff: clean.
sr0: scsi3-mmc drive: 48x/48x writer cd/rw xa/form2 cdda tray
Uniform CD-ROM driver Revision: 3.20
sr 0:0:1:0: Attached scsi CD-ROM sr0
pcmcia_socket pcmcia_socket2: pccard: PCMCIA card inserted into slot 2
pcmcia_socket pcmcia_socket2: cs: warning: no high memory space available!
pcmcia_socket pcmcia_socket2: cs: warning: no high memory space available!
EXT3-fs (sda2): using internal journal
Adding 4578520k swap on /dev/sda3.  Priority:-1 extents:1 across:4578520k 
rc.sysinit used greatest stack depth: 2036 bytes left

[2.6.33]
Linux version 2.6.33 (root at localhost.localdomain) (gcc version 4.1.2 20070502 (Red Hat 4.1.2-12)) #1 SMP Sat Mar 6 09:37:59 JST 2010
BIOS-provided physical RAM map:
 BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
 BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
 BIOS-e820: 00000000000e4000 - 0000000000100000 (reserved)
 BIOS-e820: 0000000000100000 - 000000003ffb0000 (usable)
 BIOS-e820: 000000003ffb0000 - 000000003ffc0000 (ACPI data)
 BIOS-e820: 000000003ffc0000 - 000000003fff0000 (ACPI NVS)
 BIOS-e820: 000000003fff0000 - 0000000040000000 (reserved)
 BIOS-e820: 00000000ff780000 - 0000000100000000 (reserved)
Notice: NX (Execute Disable) protection cannot be enabled: non-PAE kernel!
DMI 2.3 present.
AMI BIOS detected: BIOS may corrupt low RAM, working around it.
e820 update range: 0000000000000000 - 0000000000010000 (usable) ==> (reserved)
e820 update range: 0000000000000000 - 0000000000001000 (usable) ==> (reserved)
e820 remove range: 00000000000a0000 - 0000000000100000 (usable)
last_pfn = 0x3ffb0 max_arch_pfn = 0x100000
MTRR default type: uncachable
MTRR fixed ranges enabled:
  00000-9FFFF write-back
  A0000-EFFFF uncachable
  F0000-FFFFF write-protect
MTRR variable ranges enabled:
  0 base 0000000000 mask FFC0000000 write-back
  1 base 00DC000000 mask FFFC000000 write-combining
  2 disabled
  3 disabled
  4 disabled
  5 disabled
  6 disabled
  7 disabled
x86 PAT enabled: cpu 0, old 0x7040600070406, new 0x7010600070106
initial memory mapped : 0 - 00c00000
found SMP MP-table at [c00ff780] ff780
init_memory_mapping: 0000000000000000-00000000377fe000
 0000000000 - 0000400000 page 4k
 0000400000 - 0037400000 page 2M
 0037400000 - 00377fe000 page 4k
kernel direct mapping tables up to 377fe000 @ 15000-1a000
RAMDISK: 37d33000 - 37fef882
Allocated new RAMDISK: 00100000 - 003bc882
Move RAMDISK from 0000000037d33000 - 0000000037fef881 to 00100000 - 003bc881
ACPI: RSDP 000fa850 00021 (v02 ACPIAM)
ACPI: XSDT 3ffb0100 0003C (v01 A M I  OEMXSDT  03000615 MSFT 00000097)
ACPI: FACP 3ffb0290 000F4 (v03 A M I  OEMFACP  03000615 MSFT 00000097)
ACPI: DSDT 3ffb03f0 0391B (v01  A0277 A0277001 00000001 MSFT 0100000D)
ACPI: FACS 3ffc0000 00040
ACPI: APIC 3ffb0390 00052 (v01 A M I  OEMAPIC  03000615 MSFT 00000097)
ACPI: OEMB 3ffc0040 0003F (v01 A M I  OEMBIOS  03000615 MSFT 00000097)
ACPI: Local APIC address 0xfee00000
135MB HIGHMEM available.
887MB LOWMEM available.
  mapped low ram: 0 - 377fe000
  low ram: 0 - 377fe000
  node 0 low ram: 00000000 - 377fe000
  node 0 bootmap 00016000 - 0001cf00
(14 early reservations) ==> bootmem [0000000000 - 00377fe000]
  #0 [0000000000 - 0000001000]   BIOS data page ==> [0000000000 - 0000001000]
  #1 [0000001000 - 0000002000]    EX TRAMPOLINE ==> [0000001000 - 0000002000]
  #2 [0000400000 - 0000868334]    TEXT DATA BSS ==> [0000400000 - 0000868334]
  #3 [0000869000 - 000086c21c]              BRK ==> [0000869000 - 000086c21c]
  #4 [00000ff790 - 0000100000]    BIOS reserved ==> [00000ff790 - 0000100000]
  #5 [00000ff780 - 00000ff790]     MP-table mpf ==> [00000ff780 - 00000ff790]
  #6 [000009fc00 - 00000e0250]    BIOS reserved ==> [000009fc00 - 00000e0250]
  #7 [00000e03bc - 00000ff780]    BIOS reserved ==> [00000e03bc - 00000ff780]
  #8 [00000e0250 - 00000e03bc]     MP-table mpc ==> [00000e0250 - 00000e03bc]
  #9 [0000010000 - 0000011000]       TRAMPOLINE ==> [0000010000 - 0000011000]
  #10 [0000011000 - 0000015000]      ACPI WAKEUP ==> [0000011000 - 0000015000]
  #11 [0000015000 - 0000016000]          PGTABLE ==> [0000015000 - 0000016000]
  #12 [0000100000 - 00003bc882]      NEW RAMDISK ==> [0000100000 - 00003bc882]
  #13 [0000016000 - 000001d000]          BOOTMAP ==> [0000016000 - 000001d000]
Zone PFN ranges:
  DMA      0x00000010 -> 0x00001000
  Normal   0x00001000 -> 0x000377fe
  HighMem  0x000377fe -> 0x0003ffb0
Movable zone start PFN for each node
early_node_map[2] active PFN ranges
    0: 0x00000010 -> 0x0000009f
    0: 0x00000100 -> 0x0003ffb0
On node 0 totalpages: 261951
free_area_init_node: node 0, pgdat c077f4c0, node_mem_map c1001200
  DMA zone: 32 pages used for memmap
  DMA zone: 0 pages reserved
  DMA zone: 3951 pages, LIFO batch:0
  Normal zone: 1744 pages used for memmap
  Normal zone: 221486 pages, LIFO batch:31
  HighMem zone: 272 pages used for memmap
  HighMem zone: 34466 pages, LIFO batch:7
Using APIC driver default
Detected use of extended apic ids on hypertransport bus
ACPI: PM-Timer IO Port: 0x808
ACPI: Local APIC address 0xfee00000
ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)
ACPI: LAPIC (acpi_id[0x02] lapic_id[0x01] enabled)
ACPI: IOAPIC (id[0x02] address[0xfec00000] gsi_base[0])
IOAPIC[0]: apic_id 2, version 3, address 0xfec00000, GSI 0-23
ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
ACPI: IRQ0 used by override.
ACPI: IRQ2 used by override.
ACPI: IRQ9 used by override.
Using ACPI (MADT) for SMP configuration information
SMP: Allowing 2 CPUs, 0 hotplug CPUs
nr_irqs_gsi: 24
Allocating PCI resources starting at 40000000 (gap: 40000000:bf780000)
setup_percpu: NR_CPUS:8 nr_cpumask_bits:8 nr_cpu_ids:2 nr_node_ids:1
PERCPU: Embedded 16 pages/cpu @c1c00000 s41108 r0 d24428 u2097152
pcpu-alloc: s41108 r0 d24428 u2097152 alloc=1*4194304
pcpu-alloc: [0] 0 1 
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 259903
Kernel command line: ro root=LABEL=/1 rhgb quiet
PID hash table entries: 4096 (order: 2, 16384 bytes)
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Enabling fast FPU save and restore... done.
Enabling unmasked SIMD FPU exception support... done.
Initializing CPU#0
Initializing HighMem for node 0 (000377fe:0003ffb0)
Memory: 1030824k/1048256k available (2168k kernel code, 16504k reserved, 1448k data, 352k init, 138952k highmem)
virtual kernel memory layout:
    fixmap  : 0xffe7f000 - 0xfffff000   (1536 kB)
    pkmap   : 0xff800000 - 0xffc00000   (4096 kB)
    vmalloc : 0xf7ffe000 - 0xff7fe000   ( 120 MB)
    lowmem  : 0xc0000000 - 0xf77fe000   ( 887 MB)
      .init : 0xc0789000 - 0xc07e1000   ( 352 kB)
      .data : 0xc061e384 - 0xc0788580   (1448 kB)
      .text : 0xc0400000 - 0xc061e384   (2168 kB)
Checking if this processor honours the WP bit even in supervisor mode...Ok.
Hierarchical RCU implementation.
NR_IRQS:512
CPU 0 irqstacks, hard=c1c00000 soft=c1c01000
Extended CMOS year: 2000
Console: colour VGA+ 80x25
console [tty0] enabled
Fast TSC calibration using PIT
Detected 2202.881 MHz processor.
Calibrating delay loop (skipped), value calculated using timer frequency.. 4405.76 BogoMIPS (lpj=2202881)
Mount-cache hash table entries: 512
CPU: Physical Processor ID: 0
CPU: Processor Core ID: 0
mce: CPU supports 5 MCE banks
Performance Events: AMD PMU driver.
... version:                0
... bit width:              48
... generic registers:      4
... value mask:             0000ffffffffffff
... max period:             00007fffffffffff
... fixed-purpose events:   0
... event mask:             000000000000000f
Checking 'hlt' instruction... OK.
ACPI: Core revision 20100121
Enabling APIC mode:  Flat.  Using 1 I/O APICs
..TIMER: vector=0x30 apic1=0 pin1=2 apic2=0 pin2=0
CPU0: AMD Athlon(tm) 64 X2 Dual Core Processor 4200+ stepping 02
CPU 1 irqstacks, hard=c1e00000 soft=c1e01000
Booting Node   0, Processors  #1 Ok.
Initializing CPU#1
Brought up 2 CPUs
Total of 2 processors activated (8810.75 BogoMIPS).
khelper used greatest stack depth: 3364 bytes left
NET: Registered protocol family 16
ACPI: bus type pci registered
PCI: PCI BIOS revision 2.10 entry at 0xf0031, last bus=3
PCI: Using configuration type 1 for base access
khelper used greatest stack depth: 3204 bytes left
bio: create slab <bio-0> at 0
ACPI: EC: Look up EC in DSDT
ACPI: Executed 1 blocks of module-level executable AML code
ACPI: Interpreter enabled
ACPI: (supports S0 S1 S3 S5)
ACPI: Using IOAPIC for interrupt routing
ACPI Warning: Incorrect checksum in table [OEMB] - F4, should be E7 (20100121/tbutils-314)
ACPI: No dock devices found.
PCI: Ignoring host bridge windows from ACPI; if necessary, use "pci=use_crs" and report a bug
ACPI: PCI Root Bridge [PCI0] (0000:00)
pci_root PNP0A03:00: host bridge window [io  0x0000-0x0cf7] (ignored)
pci_root PNP0A03:00: host bridge window [io  0x0d00-0xffff] (ignored)
pci_root PNP0A03:00: host bridge window [mem 0x000a0000-0x000bffff] (ignored)
pci_root PNP0A03:00: host bridge window [mem 0x40000000-0xffffffff] (ignored)
pci 0000:00:00.0: reg 10: [mem 0xdc000000-0xdfffffff pref]
pci 0000:00:01.0: supports D1
pci 0000:00:09.0: reg 10: [io  0xa800-0xa803]
pci 0000:00:0a.0: reg 10: [mem 0xf9c00000-0xf9c03fff]
pci 0000:00:0a.0: reg 14: [io  0xb000-0xb0ff]
pci 0000:00:0a.0: reg 30: [mem 0xf9b00000-0xf9b1ffff pref]
pci 0000:00:0a.0: supports D1 D2
pci 0000:00:0a.0: PME# supported from D0 D1 D2 D3hot D3cold
pci 0000:00:0a.0: PME# disabled
pci 0000:00:0c.0: reg 10: [mem 0x00000000-0x00000fff]
pci 0000:00:0c.0: supports D1 D2
pci 0000:00:0c.0: PME# supported from D0 D1 D2 D3hot
pci 0000:00:0c.0: PME# disabled
pci 0000:00:0c.1: reg 10: [mem 0x00000000-0x00000fff]
pci 0000:00:0c.1: supports D1 D2
pci 0000:00:0c.1: PME# supported from D0 D1 D2 D3hot
pci 0000:00:0c.1: PME# disabled
pci 0000:00:0f.0: reg 10: [io  0xd000-0xd007]
pci 0000:00:0f.0: reg 14: [io  0xc800-0xc803]
pci 0000:00:0f.0: reg 18: [io  0xc400-0xc407]
pci 0000:00:0f.0: reg 1c: [io  0xc000-0xc003]
pci 0000:00:0f.0: reg 20: [io  0xb800-0xb80f]
pci 0000:00:0f.0: reg 24: [io  0xb400-0xb4ff]
pci 0000:00:0f.1: reg 20: [io  0xfc00-0xfc0f]
pci 0000:00:10.0: reg 20: [io  0xd400-0xd41f]
pci 0000:00:10.0: supports D1 D2
pci 0000:00:10.0: PME# supported from D0 D1 D2 D3hot D3cold
pci 0000:00:10.0: PME# disabled
pci 0000:00:10.1: reg 20: [io  0xd800-0xd81f]
pci 0000:00:10.1: supports D1 D2
pci 0000:00:10.1: PME# supported from D0 D1 D2 D3hot D3cold
pci 0000:00:10.1: PME# disabled
pci 0000:00:10.2: reg 20: [io  0xe000-0xe01f]
pci 0000:00:10.2: supports D1 D2
pci 0000:00:10.2: PME# supported from D0 D1 D2 D3hot D3cold
pci 0000:00:10.2: PME# disabled
pci 0000:00:10.3: reg 20: [io  0xe400-0xe41f]
pci 0000:00:10.3: supports D1 D2
pci 0000:00:10.3: PME# supported from D0 D1 D2 D3hot D3cold
pci 0000:00:10.3: PME# disabled
pci 0000:00:10.4: reg 10: [mem 0xf9e00000-0xf9e000ff]
pci 0000:00:10.4: supports D1 D2
pci 0000:00:10.4: PME# supported from D0 D1 D2 D3hot D3cold
pci 0000:00:10.4: PME# disabled
HPET not enabled in BIOS. You might try hpet=force boot option
pci 0000:00:11.0: Enabled onboard AC97/MC97 devices
pci 0000:00:11.5: reg 10: [io  0xe800-0xe8ff]
pci 0000:00:11.5: supports D1 D2
pci 0000:00:11.6: reg 10: [io  0x0000-0x00ff]
pci 0000:03:00.0: reg 10: [mem 0xfb000000-0xfbffffff]
pci 0000:03:00.0: reg 14: [mem 0xe0000000-0xefffffff pref]
pci 0000:03:00.0: reg 18: [mem 0xfa000000-0xfaffffff]
pci 0000:03:00.0: reg 30: [mem 0xf9f00000-0xf9f1ffff pref]
pci 0000:00:01.0: PCI bridge to [bus 03-03]
pci 0000:00:01.0:   bridge window [io  f000 - 0000] reg reading
pci 0000:00:01.0:   bridge window [mem 0xf9f00000-0xfbffffff]
pci 0000:00:01.0:   bridge window [mem 0xe0000000-0xf8ffffff pref]
pci_bus 0000:00: on NUMA node 0
ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT]
ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 7 10 *11 14 15)
ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 7 *10 11 14 15)
ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 *5 7 10 11 14 15)
ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 7 10 11 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LNKE] (IRQs 3 4 5 7 10 11 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LNKF] (IRQs 3 4 5 7 10 11 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LNKG] (IRQs 3 4 5 7 10 11 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LNKH] (IRQs 3 4 5 7 10 11 14 15) *0, disabled.
vgaarb: device added: PCI:0000:03:00.0,decodes=io+mem,owns=io+mem,locks=none
vgaarb: loaded
PCI: Using ACPI for IRQ routing
PCI: pci_cache_line_size set to 64 bytes
Switching to clocksource jiffies
pnp: PnP ACPI init
ACPI: bus type pnp registered
pnp 00:0a: disabling [io  0x0010-0x001f] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x0022-0x003f] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x0044-0x005f] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x0062-0x0063] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x0065-0x006f] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x0072-0x007f] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x0080] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x0084-0x0086] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x0088] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x008c-0x008e] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x0090-0x009f] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x00a2-0x00bf] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x00e0-0x00ef] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp: PnP ACPI: found 14 devices
ACPI: ACPI bus type pnp unregistered
system 00:09: [io  0x0680-0x06ff] has been reserved
system 00:09: [io  0x0290-0x0297] has been reserved
system 00:0a: [io  0x03e1-0x03e7] has been reserved
system 00:0a: [io  0x04d0-0x04d1] has been reserved
system 00:0a: [io  0x0800-0x087f] has been reserved
system 00:0a: [io  0x0400-0x041f] has been reserved
system 00:0b: [mem 0xfec00000-0xfec00fff] could not be reserved
system 00:0b: [mem 0xfee00000-0xfee00fff] has been reserved
system 00:0b: [mem 0xfff80000-0xffffffff] has been reserved
system 00:0d: [mem 0x00000000-0x0009ffff] could not be reserved
system 00:0d: [mem 0x000c0000-0x000dffff] could not be reserved
system 00:0d: [mem 0x000e0000-0x000fffff] could not be reserved
system 00:0d: [mem 0x00100000-0x3ffeffff] could not be reserved
Switching to clocksource acpi_pm
PCI: max bus depth: 1 pci_try_num: 2
pci 0000:00:0c.0: BAR 9: assigned [mem 0x40000000-0x43ffffff pref]
pci 0000:00:0c.0: BAR 10: assigned [mem 0x44000000-0x47ffffff]
pci 0000:00:0c.1: BAR 9: assigned [mem 0x48000000-0x4bffffff pref]
pci 0000:00:0c.1: BAR 10: assigned [mem 0x4c000000-0x4fffffff]
pci 0000:00:0c.0: BAR 0: assigned [mem 0x50000000-0x50000fff]
pci 0000:00:0c.0: BAR 0: set to [mem 0x50000000-0x50000fff] (PCI address [0x50000000-0x50000fff]
pci 0000:00:0c.1: BAR 0: assigned [mem 0x50001000-0x50001fff]
pci 0000:00:0c.1: BAR 0: set to [mem 0x50001000-0x50001fff] (PCI address [0x50001000-0x50001fff]
pci 0000:00:0c.0: BAR 7: assigned [io  0x1000-0x10ff]
pci 0000:00:0c.0: BAR 8: assigned [io  0x1400-0x14ff]
pci 0000:00:0c.1: BAR 7: assigned [io  0x1800-0x18ff]
pci 0000:00:0c.1: BAR 8: assigned [io  0x1c00-0x1cff]
pci 0000:00:11.6: BAR 0: assigned [io  0x2000-0x20ff]
pci 0000:00:11.6: BAR 0: set to [io  0x2000-0x20ff] (PCI address [0x2000-0x20ff]
pci 0000:00:01.0: PCI bridge to [bus 03-03]
pci 0000:00:01.0:   bridge window [io  disabled]
pci 0000:00:01.0:   bridge window [mem 0xf9f00000-0xfbffffff]
pci 0000:00:01.0:   bridge window [mem 0xe0000000-0xf8ffffff pref]
pci 0000:00:0c.0: CardBus bridge to [bus 04-07]
pci 0000:00:0c.0:   bridge window [io  0x1000-0x10ff]
pci 0000:00:0c.0:   bridge window [io  0x1400-0x14ff]
pci 0000:00:0c.0:   bridge window [mem 0x40000000-0x43ffffff pref]
pci 0000:00:0c.0:   bridge window [mem 0x44000000-0x47ffffff]
pci 0000:00:0c.1: CardBus bridge to [bus 08-0b]
pci 0000:00:0c.1:   bridge window [io  0x1800-0x18ff]
pci 0000:00:0c.1:   bridge window [io  0x1c00-0x1cff]
pci 0000:00:0c.1:   bridge window [mem 0x48000000-0x4bffffff pref]
pci 0000:00:0c.1:   bridge window [mem 0x4c000000-0x4fffffff]
pci 0000:00:01.0: setting latency timer to 64
pci 0000:00:0c.0: enabling device (0140 -> 0143)
pci 0000:00:0c.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
pci 0000:00:0c.1: enabling device (0140 -> 0143)
pci 0000:00:0c.1: PCI INT B -> GSI 18 (level, low) -> IRQ 18
pci_bus 0000:00: resource 0 [io  0x0000-0xffff]
pci_bus 0000:00: resource 1 [mem 0x00000000-0xffffffff]
pci_bus 0000:03: resource 1 [mem 0xf9f00000-0xfbffffff]
pci_bus 0000:03: resource 2 [mem 0xe0000000-0xf8ffffff pref]
pci_bus 0000:04: resource 0 [io  0x1000-0x10ff]
pci_bus 0000:04: resource 1 [io  0x1400-0x14ff]
pci_bus 0000:04: resource 2 [mem 0x40000000-0x43ffffff pref]
pci_bus 0000:04: resource 3 [mem 0x44000000-0x47ffffff]
pci_bus 0000:08: resource 0 [io  0x1800-0x18ff]
pci_bus 0000:08: resource 1 [io  0x1c00-0x1cff]
pci_bus 0000:08: resource 2 [mem 0x48000000-0x4bffffff pref]
pci_bus 0000:08: resource 3 [mem 0x4c000000-0x4fffffff]
NET: Registered protocol family 2
IP route cache hash table entries: 32768 (order: 5, 131072 bytes)
TCP established hash table entries: 131072 (order: 8, 1048576 bytes)
TCP bind hash table entries: 65536 (order: 7, 524288 bytes)
TCP: Hash tables configured (established 131072 bind 65536)
TCP reno registered
UDP hash table entries: 512 (order: 2, 16384 bytes)
UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
NET: Registered protocol family 1
pci 0000:00:01.0: disabling DAC on VIA PCI bridge
pci 0000:00:10.4: EHCI: BIOS handoff failed (BIOS bug?) 01010001
pci 0000:03:00.0: Boot video device
PCI: CLS 64 bytes, default 64
Trying to unpack rootfs image as initramfs...
Freeing initrd memory: 2802k freed
audit: initializing netlink socket (disabled)
type=2000 audit(1268516858.343:1): initialized
highmem bounce pool size: 64 pages
HugeTLB registered 4 MB page size, pre-allocated 0 pages
msgmni has been set to 1748
cryptomgr_test used greatest stack depth: 2972 bytes left
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
isapnp: Scanning for PnP cards...
isapnp: No Plug & Play device found
Non-volatile memory driver v1.3
Linux agpgart interface v0.103
Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
00:0c: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
brd: module loaded
loop: module loaded
PNP: PS/2 Controller [PNP0303:PS2K,PNP0f03:PS2M] at 0x60,0x64 irq 1,12
serio: i8042 KBD port at 0x60,0x64 irq 1
serio: i8042 AUX port at 0x60,0x64 irq 12
mice: PS/2 mouse device common for all mice
input: PC Speaker as /class/input/input0
cpuidle: using governor ladder
cpuidle: using governor menu
TCP cubic registered
Initializing XFRM netlink socket
NET: Registered protocol family 10
NET: Registered protocol family 17
Using IPI No-Shortcut mode
registered taskstats version 1
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
Freeing unused kernel memory: 352k freed
Write protecting the kernel text: 2172k
Write protecting the kernel read-only data: 1180k
input: AT Translated Set 2 keyboard as /class/input/input1
SCSI subsystem initialized
libata version 3.00 loaded.
pata_via 0000:00:0f.1: version 0.3.4
pata_via 0000:00:0f.1: PCI INT A -> GSI 20 (level, low) -> IRQ 20
scsi0 : pata_via
scsi1 : pata_via
ata1: PATA max UDMA/133 cmd 0x1f0 ctl 0x3f6 bmdma 0xfc00 irq 14
ata2: PATA max UDMA/133 cmd 0x170 ctl 0x376 bmdma 0xfc08 irq 15
ata1.00: ATA-7: ST3120814A, 3.AAD, max UDMA/100
ata1.00: 234441648 sectors, multi 16: LBA48 
ata1.01: ATAPI: _NEC DVD_RW ND-3550A, 1.20, max UDMA/33
ata1.00: configured for UDMA/100
ata1.01: configured for UDMA/33
scsi 0:0:0:0: Direct-Access     ATA      ST3120814A       3.AA PQ: 0 ANSI: 5
sd 0:0:0:0: [sda] 234441648 512-byte logical blocks: (120 GB/111 GiB)
scsi 0:0:1:0: CD-ROM            _NEC     DVD_RW ND-3550A  1.20 PQ: 0 ANSI: 5
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
 sda:
input: ImPS/2 Generic Wheel Mouse as /class/input/input2
 sda1 sda2 sda3
sd 0:0:0:0: [sda] Attached SCSI disk
insmod used greatest stack depth: 2688 bytes left
sata_via 0000:00:0f.0: version 2.6
sata_via 0000:00:0f.0: PCI INT B -> GSI 20 (level, low) -> IRQ 20
sata_via 0000:00:0f.0: routed to hard irq line 10
scsi2 : sata_via
scsi3 : sata_via
ata3: SATA max UDMA/133 cmd 0xd000 ctl 0xc800 bmdma 0xb800 irq 20
ata4: SATA max UDMA/133 cmd 0xc400 ctl 0xc000 bmdma 0xb808 irq 20
ata3: SATA link down 1.5 Gbps (SStatus 0 SControl 300)
ata4: SATA link down 1.5 Gbps (SStatus 0 SControl 300)
kjournald starting.  Commit interval 5 seconds
EXT3-fs (sda2): mounted filesystem with writeback data mode
modprobe used greatest stack depth: 2224 bytes left
Floppy drive(s): fd0 is 1.44M
FDC 0 is a post-1991 82077
input: Power Button as /class/input/input3
ACPI: Power Button [PWRB]
input: Sleep Button as /class/input/input4
ACPI: Sleep Button [SLPB]
input: Power Button as /class/input/input5
ACPI: Power Button [PWRF]
pd6729 0000:00:09.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
pd6729 0000:00:09.0: Cirrus PD6729 PCI to PCMCIA Bridge at 0xa800 on irq 16
pd6729: PCI card interrupts, PCI status changes
sr0: scsi3-mmc drive: 48x/48x writer cd/rw xa/form2 cdda tray
Uniform CD-ROM driver Revision: 3.20
sr 0:0:1:0: Attached scsi CD-ROM sr0
yenta_cardbus 0000:00:0c.0: CardBus bridge found [1195:02a2]
yenta_cardbus 0000:00:0c.0: Enabling burst memory read transactions
yenta_cardbus 0000:00:0c.0: Using CSCINT to route CSC interrupts to PCI
yenta_cardbus 0000:00:0c.0: Routing CardBus interrupts to PCI
yenta_cardbus 0000:00:0c.0: TI: mfunc 0x0cb91522, devctl 0x66
sd 0:0:0:0: Attached scsi generic sg0 type 0
sr 0:0:1:0: Attached scsi generic sg1 type 5
pcmcia_socket pcmcia_socket0: cs: IO port probe 0x100-0x3af: excluding 0x378-0x37f
pcmcia_socket pcmcia_socket0: cs: IO port probe 0x3e0-0x4ff:
pcmcia_socket pcmcia_socket1: cs: IO port probe 0x100-0x3af: excluding 0x378-0x37f
pcmcia_socket pcmcia_socket1: cs: IO port probe 0x3e0-0x4ff: clean.
pcmcia_socket pcmcia_socket1: cs: IO port probe 0x820-0x8ff: clean.
pcmcia_socket pcmcia_socket1: cs: IO port probe 0xc00-0xcf7: clean.
pcmcia_socket pcmcia_socket0: cs: IO port probe 0x820-0x8ff: clean.
pcmcia_socket pcmcia_socket0: cs: IO port probe 0xc00-0xcf7: clean.
pcmcia_socket pcmcia_socket1: cs: memory probe 0x0c0000-0x0fffff: excluding 0xc0000-0xc7fff 0xe4000-0xfffff
pcmcia_socket pcmcia_socket1: cs: memory probe 0xa0000000-0xa0ffffff: clean.
pcmcia_socket pcmcia_socket1: cs: memory probe 0x60000000-0x60ffffff: clean.
pcmcia_socket pcmcia_socket1: cs: IO port probe 0xa00-0xaff: clean.
pcmcia_socket pcmcia_socket0: cs: memory probe 0x0c0000-0x0fffff: excluding 0xc0000-0xc7fff 0xe4000-0xfffff
pcmcia_socket pcmcia_socket0: cs: memory probe 0xa0000000-0xa0ffffff: clean.
pcmcia_socket pcmcia_socket0: cs: memory probe 0x60000000-0x60ffffff: clean.
pcmcia_socket pcmcia_socket0: cs: IO port probe 0xa00-0xaff: clean.
 clean.
yenta_cardbus 0000:00:0c.0: ISA IRQ mask 0x0000, PCI irq 17
yenta_cardbus 0000:00:0c.0: Socket status: 30000006
yenta_cardbus 0000:00:0c.1: CardBus bridge found [1195:02a2]
yenta_cardbus 0000:00:0c.1: Using CSCINT to route CSC interrupts to PCI
yenta_cardbus 0000:00:0c.1: Routing CardBus interrupts to PCI
yenta_cardbus 0000:00:0c.1: TI: mfunc 0x0cb91522, devctl 0x66
yenta_cardbus 0000:00:0c.1: ISA IRQ mask 0x0000, PCI irq 18
yenta_cardbus 0000:00:0c.1: Socket status: 30000006
pcmcia_socket pcmcia_socket3: cs: IO port probe 0x100-0x3af:
pcmcia_socket pcmcia_socket2: cs: IO port probe 0x100-0x3af: excluding 0x378-0x37f
pcmcia_socket pcmcia_socket3: cs: IO port probe 0x3e0-0x4ff: clean.
pcmcia_socket pcmcia_socket3: cs: IO port probe 0x820-0x8ff: excluding 0x378-0x37f
pcmcia_socket pcmcia_socket2: cs: IO port probe 0x3e0-0x4ff: clean.
pcmcia_socket pcmcia_socket3: cs: IO port probe 0xc00-0xcf7: clean.
pcmcia_socket pcmcia_socket2: cs: IO port probe 0x820-0x8ff: clean.
pcmcia_socket pcmcia_socket3: cs: memory probe 0x0c0000-0x0fffff: excluding 0xc0000-0xc7fff 0xe4000-0xfffff
 clean.
pcmcia_socket pcmcia_socket3: cs: memory probe 0xa0000000-0xa0ffffff: clean.
pcmcia_socket pcmcia_socket2: cs: IO port probe 0xc00-0xcf7:
pcmcia_socket pcmcia_socket3: cs: memory probe 0x60000000-0x60ffffff: clean.
pcmcia_socket pcmcia_socket3: cs: IO port probe 0xa00-0xaff: clean.
pcmcia_socket pcmcia_socket2: cs: memory probe 0x0c0000-0x0fffff: excluding 0xc0000-0xc7fff 0xe4000-0xfffff
pcmcia_socket pcmcia_socket2: cs: memory probe 0xa0000000-0xa0ffffff: clean.
pcmcia_socket pcmcia_socket2: cs: memory probe 0x60000000-0x60ffffff: clean.
 clean.
pcmcia_socket pcmcia_socket2: cs: IO port probe 0xa00-0xaff: clean.
pcmcia_socket pcmcia_socket1: pccard: PCMCIA card inserted into slot 1
pcmcia_socket pcmcia_socket1: cs: memory probe 0xa0000000-0xa0ffffff: clean.
pcmcia 1.0: pcmcia: registering new device pcmcia1.0
eth0: Asix AX88790: io 0x300, irq 16, hw_addr 00:90:cc:xx:xx:xx       => change to xx
EXT3-fs (sda2): using internal journal
Adding 4578516k swap on /dev/sda3.  Priority:-1 extents:1 across:4578516k 
rc.sysinit used greatest stack depth: 1944 bytes left
eth0: found link beat
eth0: autonegotiation complete: 100baseT-FD selected
eth0: no IPv6 routers present
pci 0000:03:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16


From linux at dominikbrodowski.net  Sat Mar 13 08:58:02 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Sat, 13 Mar 2010 14:58:02 +0100
Subject: [Another BUG?  kernel 2.6.34-rc1] cs: warning: no high memory
	space available!
In-Reply-To: <20100313220548.aabcf854.komurojun-mbn@nifty.com>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<1257971899-9274-9-git-send-email-linux@dominikbrodowski.net>
	<20091213212556.03d83e1f.komurojun-mbn@nifty.com>
	<20100228153933.f6fe6f81.komurojun-mbn@nifty.com>
	<20100313210430.7e155bf4.komurojun-mbn@nifty.com>
	<20100313220548.aabcf854.komurojun-mbn@nifty.com>
Message-ID: <20100313135802.GA24864@comet.dominikbrodowski.net>

Hey,

On Sat, Mar 13, 2010 at 10:05:48PM +0900, Komuro wrote:
> >a) do the cards still work?
> 
> They do _not_ work on pd6729.
> 
> >b) what's the output of cat /proc/iomem (2.6.34-rc1)?
> 
> The difference is "40000000-ffffffff : PCI Bus #00"

Ah, that seems like a change outside the PCMCIA realm. Could you try out the
following patch, please, which should adapt this driver to the new state of
things?

Best,
	Dominik


diff --git a/drivers/pcmcia/pd6729.c b/drivers/pcmcia/pd6729.c
index 7c20491..7ba57a5 100644
--- a/drivers/pcmcia/pd6729.c
+++ b/drivers/pcmcia/pd6729.c
@@ -671,6 +671,7 @@ static int __devinit pd6729_pci_probe(struct pci_dev *dev,
 		socket[i].socket.map_size = 0x1000;
 		socket[i].socket.irq_mask = mask;
 		socket[i].socket.pci_irq  = dev->irq;
+		socket[i].socket.cb_dev = dev;
 		socket[i].socket.owner = THIS_MODULE;
 
 		socket[i].number = i;


From bugzilla-daemon at bugzilla.kernel.org  Sat Mar 13 11:54:31 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Sat, 13 Mar 2010 16:54:31 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@http.bugzilla.kernel.org/>
References: <bug-7304-4463@http.bugzilla.kernel.org/>
Message-ID: <201003131654.o2DGsV4o008494@demeter.kernel.org>

http://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #60 from Dominik Brodowski <linux at brodo.de>  2010-03-13 16:52:30 ---
Okay, to summarize:

- forcing IRQ to be 11 means the CardBus bridge works as it should -- it
recognizes card insert and eject events properly.

-  the CardBus network card does not work, though.

I'm not surprised at all that the patches in comment #51 do not work -- they
are for a different, but still similar problem. What I'd be interested now is
the output of the "cbdump" tool (part of pcmciautils, pcmcia-cs) both under a
working and a non-working kernel. Maybe we need to set some register properly
for the hard override to work.

-- 
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From komurojun-mbn at nifty.com  Sat Mar 13 15:58:47 2010
From: komurojun-mbn at nifty.com (Komuro)
Date: Sun, 14 Mar 2010 05:58:47 +0900
Subject: [Another BUG?  kernel 2.6.34-rc1] cs: warning: no high memory
	space available!
In-Reply-To: <20100313221302.74d1b211.komurojun-mbn@nifty.com>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<1257971899-9274-9-git-send-email-linux@dominikbrodowski.net>
	<20091213212556.03d83e1f.komurojun-mbn@nifty.com>
	<20100228153933.f6fe6f81.komurojun-mbn@nifty.com>
	<20100313210430.7e155bf4.komurojun-mbn@nifty.com>
	<20100313220548.aabcf854.komurojun-mbn@nifty.com>
	<20100313221302.74d1b211.komurojun-mbn@nifty.com>
Message-ID: <20100314055847.5c22a2de.komurojun-mbn@nifty.com>


Hi,

it works now. Thanks.

>Ah, that seems like a change outside the PCMCIA realm. Could you try out the
>following patch, please, which should adapt this driver to the new state of
>things?
>
>
>
>diff --git a/drivers/pcmcia/pd6729.c b/drivers/pcmcia/pd6729.c
>index 7c20491..7ba57a5 100644
>--- a/drivers/pcmcia/pd6729.c
>+++ b/drivers/pcmcia/pd6729.c
>@@ -671,6 +671,7 @@ static int __devinit pd6729_pci_probe(struct pci_dev *dev,
> 		socket[i].socket.map_size = 0x1000;
> 		socket[i].socket.irq_mask = mask;
> 		socket[i].socket.pci_irq  = dev->irq;
>+		socket[i].socket.cb_dev = dev;

Komuro


From komurojun-mbn at nifty.com  Sat Mar 13 20:44:45 2010
From: komurojun-mbn at nifty.com (Komuro)
Date: Sun, 14 Mar 2010 10:44:45 +0900
Subject: [BUG?  kernel 2.6.33]  Bogus ioport is allocated for pcmcia device
In-Reply-To: <20100314055847.5c22a2de.komurojun-mbn@nifty.com>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<1257971899-9274-9-git-send-email-linux@dominikbrodowski.net>
	<20091213212556.03d83e1f.komurojun-mbn@nifty.com>
	<20100228153933.f6fe6f81.komurojun-mbn@nifty.com>
	<20100313210430.7e155bf4.komurojun-mbn@nifty.com>
	<20100313220548.aabcf854.komurojun-mbn@nifty.com>
	<20100313221302.74d1b211.komurojun-mbn@nifty.com>
	<20100314055847.5c22a2de.komurojun-mbn@nifty.com>
Message-ID: <20100314104445.ba1ed2c0.komurojun-mbn@nifty.com>

Hi,

Bogus ioport is allocated for pcmcia device at kernel 2.6.33.
ioport is 0x30 but it should be 0x100.


[2.6.33]
ata5: PATA max PIO0 cmd 0x30 ctl 0x3e irq 17
ata5.00: CFA: , Ver.1.0, max PIO2
ata5.00: 32000 sectors, multi 0: LBA 
ata5.00: configured for PIO0
ata5.00: configured for PIO0
ata5: EH complete
isa bounce pool size: 16 pages

[2.6.33-rc5]
ata5: PATA max PIO0 cmd 0x100 ctl 0x10e irq 17
ata5.00: CFA: , Ver.1.0, max PIO2
ata5.00: 32000 sectors, multi 0: LBA 
ata5.00: configured for PIO0
ata5.00: configured for PIO0
ata5: EH complete

[2.6.33]
	Configuration:	state: on	ready: yes
			Available IRQs: none
			Available ioports:	0x00000100 - 0x000003af
						0x000003e0 - 0x000004ff
						0x00000820 - 0x000008ff
						0x00000a00 - 0x00000aff
						0x00000c00 - 0x00000cf7
			Available iomem:	0xa0000000 - 0xa0ffffff


From bugzilla-daemon at bugzilla.kernel.org  Sun Mar 14 05:34:08 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Sun, 14 Mar 2010 09:34:08 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@http.bugzilla.kernel.org/>
References: <bug-7304-4463@http.bugzilla.kernel.org/>
Message-ID: <201003140934.o2E9Y8D7022411@demeter.kernel.org>

http://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #60 from Dominik Brodowski <linux at brodo.de>  2010-03-13 16:52:30 ---
Okay, to summarize:

- forcing IRQ to be 11 means the CardBus bridge works as it should -- it
recognizes card insert and eject events properly.

-  the CardBus network card does not work, though.

I'm not surprised at all that the patches in comment #51 do not work -- they
are for a different, but still similar problem. What I'd be interested now is
the output of the "cbdump" tool (part of pcmciautils, pcmcia-cs) both under a
working and a non-working kernel. Maybe we need to set some register properly
for the hard override to work.

--- Comment #61 from Thomas Nemeth <nemeth.thomas at gmail.com>  2010-03-14 09:33:56 ---
Created an attachment (id=25507)
 --> (http://bugzilla.kernel.org/attachment.cgi?id=25507)
cbdump for 2.6.26.2

This is the output of cbdump for a not-working 2.6.26.2 kernel.

-- 
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From bugzilla-daemon at bugzilla.kernel.org  Sun Mar 14 05:37:13 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Sun, 14 Mar 2010 09:37:13 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@http.bugzilla.kernel.org/>
References: <bug-7304-4463@http.bugzilla.kernel.org/>
Message-ID: <201003140937.o2E9bDk1023232@demeter.kernel.org>

http://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #62 from Thomas Nemeth <nemeth.thomas at gmail.com>  2010-03-14 09:37:09 ---
Created an attachment (id=25508)
 --> (http://bugzilla.kernel.org/attachment.cgi?id=25508)
cbdump for 2.6.33

This is the output of cbdump for the 2.6.33 kernel modified with the
IRQ forced to 11. Although I cannot ping other computers on the network,
it may be the best option by now. I'll investigate to see if it's not a
router related problem.

I can't make a 2.4.27 load the yenta_socket driver anymore with the old
debian sarge install CD.

-- 
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From bugzilla-daemon at bugzilla.kernel.org  Sun Mar 14 05:57:14 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Sun, 14 Mar 2010 09:57:14 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@http.bugzilla.kernel.org/>
References: <bug-7304-4463@http.bugzilla.kernel.org/>
Message-ID: <201003140957.o2E9vE7p027179@demeter.kernel.org>

http://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #63 from Thomas Nemeth <nemeth.thomas at gmail.com>  2010-03-14 09:57:08 ---
After having done tests the 2.6.33 with the IRQ forced to 11 really
does not work. It's not a router related problem.

The 2.2.27 kernel is too old to run cbdump :(

I'll try to have a 2.4 working kernel again.

-- 
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From bugzilla-daemon at bugzilla.kernel.org  Sun Mar 14 06:02:48 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Sun, 14 Mar 2010 10:02:48 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@http.bugzilla.kernel.org/>
References: <bug-7304-4463@http.bugzilla.kernel.org/>
Message-ID: <201003141002.o2EA2mub028305@demeter.kernel.org>

http://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #64 from Dominik Brodowski <linux at brodo.de>  2010-03-14 10:02:44 ---
Does "lspci -vvxxx" work on a 2.2.27 kernel? Maybe the difference between the
output of "lspci -vvxxx" on 2.2.27 and 2.6.33 does help enough to make it work?

-- 
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From linux at dominikbrodowski.net  Sun Mar 14 06:05:49 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Sun, 14 Mar 2010 11:05:49 +0100
Subject: [BUG? kernel 2.6.33] Bogus ioport is allocated for pcmcia device
In-Reply-To: <20100314104445.ba1ed2c0.komurojun-mbn@nifty.com>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<1257971899-9274-9-git-send-email-linux@dominikbrodowski.net>
	<20091213212556.03d83e1f.komurojun-mbn@nifty.com>
	<20100228153933.f6fe6f81.komurojun-mbn@nifty.com>
	<20100313210430.7e155bf4.komurojun-mbn@nifty.com>
	<20100313220548.aabcf854.komurojun-mbn@nifty.com>
	<20100313221302.74d1b211.komurojun-mbn@nifty.com>
	<20100314055847.5c22a2de.komurojun-mbn@nifty.com>
	<20100314104445.ba1ed2c0.komurojun-mbn@nifty.com>
Message-ID: <20100314100549.GA23350@isilmar.linta.de>

Hey,

On Sun, Mar 14, 2010 at 10:44:45AM +0900, Komuro wrote:
> Bogus ioport is allocated for pcmcia device at kernel 2.6.33.
> ioport is 0x30 but it should be 0x100.

Does it work correctly on 2.6.34-rc1?

> [2.6.33]
> ata5: PATA max PIO0 cmd 0x30 ctl 0x3e irq 17
> ata5.00: CFA: , Ver.1.0, max PIO2
> ata5.00: 32000 sectors, multi 0: LBA 
> ata5.00: configured for PIO0
> ata5.00: configured for PIO0
> ata5: EH complete
> isa bounce pool size: 16 pages
> 
> [2.6.33-rc5]
> ata5: PATA max PIO0 cmd 0x100 ctl 0x10e irq 17
> ata5.00: CFA: , Ver.1.0, max PIO2
> ata5.00: 32000 sectors, multi 0: LBA 
> ata5.00: configured for PIO0
> ata5.00: configured for PIO0
> ata5: EH complete

There's _no_ change in the PCMCIA subsystem between 2.6.33-rc5 and 2.6.33;
drivers/ata/ doesn't seem to have any related changes...

Best,
	Domini


From linux at dominikbrodowski.net  Sun Mar 14 06:42:48 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Sun, 14 Mar 2010 11:42:48 +0100
Subject: [PATCH 2/6] pcmcia: pd6729, i82092: use parent (PCI) resources
In-Reply-To: <20100314103956.GA26118@comet.dominikbrodowski.net>
References: <20100314103956.GA26118@comet.dominikbrodowski.net>
Message-ID: <1268563372-26372-2-git-send-email-linux@dominikbrodowski.net>

A newly added parent resource entry for the root PCI bus, such as

40000000-ffffffff : PCI Bus #00

means that the pd6729 and i82092 drivers cannot allocate iomem as
freely as before, unless they do so as PCI devices. Therefore, set
socket->cb_dev so that rsrc_nonstatic.c does the right thing.

Reported-by: Komuro <komurojun-mbn at nifty.com>
Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 drivers/pcmcia/i82092.c |    1 +
 drivers/pcmcia/pd6729.c |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/pcmcia/i82092.c b/drivers/pcmcia/i82092.c
index a04f21c..f5da626 100644
--- a/drivers/pcmcia/i82092.c
+++ b/drivers/pcmcia/i82092.c
@@ -133,6 +133,7 @@ static int __devinit i82092aa_pci_probe(struct pci_dev *dev, const struct pci_de
 		sockets[i].socket.map_size = 0x1000;
 		sockets[i].socket.irq_mask = 0;
 		sockets[i].socket.pci_irq  = dev->irq;
+		sockets[i].socket.cb_dev  = dev;
 		sockets[i].socket.owner = THIS_MODULE;
 
 		sockets[i].number = i;
diff --git a/drivers/pcmcia/pd6729.c b/drivers/pcmcia/pd6729.c
index 7c20491..7ba57a5 100644
--- a/drivers/pcmcia/pd6729.c
+++ b/drivers/pcmcia/pd6729.c
@@ -671,6 +671,7 @@ static int __devinit pd6729_pci_probe(struct pci_dev *dev,
 		socket[i].socket.map_size = 0x1000;
 		socket[i].socket.irq_mask = mask;
 		socket[i].socket.pci_irq  = dev->irq;
+		socket[i].socket.cb_dev = dev;
 		socket[i].socket.owner = THIS_MODULE;
 
 		socket[i].number = i;
-- 
1.6.3.3



From linux at dominikbrodowski.net  Sun Mar 14 06:39:56 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Sun, 14 Mar 2010 11:39:56 +0100
Subject: [RFC] PCMCIA bugfixes for 2.6.34-rc2
Message-ID: <20100314103956.GA26118@comet.dominikbrodowski.net>

Hey,

a few PCMCIA-related bugfixes are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git master

I'll send them out to the PCMCIA list right away.

If there are no issues with these patches, I intend to push them to Linus
next week.

Best,
	Dominik

Dominik Brodowski (2):
      pcmcia: pd6729, i82092: use parent (PCI) resources
      pcmcia: revert "irq probe can be done without risking an IRQ storm"

Jens K?nzer (3):
      pcmcia: honor saved flags in yenta_socket's I365_CSCINT register
      pcmcia: allow for cb_irq to differ from pci_dev's irq in yenta_socket
      pcmcia: re-route Cardbus IRQ to ISA on ti1130 bridges if necessary

Yoichi Yuasa (1):
      pcmcia/vrc4171: use local spinlock for device local lock.

 drivers/pcmcia/i82092.c          |    1 +
 drivers/pcmcia/i82365.h          |    1 +
 drivers/pcmcia/pcmcia_resource.c |    8 ------
 drivers/pcmcia/pd6729.c          |    1 +
 drivers/pcmcia/ti113x.h          |   37 ++++++++++++++++++++++++++++-
 drivers/pcmcia/vrc4171_card.c    |    5 ++-
 drivers/pcmcia/yenta_socket.c    |   46 +++++++++++++++++++++++--------------
 7 files changed, 69 insertions(+), 30 deletions(-)


From linux at dominikbrodowski.net  Sun Mar 14 06:42:47 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Sun, 14 Mar 2010 11:42:47 +0100
Subject: [PATCH 1/6] pcmcia/vrc4171: use local spinlock for device local lock.
In-Reply-To: <20100314103956.GA26118@comet.dominikbrodowski.net>
References: <20100314103956.GA26118@comet.dominikbrodowski.net>
Message-ID: <1268563372-26372-1-git-send-email-linux@dominikbrodowski.net>

From: Yoichi Yuasa <yuasa at linux-mips.org>

struct pcmcia_socket lock had been used before.

Signed-off-by: Yoichi Yuasa <yuasa at linux-mips.org>
Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 drivers/pcmcia/vrc4171_card.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/pcmcia/vrc4171_card.c b/drivers/pcmcia/vrc4171_card.c
index c9fcbdc..aaccdb9 100644
--- a/drivers/pcmcia/vrc4171_card.c
+++ b/drivers/pcmcia/vrc4171_card.c
@@ -105,6 +105,7 @@ typedef struct vrc4171_socket {
 	char name[24];
 	int csc_irq;
 	int io_irq;
+	spinlock_t lock;
 } vrc4171_socket_t;
 
 static vrc4171_socket_t vrc4171_sockets[CARD_MAX_SLOTS];
@@ -327,7 +328,7 @@ static int pccard_set_socket(struct pcmcia_socket *sock, socket_state_t *state)
 	slot = sock->sock;
 	socket = &vrc4171_sockets[slot];
 
-	spin_lock_irq(&sock->lock);
+	spin_lock_irq(&socket->lock);
 
 	voltage = set_Vcc_value(state->Vcc);
 	exca_write_byte(slot, CARD_VOLTAGE_SELECT, voltage);
@@ -370,7 +371,7 @@ static int pccard_set_socket(struct pcmcia_socket *sock, socket_state_t *state)
 		cscint |= I365_CSC_DETECT;
         exca_write_byte(slot, I365_CSCINT, cscint);
 
-	spin_unlock_irq(&sock->lock);
+	spin_unlock_irq(&socket->lock);
 
 	return 0;
 }
-- 
1.6.3.3



From linux at dominikbrodowski.net  Sun Mar 14 06:42:51 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Sun, 14 Mar 2010 11:42:51 +0100
Subject: [PATCH 5/6] pcmcia: allow for cb_irq to differ from pci_dev's irq in
	yenta_socket
In-Reply-To: <20100314103956.GA26118@comet.dominikbrodowski.net>
References: <20100314103956.GA26118@comet.dominikbrodowski.net>
Message-ID: <1268563372-26372-5-git-send-email-linux@dominikbrodowski.net>

From: Jens K?nzer <Jens.Kuenzer at fpga.homeip.net>

cb_irq is presumed to be the same as the pci_dev's irq. This won't be
true any more as soon as we allow the ISA irq to be used for Cardbus
devices. Therefore, use the pci_dev's irq explicitely whenever we
care about it.

Part 2 of a series to allow the ISA irq to be used for Cardbus devices
if the socket's PCI irq is unusable.

[linux at dominikbrodowski.net: split up the original patch, commit message]

Signed-off-by: Jens Kuenzer <Jens.Kuenzer at fpga.homeip.net>
Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 drivers/pcmcia/yenta_socket.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
index 42f6763..51ee68d 100644
--- a/drivers/pcmcia/yenta_socket.c
+++ b/drivers/pcmcia/yenta_socket.c
@@ -329,8 +329,8 @@ static int yenta_set_socket(struct pcmcia_socket *sock, socket_state_t *state)
 		/* ISA interrupt control? */
 		intr = exca_readb(socket, I365_INTCTL);
 		intr = (intr & ~0xf);
-		if (!socket->cb_irq) {
-			intr |= state->io_irq;
+		if (!socket->dev->irq) {
+			intr |= socket->cb_irq ? socket->cb_irq : state->io_irq;
 			bridge |= CB_BRIDGE_INTR;
 		}
 		exca_writeb(socket, I365_INTCTL, intr);
@@ -340,7 +340,7 @@ static int yenta_set_socket(struct pcmcia_socket *sock, socket_state_t *state)
 		reg = exca_readb(socket, I365_INTCTL) & (I365_RING_ENA | I365_INTR_ENA);
 		reg |= (state->flags & SS_RESET) ? 0 : I365_PC_RESET;
 		reg |= (state->flags & SS_IOCARD) ? I365_PC_IOCARD : 0;
-		if (state->io_irq != socket->cb_irq) {
+		if (state->io_irq != socket->dev->irq) {
 			reg |= state->io_irq;
 			bridge |= CB_BRIDGE_INTR;
 		}
-- 
1.6.3.3



From linux at dominikbrodowski.net  Sun Mar 14 06:42:49 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Sun, 14 Mar 2010 11:42:49 +0100
Subject: [PATCH 3/6] pcmcia: revert "irq probe can be done without risking an
	IRQ storm"
In-Reply-To: <20100314103956.GA26118@comet.dominikbrodowski.net>
References: <20100314103956.GA26118@comet.dominikbrodowski.net>
Message-ID: <1268563372-26372-3-git-send-email-linux@dominikbrodowski.net>

This reverts commit 635416ef393e8cec5a89fc6c1de710ee9596a51e. The
argument passed to request_irq() only affects action->flags (IRQF_*),
but IRQ_NOAUTOEN relates to desc->status.

Reported-by: Jan Beulich <JBeulich at novell.com>
CC: Alan Cox <alan at linux.intel.com>
Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 drivers/pcmcia/pcmcia_resource.c |    8 --------
 1 files changed, 0 insertions(+), 8 deletions(-)

diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index b2df041..ef782c0 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -752,14 +752,6 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
 
 #ifdef CONFIG_PCMCIA_PROBE
 
-#ifdef IRQ_NOAUTOEN
-	/* if the underlying IRQ infrastructure allows for it, only allocate
-	 * the IRQ, but do not enable it
-	 */
-	if (!(req->Handler))
-		type |= IRQ_NOAUTOEN;
-#endif /* IRQ_NOAUTOEN */
-
 	if (s->irq.AssignedIRQ != 0) {
 		/* If the interrupt is already assigned, it must be the same */
 		irq = s->irq.AssignedIRQ;
-- 
1.6.3.3



From linux at dominikbrodowski.net  Sun Mar 14 06:42:52 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Sun, 14 Mar 2010 11:42:52 +0100
Subject: [PATCH 6/6] pcmcia: re-route Cardbus IRQ to ISA on ti1130 bridges if
	necessary
In-Reply-To: <20100314103956.GA26118@comet.dominikbrodowski.net>
References: <20100314103956.GA26118@comet.dominikbrodowski.net>
Message-ID: <1268563372-26372-6-git-send-email-linux@dominikbrodowski.net>

From: Jens K?nzer <Jens.Kuenzer at fpga.homeip.net>

As the PCI irq pin of the ti1130 pcmcia bridge is not connected (at
least on some old IBM Thinkpad 760ED notebooks), the Cardbus IRQ has
to be routed to an ISA irq.

Part 3 of a series to allow the ISA irq to be used for Cardbus devices
if the socket's PCI irq is unusable.

[linux at dominikbrodowski.net: split up the original patch, commit message,
 cleanup]

Signed-off-by: Jens Kuenzer <Jens.Kuenzer at fpga.homeip.net>
Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 drivers/pcmcia/ti113x.h       |   37 +++++++++++++++++++++++++++++++++++--
 drivers/pcmcia/yenta_socket.c |   25 ++++++++++++++-----------
 2 files changed, 49 insertions(+), 13 deletions(-)

diff --git a/drivers/pcmcia/ti113x.h b/drivers/pcmcia/ti113x.h
index aaa7022..9ffa97d 100644
--- a/drivers/pcmcia/ti113x.h
+++ b/drivers/pcmcia/ti113x.h
@@ -296,7 +296,7 @@ static int ti_init(struct yenta_socket *socket)
 	u8 new, reg = exca_readb(socket, I365_INTCTL);
 
 	new = reg & ~I365_INTR_ENA;
-	if (socket->cb_irq)
+	if (socket->dev->irq)
 		new |= I365_INTR_ENA;
 	if (new != reg)
 		exca_writeb(socket, I365_INTCTL, new);
@@ -316,14 +316,47 @@ static int ti_override(struct yenta_socket *socket)
 	return 0;
 }
 
+static void ti113x_use_isa_irq(struct yenta_socket *socket)
+{
+	int isa_irq = -1;
+	u8 intctl;
+	u32 isa_irq_mask = 0;
+
+	if (!isa_probe)
+		return;
+
+	/* get a free isa int */
+	isa_irq_mask = yenta_probe_irq(socket, isa_interrupts);
+	if (!isa_irq_mask)
+		return; /* no useable isa irq found */
+
+	/* choose highest available */
+	for (; isa_irq_mask; isa_irq++)
+		isa_irq_mask >>= 1;
+	socket->cb_irq = isa_irq;
+
+	exca_writeb(socket, I365_CSCINT, (isa_irq << 4));
+
+	intctl = exca_readb(socket, I365_INTCTL);
+	intctl &= ~(I365_INTR_ENA | I365_IRQ_MASK);     /* CSC Enable */
+	exca_writeb(socket, I365_INTCTL, intctl);
+
+	dev_info(&socket->dev->dev,
+		"Yenta TI113x: using isa irq %d for CardBus\n", isa_irq);
+}
+
+
 static int ti113x_override(struct yenta_socket *socket)
 {
 	u8 cardctl;
 
 	cardctl = config_readb(socket, TI113X_CARD_CONTROL);
 	cardctl &= ~(TI113X_CCR_PCI_IRQ_ENA | TI113X_CCR_PCI_IREQ | TI113X_CCR_PCI_CSC);
-	if (socket->cb_irq)
+	if (socket->dev->irq)
 		cardctl |= TI113X_CCR_PCI_IRQ_ENA | TI113X_CCR_PCI_CSC | TI113X_CCR_PCI_IREQ;
+	else
+		ti113x_use_isa_irq(socket);
+
 	config_writeb(socket, TI113X_CARD_CONTROL, cardctl);
 
 	return ti_override(socket);
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
index 51ee68d..418988a 100644
--- a/drivers/pcmcia/yenta_socket.c
+++ b/drivers/pcmcia/yenta_socket.c
@@ -42,6 +42,18 @@ module_param_string(o2_speedup, o2_speedup, sizeof(o2_speedup), 0444);
 MODULE_PARM_DESC(o2_speedup, "Use prefetch/burst for O2-bridges: 'on', 'off' "
 	"or 'default' (uses recommended behaviour for the detected bridge)");
 
+/*
+ * Only probe "regular" interrupts, don't
+ * touch dangerous spots like the mouse irq,
+ * because there are mice that apparently
+ * get really confused if they get fondled
+ * too intimately.
+ *
+ * Default to 11, 10, 9, 7, 6, 5, 4, 3.
+ */
+static u32 isa_interrupts = 0x0ef8;
+
+
 #define debug(x, s, args...) dev_dbg(&s->dev->dev, x, ##args)
 
 /* Don't ask.. */
@@ -54,6 +66,8 @@ MODULE_PARM_DESC(o2_speedup, "Use prefetch/burst for O2-bridges: 'on', 'off' "
  */
 #ifdef CONFIG_YENTA_TI
 static int yenta_probe_cb_irq(struct yenta_socket *socket);
+static unsigned int yenta_probe_irq(struct yenta_socket *socket,
+				u32 isa_irq_mask);
 #endif
 
 
@@ -898,17 +912,6 @@ static struct cardbus_type cardbus_type[] = {
 };
 
 
-/*
- * Only probe "regular" interrupts, don't
- * touch dangerous spots like the mouse irq,
- * because there are mice that apparently
- * get really confused if they get fondled
- * too intimately.
- *
- * Default to 11, 10, 9, 7, 6, 5, 4, 3.
- */
-static u32 isa_interrupts = 0x0ef8;
-
 static unsigned int yenta_probe_irq(struct yenta_socket *socket, u32 isa_irq_mask)
 {
 	int i;
-- 
1.6.3.3



From linux at dominikbrodowski.net  Sun Mar 14 06:42:50 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Sun, 14 Mar 2010 11:42:50 +0100
Subject: [PATCH 4/6] pcmcia: honor saved flags in yenta_socket's I365_CSCINT
	register
In-Reply-To: <20100314103956.GA26118@comet.dominikbrodowski.net>
References: <20100314103956.GA26118@comet.dominikbrodowski.net>
Message-ID: <1268563372-26372-4-git-send-email-linux@dominikbrodowski.net>

From: Jens K?nzer <Jens.Kuenzer at fpga.homeip.net>

Instead of overwriting the I365_CSCINT register, save the old value and
merely change the bits we care about.

Part 1 of a series to allow the ISA irq to be used for Cardbus devices
if the socket's PCI irq is unusable.

[linux at dominikbrodowski.net: split up the original patch, commit message]

Signed-off-by: Jens Kuenzer <Jens.Kuenzer at fpga.homeip.net>
Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 drivers/pcmcia/i82365.h       |    1 +
 drivers/pcmcia/yenta_socket.c |   15 +++++++++++----
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/pcmcia/i82365.h b/drivers/pcmcia/i82365.h
index 849ef1b..3f84d7a 100644
--- a/drivers/pcmcia/i82365.h
+++ b/drivers/pcmcia/i82365.h
@@ -95,6 +95,7 @@
 #define I365_CSC_DETECT	0x08
 #define I365_CSC_ANY	0x0F
 #define I365_CSC_GPI	0x10
+#define I365_CSC_IRQ_MASK	0xF0
 
 /* Flags for I365_ADDRWIN */
 #define I365_ENA_IO(map)	(0x40 << (map))
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
index 967c766..42f6763 100644
--- a/drivers/pcmcia/yenta_socket.c
+++ b/drivers/pcmcia/yenta_socket.c
@@ -356,7 +356,9 @@ static int yenta_set_socket(struct pcmcia_socket *sock, socket_state_t *state)
 			exca_writeb(socket, I365_POWER, reg);
 
 		/* CSC interrupt: no ISA irq for CSC */
-		reg = I365_CSC_DETECT;
+		reg = exca_readb(socket, I365_CSCINT);
+		reg &= I365_CSC_IRQ_MASK;
+		reg |= I365_CSC_DETECT;
 		if (state->flags & SS_IOCARD) {
 			if (state->csc_mask & SS_STSCHG)
 				reg |= I365_CSC_STSCHG;
@@ -912,6 +914,7 @@ static unsigned int yenta_probe_irq(struct yenta_socket *socket, u32 isa_irq_mas
 	int i;
 	unsigned long val;
 	u32 mask;
+	u8 reg;
 
 	/*
 	 * Probe for usable interrupts using the force
@@ -919,6 +922,7 @@ static unsigned int yenta_probe_irq(struct yenta_socket *socket, u32 isa_irq_mas
 	 */
 	cb_writel(socket, CB_SOCKET_EVENT, -1);
 	cb_writel(socket, CB_SOCKET_MASK, CB_CSTSMASK);
+	reg = exca_readb(socket, I365_CSCINT);
 	exca_writeb(socket, I365_CSCINT, 0);
 	val = probe_irq_on() & isa_irq_mask;
 	for (i = 1; i < 16; i++) {
@@ -930,7 +934,7 @@ static unsigned int yenta_probe_irq(struct yenta_socket *socket, u32 isa_irq_mas
 		cb_writel(socket, CB_SOCKET_EVENT, -1);
 	}
 	cb_writel(socket, CB_SOCKET_MASK, 0);
-	exca_writeb(socket, I365_CSCINT, 0);
+	exca_writeb(socket, I365_CSCINT, reg);
 
 	mask = probe_irq_mask(val) & 0xffff;
 
@@ -967,6 +971,8 @@ static irqreturn_t yenta_probe_handler(int irq, void *dev_id)
 /* probes the PCI interrupt, use only on override functions */
 static int yenta_probe_cb_irq(struct yenta_socket *socket)
 {
+	u8 reg;
+
 	if (!socket->cb_irq)
 		return -1;
 
@@ -979,7 +985,8 @@ static int yenta_probe_cb_irq(struct yenta_socket *socket)
 	}
 
 	/* generate interrupt, wait */
-	exca_writeb(socket, I365_CSCINT, I365_CSC_STSCHG);
+	reg = exca_readb(socket, I365_CSCINT);
+	exca_writeb(socket, I365_CSCINT, reg | I365_CSC_STSCHG);
 	cb_writel(socket, CB_SOCKET_EVENT, -1);
 	cb_writel(socket, CB_SOCKET_MASK, CB_CSTSMASK);
 	cb_writel(socket, CB_SOCKET_FORCE, CB_FCARDSTS);
@@ -988,7 +995,7 @@ static int yenta_probe_cb_irq(struct yenta_socket *socket)
 
 	/* disable interrupts */
 	cb_writel(socket, CB_SOCKET_MASK, 0);
-	exca_writeb(socket, I365_CSCINT, 0);
+	exca_writeb(socket, I365_CSCINT, reg);
 	cb_writel(socket, CB_SOCKET_EVENT, -1);
 	exca_readb(socket, I365_CSC);
 
-- 
1.6.3.3



From bugzilla-daemon at bugzilla.kernel.org  Sun Mar 14 07:03:47 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Sun, 14 Mar 2010 11:03:47 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@http.bugzilla.kernel.org/>
References: <bug-7304-4463@http.bugzilla.kernel.org/>
Message-ID: <201003141103.o2EB3l28009367@demeter.kernel.org>

http://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #65 from Thomas Nemeth <nemeth.thomas at gmail.com>  2010-03-14 11:03:31 ---
Created an attachment (id=25509)
 --> (http://bugzilla.kernel.org/attachment.cgi?id=25509)
output of lspci -vvxxx on 2.6.33

This is the output of the lspci -vvxxx command on the 2.6.33 kernel. I'm
not skilled enough to know what means the hexdump.

-- 
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From bugzilla-daemon at bugzilla.kernel.org  Sun Mar 14 07:10:21 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Sun, 14 Mar 2010 11:10:21 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@http.bugzilla.kernel.org/>
References: <bug-7304-4463@http.bugzilla.kernel.org/>
Message-ID: <201003141110.o2EBALqY010871@demeter.kernel.org>

http://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #66 from Thomas Nemeth <nemeth.thomas at gmail.com>  2010-03-14 11:10:17 ---
Created an attachment (id=25510)
 --> (http://bugzilla.kernel.org/attachment.cgi?id=25510)
output of lspci -H 2 -vvxxx on 2.2.27

I had to make a direct hardware access.

-- 
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From bugzilla-daemon at bugzilla.kernel.org  Sun Mar 14 07:15:39 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Sun, 14 Mar 2010 11:15:39 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@http.bugzilla.kernel.org/>
References: <bug-7304-4463@http.bugzilla.kernel.org/>
Message-ID: <201003141115.o2EBFdTE012069@demeter.kernel.org>

http://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #67 from Thomas Nemeth <nemeth.thomas at gmail.com>  2010-03-14 11:15:32 ---
(In reply to comment #64)
> Does "lspci -vvxxx" work on a 2.2.27 kernel? Maybe the difference between the
> output of "lspci -vvxxx" on 2.2.27 and 2.6.33 does help enough to make it work?

    As you can see, unfortunately, it's not sufficient... At least for me.
    The only thing I can observe is that with the 2.2.27 kernel, my network
    adapter is seen as a pci device though it's not even seen by the 2.6.33.

-- 
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From komurojun-mbn at nifty.com  Sun Mar 14 08:02:58 2010
From: komurojun-mbn at nifty.com (Komuro)
Date: Sun, 14 Mar 2010 21:02:58 +0900
Subject: [BUG?  kernel 2.6.33]  Bogus ioport is allocated for pcmcia device
In-Reply-To: <20100314104445.ba1ed2c0.komurojun-mbn@nifty.com>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<1257971899-9274-9-git-send-email-linux@dominikbrodowski.net>
	<20091213212556.03d83e1f.komurojun-mbn@nifty.com>
	<20100228153933.f6fe6f81.komurojun-mbn@nifty.com>
	<20100313210430.7e155bf4.komurojun-mbn@nifty.com>
	<20100313220548.aabcf854.komurojun-mbn@nifty.com>
	<20100313221302.74d1b211.komurojun-mbn@nifty.com>
	<20100314055847.5c22a2de.komurojun-mbn@nifty.com>
	<20100314104445.ba1ed2c0.komurojun-mbn@nifty.com>
Message-ID: <20100314210258.20764af8.komurojun-mbn@nifty.com>

Hi,

>Does it work correctly on 2.6.34-rc1?

same result on 2.6.34-rc1.

>There's _no_ change in the PCMCIA subsystem between 2.6.33-rc5 and 2.6.33;
>drivers/ata/ doesn't seem to have any related changes...

It seems it is the ata driver problem.
I will test it with network card.



Best Regards
Komuro


From bugzilla-daemon at bugzilla.kernel.org  Sun Mar 14 08:52:47 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Sun, 14 Mar 2010 12:52:47 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@http.bugzilla.kernel.org/>
References: <bug-7304-4463@http.bugzilla.kernel.org/>
Message-ID: <201003141252.o2ECqlB9001616@demeter.kernel.org>

http://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #68 from Dominik Brodowski <linux at brodo.de>  2010-03-14 12:52:34 ---
Could you repeat the "cbdump" on (plain) 2.6.33 with IRQ forced to 11, and the
network card inserted?

-- 
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From bugzilla-daemon at bugzilla.kernel.org  Sun Mar 14 09:03:17 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Sun, 14 Mar 2010 13:03:17 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@http.bugzilla.kernel.org/>
References: <bug-7304-4463@http.bugzilla.kernel.org/>
Message-ID: <201003141303.o2ED3HQM003887@demeter.kernel.org>

http://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #69 from Thomas Nemeth <nemeth.thomas at gmail.com>  2010-03-14 13:03:10 ---
(In reply to comment #68)
> Could you repeat the "cbdump" on (plain) 2.6.33 with IRQ forced to 11, and the
> network card inserted?

    It should already be the one in attachment 25508 (see Comment #62 for
more).

-- 
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From bugzilla-daemon at bugzilla.kernel.org  Sun Mar 14 09:11:57 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Sun, 14 Mar 2010 13:11:57 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@http.bugzilla.kernel.org/>
References: <bug-7304-4463@http.bugzilla.kernel.org/>
Message-ID: <201003141311.o2EDBvbq005605@demeter.kernel.org>

http://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #70 from Dominik Brodowski <linux at brodo.de>  2010-03-14 13:11:52 ---
While I'm checking the cbdump output: are you sure the "tulip" driver is the
correct one for this card? There seem to be some mis-assignments in the past (
https://bugs.launchpad.net/ubuntu/+source/udev/+bug/48026 ), that's why I
ask...

-- 
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From bugzilla-daemon at bugzilla.kernel.org  Sun Mar 14 09:26:25 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Sun, 14 Mar 2010 13:26:25 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@http.bugzilla.kernel.org/>
References: <bug-7304-4463@http.bugzilla.kernel.org/>
Message-ID: <201003141326.o2EDQPWm008851@demeter.kernel.org>

http://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #71 from Dominik Brodowski <linux at brodo.de>  2010-03-14 13:26:20 ---
and next question: Are there two CardBus/PCMCIA slots? If so, might the other
one work? (The I365_ settings for slot 0 seem much more appropriate than the
ones for slot 1)

-- 
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From bugzilla-daemon at bugzilla.kernel.org  Sun Mar 14 09:37:09 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Sun, 14 Mar 2010 13:37:09 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@http.bugzilla.kernel.org/>
References: <bug-7304-4463@http.bugzilla.kernel.org/>
Message-ID: <201003141337.o2EDb9Cd011579@demeter.kernel.org>

http://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #72 from Thomas Nemeth <nemeth.thomas at gmail.com>  2010-03-14 13:37:01 ---
(In reply to comment #70)
> While I'm checking the cbdump output: are you sure the "tulip" driver is the
> correct one for this card? There seem to be some mis-assignments in the past (
> https://bugs.launchpad.net/ubuntu/+source/udev/+bug/48026 ), that's why I
> ask...

    It was the one used by 2.2.27 and 2.4.22 as show in attachment 17205 and
    in attachment 17386 but may be has it changed since then ?

    The only difference, module-related, between a working and a current
    non-working kernel is that the 2.2.27 used the i82365 driver and now
    only the yenta_socket seems to recognize the device.

-- 
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From bugzilla-daemon at bugzilla.kernel.org  Sun Mar 14 09:42:21 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Sun, 14 Mar 2010 13:42:21 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@http.bugzilla.kernel.org/>
References: <bug-7304-4463@http.bugzilla.kernel.org/>
Message-ID: <201003141342.o2EDgL7p012687@demeter.kernel.org>

http://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #73 from Thomas Nemeth <nemeth.thomas at gmail.com>  2010-03-14 13:42:17 ---
(In reply to comment #71)
> and next question: Are there two CardBus/PCMCIA slots? If so, might the other
> one work? (The I365_ settings for slot 0 seem much more appropriate than the
> ones for slot 1)

    Oh !

    You got it right !!!

    That's strange, but now, with 2.6.33 and the yenta_socket IRQ forced to
    11, the card when put into the slot 0 works !

    I'm more that happy to know that.

-- 
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From bugzilla-daemon at bugzilla.kernel.org  Sun Mar 14 10:43:25 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Sun, 14 Mar 2010 14:43:25 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@http.bugzilla.kernel.org/>
References: <bug-7304-4463@http.bugzilla.kernel.org/>
Message-ID: <201003141443.o2EEhPQx027721@demeter.kernel.org>

http://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #74 from Dominik Brodowski <linux at brodo.de>  2010-03-14 14:43:16 ---
Excellent news. Is this result sufficient for you? If so, I'd suggest closing
the bug as WONTFIX. Otherwise, we'd first need to create a DMI-based quirk so
that IRQ is set to 11; and then debug why the second slot does not work, while
the first one does.

-- 
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From bugzilla-daemon at bugzilla.kernel.org  Sun Mar 14 12:40:35 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Sun, 14 Mar 2010 16:40:35 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@http.bugzilla.kernel.org/>
References: <bug-7304-4463@http.bugzilla.kernel.org/>
Message-ID: <201003141640.o2EGeZPO024767@demeter.kernel.org>

http://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #75 from Thomas Nemeth <nemeth.thomas at gmail.com>  2010-03-14 16:40:24 ---
(In reply to comment #74)
> Excellent news. Is this result sufficient for you? If so, I'd suggest closing
> the bug as WONTFIX. Otherwise, we'd first need to create a DMI-based quirk so
> that IRQ is set to 11; and then debug why the second slot does not work, while
> the first one does.

    I'm ready for the full debug session, if you don't mind, so that the
    fixes are available in distributions, espacially those targeted for
    old hardware. But if you want to let it in this state, I'm fine with
    it, I'll just have to recompile new kernels each time... Or make my
    own distro :)

-- 
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From bugzilla-daemon at bugzilla.kernel.org  Mon Mar 15 03:42:37 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Mon, 15 Mar 2010 07:42:37 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@http.bugzilla.kernel.org/>
References: <bug-7304-4463@http.bugzilla.kernel.org/>
Message-ID: <201003150742.o2F7gbCP005895@demeter.kernel.org>

http://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #76 from Dominik Brodowski <linux at brodo.de>  2010-03-15 07:42:23 ---
That's good news. To create the DMI-based quirk, we'd first need a "dmidecode"
output. For the other problem(s), I need to dig into some documentation and 2.4
source code first...

-- 
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From linux at dominikbrodowski.net  Mon Mar 15 11:50:36 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 15 Mar 2010 16:50:36 +0100
Subject: dev_pm_ops and PCMCIA sockets
Message-ID: <20100315155036.GA15101@comet.dominikbrodowski.net>

Hey,

attempting to use the "new-style" dev_pm_ops to handle the suspend / resume
needs of PCMCIA sockets gives me a headache. Maybe you can assist me in
doing it properly?

(1) PCMCIA/CardBus sockets all share one class:
	 struct class pcmcia_socket_class
    The "class" devices (which are struct *device now) are registered in
    drivers/pcmcia/cs.c . The functional ordering is:


	struct device *dev	-- some PCMCIA/CardBus bridge

	struct device *dev	-- of class pcmcia_socket_class; represents
				   the socket. One bridge may have mutliple
				   sockets.

	struct device *dev	-- of bus "pcmcia" or "pci"; represents the
				   PCMCIA/CardBus card. One card is in one
				   socket; but one card may have multiple
				   "pcmcia" or "pci" devices.


(2) For suspend, we need the following order:

	1) CardBus and PCMCIA cards themselves;
	   IRQs may be on.

	   For CardBus, this is well handled by the PCI subsystem; for
	   PCMCIA cards, we currently rely on an old-style "suspend"
	   callback in struct bus_type .

	2) the PCMCIA/CardBus socket ("class devices"); IRQs may be on

	   Currently, we rely on an ugly, custom callback mechanism. Quoting
	   drivers/pcmcia/cs.c:

	    * socket drivers are expected to use the following callbacks in
	    * their .drv struct:
	    *  - pcmcia_socket_dev_suspend
	    *  - pcmcia_socket_dev_resume
	    * These functions check for the appropriate struct pcmcia_soket arrays,
	    * and pass them to the low-level functions pcmcia_{suspend,resume}_socket

	3) The PCMCIA/CardBus bridge devices; both with IRQs on and off

	   For example, yenta_socket appropriately uses "struct dev_pm_ops".


(3) For resume, it's a bit more complicated:

	1) The PCMCIA/CardBus bridge devices with IRQs off

	2) The PCMCIA/CardBus sockets ("class devices") with IRQs off

	3) the PCMCIA/CardBus bridge devices with IRQs on

	4) The PCMCIA/CardBus sockets ("class devices") with IRQs on

	5) CardBus and PCMCIA cards themselves


(4) A first attempt to use struct dev_pm_ops in struct class pcmcia_socket_class

+ const struct dev_pm_ops pcmcia_socket_pm_ops = {
+ 	/* dev_suspend, dev_resume may be called with IRQs enabled */
+ 	SET_SYSTEM_SLEEP_PM_OPS(pcmcia_socket_classdev_suspend,
+ 				pcmcia_socket_classdev_resume)
+ 
+ 	/* early resume must be called with IRQs disabled */
+ 	.resume_noirq = pcmcia_socket_classdev_resume_noirq,
+ 	.thaw_noirq = pcmcia_socket_classdev_resume_noirq,
+ 	.restore_noirq = pcmcia_socket_classdev_resume_noirq,
+ };

    lead to the following issues:

     a) resume_noirq never got called. Haven't tried thaw_noirq and
	restore_noirq so far.

     b) If I read the information about ordering in Documentation/power/devices.txt
        correctly, even a functioning _noirq callback for classes would
	cause the order for suspend to be:

	- IRQs on, classes first, devices next:
		PCMCIA/CardBus socket (is 1, should be 2)
		PCMCIA/CardBus cards (is 2, should be 1)

		PCMCIA/CardBus bridge devices (is 3)

	- IRQs off:
		PCMCIA/CardBus bridge devices (is 3)

        and for resume to be:

	- IRQs off, devices first, classes next:

		PCMCIA/CardBus bridge devices (is 1)
		PCMCIA/CardBus socket         (is 2)

	- IRQs on, devices first, classes next:

		PCMCIA/CardBus bridge	      (is 3)
		PCMCIA/CardBus cards	      (is 4, should be 5)
		PCMCIA/CardBus socket	      (is 5, should be 4)


Any ideas on how to resolve these issues using the new-stlye dev_pm_ops?

Best,
	Dominik


From stern at rowland.harvard.edu  Mon Mar 15 13:09:55 2010
From: stern at rowland.harvard.edu (Alan Stern)
Date: Mon, 15 Mar 2010 13:09:55 -0400 (EDT)
Subject: dev_pm_ops and PCMCIA sockets
In-Reply-To: <20100315155036.GA15101@comet.dominikbrodowski.net>
Message-ID: <Pine.LNX.4.44L0.1003151247470.1257-100000@iolanthe.rowland.org>

On Mon, 15 Mar 2010, Dominik Brodowski wrote:

> Hey,
> 
> attempting to use the "new-style" dev_pm_ops to handle the suspend / resume
> needs of PCMCIA sockets gives me a headache. Maybe you can assist me in
> doing it properly?
> 
> (1) PCMCIA/CardBus sockets all share one class:
> 	 struct class pcmcia_socket_class
>     The "class" devices (which are struct *device now) are registered in
>     drivers/pcmcia/cs.c . The functional ordering is:
> 
> 
> 	struct device *dev	-- some PCMCIA/CardBus bridge

On some bus, such as PCI, right?

> 	struct device *dev	-- of class pcmcia_socket_class; represents
> 				   the socket. One bridge may have mutliple
> 				   sockets.

This is the "class" device, not registered on any bus, right?

> 	struct device *dev	-- of bus "pcmcia" or "pci"; represents the
> 				   PCMCIA/CardBus card. One card is in one
> 				   socket; but one card may have multiple
> 				   "pcmcia" or "pci" devices.
> 
> 
> (2) For suspend, we need the following order:
> 
> 	1) CardBus and PCMCIA cards themselves;
> 	   IRQs may be on.
> 
> 	   For CardBus, this is well handled by the PCI subsystem; for
> 	   PCMCIA cards, we currently rely on an old-style "suspend"
> 	   callback in struct bus_type .
> 
> 	2) the PCMCIA/CardBus socket ("class devices"); IRQs may be on
> 
> 	   Currently, we rely on an ugly, custom callback mechanism. Quoting
> 	   drivers/pcmcia/cs.c:
> 
> 	    * socket drivers are expected to use the following callbacks in
> 	    * their .drv struct:
> 	    *  - pcmcia_socket_dev_suspend
> 	    *  - pcmcia_socket_dev_resume
> 	    * These functions check for the appropriate struct pcmcia_soket arrays,
> 	    * and pass them to the low-level functions pcmcia_{suspend,resume}_socket

Okay, these callbacks could theoretically be put into a class-level
dev_pm_ops structure.

> 	3) The PCMCIA/CardBus bridge devices; both with IRQs on and off
> 
> 	   For example, yenta_socket appropriately uses "struct dev_pm_ops".
> 
> 
> (3) For resume, it's a bit more complicated:
> 
> 	1) The PCMCIA/CardBus bridge devices with IRQs off
> 
> 	2) The PCMCIA/CardBus sockets ("class devices") with IRQs off

It's a little odd that sockets need to have a noirq resume stage but
not a noirq suspend stage.

> 	3) the PCMCIA/CardBus bridge devices with IRQs on
> 
> 	4) The PCMCIA/CardBus sockets ("class devices") with IRQs on
> 
> 	5) CardBus and PCMCIA cards themselves
> 
> 
> (4) A first attempt to use struct dev_pm_ops in struct class pcmcia_socket_class
> 
> + const struct dev_pm_ops pcmcia_socket_pm_ops = {
> + 	/* dev_suspend, dev_resume may be called with IRQs enabled */
> + 	SET_SYSTEM_SLEEP_PM_OPS(pcmcia_socket_classdev_suspend,
> + 				pcmcia_socket_classdev_resume)
> + 
> + 	/* early resume must be called with IRQs disabled */
> + 	.resume_noirq = pcmcia_socket_classdev_resume_noirq,
> + 	.thaw_noirq = pcmcia_socket_classdev_resume_noirq,
> + 	.restore_noirq = pcmcia_socket_classdev_resume_noirq,
> + };
> 
>     lead to the following issues:
> 
>      a) resume_noirq never got called. Haven't tried thaw_noirq and
> 	restore_noirq so far.

They won't be called either.  I don't know whether this counts as a bug 
or a feature, but the fact is that currently the PM core doesn't invoke 
the noirq callbacks for classes or types -- only for buses.

If Rafael agrees that it is a bug, then it should be easy enough to 
fix.

>      b) If I read the information about ordering in Documentation/power/devices.txt
>         correctly, even a functioning _noirq callback for classes would
> 	cause the order for suspend to be:
> 
> 	- IRQs on, classes first, devices next:
> 		PCMCIA/CardBus socket (is 1, should be 2)
> 		PCMCIA/CardBus cards (is 2, should be 1)
> 
> 		PCMCIA/CardBus bridge devices (is 3)
> 
> 	- IRQs off:
> 		PCMCIA/CardBus bridge devices (is 3)
> 
>         and for resume to be:
> 
> 	- IRQs off, devices first, classes next:
> 
> 		PCMCIA/CardBus bridge devices (is 1)
> 		PCMCIA/CardBus socket         (is 2)
> 
> 	- IRQs on, devices first, classes next:
> 
> 		PCMCIA/CardBus bridge	      (is 3)
> 		PCMCIA/CardBus cards	      (is 4, should be 5)
> 		PCMCIA/CardBus socket	      (is 5, should be 4)

No, that's not how it works.  For suspend, each phase (IRQs off and
IRQs on) goes up the device tree.  And for each device during the IRQs
on phase, the PM core invokes class callbacks, then type, then bus, so
you'd get:

	IRQs on:
		cards (class, type, bus),
		then sockets (class, type, bus),
		then bridges (class, type, bus)

	IRQs off:
		cards (bus only),
		then sockets (bus only),
		then bridges (bus only).

Note that in the IRQs-on phase, there can be legacy callbacks for the 
class and bus, but not for the type.

Resume works exactly the same as this, but in the reverse order.  
According to your description, this should be what you need.

> Any ideas on how to resolve these issues using the new-stlye dev_pm_ops?

Assuming you don't want to put the socket devices on a bus (there 
probably is no suitable bus anyway), the answer is to add class and 
type noirq callbacks.  Take a look at device_suspend_noirq() and 
device_resume_noirq() in drivers/base/power/main.c to see what's 
involved.

Alan Stern



From linux at dominikbrodowski.net  Mon Mar 15 13:27:44 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 15 Mar 2010 18:27:44 +0100
Subject: dev_pm_ops and PCMCIA sockets
In-Reply-To: <Pine.LNX.4.44L0.1003151247470.1257-100000@iolanthe.rowland.org>
References: <20100315155036.GA15101@comet.dominikbrodowski.net>
	<Pine.LNX.4.44L0.1003151247470.1257-100000@iolanthe.rowland.org>
Message-ID: <20100315172744.GA18371@isilmar.linta.de>

Alan,

thanks for your feedback!

On Mon, Mar 15, 2010 at 01:09:55PM -0400, Alan Stern wrote:
> On Mon, 15 Mar 2010, Dominik Brodowski wrote:
> 
> > Hey,
> > 
> > attempting to use the "new-style" dev_pm_ops to handle the suspend / resume
> > needs of PCMCIA sockets gives me a headache. Maybe you can assist me in
> > doing it properly?
> > 
> > (1) PCMCIA/CardBus sockets all share one class:
> > 	 struct class pcmcia_socket_class
> >     The "class" devices (which are struct *device now) are registered in
> >     drivers/pcmcia/cs.c . The functional ordering is:
> > 
> > 
> > 	struct device *dev	-- some PCMCIA/CardBus bridge
> 
> On some bus, such as PCI, right?

Exactly. Might be PCI, might be a platform device, might be anything...

> > 	struct device *dev	-- of class pcmcia_socket_class; represents
> > 				   the socket. One bridge may have mutliple
> > 				   sockets.
> 
> This is the "class" device, not registered on any bus, right?

Right.

> > 	struct device *dev	-- of bus "pcmcia" or "pci"; represents the
> > 				   PCMCIA/CardBus card. One card is in one
> > 				   socket; but one card may have multiple
> > 				   "pcmcia" or "pci" devices.
> > 
> > 
> > (2) For suspend, we need the following order:
> > 
> > 	1) CardBus and PCMCIA cards themselves;
> > 	   IRQs may be on.
> > 
> > 	   For CardBus, this is well handled by the PCI subsystem; for
> > 	   PCMCIA cards, we currently rely on an old-style "suspend"
> > 	   callback in struct bus_type .
> > 
> > 	2) the PCMCIA/CardBus socket ("class devices"); IRQs may be on
> > 
> > 	   Currently, we rely on an ugly, custom callback mechanism. Quoting
> > 	   drivers/pcmcia/cs.c:
> > 
> > 	    * socket drivers are expected to use the following callbacks in
> > 	    * their .drv struct:
> > 	    *  - pcmcia_socket_dev_suspend
> > 	    *  - pcmcia_socket_dev_resume
> > 	    * These functions check for the appropriate struct pcmcia_soket arrays,
> > 	    * and pass them to the low-level functions pcmcia_{suspend,resume}_socket
> 
> Okay, these callbacks could theoretically be put into a class-level
> dev_pm_ops structure.
> 
> > 	3) The PCMCIA/CardBus bridge devices; both with IRQs on and off
> > 
> > 	   For example, yenta_socket appropriately uses "struct dev_pm_ops".
> > 
> > 
> > (3) For resume, it's a bit more complicated:
> > 
> > 	1) The PCMCIA/CardBus bridge devices with IRQs off
> > 
> > 	2) The PCMCIA/CardBus sockets ("class devices") with IRQs off
> 
> It's a little odd that sockets need to have a noirq resume stage but
> not a noirq suspend stage.

Ah, indeed it seems we really need to use the noirq suspend stage, but not
the irq suspend stage. For this asymmetry, see bug 14334 and the commit  
9905d1b411946fb3fb228e8c6529fd94afda8a92 by Rafael.

> > + const struct dev_pm_ops pcmcia_socket_pm_ops = {
> > + 	/* dev_suspend, dev_resume may be called with IRQs enabled */
> > + 	SET_SYSTEM_SLEEP_PM_OPS(pcmcia_socket_classdev_suspend,
> > + 				pcmcia_socket_classdev_resume)
> > + 
> > + 	/* early resume must be called with IRQs disabled */
> > + 	.resume_noirq = pcmcia_socket_classdev_resume_noirq,
> > + 	.thaw_noirq = pcmcia_socket_classdev_resume_noirq,
> > + 	.restore_noirq = pcmcia_socket_classdev_resume_noirq,
> > + };
> > 
> >     lead to the following issues:
> > 
> >      a) resume_noirq never got called. Haven't tried thaw_noirq and
> > 	restore_noirq so far.
> 
> They won't be called either.  I don't know whether this counts as a bug 
> or a feature, but the fact is that currently the PM core doesn't invoke 
> the noirq callbacks for classes or types -- only for buses.
> 
> If Rafael agrees that it is a bug, then it should be easy enough to 
> fix.
> 
> >      b) If I read the information about ordering in Documentation/power/devices.txt
> >         correctly, even a functioning _noirq callback for classes would
> > 	cause the order for suspend to be:
> > 
> > 	- IRQs on, classes first, devices next:
> > 		PCMCIA/CardBus socket (is 1, should be 2)
> > 		PCMCIA/CardBus cards (is 2, should be 1)
> > 
> > 		PCMCIA/CardBus bridge devices (is 3)
> > 
> > 	- IRQs off:
> > 		PCMCIA/CardBus bridge devices (is 3)
> > 
> >         and for resume to be:
> > 
> > 	- IRQs off, devices first, classes next:
> > 
> > 		PCMCIA/CardBus bridge devices (is 1)
> > 		PCMCIA/CardBus socket         (is 2)
> > 
> > 	- IRQs on, devices first, classes next:
> > 
> > 		PCMCIA/CardBus bridge	      (is 3)
> > 		PCMCIA/CardBus cards	      (is 4, should be 5)
> > 		PCMCIA/CardBus socket	      (is 5, should be 4)
> 
> No, that's not how it works.  For suspend, each phase (IRQs off and
> IRQs on) goes up the device tree.  And for each device during the IRQs
> on phase, the PM core invokes class callbacks, then type, then bus, so
> you'd get:
> 
> 	IRQs on:
> 		cards (class, type, bus),
> 		then sockets (class, type, bus),
> 		then bridges (class, type, bus)
> 
> 	IRQs off:
> 		cards (bus only),
> 		then sockets (bus only),
> 		then bridges (bus only).
> 
> Note that in the IRQs-on phase, there can be legacy callbacks for the 
> class and bus, but not for the type.
> 
> Resume works exactly the same as this, but in the reverse order.  
> According to your description, this should be what you need.

Indeed -- and that's excellent news. Thanks!

> > Any ideas on how to resolve these issues using the new-stlye dev_pm_ops?
> 
> Assuming you don't want to put the socket devices on a bus (there 
> probably is no suitable bus anyway), the answer is to add class and 
> type noirq callbacks.  Take a look at device_suspend_noirq() and 
> device_resume_noirq() in drivers/base/power/main.c to see what's 
> involved.

I'll do that, thanks.

Best,
	Dominik


From rjw at sisk.pl  Mon Mar 15 15:35:57 2010
From: rjw at sisk.pl (Rafael J. Wysocki)
Date: Mon, 15 Mar 2010 20:35:57 +0100
Subject: dev_pm_ops and PCMCIA sockets
In-Reply-To: <Pine.LNX.4.44L0.1003151247470.1257-100000@iolanthe.rowland.org>
References: <Pine.LNX.4.44L0.1003151247470.1257-100000@iolanthe.rowland.org>
Message-ID: <201003152035.57927.rjw@sisk.pl>

On Monday 15 March 2010, Alan Stern wrote:
> On Mon, 15 Mar 2010, Dominik Brodowski wrote:
> 
> > Hey,
> > 
> > attempting to use the "new-style" dev_pm_ops to handle the suspend / resume
> > needs of PCMCIA sockets gives me a headache. Maybe you can assist me in
> > doing it properly?
> > 
> > (1) PCMCIA/CardBus sockets all share one class:
> > 	 struct class pcmcia_socket_class
> >     The "class" devices (which are struct *device now) are registered in
> >     drivers/pcmcia/cs.c . The functional ordering is:
> > 
> > 
> > 	struct device *dev	-- some PCMCIA/CardBus bridge
> 
> On some bus, such as PCI, right?
> 
> > 	struct device *dev	-- of class pcmcia_socket_class; represents
> > 				   the socket. One bridge may have mutliple
> > 				   sockets.
> 
> This is the "class" device, not registered on any bus, right?
> 
> > 	struct device *dev	-- of bus "pcmcia" or "pci"; represents the
> > 				   PCMCIA/CardBus card. One card is in one
> > 				   socket; but one card may have multiple
> > 				   "pcmcia" or "pci" devices.
> > 
> > 
> > (2) For suspend, we need the following order:
> > 
> > 	1) CardBus and PCMCIA cards themselves;
> > 	   IRQs may be on.
> > 
> > 	   For CardBus, this is well handled by the PCI subsystem; for
> > 	   PCMCIA cards, we currently rely on an old-style "suspend"
> > 	   callback in struct bus_type .
> > 
> > 	2) the PCMCIA/CardBus socket ("class devices"); IRQs may be on
> > 
> > 	   Currently, we rely on an ugly, custom callback mechanism. Quoting
> > 	   drivers/pcmcia/cs.c:
> > 
> > 	    * socket drivers are expected to use the following callbacks in
> > 	    * their .drv struct:
> > 	    *  - pcmcia_socket_dev_suspend
> > 	    *  - pcmcia_socket_dev_resume
> > 	    * These functions check for the appropriate struct pcmcia_soket arrays,
> > 	    * and pass them to the low-level functions pcmcia_{suspend,resume}_socket
> 
> Okay, these callbacks could theoretically be put into a class-level
> dev_pm_ops structure.
> 
> > 	3) The PCMCIA/CardBus bridge devices; both with IRQs on and off
> > 
> > 	   For example, yenta_socket appropriately uses "struct dev_pm_ops".
> > 
> > 
> > (3) For resume, it's a bit more complicated:
> > 
> > 	1) The PCMCIA/CardBus bridge devices with IRQs off
> > 
> > 	2) The PCMCIA/CardBus sockets ("class devices") with IRQs off
> 
> It's a little odd that sockets need to have a noirq resume stage but
> not a noirq suspend stage.
> 
> > 	3) the PCMCIA/CardBus bridge devices with IRQs on
> > 
> > 	4) The PCMCIA/CardBus sockets ("class devices") with IRQs on
> > 
> > 	5) CardBus and PCMCIA cards themselves
> > 
> > 
> > (4) A first attempt to use struct dev_pm_ops in struct class pcmcia_socket_class
> > 
> > + const struct dev_pm_ops pcmcia_socket_pm_ops = {
> > + 	/* dev_suspend, dev_resume may be called with IRQs enabled */
> > + 	SET_SYSTEM_SLEEP_PM_OPS(pcmcia_socket_classdev_suspend,
> > + 				pcmcia_socket_classdev_resume)
> > + 
> > + 	/* early resume must be called with IRQs disabled */
> > + 	.resume_noirq = pcmcia_socket_classdev_resume_noirq,
> > + 	.thaw_noirq = pcmcia_socket_classdev_resume_noirq,
> > + 	.restore_noirq = pcmcia_socket_classdev_resume_noirq,
> > + };
> > 
> >     lead to the following issues:
> > 
> >      a) resume_noirq never got called. Haven't tried thaw_noirq and
> > 	restore_noirq so far.
> 
> They won't be called either.  I don't know whether this counts as a bug 
> or a feature, but the fact is that currently the PM core doesn't invoke 
> the noirq callbacks for classes or types -- only for buses.
> 
> If Rafael agrees that it is a bug, then it should be easy enough to 
> fix.

This was intentional, because there were no classes imlementing the "noirq"
callbacks in the "legacy" model.

We can add that just fine if necessary.

Rafael


From linux at dominikbrodowski.net  Mon Mar 15 16:59:03 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 15 Mar 2010 21:59:03 +0100
Subject: [RFC PATCH] power: support _noirq actions on device types and classes
In-Reply-To: <201003152035.57927.rjw@sisk.pl>
References: <Pine.LNX.4.44L0.1003151247470.1257-100000@iolanthe.rowland.org>
	<201003152035.57927.rjw@sisk.pl>
Message-ID: <20100315205903.GA7094@comet.dominikbrodowski.net>

Hey,

Does this look right? As PCMCIA seems to be the first user (for 2.6.35), I
can carry it if you prefer. Otherwise, we'd need to be careful that this
gets merged before the next big PCMCIA update for 2.6.35-rc1.

What's possible with this -- 66 insertions(+), 288 deletions(-) -- for the
PCMCIA subsystem can be seen here:

http://git.kernel.org/?p=linux/kernel/git/brodo/pcmcia-2.6.git;a=commitdiff;h=ac1986af0977c339dc6072f476e23a42103c980f


From: Dominik Brodowski <linux at dominikbrodowski.net>
Date: Mon, 15 Mar 2010 21:43:11 +0100
Subject: [PATCH] power: support _noirq actions on device types and classes

The new-style dev_pm_ops provide callbacks for both IRQs enabled
and disabled. However, the _noirq variants were only called for
buses registered with a device, not for classes and types.

In order to properly use dev_pm_ops in class pcmcia_socket_class,
support _noirq actions also on classes and types.

Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>

diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index d477f4d..941fcb8 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -439,8 +439,23 @@ static int device_resume_noirq(struct device *dev, pm_message_t state)
 	if (dev->bus && dev->bus->pm) {
 		pm_dev_dbg(dev, state, "EARLY ");
 		error = pm_noirq_op(dev, dev->bus->pm, state);
+		if (error)
+			goto End;
 	}
 
+	if (dev->type && dev->type->pm) {
+		pm_dev_dbg(dev, state, "EARLY type ");
+		error = pm_noirq_op(dev, dev->type->pm, state);
+		if (error)
+			goto End;
+	}
+
+	if (dev->class && dev->class->pm) {
+		pm_dev_dbg(dev, state, "EARLY class ");
+		error = pm_noirq_op(dev, dev->class->pm, state);
+	}
+
+End:
 	TRACE_RESUME(error);
 	return error;
 }
@@ -735,10 +750,26 @@ static int device_suspend_noirq(struct device *dev, pm_message_t state)
 {
 	int error = 0;
 
+	if (dev->class && dev->class->pm) {
+		pm_dev_dbg(dev, state, "LATE class ");
+		error = pm_noirq_op(dev, dev->class->pm, state);
+		if (error)
+			goto End;
+	}
+
+	if (dev->type && dev->type->pm) {
+		pm_dev_dbg(dev, state, "LATE type ");
+		error = pm_noirq_op(dev, dev->type->pm, state);
+		if (error)
+			goto End;
+	}
+
 	if (dev->bus && dev->bus->pm) {
 		pm_dev_dbg(dev, state, "LATE ");
 		error = pm_noirq_op(dev, dev->bus->pm, state);
 	}
+
+End:
 	return error;
 }
 


From rjw at sisk.pl  Mon Mar 15 17:44:15 2010
From: rjw at sisk.pl (Rafael J. Wysocki)
Date: Mon, 15 Mar 2010 22:44:15 +0100
Subject: [RFC PATCH] power: support _noirq actions on device types and
	classes
In-Reply-To: <20100315205903.GA7094@comet.dominikbrodowski.net>
References: <Pine.LNX.4.44L0.1003151247470.1257-100000@iolanthe.rowland.org>
	<201003152035.57927.rjw@sisk.pl>
	<20100315205903.GA7094@comet.dominikbrodowski.net>
Message-ID: <201003152244.15602.rjw@sisk.pl>

On Monday 15 March 2010, Dominik Brodowski wrote:
> Hey,
> 
> Does this look right?

Yes, it does.

> As PCMCIA seems to be the first user (for 2.6.35), I can carry it if you
> prefer.

Well, that would be better for linux-next too, but we'd need a documentation
update along with it.  Unfortunately, the documentation patch affected by this
change hasn't been merged yet. ;-)

I think I'll push the documentation update shortly and let you know when it's
in (/me hopes documentation updates count as fixes).

> Otherwise, we'd need to be careful that this
> gets merged before the next big PCMCIA update for 2.6.35-rc1.
> 
> What's possible with this -- 66 insertions(+), 288 deletions(-) -- for the
> PCMCIA subsystem can be seen here:
> 
> http://git.kernel.org/?p=linux/kernel/git/brodo/pcmcia-2.6.git;a=commitdiff;h=ac1986af0977c339dc6072f476e23a42103c980f
> 
> 
> From: Dominik Brodowski <linux at dominikbrodowski.net>
> Date: Mon, 15 Mar 2010 21:43:11 +0100
> Subject: [PATCH] power: support _noirq actions on device types and classes
> 
> The new-style dev_pm_ops provide callbacks for both IRQs enabled
> and disabled. However, the _noirq variants were only called for
> buses registered with a device, not for classes and types.
> 
> In order to properly use dev_pm_ops in class pcmcia_socket_class,
> support _noirq actions also on classes and types.
> 
> Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>

Acked-by: Rafael J. Wysocki <rjw at sisk.pl>

> diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
> index d477f4d..941fcb8 100644
> --- a/drivers/base/power/main.c
> +++ b/drivers/base/power/main.c
> @@ -439,8 +439,23 @@ static int device_resume_noirq(struct device *dev, pm_message_t state)
>  	if (dev->bus && dev->bus->pm) {
>  		pm_dev_dbg(dev, state, "EARLY ");
>  		error = pm_noirq_op(dev, dev->bus->pm, state);
> +		if (error)
> +			goto End;
>  	}
>  
> +	if (dev->type && dev->type->pm) {
> +		pm_dev_dbg(dev, state, "EARLY type ");
> +		error = pm_noirq_op(dev, dev->type->pm, state);
> +		if (error)
> +			goto End;
> +	}
> +
> +	if (dev->class && dev->class->pm) {
> +		pm_dev_dbg(dev, state, "EARLY class ");
> +		error = pm_noirq_op(dev, dev->class->pm, state);
> +	}
> +
> +End:
>  	TRACE_RESUME(error);
>  	return error;
>  }
> @@ -735,10 +750,26 @@ static int device_suspend_noirq(struct device *dev, pm_message_t state)
>  {
>  	int error = 0;
>  
> +	if (dev->class && dev->class->pm) {
> +		pm_dev_dbg(dev, state, "LATE class ");
> +		error = pm_noirq_op(dev, dev->class->pm, state);
> +		if (error)
> +			goto End;
> +	}
> +
> +	if (dev->type && dev->type->pm) {
> +		pm_dev_dbg(dev, state, "LATE type ");
> +		error = pm_noirq_op(dev, dev->type->pm, state);
> +		if (error)
> +			goto End;
> +	}
> +
>  	if (dev->bus && dev->bus->pm) {
>  		pm_dev_dbg(dev, state, "LATE ");
>  		error = pm_noirq_op(dev, dev->bus->pm, state);
>  	}
> +
> +End:
>  	return error;
>  }
>  
> 
> 



From jslaby at suse.cz  Tue Mar 16 10:57:44 2010
From: jslaby at suse.cz (Jiri Slaby)
Date: Tue, 16 Mar 2010 15:57:44 +0100
Subject: [PATCH 1/1] PCMCIA: resource, fix lock imbalance
Message-ID: <1268751464-15168-1-git-send-email-jslaby@suse.cz>

Stanse found that one error path (when alloc_skb fails) in netdev_tx
omits to unlock hw_priv->hwlock. Fix that by moving away from unlock in
each fail path. Unlock at one place instead.

Introduced in 94a819f80297e1f635a7cde4ed5317612e512ba7
(pcmcia: assert locking to struct pcmcia_device)

Signed-off-by: Jiri Slaby <jslaby at suse.cz>
Cc: Dominik Brodowski <linux at dominikbrodowski.net>
---
 drivers/pcmcia/pcmcia_resource.c |   28 ++++++++++++++++------------
 1 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index b2df041..add962a 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -256,6 +256,7 @@ int pcmcia_modify_configuration(struct pcmcia_device *p_dev,
 {
 	struct pcmcia_socket *s;
 	config_t *c;
+	int ret;
 
 	s = p_dev->socket;
 
@@ -264,13 +265,13 @@ int pcmcia_modify_configuration(struct pcmcia_device *p_dev,
 
 	if (!(s->state & SOCKET_PRESENT)) {
 		dev_dbg(&s->dev, "No card present\n");
-		mutex_unlock(&s->ops_mutex);
-		return -ENODEV;
+		ret = -ENODEV;
+		goto unlock;
 	}
 	if (!(c->state & CONFIG_LOCKED)) {
 		dev_dbg(&s->dev, "Configuration isnt't locked\n");
-		mutex_unlock(&s->ops_mutex);
-		return -EACCES;
+		ret = -EACCES;
+		goto unlock;
 	}
 
 	if (mod->Attributes & CONF_IRQ_CHANGE_VALID) {
@@ -286,7 +287,8 @@ int pcmcia_modify_configuration(struct pcmcia_device *p_dev,
 
 	if (mod->Attributes & CONF_VCC_CHANGE_VALID) {
 		dev_dbg(&s->dev, "changing Vcc is not allowed at this time\n");
-		return -EINVAL;
+		ret = -EINVAL;
+		goto unlock;
 	}
 
 	/* We only allow changing Vpp1 and Vpp2 to the same value */
@@ -294,21 +296,21 @@ int pcmcia_modify_configuration(struct pcmcia_device *p_dev,
 	    (mod->Attributes & CONF_VPP2_CHANGE_VALID)) {
 		if (mod->Vpp1 != mod->Vpp2) {
 			dev_dbg(&s->dev, "Vpp1 and Vpp2 must be the same\n");
-			mutex_unlock(&s->ops_mutex);
-			return -EINVAL;
+			ret = -EINVAL;
+			goto unlock;
 		}
 		s->socket.Vpp = mod->Vpp1;
 		if (s->ops->set_socket(s, &s->socket)) {
-			mutex_unlock(&s->ops_mutex);
 			dev_printk(KERN_WARNING, &s->dev,
 				   "Unable to set VPP\n");
-			return -EIO;
+			ret = -EIO;
+			goto unlock;
 		}
 	} else if ((mod->Attributes & CONF_VPP1_CHANGE_VALID) ||
 		   (mod->Attributes & CONF_VPP2_CHANGE_VALID)) {
 		dev_dbg(&s->dev, "changing Vcc is not allowed at this time\n");
-		mutex_unlock(&s->ops_mutex);
-		return -EINVAL;
+		ret = -EINVAL;
+		goto unlock;
 	}
 
 	if (mod->Attributes & CONF_IO_CHANGE_WIDTH) {
@@ -332,9 +334,11 @@ int pcmcia_modify_configuration(struct pcmcia_device *p_dev,
 			s->ops->set_io_map(s, &io_on);
 		}
 	}
+	ret = 0;
+unlock:
 	mutex_unlock(&s->ops_mutex);
 
-	return 0;
+	return ret;
 } /* modify_configuration */
 EXPORT_SYMBOL(pcmcia_modify_configuration);
 
-- 
1.7.0.1




From linux at dominikbrodowski.net  Tue Mar 16 12:57:13 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Tue, 16 Mar 2010 17:57:13 +0100
Subject: [PATCH 1/1] PCMCIA: resource, fix lock imbalance
In-Reply-To: <1268751464-15168-1-git-send-email-jslaby@suse.cz>
References: <1268751464-15168-1-git-send-email-jslaby@suse.cz>
Message-ID: <20100316165712.GA25385@comet.dominikbrodowski.net>

ACK, applied -- even though this code path is actually unused in current
kernels.

Thanks,
	Dominik

On Tue, Mar 16, 2010 at 03:57:44PM +0100, Jiri Slaby wrote:
> Stanse found that one error path (when alloc_skb fails) in netdev_tx
> omits to unlock hw_priv->hwlock. Fix that by moving away from unlock in
> each fail path. Unlock at one place instead.
> 
> Introduced in 94a819f80297e1f635a7cde4ed5317612e512ba7
> (pcmcia: assert locking to struct pcmcia_device)
> 
> Signed-off-by: Jiri Slaby <jslaby at suse.cz>
> Cc: Dominik Brodowski <linux at dominikbrodowski.net>
> ---
>  drivers/pcmcia/pcmcia_resource.c |   28 ++++++++++++++++------------
>  1 files changed, 16 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
> index b2df041..add962a 100644
> --- a/drivers/pcmcia/pcmcia_resource.c
> +++ b/drivers/pcmcia/pcmcia_resource.c
> @@ -256,6 +256,7 @@ int pcmcia_modify_configuration(struct pcmcia_device *p_dev,
>  {
>  	struct pcmcia_socket *s;
>  	config_t *c;
> +	int ret;
>  
>  	s = p_dev->socket;
>  
> @@ -264,13 +265,13 @@ int pcmcia_modify_configuration(struct pcmcia_device *p_dev,
>  
>  	if (!(s->state & SOCKET_PRESENT)) {
>  		dev_dbg(&s->dev, "No card present\n");
> -		mutex_unlock(&s->ops_mutex);
> -		return -ENODEV;
> +		ret = -ENODEV;
> +		goto unlock;
>  	}
>  	if (!(c->state & CONFIG_LOCKED)) {
>  		dev_dbg(&s->dev, "Configuration isnt't locked\n");
> -		mutex_unlock(&s->ops_mutex);
> -		return -EACCES;
> +		ret = -EACCES;
> +		goto unlock;
>  	}
>  
>  	if (mod->Attributes & CONF_IRQ_CHANGE_VALID) {
> @@ -286,7 +287,8 @@ int pcmcia_modify_configuration(struct pcmcia_device *p_dev,
>  
>  	if (mod->Attributes & CONF_VCC_CHANGE_VALID) {
>  		dev_dbg(&s->dev, "changing Vcc is not allowed at this time\n");
> -		return -EINVAL;
> +		ret = -EINVAL;
> +		goto unlock;
>  	}
>  
>  	/* We only allow changing Vpp1 and Vpp2 to the same value */
> @@ -294,21 +296,21 @@ int pcmcia_modify_configuration(struct pcmcia_device *p_dev,
>  	    (mod->Attributes & CONF_VPP2_CHANGE_VALID)) {
>  		if (mod->Vpp1 != mod->Vpp2) {
>  			dev_dbg(&s->dev, "Vpp1 and Vpp2 must be the same\n");
> -			mutex_unlock(&s->ops_mutex);
> -			return -EINVAL;
> +			ret = -EINVAL;
> +			goto unlock;
>  		}
>  		s->socket.Vpp = mod->Vpp1;
>  		if (s->ops->set_socket(s, &s->socket)) {
> -			mutex_unlock(&s->ops_mutex);
>  			dev_printk(KERN_WARNING, &s->dev,
>  				   "Unable to set VPP\n");
> -			return -EIO;
> +			ret = -EIO;
> +			goto unlock;
>  		}
>  	} else if ((mod->Attributes & CONF_VPP1_CHANGE_VALID) ||
>  		   (mod->Attributes & CONF_VPP2_CHANGE_VALID)) {
>  		dev_dbg(&s->dev, "changing Vcc is not allowed at this time\n");
> -		mutex_unlock(&s->ops_mutex);
> -		return -EINVAL;
> +		ret = -EINVAL;
> +		goto unlock;
>  	}
>  
>  	if (mod->Attributes & CONF_IO_CHANGE_WIDTH) {
> @@ -332,9 +334,11 @@ int pcmcia_modify_configuration(struct pcmcia_device *p_dev,
>  			s->ops->set_io_map(s, &io_on);
>  		}
>  	}
> +	ret = 0;
> +unlock:
>  	mutex_unlock(&s->ops_mutex);
>  
> -	return 0;
> +	return ret;
>  } /* modify_configuration */
>  EXPORT_SYMBOL(pcmcia_modify_configuration);
>  
> -- 
> 1.7.0.1
> 
> 


From linux at dominikbrodowski.net  Tue Mar 16 14:16:47 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Tue, 16 Mar 2010 19:16:47 +0100
Subject: [git pull] PCMCIA bugfixes for 2.6.34-rc2
Message-ID: <20100316181647.GA3464@comet.dominikbrodowski.net>

Linus,

some PCMCIA bugfixes for 2.6.34-rc2 are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git urgent

Please pull from that location. The diffstat and list of changes follows,
the individual diffs were sent (at least) to the linux-pcmcia list.

Thanks,
	Dominik

----

Dan Carpenter (1):
      pcmcia: add important if statement

Dominik Brodowski (2):
      pcmcia: pd6729, i82092: use parent (PCI) resources
      pcmcia: revert "irq probe can be done without risking an IRQ storm"

Jens K?nzer (3):
      pcmcia: honor saved flags in yenta_socket's I365_CSCINT register
      pcmcia: allow for cb_irq to differ from pci_dev's irq in yenta_socket
      pcmcia: re-route Cardbus IRQ to ISA on ti1130 bridges if necessary

Jiri Slaby (1):
      PCMCIA: resource, fix lock imbalance

Yoichi Yuasa (1):
      pcmcia/vrc4171: use local spinlock for device local lock.

 drivers/pcmcia/i82092.c          |    1 +
 drivers/pcmcia/i82365.h          |    1 +
 drivers/pcmcia/pcmcia_resource.c |   36 +++++++++++++----------------
 drivers/pcmcia/pd6729.c          |    1 +
 drivers/pcmcia/ti113x.h          |   37 ++++++++++++++++++++++++++++-
 drivers/pcmcia/vrc4171_card.c    |    5 ++-
 drivers/pcmcia/yenta_socket.c    |   46 +++++++++++++++++++++++--------------
 drivers/scsi/pcmcia/nsp_cs.c     |    1 +
 8 files changed, 86 insertions(+), 42 deletions(-)


From bugzilla-daemon at bugzilla.kernel.org  Wed Mar 17 08:07:55 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Wed, 17 Mar 2010 12:07:55 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@http.bugzilla.kernel.org/>
References: <bug-7304-4463@http.bugzilla.kernel.org/>
Message-ID: <201003171207.o2HC7ttY008947@demeter.kernel.org>

http://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #77 from Thomas Nemeth <nemeth.thomas at gmail.com>  2010-03-17 12:07:40 ---
(In reply to comment #76)
> That's good news. To create the DMI-based quirk, we'd first need a "dmidecode"
> output. For the other problem(s), I need to dig into some documentation and 2.4
> source code first...

   Ok. I'll provide you this information. Is there anything special needed
   to look for in the output ?

-- 
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From bugzilla-daemon at bugzilla.kernel.org  Wed Mar 17 15:24:57 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Wed, 17 Mar 2010 19:24:57 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@http.bugzilla.kernel.org/>
References: <bug-7304-4463@http.bugzilla.kernel.org/>
Message-ID: <201003171924.o2HJOvHn032541@demeter.kernel.org>

http://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #78 from Thomas Nemeth <nemeth.thomas at gmail.com>  2010-03-17 19:24:47 ---
Created an attachment (id=25571)
 --> (http://bugzilla.kernel.org/attachment.cgi?id=25571)
dmidecode output on 2.6.33 with IRQ 11 forced.

Here we have a problem.

dmidecode did not produce any output. On my work desktop, dmidecode worked
nice producing a lot of output, but on the target machine, nothing came out.
Just this message saying that it found nothing.

I have compiled the other softs in the dmidecode package. If you need some
more information, just tell me.

-- 
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From ccpgrinner at free.fr  Wed Mar 17 18:22:50 2010
From: ccpgrinner at free.fr (Cyrille GRINNER)
Date: Wed, 17 Mar 2010 23:22:50 +0100
Subject: [git pull] more PCMCIA updates for 2.6.34 (including ioctl
	deprecation)
In-Reply-To: <20100303084337.GA24920@comet.dominikbrodowski.net>
References: <20100303084337.GA24920@comet.dominikbrodowski.net>
Message-ID: <4BA1563A.5020404@free.fr>

Hello!

I'm really lost! I have a laptop running under U9.1 with a pcmcia USB2.0 
card adapter (NEC Chipset); it is not recognized when typing lspcmcia.
I just have the Socket 0 Bridge: [yenta_cardbus]...

pcmciautils is the latest available (I removed it and reinstalled it)

Is the solution in changing cardbus from Yenta to something else? But 
which one and where to modify the config?

Thanks for your support!

Cyrille


From linux at dominikbrodowski.net  Wed Mar 17 18:29:04 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Wed, 17 Mar 2010 23:29:04 +0100
Subject: [git pull] more PCMCIA updates for 2.6.34 (including ioctl
	deprecation)
In-Reply-To: <4BA1563A.5020404@free.fr>
References: <20100303084337.GA24920@comet.dominikbrodowski.net>
	<4BA1563A.5020404@free.fr>
Message-ID: <20100317222904.GA8665@isilmar.linta.de>

Hey,

could you post the output of "lspci" and "lspcmcia -vvv", please?

Best,
	Dominik


From ccpgrinner at free.fr  Thu Mar 18 02:31:26 2010
From: ccpgrinner at free.fr (ccpgrinner at free.fr)
Date: Thu, 18 Mar 2010 07:31:26 +0100
Subject: Thanks for your precious help!! PCMCIA USB2 ADAPTER U9.10 issue ;-(
Message-ID: <1268893886.4ba1c8be13180@imp.free.fr>




Hi!

Here are the outputs...

00:00.0 Host bridge: Intel Corporation 82815 815 Chipset Host Bridge and Memory
Controller Hub (rev 11)
00:02.0 VGA compatible controller: Intel Corporation 82815 Chipset Graphics
Controller (CGC) (rev 11)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 03)
00:1f.0 ISA bridge: Intel Corporation 82801BAM ISA Bridge (LPC) (rev 03)
00:1f.1 IDE interface: Intel Corporation 82801BAM IDE U100 Controller (rev 03)
00:1f.2 USB Controller: Intel Corporation 82801BA/BAM USB Controller #1 (rev 03)
00:1f.3 SMBus: Intel Corporation 82801BA/BAM SMBus Controller (rev 03)
00:1f.4 USB Controller: Intel Corporation 82801BA/BAM USB Controller #1 (rev 03)
00:1f.5 Multimedia audio controller: Intel Corporation 82801BA/BAM AC'97 Audio
Controller (rev 03)
00:1f.6 Modem: Intel Corporation 82801BA/BAM AC'97 Modem Controller (rev 03)
01:00.0 FireWire (IEEE 1394): Texas Instruments TSB43AA22 IEEE-1394 Controller
(PHY/Link Integrated) (rev 02)
01:02.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev 80)
01:02.1 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev 80)




*******



00:00.0 Host bridge: Intel Corporation 82815 815 Chipset Host Bridge and Memory
Controller Hub (rev 11)
	Subsystem: Sony Corporation Device 80df
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping-
SERR+ FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort-
<MAbort+ >SERR- <PERR- INTx-
	Latency: 0
	Capabilities: <access denied>
	Kernel driver in use: agpgart-intel
	Kernel modules: intel-agp

00:02.0 VGA compatible controller: Intel Corporation 82815 Chipset Graphics
Controller (CGC) (rev 11)
	Subsystem: Sony Corporation Device 80df
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping-
SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort-
<MAbort- >SERR- <PERR- INTx-
	Latency: 0
	Interrupt: pin A routed to IRQ 10
	Region 0: Memory at f8000000 (32-bit, prefetchable) [size=64M]
	Region 1: Memory at f4000000 (32-bit, non-prefetchable) [size=512K]
	Capabilities: <access denied>

00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 03)
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping-
SERR+ FastB2B- DisINTx-
	Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort-
<MAbort- >SERR- <PERR- INTx-
	Latency: 0
	Bus: primary=00, secondary=01, subordinate=09, sec-latency=64
	I/O behind bridge: 00003000-00003fff
	Memory behind bridge: f4100000-f41fffff
	Prefetchable memory behind bridge: 20000000-27ffffff
	Secondary status: 66MHz- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort-
<MAbort+ <SERR- <PERR-
	BridgeCtl: Parity- SERR- NoISA+ VGA- MAbort- >Reset- FastB2B-
		PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
	Kernel modules: shpchp

00:1f.0 ISA bridge: Intel Corporation 82801BAM ISA Bridge (LPC) (rev 03)
	Control: I/O+ Mem+ BusMaster+ SpecCycle+ MemWINV- VGASnoop- ParErr- Stepping-
SERR- FastB2B- DisINTx-
	Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort-
<MAbort- >SERR- <PERR- INTx-
	Latency: 0
	Kernel modules: iTCO_wdt, intel-rng

00:1f.1 IDE interface: Intel Corporation 82801BAM IDE U100 Controller (rev 03)
(prog-if 80 [Master])
	Subsystem: Sony Corporation Device 80df
	Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping-
SERR- FastB2B- DisINTx-
	Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort-
<MAbort- >SERR- <PERR- INTx-
	Latency: 0
	Region 0: [virtual] Memory at 000001f0 (32-bit, non-prefetchable) [disabled]
[size=8]
	Region 1: [virtual] Memory at 000003f0 (type 3, non-prefetchable) [disabled]
[size=1]
	Region 2: [virtual] Memory at 00000170 (32-bit, non-prefetchable) [disabled]
[size=8]
	Region 3: [virtual] Memory at 00000370 (type 3, non-prefetchable) [disabled]
[size=1]
	Region 4: I/O ports at 1800 [size=16]
	Kernel driver in use: ata_piix

00:1f.2 USB Controller: Intel Corporation 82801BA/BAM USB Controller #1 (rev 03)
	Subsystem: Sony Corporation Device 80df
	Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping-
SERR- FastB2B- DisINTx-
	Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort-
<MAbort- >SERR- <PERR- INTx-
	Latency: 0
	Interrupt: pin D routed to IRQ 9
	Region 4: I/O ports at 1820 [size=32]
	Kernel driver in use: uhci_hcd

00:1f.3 SMBus: Intel Corporation 82801BA/BAM SMBus Controller (rev 03)
	Subsystem: Sony Corporation Device 80df
	Control: I/O+ Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping-
SERR- FastB2B- DisINTx-
	Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort-
<MAbort- >SERR- <PERR- INTx-
	Interrupt: pin B routed to IRQ 5
	Region 4: I/O ports at 1810 [size=16]
	Kernel modules: i2c-i801

00:1f.4 USB Controller: Intel Corporation 82801BA/BAM USB Controller #1 (rev 03)
	Subsystem: Sony Corporation Device 80df
	Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping-
SERR- FastB2B- DisINTx-
	Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort-
<MAbort- >SERR- <PERR- INTx-
	Latency: 0
	Interrupt: pin C routed to IRQ 11
	Region 4: I/O ports at 2400 [size=32]
	Kernel driver in use: uhci_hcd

00:1f.5 Multimedia audio controller: Intel Corporation 82801BA/BAM AC'97 Audio
Controller (rev 03)
	Subsystem: Sony Corporation Device 80df
	Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping-
SERR- FastB2B- DisINTx-
	Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort-
<MAbort- >SERR- <PERR- INTx-
	Latency: 0
	Interrupt: pin B routed to IRQ 5
	Region 0: I/O ports at 1c00 [size=256]
	Region 1: I/O ports at 1840 [size=64]
	Kernel driver in use: Intel ICH
	Kernel modules: snd-intel8x0

00:1f.6 Modem: Intel Corporation 82801BA/BAM AC'97 Modem Controller (rev 03)
	Subsystem: Sony Corporation Device 80df
	Control: I/O+ Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping-
SERR- FastB2B- DisINTx-
	Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort-
<MAbort- >SERR- <PERR- INTx-
	Interrupt: pin B routed to IRQ 5
	Region 0: I/O ports at 2000 [size=256]
	Region 1: I/O ports at 1880 [size=128]
	Kernel modules: snd-intel8x0m

01:00.0 FireWire (IEEE 1394): Texas Instruments TSB43AA22 IEEE-1394 Controller
(PHY/Link Integrated) (rev 02) (prog-if 10)
	Subsystem: Sony Corporation Device 80df
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping-
SERR+ FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort-
<MAbort- >SERR- <PERR- INTx-
	Latency: 64 (750ns min, 1000ns max), Cache Line Size: 32 bytes
	Interrupt: pin A routed to IRQ 0
	Region 0: Memory at f4104000 (32-bit, non-prefetchable) [size=2K]
	Region 1: Memory at f4100000 (32-bit, non-prefetchable) [size=16K]
	Capabilities: <access denied>
	Kernel modules: firewire-ohci, ohci1394

01:02.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev 80)
	Subsystem: Sony Corporation Device 80df
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping-
SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort-
<MAbort- >SERR- <PERR- INTx-
	Latency: 168
	Interrupt: pin A routed to IRQ 0
	Region 0: Memory at f4105000 (32-bit, non-prefetchable) [size=4K]
	Bus: primary=01, secondary=02, subordinate=05, sec-latency=176
	Memory window 0: 20000000-23fff000 (prefetchable)
	Memory window 1: 28000000-2bfff000
	I/O window 0: 00003000-000030ff
	I/O window 1: 00003400-000034ff
	BridgeCtl: Parity- SERR- ISA- VGA- MAbort- >Reset- 16bInt- PostWrite+
	16-bit legacy interface ports at 0001
	Kernel driver in use: yenta_cardbus
	Kernel modules: yenta_socket

01:02.1 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev 80)
	Subsystem: Sony Corporation Device 80df
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping-
SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort-
<MAbort- >SERR- <PERR- INTx-
	Latency: 168
	Interrupt: pin B routed to IRQ 0
	Region 0: Memory at f4106000 (32-bit, non-prefetchable) [size=4K]
	Bus: primary=01, secondary=06, subordinate=09, sec-latency=176
	Memory window 0: 24000000-27fff000 (prefetchable)
	Memory window 1: 2c000000-2ffff000
	I/O window 0: 00003800-000038ff
	I/O window 1: 00003c00-00003cff
	BridgeCtl: Parity- SERR- ISA- VGA- MAbort- >Reset- 16bInt+ PostWrite+
	16-bit legacy interface ports at 0001
	Kernel driver in use: yenta_cardbus
	Kernel modules: yenta_socket






From linux at dominikbrodowski.net  Thu Mar 18 02:58:30 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Thu, 18 Mar 2010 07:58:30 +0100
Subject: PCMCIA USB2 ADAPTER U9.10 issue ;-(
In-Reply-To: <1268893886.4ba1c8be13180@imp.free.fr>
References: <1268893886.4ba1c8be13180@imp.free.fr>
Message-ID: <20100318065830.GA6432@isilmar.linta.de>

Hey,

> 01:02.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev 80)
> 	Interrupt: pin A routed to IRQ 0

> 01:02.1 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev 80)
> 	Interrupt: pin B routed to IRQ 0

It looks like the IRQ routing is broken -- Could you try out the following
boot options, please?

acpi=noirq

irqfixup

pci=biosirq

pci=usepirqmask

If all this fails, please send a complete "dmesg" output. And if anything
helps, please report so, too. Thanks!

Best,
	Dominik


From ccpgrinner at free.fr  Thu Mar 18 08:33:48 2010
From: ccpgrinner at free.fr (Cyrille GRINNER)
Date: Thu, 18 Mar 2010 13:33:48 +0100
Subject: PCMCIA issue vs. ACPI + BIOS
Message-ID: <4BA21DAC.1080807@free.fr>

Hello Dominik!

I tried acpi=force as a boot option; the pcmcia usb2.0 module is 
recognized (blinking usb key) but the machine doesn't start; it freezes 
after a fraction of second...

Here is what I can read on the screen:

[     0.032223]    ACPI: Core revision 20090521
[     0.04........]    ACPI: setting ELCR to 0200 (from 0e20)Core 
revision 20090521
[     0.04........]    weird, boot CPU (#0) not listed by the BIOS.
[     0.04........]    SMP motherboard not detected.
[     0.04........]    Local APIC not detected. Using dummy APIC emulation.
[     0.04........]    SMP disabled.
[     0.05........]    Brought up 1 CPUs.
....
[     0.05........]    ACPI: bus bridge pci registered
[     0.06........]    PCI: PCI BIOS revision 2.10 entry at 0xfd9b0, 
last bus=1
[     0.06........]    PCI: Using configuration type 1 for base access


and last line before freezing:

[     0.069000]   bio: create slab <bio-0> at 0


From ccpgrinner at free.fr  Thu Mar 18 12:31:39 2010
From: ccpgrinner at free.fr (Cyrille GRINNER)
Date: Thu, 18 Mar 2010 17:31:39 +0100
Subject: PCMCIA BIOS
Message-ID: <4BA2556B.7090601@free.fr>

Hi again,

bizarrely the pcmcia module is recognized under Windows 98 on the same 
machine! Of course I have a dual boot but mainly uses Ubuntu ;-) Usually 
Linux is far better than Windows... Grrrr....

Cyrille


From cyrille at grinner.fr  Thu Mar 18 17:54:50 2010
From: cyrille at grinner.fr (Cyrille GRINNER)
Date: Thu, 18 Mar 2010 22:54:50 +0100
Subject: old vaios are not Linux pcmcia ready ;-(
Message-ID: <1268949290.4ba2a12a6c7a5@imp.free.fr>


Hi!

If I boot without options, then the system does not boot; either restarts after
a few secs or freezes with the text I sent you... ;-(

Cyrille

PS: Thanks again for identifying the source of the problem! Now I'm just stuck
with a more precise idea of what goes wrong ;-(


From komurojun-mbn at nifty.com  Fri Mar 19 17:39:19 2010
From: komurojun-mbn at nifty.com (Komuro)
Date: Sat, 20 Mar 2010 06:39:19 +0900
Subject: [PATCH kernel 2.6.34-rc1-git7] pd6729: Coding Style fixes
In-Reply-To: <20100228153933.f6fe6f81.komurojun-mbn@nifty.com>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<1257971899-9274-9-git-send-email-linux@dominikbrodowski.net>
	<20091213212556.03d83e1f.komurojun-mbn@nifty.com>
	<20100228153933.f6fe6f81.komurojun-mbn@nifty.com>
Message-ID: <20100320063919.f7cd4421.komurojun-mbn@nifty.com>



Signed-off-by: Komuro <komurojun-mbn at nifty.com>

---

--- linux-2.6.34-rc1/drivers/pcmcia/pd6729.c.orig2	2010-03-14 05:45:04.000000000 +0900
+++ linux-2.6.34-rc1/drivers/pcmcia/pd6729.c	2010-03-19 06:24:16.000000000 +0900
@@ -14,13 +14,13 @@
 #include <linux/workqueue.h>
 #include <linux/interrupt.h>
 #include <linux/device.h>
+#include <linux/io.h>
 
 #include <pcmcia/cs_types.h>
 #include <pcmcia/ss.h>
 #include <pcmcia/cs.h>
 
 #include <asm/system.h>
-#include <asm/io.h>
 
 #include "pd6729.h"
 #include "i82365.h"
@@ -222,9 +222,9 @@ static irqreturn_t pd6729_interrupt(int 
 						? SS_READY : 0;
 			}
 
-			if (events) {
+			if (events)
 				pcmcia_parse_events(&socket[i].socket, events);
-			}
+
 			active |= events;
 		}
 
@@ -256,9 +256,8 @@ static int pd6729_get_status(struct pcmc
 	status = indirect_read(socket, I365_STATUS);
 	*value = 0;
 
-	if ((status & I365_CS_DETECT) == I365_CS_DETECT) {
+	if ((status & I365_CS_DETECT) == I365_CS_DETECT)
 		*value |= SS_DETECT;
-	}
 
 	/*
 	 * IO cards have a different meaning of bits 0,1
@@ -308,7 +307,7 @@ static int pd6729_set_socket(struct pcmc
 	socket->card_irq = state->io_irq;
 
 	reg = 0;
- 	/* The reset bit has "inverse" logic */
+	/* The reset bit has "inverse" logic */
 	if (!(state->flags & SS_RESET))
 		reg |= I365_PC_RESET;
 	if (state->flags & SS_IOCARD)
@@ -380,7 +379,7 @@ static int pd6729_set_socket(struct pcmc
 		indirect_write(socket, I365_POWER, reg);
 
 	if (irq_mode == 1) {
-		 /* all interrupts are to be done as PCI interrupts */
+		/* all interrupts are to be done as PCI interrupts */
 		data = PD67_EC1_INV_MGMT_IRQ | PD67_EC1_INV_CARD_IRQ;
 	} else
 		data = 0;
@@ -391,9 +390,9 @@ static int pd6729_set_socket(struct pcmc
 	/* Enable specific interrupt events */
 
 	reg = 0x00;
-	if (state->csc_mask & SS_DETECT) {
+	if (state->csc_mask & SS_DETECT)
 		reg |= I365_CSC_DETECT;
-	}
+
 	if (state->flags & SS_IOCARD) {
 		if (state->csc_mask & SS_STSCHG)
 			reg |= I365_CSC_STSCHG;
@@ -450,9 +449,12 @@ static int pd6729_set_io_map(struct pcmc
 
 	ioctl = indirect_read(socket, I365_IOCTL) & ~I365_IOCTL_MASK(map);
 
-	if (io->flags & MAP_0WS) ioctl |= I365_IOCTL_0WS(map);
-	if (io->flags & MAP_16BIT) ioctl |= I365_IOCTL_16BIT(map);
-	if (io->flags & MAP_AUTOSZ) ioctl |= I365_IOCTL_IOCS16(map);
+	if (io->flags & MAP_0WS)
+		ioctl |= I365_IOCTL_0WS(map);
+	if (io->flags & MAP_16BIT)
+		ioctl |= I365_IOCTL_16BIT(map);
+	if (io->flags & MAP_AUTOSZ)
+		ioctl |= I365_IOCTL_IOCS16(map);
 
 	indirect_write(socket, I365_IOCTL, ioctl);
 
@@ -497,7 +499,7 @@ static int pd6729_set_mem_map(struct pcm
 
 	/* write the stop address */
 
-	i= (mem->res->end >> 12) & 0x0fff;
+	i = (mem->res->end >> 12) & 0x0fff;
 	switch (to_cycles(mem->speed)) {
 	case 0:
 		break;
@@ -563,7 +565,7 @@ static int pd6729_init(struct pcmcia_soc
 
 /* the pccard structure and its functions */
 static struct pccard_operations pd6729_operations = {
-	.init 			= pd6729_init,
+	.init			= pd6729_init,
 	.get_status		= pd6729_get_status,
 	.set_socket		= pd6729_set_socket,
 	.set_io_map		= pd6729_set_io_map,
@@ -578,8 +580,13 @@ static irqreturn_t pd6729_test(int irq, 
 
 static int pd6729_check_irq(int irq)
 {
-	if (request_irq(irq, pd6729_test, IRQF_PROBE_SHARED, "x", pd6729_test)
-		!= 0) return -1;
+	int ret;
+
+	ret = request_irq(irq, pd6729_test, IRQF_PROBE_SHARED, "x",
+			  pd6729_test);
+	if (ret)
+		return -1;
+
 	free_irq(irq, pd6729_test);
 	return 0;
 }
@@ -591,7 +598,7 @@ static u_int __devinit pd6729_isa_scan(v
 
 	if (irq_mode == 1) {
 		printk(KERN_INFO "pd6729: PCI card interrupts, "
-						"PCI status changes\n");
+		       "PCI status changes\n");
 		return 0;
 	}
 
@@ -607,9 +614,10 @@ static u_int __devinit pd6729_isa_scan(v
 		if (mask & (1<<i))
 			printk("%s%d", ((mask & ((1<<i)-1)) ? "," : ""), i);
 
-	if (mask == 0) printk("none!");
-
-	printk("  polling status changes.\n");
+	if (mask == 0)
+		printk("none!");
+	else
+		printk("  polling status changes.\n");
 
 	return mask;
 }
@@ -624,11 +632,16 @@ static int __devinit pd6729_pci_probe(st
 
 	socket = kzalloc(sizeof(struct pd6729_socket) * MAX_SOCKETS,
 			 GFP_KERNEL);
-	if (!socket)
+	if (!socket) {
+		dev_warn(&dev->dev, "failed to kzalloc socket.\n");
 		return -ENOMEM;
+	}
 
-	if ((ret = pci_enable_device(dev)))
+	ret = pci_enable_device(dev);
+	if (ret) {
+		dev_warn(&dev->dev, "failed to enable pci_device.\n");
 		goto err_out_free_mem;
+	}
 
 	if (!pci_resource_start(dev, 0)) {
 		dev_warn(&dev->dev, "refusing to load the driver as the "
@@ -639,7 +652,7 @@ static int __devinit pd6729_pci_probe(st
 	dev_info(&dev->dev, "Cirrus PD6729 PCI to PCMCIA Bridge at 0x%llx "
 		"on irq %d\n",
 		(unsigned long long)pci_resource_start(dev, 0), dev->irq);
- 	/*
+	/*
 	 * Since we have no memory BARs some firmware may not
 	 * have had PCI_COMMAND_MEMORY enabled, yet the device needs it.
 	 */
@@ -685,8 +698,9 @@ static int __devinit pd6729_pci_probe(st
 	pci_set_drvdata(dev, socket);
 	if (irq_mode == 1) {
 		/* Register the interrupt handler */
-		if ((ret = request_irq(dev->irq, pd6729_interrupt, IRQF_SHARED,
-							"pd6729", socket))) {
+		ret = request_irq(dev->irq, pd6729_interrupt, IRQF_SHARED,
+				  "pd6729", socket);
+		if (ret) {
 			dev_err(&dev->dev, "Failed to register irq %d\n",
 				dev->irq);
 			goto err_out_free_res;


From linux at dominikbrodowski.net  Sat Mar 20 06:51:20 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Sat, 20 Mar 2010 11:51:20 +0100
Subject: [PATCH kernel 2.6.34-rc1-git7] pd6729: Coding Style fixes
In-Reply-To: <20100320063919.f7cd4421.komurojun-mbn@nifty.com>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<1257971899-9274-9-git-send-email-linux@dominikbrodowski.net>
	<20091213212556.03d83e1f.komurojun-mbn@nifty.com>
	<20100228153933.f6fe6f81.komurojun-mbn@nifty.com>
	<20100320063919.f7cd4421.komurojun-mbn@nifty.com>
Message-ID: <20100320105120.GA7159@comet.dominikbrodowski.net>

Applied, thanks!

	Dominik


From linux at dominikbrodowski.net  Sat Mar 20 06:59:31 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Sat, 20 Mar 2010 11:59:31 +0100
Subject: [git pull] more PCMCIA updates for 2.6.34 (including ioctl
	deprecation)
In-Reply-To: <1268949290.4ba2a12a6c7a5@imp.free.fr> <4BA2556B.7090601@free.fr>
	<4BA21DAC.1080807@free.fr> <1268898635.4ba1db4bbb263@imp.free.fr>
Message-ID: <20100320105931.GB7159@comet.dominikbrodowski.net>

Hey Cyrille,

let my try to summarize:

(1) You needed to add "acpi=off" so that your CD-ROM works. If you use
    "acpi=off" in the kernel command line, the CD-ROM works, but the IRQ
    routing is broken which means that CardBus cards do not work. This PCI
    IRQ routing is, in principle, something that the PCI and ACPI
    maintainers should fix.

(2) If you remove "acpi=off", the system does not boot (any more). That
    seems to be an ACPI-related problem.

Could you check or the following things, please?

(a) Is there a BIOS update available? Often, updating the BIOS helps in
    addressing ACPI / PCI-IRQ issues.

(b) Could you boot with "acpi=off", please, insert a CardBus card, and then
    send me the output of the "dmesg" command?

(c) Does booting with "acpi=off pci=biosirq" help?
    Does booting with "acpi=off pci=usepirqmask" help?

Best,
	Dominik


From komurojun-mbn at nifty.com  Sat Mar 20 17:55:39 2010
From: komurojun-mbn at nifty.com (Komuro)
Date: Sun, 21 Mar 2010 06:55:39 +0900
Subject: [BUG? kernel 2.6.34-rc1-git8] cs: IO port probe 0x0-0xcf7: clean.
In-Reply-To: <20100320063919.f7cd4421.komurojun-mbn@nifty.com>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<1257971899-9274-9-git-send-email-linux@dominikbrodowski.net>
	<20091213212556.03d83e1f.komurojun-mbn@nifty.com>
	<20100228153933.f6fe6f81.komurojun-mbn@nifty.com>
	<20100320063919.f7cd4421.komurojun-mbn@nifty.com>
Message-ID: <20100321065539.57cb2c96.komurojun-mbn@nifty.com>

Hi,

I don't add "include port 0x0-0xcf7" in /etc/pcmcia/config.opts.
but recent kernel probes this ioport range ...



yenta_cardbus 0000:04:06.0: CardBus bridge found [1179:ff66]
yenta_cardbus 0000:04:06.0: ISA IRQ mask 0x0ca8, PCI irq 18
yenta_cardbus 0000:04:06.0: Socket status: 30000410
yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge I/O window: 0x1000 - 0x1fff
pcmcia_socket pcmcia_socket0: cs: IO port probe 0x1000-0x1fff: clean.
yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge Memory window: 0xd2000000 - 0xd40fffff
pcmcia_socket pcmcia_socket0: cs: memory probe 0xd2000000-0xd40fffff: excluding 0xd3ef0000-0xd40fffff
yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge Memory window: 0xd0000000 - 0xd1ffffff
pcmcia_socket pcmcia_socket0: cs: memory probe 0xd0000000-0xd1ffffff: excluding 0xd0000000-0xd1ffffff
yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge I/O window: 0x0 - 0xcf7
pcmcia_socket pcmcia_socket0: cs: IO port probe 0x0-0xcf7: clean.
yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge I/O window: 0xd00 - 0xffff
pcmcia_socket pcmcia_socket0: cs: IO port probe 0xd00-0xffff: clean.
yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge Memory window: 0xa0000 - 0xbffff
pcmcia_socket pcmcia_socket0: cs: memory probe 0x0a0000-0x0bffff: excluding 0xa0000-0xbffff
yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge Memory window: 0xc0000000 - 0xfebfffff
pcmcia_socket pcmcia_socket0: cs: memory probe 0xc0000000-0xfebfffff: excluding 0xc0000000-0xd1ffffff 0xd4000000-0xdaffffff 0xdc000000-0xe3ffffff 0xf8000000-0xfbffffff 0xfe800000-0xfeffffff


From linux at dominikbrodowski.net  Sun Mar 21 05:52:18 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Sun, 21 Mar 2010 10:52:18 +0100
Subject: [BUG? kernel 2.6.34-rc1-git8] cs: IO port probe 0x0-0xcf7: clean.
In-Reply-To: <20100321065539.57cb2c96.komurojun-mbn@nifty.com>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<1257971899-9274-9-git-send-email-linux@dominikbrodowski.net>
	<20091213212556.03d83e1f.komurojun-mbn@nifty.com>
	<20100228153933.f6fe6f81.komurojun-mbn@nifty.com>
	<20100320063919.f7cd4421.komurojun-mbn@nifty.com>
	<20100321065539.57cb2c96.komurojun-mbn@nifty.com>
Message-ID: <20100321095218.GA30826@isilmar.linta.de>

Hey,

On Sun, Mar 21, 2010 at 06:55:39AM +0900, Komuro wrote:
> I don't add "include port 0x0-0xcf7" in /etc/pcmcia/config.opts.
> but recent kernel probes this ioport range ...

That's because the parent PCI bridge offers these resources for downstream
users, such as yenta_cardbus. So that's not a bug.

Best,
	Dominik


From linux at dominikbrodowski.net  Sun Mar 21 18:45:46 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Sun, 21 Mar 2010 23:45:46 +0100
Subject: runtime PM ops and PCMCIA bus
Message-ID: <20100321224546.GA23626@comet.dominikbrodowski.net>

Hey!

On the PCMCIA bus, implementing runtime PM "should" be simple.
However, there's a major caveat: the bus must be able to
force devices to suspend, or force them to resume during
runtime. Let's discuss this in detail:

(1) Converting the PCMCIA bus to dev_pm_ops seems easy:

    pcmcia_dev_suspend() needs to get rid of its second argument,
    then it's just a 

    SET_SYSTEM_SLEEP_PM_OPS(pcmcia_dev_suspend, pcmcia_dev_resume)


(2) Whenever two functions local to drivers/pcmcia/ds.c --
    runtime_suspend() or runtime_resume() -- are called,
    we need to force a synchronous call to pcmcia_dev_suspend(),
    or to pcmcia_dev_resume(). Currently, we do this by taking
    device_lock() and calling the function manually.


(3) However, it'd be much nicer to be able to use the new runtime
    PM interface. As the PCMCIA bus can always suspend,
    pcmcia_dev_idle() might only contain a call to

	pm_schedule_suspend(dev, 0) - or pm_runtime_suspend() ?

    To enable it, we should add

       pm_runtime_set_active(&p_dev->dev);
       pm_runtime_enable(&p_dev->dev);

    in pcmcia_device_add().


(4) What is then to be done to modify runtime_suspend() / runtime_resume() ?
    Is it:

+ static int runtime_suspend(struct device *dev)
+ {
+ 	pm_runtime_put_noidle(dev);
+ 	return pm_runtime_suspend(dev);
+ }
+ 
+ static int runtime_resume(struct device *dev)
+ {
+ 	return pm_runtime_get_sync(dev);
+ }


    or more something like


+  static int runtime_suspend(struct device *dev)
+ {
+ 	return pm_runtime_put_sync(dev);
+ }
+ 
+ static int runtime_resume(struct device *dev)
+ {
+ 	return pm_runtime_get_sync(dev);
+ }

    and modifying pcmcia_dev_idle() to call pm_runtime_suspend() instead of
    pm_schedule_suspend()?


(5) Another problem I'm seeing with the put/get approach: there are three
    different callpaths where runtime_suspend() / runtime_resume() might
    be called.[*] However, each one decreases the counter, which might get < 0.
    What to do? Using pm_runtime_suspended seems racy...


(6) As pcmcia_dev_resume() is used -- as per UNIVERSAL_DEV_PM_OPS -- what is
    needed there to set the runtime PM state correctly if we do not wake up
    the device during system sleep suspend?


Pseudo patch -- untested and probably broken [see at least (5) above]
attached. Any feedback is most welcome.

Best,
	Dominik

[*] 1) by echoing the state into a device sysfs file.
    2) by echoing the state into a socket sysfs file.
    3) during "resets" of the socket -- we need to suspend devices
           first, then physically reset the socket, then resume the devices
	   on the card.

diff --git a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig
index caca50e..551fcdb 100644
--- a/drivers/pcmcia/Kconfig
+++ b/drivers/pcmcia/Kconfig
@@ -20,6 +20,7 @@ if PCCARD
 config PCMCIA
 	tristate "16-bit PCMCIA support"
 	select CRC32
+	select PM_RUNTIME
 	default y
 	---help---
 	   This option enables support for 16-bit PCMCIA cards. Most older
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index f4df4d0..ec9f56e 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -24,6 +24,7 @@
 #include <linux/firmware.h>
 #include <linux/kref.h>
 #include <linux/dma-mapping.h>
+#include <linux/pm_runtime.h>
 
 #include <pcmcia/cs_types.h>
 #include <pcmcia/cs.h>
@@ -560,6 +561,9 @@ struct pcmcia_device *pcmcia_device_add(struct pcmcia_socket *s, unsigned int fu
 	if (device_register(&p_dev->dev))
 		goto err_unreg;
 
+	pm_runtime_set_active(&p_dev->dev);
+	pm_runtime_enable(&p_dev->dev);
+
 	return p_dev;
 
  err_unreg:
@@ -952,28 +956,24 @@ static int pcmcia_bus_uevent(struct device *dev, struct kobj_uevent_env *env)
 #endif
 
 /************************ runtime PM support ***************************/
-
-static int pcmcia_dev_suspend(struct device *dev, pm_message_t state);
-static int pcmcia_dev_resume(struct device *dev);
-
 static int runtime_suspend(struct device *dev)
 {
-	int rc;
+	int ret;
 
-	device_lock(dev);
-	rc = pcmcia_dev_suspend(dev, PMSG_SUSPEND);
-	device_unlock(dev);
-	return rc;
+	dev_dbg(dev, "runtime_suspend\n");
+	ret = pm_runtime_put_sync(dev);
+	dev_dbg(dev, "runtime_suspend %d\n", ret);
+	return (ret >=0 ? 0 : ret);
 }
 
 static int runtime_resume(struct device *dev)
 {
-	int rc;
+	int ret;
 
-	device_lock(dev);
-	rc = pcmcia_dev_resume(dev);
-	device_unlock(dev);
-	return rc;
+	dev_dbg(dev, "runtime_resume\n");
+	ret = pm_runtime_get_sync(dev);
+	dev_dbg(dev, "runtime_resume %d\n", ret);
+	return (ret >=0 ? 0 : ret);
 }
 
 /************************ per-device sysfs output ***************************/
@@ -1085,7 +1085,7 @@ static struct device_attribute pcmcia_dev_attrs[] = {
 
 /* PM support, also needed for reset */
 
-static int pcmcia_dev_suspend(struct device *dev, pm_message_t state)
+static int pcmcia_dev_suspend(struct device *dev)
 {
 	struct pcmcia_device *p_dev = to_pcmcia_dev(dev);
 	struct pcmcia_driver *p_drv = NULL;
@@ -1406,6 +1406,19 @@ static struct class_interface pcmcia_bus_interface __refdata = {
 };
 
 
+static int pcmcia_dev_idle(struct device *dev)
+{
+	int ret = pm_runtime_suspend(dev);
+
+	/* we can always suspend */
+	dev_dbg(dev, "idle callback -- pm_runtime_suspend returned %d\n", ret);
+
+	return ret;
+}
+
+UNIVERSAL_DEV_PM_OPS(pcmcia_bus_pm_ops, 
+		pcmcia_dev_suspend, pcmcia_dev_resume, pcmcia_dev_idle);
+
 struct bus_type pcmcia_bus_type = {
 	.name = "pcmcia",
 	.uevent = pcmcia_bus_uevent,
@@ -1413,8 +1426,7 @@ struct bus_type pcmcia_bus_type = {
 	.dev_attrs = pcmcia_dev_attrs,
 	.probe = pcmcia_device_probe,
 	.remove = pcmcia_device_remove,
-	.suspend = pcmcia_dev_suspend,
-	.resume = pcmcia_dev_resume,
+	.pm = &pcmcia_bus_pm_ops,
 };
 
 


From linux at dominikbrodowski.net  Sun Mar 21 19:07:31 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 22 Mar 2010 00:07:31 +0100
Subject: [RFC PATCH 13/19] pcmcia: dev_node removal (core)
In-Reply-To: <20100321230617.GA24791@comet.dominikbrodowski.net>
References: <20100321230617.GA24791@comet.dominikbrodowski.net>
Message-ID: <1269212857-25364-13-git-send-email-linux@dominikbrodowski.net>

Remove the dev_node declaration. We now only pass the device name
to the deprecated userspace tools.

Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 Documentation/pcmcia/driver-changes.txt |    3 +++
 drivers/pcmcia/ds.c                     |    2 --
 drivers/pcmcia/pcmcia_ioctl.c           |   15 +++------------
 include/pcmcia/ds.h                     |   10 ----------
 4 files changed, 6 insertions(+), 24 deletions(-)

diff --git a/Documentation/pcmcia/driver-changes.txt b/Documentation/pcmcia/driver-changes.txt
index 3268a9a..61bc4e9 100644
--- a/Documentation/pcmcia/driver-changes.txt
+++ b/Documentation/pcmcia/driver-changes.txt
@@ -1,4 +1,7 @@
 This file details changes in 2.6 which affect PCMCIA card driver authors:
+* No dev_node_t (as of 2.6.35)
+   There is no more need to fill out a "dev_node_t" structure.
+
 * New IRQ request rules (as of 2.6.35)
    Instead of the old pcmcia_request_irq() interface, drivers may now
    choose between:
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 74245cc..f4df4d0 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -371,8 +371,6 @@ static int pcmcia_device_remove(struct device *dev)
 	if (p_drv->remove)
 		p_drv->remove(p_dev);
 
-	p_dev->dev_node = NULL;
-
 	/* check for proper unloading */
 	if (p_dev->_irq || p_dev->_io || p_dev->_locked)
 		dev_printk(KERN_INFO, dev,
diff --git a/drivers/pcmcia/pcmcia_ioctl.c b/drivers/pcmcia/pcmcia_ioctl.c
index 5abbad5..f922320 100644
--- a/drivers/pcmcia/pcmcia_ioctl.c
+++ b/drivers/pcmcia/pcmcia_ioctl.c
@@ -570,7 +570,6 @@ static struct pci_bus *pcmcia_lookup_bus(struct pcmcia_socket *s)
 
 static int get_device_info(struct pcmcia_socket *s, bind_info_t *bind_info, int first)
 {
-	dev_node_t *node;
 	struct pcmcia_device *p_dev;
 	struct pcmcia_driver *p_drv;
 	int ret = 0;
@@ -632,21 +631,13 @@ static int get_device_info(struct pcmcia_socket *s, bind_info_t *bind_info, int
 		goto err_put;
 	}
 
-	if (first)
-		node = p_dev->dev_node;
-	else
-		for (node = p_dev->dev_node; node; node = node->next)
-			if (node == bind_info->next)
-				break;
-	if (!node) {
+	if (!first) {
 		ret = -ENODEV;
 		goto err_put;
 	}
 
-	strlcpy(bind_info->name, node->dev_name, DEV_NAME_LEN);
-	bind_info->major = node->major;
-	bind_info->minor = node->minor;
-	bind_info->next = node->next;
+	strlcpy(bind_info->name, dev_name(&p_dev->dev), DEV_NAME_LEN);
+	bind_info->next = NULL;
 
  err_put:
 	pcmcia_put_dev(p_dev);
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
index 81b6d86..ef15a36 100644
--- a/include/pcmcia/ds.h
+++ b/include/pcmcia/ds.h
@@ -61,15 +61,6 @@ struct pcmcia_driver {
 int pcmcia_register_driver(struct pcmcia_driver *driver);
 void pcmcia_unregister_driver(struct pcmcia_driver *driver);
 
-/* Some drivers use dev_node_t to store char or block device information.
- * Don't use this in new drivers, though.
- */
-typedef struct dev_node_t {
-	char			dev_name[DEV_NAME_LEN];
-	u_short			major, minor;
-	struct dev_node_t	*next;
-} dev_node_t;
-
 struct pcmcia_device {
 	/* the socket and the device_no [for multifunction devices]
 	   uniquely define a pcmcia_device */
@@ -87,7 +78,6 @@ struct pcmcia_device {
 	struct list_head	socket_device_list;
 
 	/* deprecated, will be cleaned up soon */
-	dev_node_t		*dev_node;
 	u_int			open;
 	io_req_t		io;
 	config_req_t		conf;
-- 
1.6.3.3



From linux at dominikbrodowski.net  Sun Mar 21 19:07:26 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 22 Mar 2010 00:07:26 +0100
Subject: [RFC PATCH 08/19] pcmcia: clean up cs.h
In-Reply-To: <20100321230617.GA24791@comet.dominikbrodowski.net>
References: <20100321230617.GA24791@comet.dominikbrodowski.net>
Message-ID: <1269212857-25364-8-git-send-email-linux@dominikbrodowski.net>

With req_irq_t gone, we can get rid of some definitions.

Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 include/pcmcia/cs.h |   11 -----------
 1 files changed, 0 insertions(+), 11 deletions(-)

diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h
index a04e6ca..57d8d03 100644
--- a/include/pcmcia/cs.h
+++ b/include/pcmcia/cs.h
@@ -114,18 +114,7 @@ typedef struct io_req_t {
 #define IO_DATA_PATH_WIDTH_16	0x08
 #define IO_DATA_PATH_WIDTH_AUTO	0x10
 
-/* Attributes for RequestIRQ and ReleaseIRQ */
-#define IRQ_TYPE			0x03
-#define IRQ_TYPE_EXCLUSIVE		0x00
-#define IRQ_TYPE_TIME			0x01
-#define IRQ_TYPE_DYNAMIC_SHARING	0x02
-#define IRQ_FORCED_PULSE		0x04
-#define IRQ_FIRST_SHARED		0x08 /* unused */
-#define IRQ_HANDLE_PRESENT		0x10 /* unused */
-#define IRQ_PULSE_ALLOCATED		0x100
-
 /* Bits in IRQInfo1 field */
-#define IRQ_MASK		0x0f
 #define IRQ_NMI_ID		0x01
 #define IRQ_IOCK_ID		0x02
 #define IRQ_BERR_ID		0x04
-- 
1.6.3.3



From linux at dominikbrodowski.net  Sun Mar 21 19:07:22 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 22 Mar 2010 00:07:22 +0100
Subject: [RFC PATCH 04/19] pcmcia: setup IRQ to be used by PCMCIA drivers at
	card insert
In-Reply-To: <20100321230617.GA24791@comet.dominikbrodowski.net>
References: <20100321230617.GA24791@comet.dominikbrodowski.net>
Message-ID: <1269212857-25364-4-git-send-email-linux@dominikbrodowski.net>

Setup the IRQ to be used by PCMCIA drivers already during the device
registration stage, making use of a new function pcmcia_setup_irq().
This will allow us to get rid of quite a lot of indirection in the
future.

Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 drivers/pcmcia/cs_internal.h     |    2 +
 drivers/pcmcia/ds.c              |   15 ++-
 drivers/pcmcia/pcmcia_resource.c |  216 ++++++++++++++++++++++----------------
 include/pcmcia/ds.h              |    3 +
 4 files changed, 141 insertions(+), 95 deletions(-)

diff --git a/drivers/pcmcia/cs_internal.h b/drivers/pcmcia/cs_internal.h
index f95864c..74d91c8 100644
--- a/drivers/pcmcia/cs_internal.h
+++ b/drivers/pcmcia/cs_internal.h
@@ -149,6 +149,8 @@ extern struct resource *pcmcia_find_mem_region(u_long base,
 					       int low,
 					       struct pcmcia_socket *s);
 
+void pcmcia_cleanup_irq(struct pcmcia_socket *s);
+int pcmcia_setup_irq(struct pcmcia_device *p_dev);
 
 /* cistpl.c */
 extern struct bin_attribute pccard_cis_attr;
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index a2b0d69..e0b1efc 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -531,26 +531,32 @@ struct pcmcia_device *pcmcia_device_add(struct pcmcia_socket *s, unsigned int fu
 			p_dev->function_config = tmp_dev->function_config;
 			p_dev->io = tmp_dev->io;
 			p_dev->irq = tmp_dev->irq;
+			p_dev->irq_v = tmp_dev->irq_v;
 			kref_get(&p_dev->function_config->ref);
 		}
 
 	/* Add to the list in pcmcia_bus_socket */
 	list_add(&p_dev->socket_device_list, &s->devices_list);
 
-	mutex_unlock(&s->ops_mutex);
+	if (pcmcia_setup_irq(p_dev))
+		dev_warn(&p_dev->dev,
+			"IRQ setup failed -- device might not work\n");
 
 	if (!p_dev->function_config) {
 		dev_dbg(&p_dev->dev, "creating config_t\n");
 		p_dev->function_config = kzalloc(sizeof(struct config_t),
 						 GFP_KERNEL);
-		if (!p_dev->function_config)
+		if (!p_dev->function_config) {
+			mutex_unlock(&s->ops_mutex);
 			goto err_unreg;
+		}
 		kref_init(&p_dev->function_config->ref);
 	}
+	mutex_unlock(&s->ops_mutex);
 
 	dev_printk(KERN_NOTICE, &p_dev->dev,
-		   "pcmcia: registering new device %s\n",
-		   p_dev->devname);
+		   "pcmcia: registering new device %s (IRQ: %d)\n",
+		   p_dev->devname, p_dev->irq_v);
 
 	pcmcia_device_query(p_dev);
 
@@ -1242,6 +1248,7 @@ static int ds_event(struct pcmcia_socket *skt, event_t event, int priority)
 		handle_event(skt, event);
 		mutex_lock(&s->ops_mutex);
 		destroy_cis_cache(s);
+		pcmcia_cleanup_irq(s);
 		mutex_unlock(&s->ops_mutex);
 		break;
 
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index cac5656..e4b8fa0 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -22,6 +22,8 @@
 #include <linux/device.h>
 #include <linux/netdevice.h>
 
+#include <asm/irq.h>
+
 #include <pcmcia/cs_types.h>
 #include <pcmcia/ss.h>
 #include <pcmcia/cs.h>
@@ -37,12 +39,6 @@ static int io_speed;
 module_param(io_speed, int, 0444);
 
 
-#ifdef CONFIG_PCMCIA_PROBE
-#include <asm/irq.h>
-/* mask of IRQs already reserved by other cards, we should avoid using them */
-static u8 pcmcia_used_irq[NR_IRQS];
-#endif
-
 static int pcmcia_adjust_io_region(struct resource *res, unsigned long start,
 				   unsigned long end, struct pcmcia_socket *s)
 {
@@ -439,15 +435,11 @@ static int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req)
 	}
 	if (--s->irq.Config == 0) {
 		c->state &= ~CONFIG_IRQ_REQ;
-		s->irq.AssignedIRQ = 0;
 	}
 
 	if (req->Handler)
 		free_irq(req->AssignedIRQ, p_dev->priv);
 
-#ifdef CONFIG_PCMCIA_PROBE
-	pcmcia_used_irq[req->AssignedIRQ]--;
-#endif
 	ret = 0;
 
 out:
@@ -698,26 +690,14 @@ EXPORT_SYMBOL(pcmcia_request_io);
 /** pcmcia_request_irq
  *
  * Request_irq() reserves an irq for this client.
- *
- * Also, since Linux only reserves irq's when they are actually
- * hooked, we don't guarantee that an irq will still be available
- * when the configuration is locked.  Now that I think about it,
- * there might be a way to fix this using a dummy handler.
  */
 
-#ifdef CONFIG_PCMCIA_PROBE
-static irqreturn_t test_action(int cpl, void *dev_id)
-{
-	return IRQ_NONE;
-}
-#endif
-
 int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
 {
 	struct pcmcia_socket *s = p_dev->socket;
 	config_t *c;
-	int ret = -EINVAL, irq = 0;
-	int type;
+	int ret = -EINVAL, irq = p_dev->irq_v;
+	int type = IRQF_SHARED;
 
 	mutex_lock(&s->ops_mutex);
 
@@ -735,63 +715,20 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
 		goto out;
 	}
 
-	/* Decide what type of interrupt we are registering */
-	type = 0;
-	if (s->functions > 1)		/* All of this ought to be handled higher up */
-		type = IRQF_SHARED;
-	else if (req->Attributes & IRQ_TYPE_DYNAMIC_SHARING)
-		type = IRQF_SHARED;
-	else
-		printk(KERN_WARNING "pcmcia: Driver needs updating to support IRQ sharing.\n");
-
-#ifdef CONFIG_PCMCIA_PROBE
-
-	if (s->irq.AssignedIRQ != 0) {
-		/* If the interrupt is already assigned, it must be the same */
-		irq = s->irq.AssignedIRQ;
-	} else {
-		int try;
-		u32 mask = s->irq_mask;
-		void *data = p_dev; /* something unique to this device */
-
-		for (try = 0; try < 64; try++) {
-			irq = try % 32;
-
-			/* marked as available by driver, and not blocked by userspace? */
-			if (!((mask >> irq) & 1))
-				continue;
-
-			/* avoid an IRQ which is already used by a PCMCIA card */
-			if ((try < 32) && pcmcia_used_irq[irq])
-				continue;
-
-			/* register the correct driver, if possible, of check whether
-			 * registering a dummy handle works, i.e. if the IRQ isn't
-			 * marked as used by the kernel resource management core */
-			ret = request_irq(irq,
-					  (req->Handler) ? req->Handler : test_action,
-					  type,
-					  p_dev->devname,
-					  (req->Handler) ? p_dev->priv : data);
-			if (!ret) {
-				if (!req->Handler)
-					free_irq(irq, data);
-				break;
-			}
-		}
+	if (!irq) {
+		dev_dbg(&s->dev, "no IRQ available\n");
+		goto out;
 	}
-#endif
-	/* only assign PCI irq if no IRQ already assigned */
-	if (ret && !s->irq.AssignedIRQ) {
-		if (!s->pci_irq) {
-			dev_printk(KERN_INFO, &s->dev, "no IRQ found\n");
-			goto out;
-		}
-		type = IRQF_SHARED;
-		irq = s->pci_irq;
+
+	if (!(req->Attributes & IRQ_TYPE_DYNAMIC_SHARING)) {
+		req->Attributes |= IRQ_TYPE_DYNAMIC_SHARING;
+		dev_printk(KERN_WARNING, &p_dev->dev, "pcmcia: "
+			"request for exclusive IRQ could not be fulfilled.\n");
+		dev_printk(KERN_WARNING, &p_dev->dev, "pcmcia: the driver "
+			"needs updating to supported shared IRQ lines.\n");
 	}
 
-	if (ret && req->Handler) {
+	if (req->Handler) {
 		ret = request_irq(irq, req->Handler, type,
 				  p_dev->devname, p_dev->priv);
 		if (ret) {
@@ -801,25 +738,13 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
 		}
 	}
 
-	/* Make sure the fact the request type was overridden is passed back */
-	if (type == IRQF_SHARED && !(req->Attributes & IRQ_TYPE_DYNAMIC_SHARING)) {
-		req->Attributes |= IRQ_TYPE_DYNAMIC_SHARING;
-		dev_printk(KERN_WARNING, &p_dev->dev, "pcmcia: "
-			"request for exclusive IRQ could not be fulfilled.\n");
-		dev_printk(KERN_WARNING, &p_dev->dev, "pcmcia: the driver "
-			"needs updating to supported shared IRQ lines.\n");
-	}
 	c->irq.Attributes = req->Attributes;
-	s->irq.AssignedIRQ = req->AssignedIRQ = irq;
+	req->AssignedIRQ = irq;
 	s->irq.Config++;
 
 	c->state |= CONFIG_IRQ_REQ;
 	p_dev->_irq = 1;
 
-#ifdef CONFIG_PCMCIA_PROBE
-	pcmcia_used_irq[irq]++;
-#endif
-
 	ret = 0;
 out:
 	mutex_unlock(&s->ops_mutex);
@@ -828,6 +753,115 @@ out:
 EXPORT_SYMBOL(pcmcia_request_irq);
 
 
+#ifdef CONFIG_PCMCIA_PROBE
+
+/* mask of IRQs already reserved by other cards, we should avoid using them */
+static u8 pcmcia_used_irq[NR_IRQS];
+
+static irqreturn_t test_action(int cpl, void *dev_id)
+{
+	return IRQ_NONE;
+}
+
+/**
+ * pcmcia_setup_isa_irq() - determine whether an ISA IRQ can be used
+ * @p_dev - the associated PCMCIA device
+ *
+ * locking note: must be called with ops_mutex locked.
+ */
+static int pcmcia_setup_isa_irq(struct pcmcia_device *p_dev, int type)
+{
+	struct pcmcia_socket *s = p_dev->socket;
+	unsigned int try, irq;
+	u32 mask = s->irq_mask;
+	int ret = -ENODEV;
+
+	for (try = 0; try < 64; try++) {
+		irq = try % 32;
+
+		/* marked as available by driver, not blocked by userspace? */
+		if (!((mask >> irq) & 1))
+			continue;
+
+		/* avoid an IRQ which is already used by another PCMCIA card */
+		if ((try < 32) && pcmcia_used_irq[irq])
+			continue;
+
+		/* register the correct driver, if possible, to check whether
+		 * registering a dummy handle works, i.e. if the IRQ isn't
+		 * marked as used by the kernel resource management core */
+		ret = request_irq(irq, test_action, type, p_dev->devname,
+				  p_dev);
+		if (!ret) {
+			free_irq(irq, p_dev);
+			p_dev->irq_v = s->irq.AssignedIRQ = irq;
+			pcmcia_used_irq[irq]++;
+			break;
+		}
+	}
+
+	return ret;
+}
+
+void pcmcia_cleanup_irq(struct pcmcia_socket *s)
+{
+	pcmcia_used_irq[s->irq.AssignedIRQ]--;
+	s->irq.AssignedIRQ = 0;
+}
+
+#else /* CONFIG_PCMCIA_PROBE */
+
+static int pcmcia_setup_isa_irq(struct pcmcia_device *p_dev, int type)
+{
+	return -EINVAL;
+}
+
+void pcmcia_cleanup_irq(struct pcmcia_socket *s)
+{
+	s->irq.AssignedIRQ = 0;
+	return;
+}
+
+#endif  /* CONFIG_PCMCIA_PROBE */
+
+
+/**
+ * pcmcia_setup_irq() - determine IRQ to be used for device
+ * @p_dev - the associated PCMCIA device
+ *
+ * locking note: must be called with ops_mutex locked.
+ */
+int pcmcia_setup_irq(struct pcmcia_device *p_dev)
+{
+	struct pcmcia_socket *s = p_dev->socket;
+
+	if (p_dev->irq_v)
+		return 0;
+
+	/* already assigned? */
+	if (s->irq.AssignedIRQ) {
+		p_dev->irq_v = s->irq.AssignedIRQ;
+		return 0;
+	}
+
+	/* prefer an exclusive ISA irq */
+	if (!pcmcia_setup_isa_irq(p_dev, 0))
+		return 0;
+
+	/* but accept a shared ISA irq */
+	if (!pcmcia_setup_isa_irq(p_dev, IRQF_SHARED))
+		return 0;
+
+	/* but use the PCI irq otherwise */
+	if (s->pci_irq) {
+		p_dev->irq_v = s->irq.AssignedIRQ = s->pci_irq;
+		return 0;
+	}
+
+	return -EINVAL;
+}
+
+
 /** pcmcia_request_window
  *
  * Request_window() establishes a mapping between card memory space
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
index d57847f..f70c5c1 100644
--- a/include/pcmcia/ds.h
+++ b/include/pcmcia/ds.h
@@ -94,6 +94,9 @@ struct pcmcia_device {
 	config_req_t		conf;
 	window_handle_t		win;
 
+	/* device setup */
+	unsigned int		irq_v; /* do not use directly yet */
+
 	/* Is the device suspended, or in the process of
 	 * being removed? */
 	u16			suspended:1;
-- 
1.6.3.3



From linux at dominikbrodowski.net  Sun Mar 21 19:07:32 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 22 Mar 2010 00:07:32 +0100
Subject: [RFC PATCH 14/19] power: support _noirq actions on device types and
	classes
In-Reply-To: <20100321230617.GA24791@comet.dominikbrodowski.net>
References: <20100321230617.GA24791@comet.dominikbrodowski.net>
Message-ID: <1269212857-25364-14-git-send-email-linux@dominikbrodowski.net>

The new-style dev_pm_ops provide callbacks for both IRQs enabled
and disabled. However, the _noirq variants were only called for
buses registered with a device, not for classes and types.

In order to properly use dev_pm_ops in class pcmcia_socket_class,
support _noirq actions also on classes and types.

Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
Acked-by: Rafael J. Wysocki <rjw at sisk.pl>
---
 drivers/base/power/main.c |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index d477f4d..941fcb8 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -439,8 +439,23 @@ static int device_resume_noirq(struct device *dev, pm_message_t state)
 	if (dev->bus && dev->bus->pm) {
 		pm_dev_dbg(dev, state, "EARLY ");
 		error = pm_noirq_op(dev, dev->bus->pm, state);
+		if (error)
+			goto End;
 	}
 
+	if (dev->type && dev->type->pm) {
+		pm_dev_dbg(dev, state, "EARLY type ");
+		error = pm_noirq_op(dev, dev->type->pm, state);
+		if (error)
+			goto End;
+	}
+
+	if (dev->class && dev->class->pm) {
+		pm_dev_dbg(dev, state, "EARLY class ");
+		error = pm_noirq_op(dev, dev->class->pm, state);
+	}
+
+End:
 	TRACE_RESUME(error);
 	return error;
 }
@@ -735,10 +750,26 @@ static int device_suspend_noirq(struct device *dev, pm_message_t state)
 {
 	int error = 0;
 
+	if (dev->class && dev->class->pm) {
+		pm_dev_dbg(dev, state, "LATE class ");
+		error = pm_noirq_op(dev, dev->class->pm, state);
+		if (error)
+			goto End;
+	}
+
+	if (dev->type && dev->type->pm) {
+		pm_dev_dbg(dev, state, "LATE type ");
+		error = pm_noirq_op(dev, dev->type->pm, state);
+		if (error)
+			goto End;
+	}
+
 	if (dev->bus && dev->bus->pm) {
 		pm_dev_dbg(dev, state, "LATE ");
 		error = pm_noirq_op(dev, dev->bus->pm, state);
 	}
+
+End:
 	return error;
 }
 
-- 
1.6.3.3



From linux at dominikbrodowski.net  Sun Mar 21 19:07:36 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 22 Mar 2010 00:07:36 +0100
Subject: [RFC PATCH 18/19] pcmcia: clarify alloc_io_space,
	move it to resource handlers
In-Reply-To: <20100321230617.GA24791@comet.dominikbrodowski.net>
References: <20100321230617.GA24791@comet.dominikbrodowski.net>
Message-ID: <1269212857-25364-18-git-send-email-linux@dominikbrodowski.net>

Clean up the alloc_io_space() function by moving most of it to
the actual resource_ops. This allows for a bit less re-directions.
Future cleanups will follow, and will make up for the code
duplication currently present between rsrc_iodyn and rsrc_nonstatic
(which are hardly ever built at the same time anyway, therefore no
increase in built size).

Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 drivers/pcmcia/cs_internal.h     |   12 ++---
 drivers/pcmcia/pcmcia_resource.c |   71 ++-----------------------
 drivers/pcmcia/rsrc_iodyn.c      |   92 ++++++++++++++++++++++++++++-----
 drivers/pcmcia/rsrc_mgr.c        |   14 ++++-
 drivers/pcmcia/rsrc_nonstatic.c  |  105 ++++++++++++++++++++++++++++++++++----
 include/pcmcia/ds.h              |   11 +++-
 6 files changed, 204 insertions(+), 101 deletions(-)

diff --git a/drivers/pcmcia/cs_internal.h b/drivers/pcmcia/cs_internal.h
index ab000ea..4126a75 100644
--- a/drivers/pcmcia/cs_internal.h
+++ b/drivers/pcmcia/cs_internal.h
@@ -52,13 +52,11 @@ struct cis_cache_entry {
 
 struct pccard_resource_ops {
 	int	(*validate_mem)		(struct pcmcia_socket *s);
-	int	(*adjust_io_region)	(struct resource *res,
-					 unsigned long r_start,
-					 unsigned long r_end,
-					 struct pcmcia_socket *s);
-	struct resource* (*find_io)	(unsigned long base, int num,
-					 unsigned long align,
-					 struct pcmcia_socket *s);
+	int	(*find_io)		(struct pcmcia_socket *s,
+					 unsigned int attr,
+					 unsigned int *base,
+					 unsigned int num,
+					 unsigned int align);
 	struct resource* (*find_mem)	(unsigned long base, unsigned long num,
 					 unsigned long align, int low,
 					 struct pcmcia_socket *s);
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index 8bd23c8..1a1ead7 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -38,23 +38,6 @@ static int io_speed;
 module_param(io_speed, int, 0444);
 
 
-static int pcmcia_adjust_io_region(struct resource *res, unsigned long start,
-				   unsigned long end, struct pcmcia_socket *s)
-{
-	if (s->resource_ops->adjust_io_region)
-		return s->resource_ops->adjust_io_region(res, start, end, s);
-	return -ENOMEM;
-}
-
-static struct resource *pcmcia_find_io_region(unsigned long base, int num,
-					      unsigned long align,
-					      struct pcmcia_socket *s)
-{
-	if (s->resource_ops->find_io)
-		return s->resource_ops->find_io(base, num, align, s);
-	return NULL;
-}
-
 int pcmcia_validate_mem(struct pcmcia_socket *s)
 {
 	if (s->resource_ops->validate_mem)
@@ -80,8 +63,7 @@ struct resource *pcmcia_find_mem_region(u_long base, u_long num, u_long align,
 static int alloc_io_space(struct pcmcia_socket *s, u_int attr,
 			  unsigned int *base, unsigned int num, u_int lines)
 {
-	int i;
-	unsigned int try, align;
+	unsigned int align;
 
 	align = (*base) ? (lines ? 1<<lines : 0) : 1;
 	if (align && (align < num)) {
@@ -98,50 +80,8 @@ static int alloc_io_space(struct pcmcia_socket *s, u_int attr,
 		       *base, align);
 		align = 0;
 	}
-	if ((s->features & SS_CAP_STATIC_MAP) && s->io_offset) {
-		*base = s->io_offset | (*base & 0x0fff);
-		return 0;
-	}
-	/* Check for an already-allocated window that must conflict with
-	 * what was asked for.  It is a hack because it does not catch all
-	 * potential conflicts, just the most obvious ones.
-	 */
-	for (i = 0; i < MAX_IO_WIN; i++)
-		if ((s->io[i].res) && *base &&
-		    ((s->io[i].res->start & (align-1)) == *base))
-			return 1;
-	for (i = 0; i < MAX_IO_WIN; i++) {
-		if (!s->io[i].res) {
-			s->io[i].res = pcmcia_find_io_region(*base, num, align, s);
-			if (s->io[i].res) {
-				*base = s->io[i].res->start;
-				s->io[i].res->flags = (s->io[i].res->flags & ~IORESOURCE_BITS) | (attr & IORESOURCE_BITS);
-				s->io[i].InUse = num;
-				break;
-			} else
-				return 1;
-		} else if ((s->io[i].res->flags & IORESOURCE_BITS) != (attr & IORESOURCE_BITS))
-			continue;
-		/* Try to extend top of window */
-		try = s->io[i].res->end + 1;
-		if ((*base == 0) || (*base == try))
-			if (pcmcia_adjust_io_region(s->io[i].res, s->io[i].res->start,
-						    s->io[i].res->end + num, s) == 0) {
-				*base = try;
-				s->io[i].InUse += num;
-				break;
-			}
-		/* Try to extend bottom of window */
-		try = s->io[i].res->start - num;
-		if ((*base == 0) || (*base == try))
-			if (pcmcia_adjust_io_region(s->io[i].res, s->io[i].res->start - num,
-						    s->io[i].res->end, s) == 0) {
-				*base = try;
-				s->io[i].InUse += num;
-				break;
-			}
-	}
-	return (i == MAX_IO_WIN);
+
+	return s->resource_ops->find_io(s, attr, base, num, align);
 } /* alloc_io_space */
 
 
@@ -680,7 +620,8 @@ EXPORT_SYMBOL(pcmcia_request_irq);
  * free_irq themselves, too), or the pcmcia_request_irq() function.
  */
 int __must_check
-pcmcia_request_exclusive_irq(struct pcmcia_device *p_dev, irq_handler_t handler)
+__pcmcia_request_exclusive_irq(struct pcmcia_device *p_dev,
+			irq_handler_t handler)
 {
 	int ret;
 
@@ -702,7 +643,7 @@ pcmcia_request_exclusive_irq(struct pcmcia_device *p_dev, irq_handler_t handler)
 
 	return ret;
 } /* pcmcia_request_exclusive_irq */
-EXPORT_SYMBOL(pcmcia_request_exclusive_irq);
+EXPORT_SYMBOL(__pcmcia_request_exclusive_irq);
 
 
 #ifdef CONFIG_PCMCIA_PROBE
diff --git a/drivers/pcmcia/rsrc_iodyn.c b/drivers/pcmcia/rsrc_iodyn.c
index 3fa808b..7791375 100644
--- a/drivers/pcmcia/rsrc_iodyn.c
+++ b/drivers/pcmcia/rsrc_iodyn.c
@@ -56,15 +56,9 @@ static resource_size_t pcmcia_align(void *align_data,
 }
 
 
-static int iodyn_adjust_io_region(struct resource *res, unsigned long r_start,
-		unsigned long r_end, struct pcmcia_socket *s)
-{
-	return adjust_resource(res, r_start, r_end - r_start + 1);
-}
-
-
-static struct resource *iodyn_find_io_region(unsigned long base, int num,
-		unsigned long align, struct pcmcia_socket *s)
+static struct resource *__iodyn_find_io_region(struct pcmcia_socket *s,
+					unsigned long base, int num,
+					unsigned long align)
 {
 	struct resource *res = pcmcia_make_resource(0, num, IORESOURCE_IO,
 						dev_name(&s->dev));
@@ -72,9 +66,6 @@ static struct resource *iodyn_find_io_region(unsigned long base, int num,
 	unsigned long min = base;
 	int ret;
 
-	if (align == 0)
-		align = 0x10000;
-
 	data.mask = align - 1;
 	data.offset = base & data.mask;
 
@@ -94,10 +85,83 @@ static struct resource *iodyn_find_io_region(unsigned long base, int num,
 	return res;
 }
 
+static int iodyn_find_io(struct pcmcia_socket *s, unsigned int attr,
+			unsigned int *base, unsigned int num,
+			unsigned int align)
+{
+	int i, ret = 0;
+
+	/* Check for an already-allocated window that must conflict with
+	 * what was asked for.  It is a hack because it does not catch all
+	 * potential conflicts, just the most obvious ones.
+	 */
+	for (i = 0; i < MAX_IO_WIN; i++) {
+		if (!s->io[i].res)
+			continue;
+
+		if (!*base)
+			continue;
+
+		if ((s->io[i].res->start & (align-1)) == *base)
+			return -EBUSY;
+	}
+
+	for (i = 0; i < MAX_IO_WIN; i++) {
+		struct resource *res = s->io[i].res;
+		unsigned int try;
+
+		if (res && (res->flags & IORESOURCE_BITS) !=
+			(attr & IORESOURCE_BITS))
+			continue;
+
+		if (!res) {
+			if (align == 0)
+				align = 0x10000;
+
+			res = s->io[i].res = __iodyn_find_io_region(s, *base,
+								num, align);
+			if (!res)
+				return -EINVAL;
+
+			*base = res->start;
+			s->io[i].res->flags =
+				((res->flags & ~IORESOURCE_BITS) |
+					(attr & IORESOURCE_BITS));
+			s->io[i].InUse = num;
+			return 0;
+		}
+
+		/* Try to extend top of window */
+		try = res->end + 1;
+		if ((*base == 0) || (*base == try)) {
+			if (adjust_resource(s->io[i].res, res->start,
+					res->end - res->start + num + 1))
+				continue;
+			*base = try;
+			s->io[i].InUse += num;
+			return 0;
+		}
+
+		/* Try to extend bottom of window */
+		try = res->start - num;
+		if ((*base == 0) || (*base == try)) {
+			if (adjust_resource(s->io[i].res,
+					res->start - num,
+					res->end - res->start + num + 1))
+				continue;
+			*base = try;
+			s->io[i].InUse += num;
+			return 0;
+		}
+	}
+
+	return -EINVAL;
+}
+
+
 struct pccard_resource_ops pccard_iodyn_ops = {
 	.validate_mem = NULL,
-	.adjust_io_region = iodyn_adjust_io_region,
-	.find_io = iodyn_find_io_region,
+	.find_io = iodyn_find_io,
 	.find_mem = NULL,
 	.add_io = NULL,
 	.add_mem = NULL,
diff --git a/drivers/pcmcia/rsrc_mgr.c b/drivers/pcmcia/rsrc_mgr.c
index 5728522..9bdce3d 100644
--- a/drivers/pcmcia/rsrc_mgr.c
+++ b/drivers/pcmcia/rsrc_mgr.c
@@ -45,11 +45,21 @@ struct resource *pcmcia_make_resource(unsigned long start, unsigned long end,
 	return res;
 }
 
+static int static_find_io(struct pcmcia_socket *s, unsigned int attr,
+			unsigned int *base, unsigned int num,
+			unsigned int align)
+{
+	if (!s->io_offset)
+		return -EINVAL;
+	*base = s->io_offset | (*base & 0x0fff);
+
+	return 0;
+}
+
 
 struct pccard_resource_ops pccard_static_ops = {
 	.validate_mem = NULL,
-	.adjust_io_region = NULL,
-	.find_io = NULL,
+	.find_io = static_find_io,
 	.find_mem = NULL,
 	.add_io = NULL,
 	.add_mem = NULL,
diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c
index 92fe4a7..ba3a53e 100644
--- a/drivers/pcmcia/rsrc_nonstatic.c
+++ b/drivers/pcmcia/rsrc_nonstatic.c
@@ -646,8 +646,9 @@ pcmcia_align(void *align_data, const struct resource *res,
  * Adjust an existing IO region allocation, but making sure that we don't
  * encroach outside the resources which the user supplied.
  */
-static int nonstatic_adjust_io_region(struct resource *res, unsigned long r_start,
-				      unsigned long r_end, struct pcmcia_socket *s)
+static int __nonstatic_adjust_io_region(struct pcmcia_socket *s,
+					unsigned long r_start,
+					unsigned long r_end)
 {
 	struct resource_map *m;
 	struct socket_data *s_data = s->resource_data;
@@ -660,8 +661,7 @@ static int nonstatic_adjust_io_region(struct resource *res, unsigned long r_star
 		if (start > r_start || r_end > end)
 			continue;
 
-		ret = adjust_resource(res, r_start, r_end - r_start + 1);
-		break;
+		ret = 0;
 	}
 
 	return ret;
@@ -680,8 +680,9 @@ static int nonstatic_adjust_io_region(struct resource *res, unsigned long r_star
 
 ======================================================================*/
 
-static struct resource *nonstatic_find_io_region(unsigned long base, int num,
-		   unsigned long align, struct pcmcia_socket *s)
+static struct resource *__nonstatic_find_io_region(struct pcmcia_socket *s,
+						unsigned long base, int num,
+						unsigned long align)
 {
 	struct resource *res = pcmcia_make_resource(0, num, IORESOURCE_IO,
 						dev_name(&s->dev));
@@ -690,9 +691,6 @@ static struct resource *nonstatic_find_io_region(unsigned long base, int num,
 	unsigned long min = base;
 	int ret;
 
-	if (align == 0)
-		align = 0x10000;
-
 	data.mask = align - 1;
 	data.offset = base & data.mask;
 	data.map = &s_data->io_db;
@@ -713,6 +711,92 @@ static struct resource *nonstatic_find_io_region(unsigned long base, int num,
 	return res;
 }
 
+static int nonstatic_find_io(struct pcmcia_socket *s, unsigned int attr,
+			unsigned int *base, unsigned int num,
+			unsigned int align)
+{
+	int i, ret = 0;
+
+	/* Check for an already-allocated window that must conflict with
+	 * what was asked for.  It is a hack because it does not catch all
+	 * potential conflicts, just the most obvious ones.
+	 */
+	for (i = 0; i < MAX_IO_WIN; i++) {
+		if (!s->io[i].res)
+			continue;
+
+		if (!*base)
+			continue;
+
+		if ((s->io[i].res->start & (align-1)) == *base)
+			return -EBUSY;
+	}
+
+	for (i = 0; i < MAX_IO_WIN; i++) {
+		struct resource *res = s->io[i].res;
+		unsigned int try;
+
+		if (res && (res->flags & IORESOURCE_BITS) !=
+			(attr & IORESOURCE_BITS))
+			continue;
+
+		if (!res) {
+			if (align == 0)
+				align = 0x10000;
+
+			res = s->io[i].res = __nonstatic_find_io_region(s,
+								*base, num,
+								align);
+			if (!res)
+				return -EINVAL;
+
+			*base = res->start;
+			s->io[i].res->flags =
+				((res->flags & ~IORESOURCE_BITS) |
+					(attr & IORESOURCE_BITS));
+			s->io[i].InUse = num;
+			return 0;
+		}
+
+		/* Try to extend top of window */
+		try = res->end + 1;
+		if ((*base == 0) || (*base == try)) {
+			ret =  __nonstatic_adjust_io_region(s, res->start,
+							res->end + num);
+			if (!ret) {
+				ret = adjust_resource(s->io[i].res, res->start,
+					       res->end - res->start + num + 1);
+				if (ret)
+					continue;
+				*base = try;
+				s->io[i].InUse += num;
+				return 0;
+			}
+		}
+
+		/* Try to extend bottom of window */
+		try = res->start - num;
+		if ((*base == 0) || (*base == try)) {
+			ret =  __nonstatic_adjust_io_region(s,
+							res->start - num,
+							res->end);
+			if (!ret) {
+				ret = adjust_resource(s->io[i].res,
+					       res->start - num,
+					       res->end - res->start + num + 1);
+				if (ret)
+					continue;
+				*base = try;
+				s->io[i].InUse += num;
+				return 0;
+			}
+		}
+	}
+
+	return -EINVAL;
+}
+
+
 static struct resource *nonstatic_find_mem_region(u_long base, u_long num,
 		u_long align, int low, struct pcmcia_socket *s)
 {
@@ -938,8 +1022,7 @@ static void nonstatic_release_resource_db(struct pcmcia_socket *s)
 
 struct pccard_resource_ops pccard_nonstatic_ops = {
 	.validate_mem = pcmcia_nonstatic_validate_mem,
-	.adjust_io_region = nonstatic_adjust_io_region,
-	.find_io = nonstatic_find_io_region,
+	.find_io = nonstatic_find_io,
 	.find_mem = nonstatic_find_mem_region,
 	.add_io = adjust_io,
 	.add_mem = adjust_memory,
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
index ef15a36..6864f39 100644
--- a/include/pcmcia/ds.h
+++ b/include/pcmcia/ds.h
@@ -185,9 +185,16 @@ int pcmcia_access_configuration_register(struct pcmcia_device *p_dev,
 /* device configuration */
 int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req);
 
-int __must_check __deprecated
-pcmcia_request_exclusive_irq(struct pcmcia_device *p_dev,
+int __must_check
+__pcmcia_request_exclusive_irq(struct pcmcia_device *p_dev,
 				irq_handler_t handler);
+static inline __must_check __deprecated int
+pcmcia_request_exclusive_irq(struct pcmcia_device *p_dev,
+				irq_handler_t handler)
+{
+	return __pcmcia_request_exclusive_irq(p_dev, handler);
+}
+
 int __must_check pcmcia_request_irq(struct pcmcia_device *p_dev,
 				irq_handler_t handler);
 
-- 
1.6.3.3



From linux at dominikbrodowski.net  Sun Mar 21 19:07:21 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 22 Mar 2010 00:07:21 +0100
Subject: [RFC PATCH 03/19] pcmcia: remove unused IRQ modification feature
In-Reply-To: <20100321230617.GA24791@comet.dominikbrodowski.net>
References: <20100321230617.GA24791@comet.dominikbrodowski.net>
Message-ID: <1269212857-25364-3-git-send-email-linux@dominikbrodowski.net>

The IRQ modification feature was unused, and I see no reason to keep it.

Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 drivers/pcmcia/pcmcia_resource.c |   16 +++-------------
 1 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index c4612c5..cac5656 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -274,19 +274,9 @@ int pcmcia_modify_configuration(struct pcmcia_device *p_dev,
 		goto unlock;
 	}
 
-	if (mod->Attributes & CONF_IRQ_CHANGE_VALID) {
-		if (mod->Attributes & CONF_ENABLE_IRQ) {
-			c->Attributes |= CONF_ENABLE_IRQ;
-			s->socket.io_irq = s->irq.AssignedIRQ;
-		} else {
-			c->Attributes &= ~CONF_ENABLE_IRQ;
-			s->socket.io_irq = 0;
-		}
-		s->ops->set_socket(s, &s->socket);
-	}
-
-	if (mod->Attributes & CONF_VCC_CHANGE_VALID) {
-		dev_dbg(&s->dev, "changing Vcc is not allowed at this time\n");
+	if (mod->Attributes & (CONF_IRQ_CHANGE_VALID | CONF_VCC_CHANGE_VALID)) {
+		dev_dbg(&s->dev,
+			"changing Vcc or IRQ is not allowed at this time\n");
 		ret = -EINVAL;
 		goto unlock;
 	}
-- 
1.6.3.3



From linux at dominikbrodowski.net  Sun Mar 21 19:07:20 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 22 Mar 2010 00:07:20 +0100
Subject: [RFC PATCH 02/19] pcmcia: remove unused mem_op.h
In-Reply-To: <20100321230617.GA24791@comet.dominikbrodowski.net>
References: <20100321230617.GA24791@comet.dominikbrodowski.net>
Message-ID: <1269212857-25364-2-git-send-email-linux@dominikbrodowski.net>

Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 drivers/net/pcmcia/3c574_cs.c        |    1 -
 drivers/net/wireless/ray_cs.c        |    1 -
 drivers/staging/netwave/netwave_cs.c |    1 -
 include/pcmcia/mem_op.h              |  116 ----------------------------------
 4 files changed, 0 insertions(+), 119 deletions(-)
 delete mode 100644 include/pcmcia/mem_op.h

diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c
index 3d1d3a7..61e33cf 100644
--- a/drivers/net/pcmcia/3c574_cs.c
+++ b/drivers/net/pcmcia/3c574_cs.c
@@ -93,7 +93,6 @@ earlier 3Com products.
 #include <pcmcia/cisreg.h>
 #include <pcmcia/ciscode.h>
 #include <pcmcia/ds.h>
-#include <pcmcia/mem_op.h>
 
 #include <asm/uaccess.h>
 #include <asm/io.h>
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
index 84c530a..7f0f855 100644
--- a/drivers/net/wireless/ray_cs.c
+++ b/drivers/net/wireless/ray_cs.c
@@ -52,7 +52,6 @@
 #include <pcmcia/cistpl.h>
 #include <pcmcia/cisreg.h>
 #include <pcmcia/ds.h>
-#include <pcmcia/mem_op.h>
 
 #include <linux/wireless.h>
 #include <net/iw_handler.h>
diff --git a/drivers/staging/netwave/netwave_cs.c b/drivers/staging/netwave/netwave_cs.c
index e936717..26477fd 100644
--- a/drivers/staging/netwave/netwave_cs.c
+++ b/drivers/staging/netwave/netwave_cs.c
@@ -62,7 +62,6 @@
 #include <pcmcia/cistpl.h>
 #include <pcmcia/cisreg.h>
 #include <pcmcia/ds.h>
-#include <pcmcia/mem_op.h>
 
 #include <asm/system.h>
 #include <asm/io.h>
diff --git a/include/pcmcia/mem_op.h b/include/pcmcia/mem_op.h
deleted file mode 100644
index 0fa06e5..0000000
--- a/include/pcmcia/mem_op.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * mem_op.h
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * The initial developer of the original code is David A. Hinds
- * <dahinds at users.sourceforge.net>.  Portions created by David A. Hinds
- * are Copyright (C) 1999 David A. Hinds.  All Rights Reserved.
- *
- * (C) 1999             David A. Hinds
- */
-
-#ifndef _LINUX_MEM_OP_H
-#define _LINUX_MEM_OP_H
-
-#include <linux/io.h>
-#include <asm/uaccess.h>
-
-/*
-   If UNSAFE_MEMCPY is defined, we use the (optimized) system routines
-   to copy between a card and kernel memory.  These routines do 32-bit
-   operations which may not work with all PCMCIA controllers.  The
-   safe versions defined here will do only 8-bit and 16-bit accesses.
-*/
-
-#ifdef UNSAFE_MEMCPY
-
-#define copy_from_pc memcpy_fromio
-#define copy_to_pc memcpy_toio
-
-static inline void copy_pc_to_user(void *to, const void *from, size_t n)
-{
-    size_t odd = (n & 3);
-    n -= odd;
-    while (n) {
-	put_user(__raw_readl(from), (int *)to);
-	(char *)from += 4; (char *)to += 4; n -= 4;
-    }
-    while (odd--)
-	put_user(readb((char *)from++), (char *)to++);
-}
-
-static inline void copy_user_to_pc(void *to, const void *from, size_t n)
-{
-    int l;
-    char c;
-    size_t odd = (n & 3);
-    n -= odd;
-    while (n) {
-	get_user(l, (int *)from);
-	__raw_writel(l, to);
-	(char *)to += 4; (char *)from += 4; n -= 4;
-    }
-    while (odd--) {
-	get_user(c, (char *)from++);
-	writeb(c, (char *)to++);
-    }
-}
-
-#else /* UNSAFE_MEMCPY */
-
-static inline void copy_from_pc(void *to, void __iomem *from, size_t n)
-{
-	__u16 *t = to;
-	__u16 __iomem *f = from;
-	size_t odd = (n & 1);
-	for (n >>= 1; n; n--)
-		*t++ = __raw_readw(f++);
-	if (odd)
-		*(__u8 *)t = readb(f);
-}
-
-static inline void copy_to_pc(void __iomem *to, const void *from, size_t n)
-{
-	__u16 __iomem *t = to;
-	const __u16 *f = from;
-	size_t odd = (n & 1);
-	for (n >>= 1; n ; n--)
-		__raw_writew(*f++, t++);
-	if (odd)
-		writeb(*(__u8 *)f, t);
-}
-
-static inline void copy_pc_to_user(void __user *to, void __iomem *from, size_t n)
-{
-	__u16 __user *t = to;
-	__u16 __iomem *f = from;
-	size_t odd = (n & 1);
-	for (n >>= 1; n ; n--)
-		put_user(__raw_readw(f++), t++);
-	if (odd)
-		put_user(readb(f), (char __user *)t);
-}
-
-static inline void copy_user_to_pc(void __iomem *to, void __user *from, size_t n)
-{
-	__u16 __user *f = from;
-	__u16 __iomem *t = to;
-	short s;
-	char c;
-	size_t odd = (n & 1);
-	for (n >>= 1; n; n--) {
-		get_user(s, f++);
-		__raw_writew(s, t++);
-	}
-	if (odd) {
-		get_user(c, (char __user *)f);
-		writeb(c, t);
-	}
-}
-
-#endif /* UNSAFE_MEMCPY */
-
-#endif /* _LINUX_MEM_OP_H */
-- 
1.6.3.3



From linux at dominikbrodowski.net  Sun Mar 21 19:07:24 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 22 Mar 2010 00:07:24 +0100
Subject: [RFC PATCH 06/19] pcmcia: pass FORCED_PULSE parameter in
	pcmcia_request_configuration()
In-Reply-To: <20100321230617.GA24791@comet.dominikbrodowski.net>
References: <20100321230617.GA24791@comet.dominikbrodowski.net>
Message-ID: <1269212857-25364-6-git-send-email-linux@dominikbrodowski.net>

As it's only used there it makes no sense relying on pcmcia_request_irq().

CC: alsa-devel at alsa-project.org
Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 drivers/pcmcia/pcmcia_resource.c             |   10 ++--------
 drivers/staging/comedi/drivers/ni_labpc_cs.c |    5 +++--
 include/pcmcia/cs.h                          |    1 +
 sound/pcmcia/pdaudiocf/pdaudiocf.c           |    6 +++---
 4 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index fb08e80..f629aac 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -425,10 +425,6 @@ static int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req)
 	if (c->state & CONFIG_LOCKED)
 		goto out;
 
-	if (c->irq.Attributes != req->Attributes) {
-		dev_dbg(&s->dev, "IRQ attributes must match assigned ones\n");
-		goto out;
-	}
 	if (s->pcmcia_irq != req->AssignedIRQ) {
 		dev_dbg(&s->dev, "IRQ must match assigned one\n");
 		goto out;
@@ -552,9 +548,8 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev,
 			if (req->Present & PRESENT_IOBASE_0)
 				c->Option |= COR_ADDR_DECODE;
 		}
-		if (req->Attributes & CONF_ENABLE_IRQ)
-			if (!(c->irq.Attributes & IRQ_FORCED_PULSE))
-				c->Option |= COR_LEVEL_REQ;
+		if (req->Attributes & CONF_ENABLE_PULSE_IRQ)
+			c->Option |= COR_LEVEL_REQ;
 		pcmcia_write_cis_mem(s, 1, (base + CISREG_COR)>>1, 1, &c->Option);
 		mdelay(40);
 	}
@@ -729,7 +724,6 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
 		}
 	}
 
-	c->irq.Attributes = req->Attributes;
 	req->AssignedIRQ = irq;
 
 	p_dev->_irq = 1;
diff --git a/drivers/staging/comedi/drivers/ni_labpc_cs.c b/drivers/staging/comedi/drivers/ni_labpc_cs.c
index 0b963bb..5a0e5b9 100644
--- a/drivers/staging/comedi/drivers/ni_labpc_cs.c
+++ b/drivers/staging/comedi/drivers/ni_labpc_cs.c
@@ -229,7 +229,7 @@ static int labpc_cs_attach(struct pcmcia_device *link)
 	link->priv = local;
 
 	/* Interrupt setup */
-	link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | IRQ_FORCED_PULSE;
+	link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
 	link->irq.Handler = NULL;
 
 	/*
@@ -306,7 +306,8 @@ static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev,
 
 	/* Do we need to allocate an interrupt? */
 	if (cfg->irq.IRQInfo1 || dflt->irq.IRQInfo1)
-		p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
+		p_dev->conf.Attributes |=
+			(CONF_ENABLE_IRQ | CONF_ENABLE_PULSE_IRQ);
 
 	/* IO window settings */
 	p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h
index 75fa353..af61571 100644
--- a/include/pcmcia/cs.h
+++ b/include/pcmcia/cs.h
@@ -85,6 +85,7 @@ typedef struct config_req_t {
 #define CONF_ENABLE_IRQ		0x01
 #define CONF_ENABLE_DMA		0x02
 #define CONF_ENABLE_SPKR	0x04
+#define CONF_ENABLE_PULSE_IRQ	0x08
 #define CONF_VALID_CLIENT	0x100
 
 /* IntType field */
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf.c b/sound/pcmcia/pdaudiocf/pdaudiocf.c
index edaa729..dcf8539 100644
--- a/sound/pcmcia/pdaudiocf/pdaudiocf.c
+++ b/sound/pcmcia/pdaudiocf/pdaudiocf.c
@@ -142,12 +142,12 @@ static int snd_pdacf_probe(struct pcmcia_device *link)
 	link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
 	link->io.NumPorts1 = 16;
 
-	link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_FORCED_PULSE;
+	link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
 	/* FIXME: This driver should be updated to allow for dynamic IRQ sharing */
-	/* link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | IRQ_FORCED_PULSE; */
+	/* link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; */
 
 	link->irq.Handler = pdacf_interrupt;
-	link->conf.Attributes = CONF_ENABLE_IRQ;
+	link->conf.Attributes = CONF_ENABLE_IRQ | CONF_ENABLE_PULSE_IRQ;
 	link->conf.IntType = INT_MEMORY_AND_IO;
 	link->conf.ConfigIndex = 1;
 	link->conf.Present = PRESENT_OPTION;
-- 
1.6.3.3



From linux at dominikbrodowski.net  Sun Mar 21 19:07:29 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 22 Mar 2010 00:07:29 +0100
Subject: [RFC PATCH 11/19] pcmcia: dev_node removal (drivers with
	unregister_netdev check)
In-Reply-To: <20100321230617.GA24791@comet.dominikbrodowski.net>
References: <20100321230617.GA24791@comet.dominikbrodowski.net>
Message-ID: <1269212857-25364-11-git-send-email-linux@dominikbrodowski.net>

As a third step, remove any usage of dev_node_t from drivers which
only wrote to this typedef/struct, except to determine whether
register_netdev() succeeded previously. However, the function calling
unregister_netdev() was only ever called by the PCMCIA core if
register_netdev() succeeded previously. The lonely exception was
easily fixed.

CC: netdev at vger.kernel.org
CC: linux-wireless at vger.kernel.org
Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 drivers/net/pcmcia/3c574_cs.c              |    8 +------
 drivers/net/pcmcia/3c589_cs.c              |    9 +-------
 drivers/net/pcmcia/axnet_cs.c              |    8 +------
 drivers/net/pcmcia/com20020_cs.c           |   21 ++++++-------------
 drivers/net/pcmcia/fmvj18x_cs.c            |    8 +------
 drivers/net/pcmcia/ibmtr_cs.c              |    8 +------
 drivers/net/pcmcia/nmclan_cs.c             |    8 +------
 drivers/net/pcmcia/pcnet_cs.c              |    8 +------
 drivers/net/pcmcia/smc91c92_cs.c           |    9 +-------
 drivers/net/pcmcia/xirc2ps_cs.c            |   29 +---------------------------
 drivers/net/wireless/orinoco/orinoco_cs.c  |   14 +------------
 drivers/net/wireless/orinoco/spectrum_cs.c |   14 +------------
 drivers/net/wireless/ray_cs.c              |    6 +----
 drivers/net/wireless/ray_cs.h              |    1 -
 drivers/net/wireless/wl3501.h              |    1 -
 drivers/net/wireless/wl3501_cs.c           |   15 ++-----------
 16 files changed, 22 insertions(+), 145 deletions(-)

diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c
index 839a29c..727bb38 100644
--- a/drivers/net/pcmcia/3c574_cs.c
+++ b/drivers/net/pcmcia/3c574_cs.c
@@ -199,7 +199,6 @@ enum Window4 {		/* Window 4: Xcvr/media bits. */
 
 struct el3_private {
 	struct pcmcia_device	*p_dev;
-	dev_node_t node;
 	u16 advertising, partner;		/* NWay media advertisement */
 	unsigned char phys;			/* MII device address */
 	unsigned int autoselect:1, default_media:3;	/* Read from the EEPROM/Wn3_Config. */
@@ -308,8 +307,7 @@ static void tc574_detach(struct pcmcia_device *link)
 
 	dev_dbg(&link->dev, "3c574_detach()\n");
 
-	if (link->dev_node)
-		unregister_netdev(dev);
+	unregister_netdev(dev);
 
 	tc574_release(link);
 
@@ -443,17 +441,13 @@ static int tc574_config(struct pcmcia_device *link)
 		}
 	}
 
-	link->dev_node = &lp->node;
 	SET_NETDEV_DEV(dev, &link->dev);
 
 	if (register_netdev(dev) != 0) {
 		printk(KERN_NOTICE "3c574_cs: register_netdev() failed\n");
-		link->dev_node = NULL;
 		goto failed;
 	}
 
-	strcpy(lp->node.dev_name, dev->name);
-
 	printk(KERN_INFO "%s: %s at io %#3lx, irq %d, "
 	       "hw_addr %pM.\n",
 	       dev->name, cardname, dev->base_addr, dev->irq,
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c
index 405d772..5ab589d 100644
--- a/drivers/net/pcmcia/3c589_cs.c
+++ b/drivers/net/pcmcia/3c589_cs.c
@@ -106,7 +106,6 @@ enum RxFilter {
 
 struct el3_private {
 	struct pcmcia_device	*p_dev;
-    dev_node_t 		node;
     /* For transceiver monitoring */
     struct timer_list	media;
     u16			media_status;
@@ -222,8 +221,7 @@ static void tc589_detach(struct pcmcia_device *link)
 
     dev_dbg(&link->dev, "3c589_detach\n");
 
-    if (link->dev_node)
-	unregister_netdev(dev);
+    unregister_netdev(dev);
 
     tc589_release(link);
 
@@ -241,7 +239,6 @@ static void tc589_detach(struct pcmcia_device *link)
 static int tc589_config(struct pcmcia_device *link)
 {
     struct net_device *dev = link->priv;
-    struct el3_private *lp = netdev_priv(dev);
     __be16 *phys_addr;
     int ret, i, j, multi = 0, fifo;
     unsigned int ioaddr;
@@ -312,17 +309,13 @@ static int tc589_config(struct pcmcia_device *link)
     else
 	printk(KERN_ERR "3c589_cs: invalid if_port requested\n");
     
-    link->dev_node = &lp->node;
     SET_NETDEV_DEV(dev, &link->dev);
 
     if (register_netdev(dev) != 0) {
 	printk(KERN_ERR "3c589_cs: register_netdev() failed\n");
-	link->dev_node = NULL;
 	goto failed;
     }
 
-    strcpy(lp->node.dev_name, dev->name);
-
     printk(KERN_INFO "%s: 3Com 3c%s, io %#3lx, irq %d, "
 	   "hw_addr %pM\n",
 	   dev->name, (multi ? "562" : "589"), dev->base_addr, dev->irq,
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c
index 41d2def..50a8dda 100644
--- a/drivers/net/pcmcia/axnet_cs.c
+++ b/drivers/net/pcmcia/axnet_cs.c
@@ -114,7 +114,6 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id);
 
 typedef struct axnet_dev_t {
 	struct pcmcia_device	*p_dev;
-    dev_node_t		node;
     caddr_t		base;
     struct timer_list	watchdog;
     int			stale, fast_poll;
@@ -195,8 +194,7 @@ static void axnet_detach(struct pcmcia_device *link)
 
     dev_dbg(&link->dev, "axnet_detach(0x%p)\n", link);
 
-    if (link->dev_node)
-	unregister_netdev(dev);
+    unregister_netdev(dev);
 
     axnet_release(link);
 
@@ -393,17 +391,13 @@ static int axnet_config(struct pcmcia_device *link)
     }
 
     info->phy_id = (i < 32) ? i : -1;
-    link->dev_node = &info->node;
     SET_NETDEV_DEV(dev, &link->dev);
 
     if (register_netdev(dev) != 0) {
 	printk(KERN_NOTICE "axnet_cs: register_netdev() failed\n");
-	link->dev_node = NULL;
 	goto failed;
     }
 
-    strcpy(info->node.dev_name, dev->name);
-
     printk(KERN_INFO "%s: Asix AX88%d90: io %#3lx, irq %d, "
 	   "hw_addr %pM\n",
 	   dev->name, ((info->flags & IS_AX88790) ? 7 : 1),
diff --git a/drivers/net/pcmcia/com20020_cs.c b/drivers/net/pcmcia/com20020_cs.c
index 278438b..5643f94 100644
--- a/drivers/net/pcmcia/com20020_cs.c
+++ b/drivers/net/pcmcia/com20020_cs.c
@@ -122,7 +122,6 @@ static void com20020_detach(struct pcmcia_device *p_dev);
 
 typedef struct com20020_dev_t {
     struct net_device       *dev;
-    dev_node_t          node;
 } com20020_dev_t;
 
 /*======================================================================
@@ -195,18 +194,16 @@ static void com20020_detach(struct pcmcia_device *link)
 
     dev_dbg(&link->dev, "com20020_detach\n");
 
-    if (link->dev_node) {
-	dev_dbg(&link->dev, "unregister...\n");
+    dev_dbg(&link->dev, "unregister...\n");
 
-	unregister_netdev(dev);
+    unregister_netdev(dev);
 
-	/*
-	 * this is necessary because we register our IRQ separately
-	 * from card services.
-	 */
-	if (dev->irq)
+    /*
+     * this is necessary because we register our IRQ separately
+     * from card services.
+     */
+    if (dev->irq)
 	    free_irq(dev->irq, dev);
-    }
 
     com20020_release(link);
 
@@ -297,7 +294,6 @@ static int com20020_config(struct pcmcia_device *link)
     lp->card_name = "PCMCIA COM20020";
     lp->card_flags = ARC_CAN_10MBIT; /* pretend all of them can 10Mbit */
 
-    link->dev_node = &info->node;
     SET_NETDEV_DEV(dev, &link->dev);
 
     i = com20020_found(dev, 0);	/* calls register_netdev */
@@ -305,12 +301,9 @@ static int com20020_config(struct pcmcia_device *link)
     if (i != 0) {
 	dev_printk(KERN_NOTICE, &link->dev,
 		"com20020_cs: com20020_found() failed\n");
-	link->dev_node = NULL;
 	goto failed;
     }
 
-    strcpy(info->node.dev_name, dev->name);
-
     dev_dbg(&link->dev,KERN_INFO "%s: port %#3lx, irq %d\n",
            dev->name, dev->base_addr, dev->irq);
     return 0;
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c
index 31f1a03..6580d78 100644
--- a/drivers/net/pcmcia/fmvj18x_cs.c
+++ b/drivers/net/pcmcia/fmvj18x_cs.c
@@ -110,7 +110,6 @@ typedef enum { MBH10302, MBH10304, TDK, CONTEC, LA501, UNGERMANN,
 */
 typedef struct local_info_t {
 	struct pcmcia_device	*p_dev;
-    dev_node_t node;
     long open_time;
     uint tx_started:1;
     uint tx_queue;
@@ -274,8 +273,7 @@ static void fmvj18x_detach(struct pcmcia_device *link)
 
     dev_dbg(&link->dev, "fmvj18x_detach\n");
 
-    if (link->dev_node)
-	unregister_netdev(dev);
+    unregister_netdev(dev);
 
     fmvj18x_release(link);
 
@@ -523,17 +521,13 @@ static int fmvj18x_config(struct pcmcia_device *link)
     }
 
     lp->cardtype = cardtype;
-    link->dev_node = &lp->node;
     SET_NETDEV_DEV(dev, &link->dev);
 
     if (register_netdev(dev) != 0) {
 	printk(KERN_NOTICE "fmvj18x_cs: register_netdev() failed\n");
-	link->dev_node = NULL;
 	goto failed;
     }
 
-    strcpy(lp->node.dev_name, dev->name);
-
     /* print current configuration */
     printk(KERN_INFO "%s: %s, sram %s, port %#3lx, irq %d, "
 	   "hw_addr %pM\n",
diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c
index 0225cdf..2e42d80 100644
--- a/drivers/net/pcmcia/ibmtr_cs.c
+++ b/drivers/net/pcmcia/ibmtr_cs.c
@@ -104,7 +104,6 @@ static void ibmtr_detach(struct pcmcia_device *p_dev);
 typedef struct ibmtr_dev_t {
 	struct pcmcia_device	*p_dev;
     struct net_device	*dev;
-    dev_node_t          node;
     window_handle_t     sram_win_handle;
     struct tok_info	*ti;
 } ibmtr_dev_t;
@@ -190,8 +189,7 @@ static void ibmtr_detach(struct pcmcia_device *link)
      */
     ti->sram_phys |= 1;
 
-    if (link->dev_node)
-	unregister_netdev(dev);
+    unregister_netdev(dev);
     
     del_timer_sync(&(ti->tr_timer));
 
@@ -289,18 +287,14 @@ static int __devinit ibmtr_config(struct pcmcia_device *link)
         Adapters Technical Reference"  SC30-3585 for this info.  */
     ibmtr_hw_setup(dev, mmiobase);
 
-    link->dev_node = &info->node;
     SET_NETDEV_DEV(dev, &link->dev);
 
     i = ibmtr_probe_card(dev);
     if (i != 0) {
 	printk(KERN_NOTICE "ibmtr_cs: register_netdev() failed\n");
-	link->dev_node = NULL;
 	goto failed;
     }
 
-    strcpy(info->node.dev_name, dev->name);
-
     printk(KERN_INFO
 	   "%s: port %#3lx, irq %d,  mmio %#5lx, sram %#5lx, hwaddr=%pM\n",
            dev->name, dev->base_addr, dev->irq,
diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c
index b779e3a..d8a3b3c 100644
--- a/drivers/net/pcmcia/nmclan_cs.c
+++ b/drivers/net/pcmcia/nmclan_cs.c
@@ -363,7 +363,6 @@ typedef struct _mace_statistics {
 
 typedef struct _mace_private {
 	struct pcmcia_device	*p_dev;
-    dev_node_t node;
     struct net_device_stats linux_stats; /* Linux statistics counters */
     mace_statistics mace_stats; /* MACE chip statistics counters */
 
@@ -491,8 +490,7 @@ static void nmclan_detach(struct pcmcia_device *link)
 
     dev_dbg(&link->dev, "nmclan_detach\n");
 
-    if (link->dev_node)
-	unregister_netdev(dev);
+    unregister_netdev(dev);
 
     nmclan_release(link);
 
@@ -696,18 +694,14 @@ static int nmclan_config(struct pcmcia_device *link)
   else
     printk(KERN_NOTICE "nmclan_cs: invalid if_port requested\n");
 
-  link->dev_node = &lp->node;
   SET_NETDEV_DEV(dev, &link->dev);
 
   i = register_netdev(dev);
   if (i != 0) {
     printk(KERN_NOTICE "nmclan_cs: register_netdev() failed\n");
-    link->dev_node = NULL;
     goto failed;
   }
 
-  strcpy(lp->node.dev_name, dev->name);
-
   printk(KERN_INFO "%s: nmclan: port %#3lx, irq %d, %s port,"
 	 " hw_addr %pM\n",
 	 dev->name, dev->base_addr, dev->irq, if_names[dev->if_port],
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c
index 22a3350..445f555 100644
--- a/drivers/net/pcmcia/pcnet_cs.c
+++ b/drivers/net/pcmcia/pcnet_cs.c
@@ -209,7 +209,6 @@ static hw_info_t dl10022_info = { 0, 0, 0, 0, IS_DL10022|HAS_MII };
 
 typedef struct pcnet_dev_t {
 	struct pcmcia_device	*p_dev;
-    dev_node_t		node;
     u_int		flags;
     void		__iomem *base;
     struct timer_list	watchdog;
@@ -288,8 +287,7 @@ static void pcnet_detach(struct pcmcia_device *link)
 
 	dev_dbg(&link->dev, "pcnet_detach\n");
 
-	if (link->dev_node)
-		unregister_netdev(dev);
+	unregister_netdev(dev);
 
 	pcnet_release(link);
 
@@ -640,17 +638,13 @@ static int pcnet_config(struct pcmcia_device *link)
     if (info->flags & (IS_DL10019|IS_DL10022))
 	mii_phy_probe(dev);
 
-    link->dev_node = &info->node;
     SET_NETDEV_DEV(dev, &link->dev);
 
     if (register_netdev(dev) != 0) {
 	printk(KERN_NOTICE "pcnet_cs: register_netdev() failed\n");
-	link->dev_node = NULL;
 	goto failed;
     }
 
-    strcpy(info->node.dev_name, dev->name);
-
     if (info->flags & (IS_DL10019|IS_DL10022)) {
 	u_char id = inb(dev->base_addr + 0x1a);
 	printk(KERN_INFO "%s: NE2000 (DL100%d rev %02x): ",
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c
index 1257d10..5ac1ed9 100644
--- a/drivers/net/pcmcia/smc91c92_cs.c
+++ b/drivers/net/pcmcia/smc91c92_cs.c
@@ -103,7 +103,6 @@ struct smc_private {
     u_short			manfid;
     u_short			cardid;
 
-    dev_node_t			node;
     struct sk_buff		*saved_skb;
     int				packets_waiting;
     void			__iomem *base;
@@ -323,7 +322,6 @@ static int smc91c92_probe(struct pcmcia_device *link)
 	return -ENOMEM;
     smc = netdev_priv(dev);
     smc->p_dev = link;
-    link->priv = dev;
 
     spin_lock_init(&smc->lock);
     link->io.NumPorts1 = 16;
@@ -361,8 +359,7 @@ static void smc91c92_detach(struct pcmcia_device *link)
 
     dev_dbg(&link->dev, "smc91c92_detach\n");
 
-    if (link->dev_node)
-	unregister_netdev(dev);
+    unregister_netdev(dev);
 
     smc91c92_release(link);
 
@@ -955,17 +952,13 @@ static int smc91c92_config(struct pcmcia_device *link)
 	SMC_SELECT_BANK(0);
     }
 
-    link->dev_node = &smc->node;
     SET_NETDEV_DEV(dev, &link->dev);
 
     if (register_netdev(dev) != 0) {
 	printk(KERN_ERR "smc91c92_cs: register_netdev() failed\n");
-	link->dev_node = NULL;
 	goto config_undo;
     }
 
-    strcpy(smc->node.dev_name, dev->name);
-
     printk(KERN_INFO "%s: smc91c%s rev %d: io %#3lx, irq %d, "
 	   "hw_addr %pM\n",
 	   dev->name, name, (rev & 0x0f), dev->base_addr, dev->irq,
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c
index c9e7d7d..5e6b62b 100644
--- a/drivers/net/pcmcia/xirc2ps_cs.c
+++ b/drivers/net/pcmcia/xirc2ps_cs.c
@@ -297,31 +297,9 @@ static void xirc2ps_detach(struct pcmcia_device *p_dev);
 
 static irqreturn_t xirc2ps_interrupt(int irq, void *dev_id);
 
-/****************
- * A linked list of "instances" of the device.  Each actual
- * PCMCIA card corresponds to one device instance, and is described
- * by one struct pcmcia_device structure (defined in ds.h).
- *
- * You may not want to use a linked list for this -- for example, the
- * memory card driver uses an array of struct pcmcia_device pointers, where minor
- * device numbers are used to derive the corresponding array index.
- */
-
-/****************
- * A driver needs to provide a dev_node_t structure for each device
- * on a card.  In some cases, there is only one device per card (for
- * example, ethernet cards, modems).  In other cases, there may be
- * many actual or logical devices (SCSI adapters, memory cards with
- * multiple partitions).  The dev_node_t structures need to be kept
- * in a linked list starting at the 'dev' field of a struct pcmcia_device
- * structure.  We allocate them in the card's private data structure,
- * because they generally can't be allocated dynamically.
- */
-
 typedef struct local_info_t {
 	struct net_device	*dev;
 	struct pcmcia_device	*p_dev;
-    dev_node_t node;
 
     int card_type;
     int probe_port;
@@ -579,8 +557,7 @@ xirc2ps_detach(struct pcmcia_device *link)
 
     dev_dbg(&link->dev, "detach\n");
 
-    if (link->dev_node)
-	unregister_netdev(dev);
+    unregister_netdev(dev);
 
     xirc2ps_release(link);
 
@@ -985,17 +962,13 @@ xirc2ps_config(struct pcmcia_device * link)
     if (local->dingo)
 	do_reset(dev, 1); /* a kludge to make the cem56 work */
 
-    link->dev_node = &local->node;
     SET_NETDEV_DEV(dev, &link->dev);
 
     if ((err=register_netdev(dev))) {
 	printk(KNOT_XIRC "register_netdev() failed\n");
-	link->dev_node = NULL;
 	goto config_error;
     }
 
-    strcpy(local->node.dev_name, dev->name);
-
     /* give some infos about the hardware */
     printk(KERN_INFO "%s: %s: port %#3lx, irq %d, hwaddr %pM\n",
 	   dev->name, local->manf_str,(u_long)dev->base_addr, (int)dev->irq,
diff --git a/drivers/net/wireless/orinoco/orinoco_cs.c b/drivers/net/wireless/orinoco/orinoco_cs.c
index 5d29b11..03056ab 100644
--- a/drivers/net/wireless/orinoco/orinoco_cs.c
+++ b/drivers/net/wireless/orinoco/orinoco_cs.c
@@ -50,7 +50,6 @@ MODULE_PARM_DESC(ignore_cis_vcc, "Allow voltage mismatch between card and socket
  * struct orinoco_private */
 struct orinoco_pccard {
 	struct pcmcia_device	*p_dev;
-	dev_node_t node;
 
 	/* Used to handle hard reset */
 	/* yuck, we need this hack to work around the insanity of the
@@ -140,8 +139,7 @@ static void orinoco_cs_detach(struct pcmcia_device *link)
 {
 	struct orinoco_private *priv = link->priv;
 
-	if (link->dev_node)
-		orinoco_if_del(priv);
+	orinoco_if_del(priv);
 
 	orinoco_cs_release(link);
 
@@ -226,7 +224,6 @@ static int
 orinoco_cs_config(struct pcmcia_device *link)
 {
 	struct orinoco_private *priv = link->priv;
-	struct orinoco_pccard *card = priv->card;
 	hermes_t *hw = &priv->hw;
 	int ret;
 	void __iomem *mem;
@@ -276,9 +273,6 @@ orinoco_cs_config(struct pcmcia_device *link)
 	if (ret)
 		goto failed;
 
-	/* Ok, we have the configuration, prepare to register the netdev */
-	card->node.major = card->node.minor = 0;
-
 	/* Initialise the main driver */
 	if (orinoco_init(priv) != 0) {
 		printk(KERN_ERR PFX "orinoco_init() failed\n");
@@ -292,12 +286,6 @@ orinoco_cs_config(struct pcmcia_device *link)
 		goto failed;
 	}
 
-	/* At this point, the dev_node_t structure(s) needs to be
-	 * initialized and arranged in a linked list at link->dev_node. */
-	strcpy(card->node.dev_name, priv->ndev->name);
-	link->dev_node = &card->node; /* link->dev_node being non-NULL is also
-				       * used to indicate that the
-				       * net_device has been registered */
 	return 0;
 
  failed:
diff --git a/drivers/net/wireless/orinoco/spectrum_cs.c b/drivers/net/wireless/orinoco/spectrum_cs.c
index 7a8e056..41b9ce4 100644
--- a/drivers/net/wireless/orinoco/spectrum_cs.c
+++ b/drivers/net/wireless/orinoco/spectrum_cs.c
@@ -57,7 +57,6 @@ MODULE_PARM_DESC(ignore_cis_vcc, "Allow voltage mismatch between card and socket
  * struct orinoco_private */
 struct orinoco_pccard {
 	struct pcmcia_device	*p_dev;
-	dev_node_t node;
 };
 
 /********************************************************************/
@@ -214,8 +213,7 @@ static void spectrum_cs_detach(struct pcmcia_device *link)
 {
 	struct orinoco_private *priv = link->priv;
 
-	if (link->dev_node)
-		orinoco_if_del(priv);
+	orinoco_if_del(priv);
 
 	spectrum_cs_release(link);
 
@@ -300,7 +298,6 @@ static int
 spectrum_cs_config(struct pcmcia_device *link)
 {
 	struct orinoco_private *priv = link->priv;
-	struct orinoco_pccard *card = priv->card;
 	hermes_t *hw = &priv->hw;
 	int ret;
 	void __iomem *mem;
@@ -350,9 +347,6 @@ spectrum_cs_config(struct pcmcia_device *link)
 	if (ret)
 		goto failed;
 
-	/* Ok, we have the configuration, prepare to register the netdev */
-	card->node.major = card->node.minor = 0;
-
 	/* Reset card */
 	if (spectrum_cs_hard_reset(priv) != 0)
 		goto failed;
@@ -370,12 +364,6 @@ spectrum_cs_config(struct pcmcia_device *link)
 		goto failed;
 	}
 
-	/* At this point, the dev_node_t structure(s) needs to be
-	 * initialized and arranged in a linked list at link->dev_node. */
-	strcpy(card->node.dev_name, priv->ndev->name);
-	link->dev_node = &card->node; /* link->dev_node being non-NULL is also
-				       * used to indicate that the
-				       * net_device has been registered */
 	return 0;
 
  failed:
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
index e7ed2a4..3016cc1 100644
--- a/drivers/net/wireless/ray_cs.c
+++ b/drivers/net/wireless/ray_cs.c
@@ -379,8 +379,7 @@ static void ray_detach(struct pcmcia_device *link)
 	del_timer(&local->timer);
 
 	if (link->priv) {
-		if (link->dev_node)
-			unregister_netdev(dev);
+		unregister_netdev(dev);
 		free_netdev(dev);
 	}
 	dev_dbg(&link->dev, "ray_cs ray_detach ending\n");
@@ -489,9 +488,6 @@ static int ray_config(struct pcmcia_device *link)
 		return i;
 	}
 
-	strcpy(local->node.dev_name, dev->name);
-	link->dev_node = &local->node;
-
 	printk(KERN_INFO "%s: RayLink, irq %d, hw_addr %pM\n",
 	       dev->name, dev->irq, dev->dev_addr);
 
diff --git a/drivers/net/wireless/ray_cs.h b/drivers/net/wireless/ray_cs.h
index 1e23b7f..9f01ddb 100644
--- a/drivers/net/wireless/ray_cs.h
+++ b/drivers/net/wireless/ray_cs.h
@@ -25,7 +25,6 @@ struct beacon_rx {
 typedef struct ray_dev_t {
     int card_status;
     int authentication_state;
-    dev_node_t  node;
     window_handle_t amem_handle;   /* handle to window for attribute memory  */
     window_handle_t rmem_handle;   /* handle to window for rx buffer on card */
     void __iomem *sram;            /* pointer to beginning of shared RAM     */
diff --git a/drivers/net/wireless/wl3501.h b/drivers/net/wireless/wl3501.h
index 8bce1a5..8816e37 100644
--- a/drivers/net/wireless/wl3501.h
+++ b/drivers/net/wireless/wl3501.h
@@ -610,7 +610,6 @@ struct wl3501_card {
 	struct iw_statistics		wstats;
 	struct iw_spy_data		spy_data;
 	struct iw_public_data		wireless_data;
-	struct dev_node_t		node;
 	struct pcmcia_device		*p_dev;
 };
 #endif
diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c
index c43f05b..5e5d24c 100644
--- a/drivers/net/wireless/wl3501_cs.c
+++ b/drivers/net/wireless/wl3501_cs.c
@@ -1451,6 +1451,8 @@ static void wl3501_detach(struct pcmcia_device *link)
 	netif_device_detach(dev);
 	wl3501_release(link);
 
+	unregister_netdev(dev);
+
 	if (link->priv)
 		free_netdev(link->priv);
 
@@ -1977,20 +1979,15 @@ static int wl3501_config(struct pcmcia_device *link)
 	}
 
 	this = netdev_priv(dev);
-	/*
-	 * At this point, the dev_node_t structure(s) should be initialized and
-	 * arranged in a linked list at link->dev_node.
-	 */
-	link->dev_node = &this->node;
 
 	this->base_addr = dev->base_addr;
 
 	if (!wl3501_get_flash_mac_addr(this)) {
 		printk(KERN_WARNING "%s: Cant read MAC addr in flash ROM?\n",
 		       dev->name);
+		unregister_netdev(dev);
 		goto failed;
 	}
-	strcpy(this->node.dev_name, dev->name);
 
 	for (i = 0; i < 6; i++)
 		dev->dev_addr[i] = ((char *)&this->mac_addr)[i];
@@ -2034,12 +2031,6 @@ failed:
  */
 static void wl3501_release(struct pcmcia_device *link)
 {
-	struct net_device *dev = link->priv;
-
-	/* Unlink the device chain */
-	if (link->dev_node)
-		unregister_netdev(dev);
-
 	pcmcia_disable_device(link);
 }
 
-- 
1.6.3.3



From linux at dominikbrodowski.net  Sun Mar 21 19:07:37 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 22 Mar 2010 00:07:37 +0100
Subject: [RFC PATCH 19/19] pata_pcmcia: get rid of extra indirection
In-Reply-To: <20100321230617.GA24791@comet.dominikbrodowski.net>
References: <20100321230617.GA24791@comet.dominikbrodowski.net>
Message-ID: <1269212857-25364-19-git-send-email-linux@dominikbrodowski.net>

We don't need ata_pcmcia_info any more.

CC: linux-ide at vger.kernel.org
Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 drivers/ata/pata_pcmcia.c |   41 ++++++-----------------------------------
 1 files changed, 6 insertions(+), 35 deletions(-)

diff --git a/drivers/ata/pata_pcmcia.c b/drivers/ata/pata_pcmcia.c
index 1336216..8bcb8b6 100644
--- a/drivers/ata/pata_pcmcia.c
+++ b/drivers/ata/pata_pcmcia.c
@@ -44,16 +44,6 @@
 #define DRV_NAME "pata_pcmcia"
 #define DRV_VERSION "0.3.5"
 
-/*
- *	Private data structure to glue stuff together
- */
-
-struct ata_pcmcia_info {
-	struct pcmcia_device *pdev;
-	int		ndev;
-	dev_node_t	node;
-};
-
 /**
  *	pcmcia_set_mode	-	PCMCIA specific mode setup
  *	@link: link
@@ -247,7 +237,6 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)
 {
 	struct ata_host *host;
 	struct ata_port *ap;
-	struct ata_pcmcia_info *info;
 	struct pcmcia_config_check *stk = NULL;
 	int is_kme = 0, ret = -ENOMEM, p;
 	unsigned long io_base, ctl_base;
@@ -255,14 +244,6 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)
 	int n_ports = 1;
 	struct ata_port_operations *ops = &pcmcia_port_ops;
 
-	info = kzalloc(sizeof(*info), GFP_KERNEL);
-	if (info == NULL)
-		return -ENOMEM;
-
-	/* Glue stuff together. FIXME: We may be able to get rid of info with care */
-	info->pdev = pdev;
-	pdev->priv = info;
-
 	/* Set up attributes in order to probe card and get resources */
 	pdev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
 	pdev->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
@@ -346,16 +327,14 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)
 	if (ret)
 		goto failed;
 
-	info->ndev = 1;
+	pdev->priv = host;
 	kfree(stk);
 	return 0;
 
 failed:
 	kfree(stk);
-	info->ndev = 0;
 	pcmcia_disable_device(pdev);
 out1:
-	kfree(info);
 	return ret;
 }
 
@@ -369,20 +348,12 @@ out1:
 
 static void pcmcia_remove_one(struct pcmcia_device *pdev)
 {
-	struct ata_pcmcia_info *info = pdev->priv;
-	struct device *dev = &pdev->dev;
-
-	if (info != NULL) {
-		/* If we have attached the device to the ATA layer, detach it */
-		if (info->ndev) {
-			struct ata_host *host = dev_get_drvdata(dev);
-			ata_host_detach(host);
-		}
-		info->ndev = 0;
-		pdev->priv = NULL;
-	}
+	struct ata_host *host = pdev->priv;
+
+	if (host)
+		ata_host_detach(host);
+
 	pcmcia_disable_device(pdev);
-	kfree(info);
 }
 
 static struct pcmcia_device_id pcmcia_devices[] = {
-- 
1.6.3.3



From linux at dominikbrodowski.net  Sun Mar 21 19:07:27 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 22 Mar 2010 00:07:27 +0100
Subject: [RFC PATCH 09/19] pcmcia: dev_node removal (write-only drivers)
In-Reply-To: <20100321230617.GA24791@comet.dominikbrodowski.net>
References: <20100321230617.GA24791@comet.dominikbrodowski.net>
Message-ID: <1269212857-25364-9-git-send-email-linux@dominikbrodowski.net>

dev_node_t was only used to transport some minor/major numbers
from the PCMCIA device drivers to deprecated userspace helpers.
However, only a few drivers made use of it, and the userspace
helpers are deprecated anyways. Therefore, get rid of dev_node_t .

As a first step, remove any usage of dev_node_t from drivers which
only wrote to this typedef/struct, but did not make use of it.

CC: linux-bluetooth at vger.kernel.org
CC: Harald Welte <laforge at gnumonks.org>
CC: linux-mtd at lists.infradead.org
CC: linux-wireless at vger.kernel.org
CC: netdev at vger.kernel.org
CC: linux-serial at vger.kernel.org
CC: alsa-devel at alsa-project.org
Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 drivers/bluetooth/bluecard_cs.c         |    4 ---
 drivers/bluetooth/bt3c_cs.c             |    4 ---
 drivers/bluetooth/btuart_cs.c           |    4 ---
 drivers/bluetooth/dtl1_cs.c             |    4 ---
 drivers/char/pcmcia/cm4040_cs.c         |    5 ---
 drivers/mtd/maps/pcmciamtd.c            |    3 --
 drivers/net/wireless/atmel_cs.c         |   42 -------------------------------
 drivers/net/wireless/hostap/hostap_cs.c |    9 +-----
 drivers/parport/parport_cs.c            |    5 ---
 drivers/scsi/pcmcia/aha152x_stub.c      |    3 --
 drivers/scsi/pcmcia/fdomain_stub.c      |    3 --
 drivers/scsi/pcmcia/nsp_cs.c            |    3 --
 drivers/scsi/pcmcia/nsp_cs.h            |    1 -
 drivers/scsi/pcmcia/qlogic_stub.c       |    3 --
 drivers/scsi/pcmcia/sym53c500_cs.c      |    3 --
 drivers/serial/serial_cs.c              |    9 ------
 drivers/telephony/ixj_pcmcia.c          |    3 --
 sound/pcmcia/pdaudiocf/pdaudiocf.c      |    1 -
 sound/pcmcia/pdaudiocf/pdaudiocf.h      |    1 -
 sound/pcmcia/vx/vxpocket.c              |    2 -
 sound/pcmcia/vx/vxpocket.h              |    1 -
 21 files changed, 2 insertions(+), 111 deletions(-)

diff --git a/drivers/bluetooth/bluecard_cs.c b/drivers/bluetooth/bluecard_cs.c
index a34653d..6f907eb 100644
--- a/drivers/bluetooth/bluecard_cs.c
+++ b/drivers/bluetooth/bluecard_cs.c
@@ -65,7 +65,6 @@ MODULE_LICENSE("GPL");
 
 typedef struct bluecard_info_t {
 	struct pcmcia_device *p_dev;
-	dev_node_t node;
 
 	struct hci_dev *hdev;
 
@@ -916,9 +915,6 @@ static int bluecard_config(struct pcmcia_device *link)
 	if (bluecard_open(info) != 0)
 		goto failed;
 
-	strcpy(info->node.dev_name, info->hdev->name);
-	link->dev_node = &info->node;
-
 	return 0;
 
 failed:
diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c
index 1ad9694..21e05fd 100644
--- a/drivers/bluetooth/bt3c_cs.c
+++ b/drivers/bluetooth/bt3c_cs.c
@@ -72,7 +72,6 @@ MODULE_FIRMWARE("BT3CPCC.bin");
 
 typedef struct bt3c_info_t {
 	struct pcmcia_device *p_dev;
-	dev_node_t node;
 
 	struct hci_dev *hdev;
 
@@ -751,9 +750,6 @@ found_port:
 	if (bt3c_open(info) != 0)
 		goto failed;
 
-	strcpy(info->node.dev_name, info->hdev->name);
-	link->dev_node = &info->node;
-
 	return 0;
 
 failed:
diff --git a/drivers/bluetooth/btuart_cs.c b/drivers/bluetooth/btuart_cs.c
index 1073d66..4ed7288 100644
--- a/drivers/bluetooth/btuart_cs.c
+++ b/drivers/bluetooth/btuart_cs.c
@@ -67,7 +67,6 @@ MODULE_LICENSE("GPL");
 
 typedef struct btuart_info_t {
 	struct pcmcia_device *p_dev;
-	dev_node_t node;
 
 	struct hci_dev *hdev;
 
@@ -680,9 +679,6 @@ found_port:
 	if (btuart_open(info) != 0)
 		goto failed;
 
-	strcpy(info->node.dev_name, info->hdev->name);
-	link->dev_node = &info->node;
-
 	return 0;
 
 failed:
diff --git a/drivers/bluetooth/dtl1_cs.c b/drivers/bluetooth/dtl1_cs.c
index 3d72afd..ef044d5 100644
--- a/drivers/bluetooth/dtl1_cs.c
+++ b/drivers/bluetooth/dtl1_cs.c
@@ -67,7 +67,6 @@ MODULE_LICENSE("GPL");
 
 typedef struct dtl1_info_t {
 	struct pcmcia_device *p_dev;
-	dev_node_t node;
 
 	struct hci_dev *hdev;
 
@@ -629,9 +628,6 @@ static int dtl1_config(struct pcmcia_device *link)
 	if (dtl1_open(info) != 0)
 		goto failed;
 
-	strcpy(info->node.dev_name, info->hdev->name);
-	link->dev_node = &info->node;
-
 	return 0;
 
 failed:
diff --git a/drivers/char/pcmcia/cm4040_cs.c b/drivers/char/pcmcia/cm4040_cs.c
index a6a70e4..c0775c8 100644
--- a/drivers/char/pcmcia/cm4040_cs.c
+++ b/drivers/char/pcmcia/cm4040_cs.c
@@ -72,7 +72,6 @@ static struct class *cmx_class;
 
 struct reader_dev {
 	struct pcmcia_device	*p_dev;
-	dev_node_t		node;
 	wait_queue_head_t	devq;
 	wait_queue_head_t	poll_wait;
 	wait_queue_head_t	read_wait;
@@ -568,10 +567,6 @@ static int reader_config(struct pcmcia_device *link, int devno)
 	}
 
 	dev = link->priv;
-	sprintf(dev->node.dev_name, DEVICE_NAME "%d", devno);
-	dev->node.major = major;
-	dev->node.minor = devno;
-	dev->node.next = &dev->node;
 
 	DEBUGP(2, dev, "device " DEVICE_NAME "%d at 0x%.4x-0x%.4x\n", devno,
 	      link->io.BasePort1, link->io.BasePort1+link->io.NumPorts1);
diff --git a/drivers/mtd/maps/pcmciamtd.c b/drivers/mtd/maps/pcmciamtd.c
index 689d6a7..87b2b8f 100644
--- a/drivers/mtd/maps/pcmciamtd.c
+++ b/drivers/mtd/maps/pcmciamtd.c
@@ -52,7 +52,6 @@ static const int debug = 0;
 
 struct pcmciamtd_dev {
 	struct pcmcia_device	*p_dev;
-	dev_node_t	node;		/* device node */
 	caddr_t		win_base;	/* ioremapped address of PCMCIA window */
 	unsigned int	win_size;	/* size of window */
 	unsigned int	offset;		/* offset into card the window currently points at */
@@ -647,9 +646,7 @@ static int pcmciamtd_config(struct pcmcia_device *link)
 		pcmciamtd_release(link);
 		return -ENODEV;
 	}
-	snprintf(dev->node.dev_name, sizeof(dev->node.dev_name), "mtd%d", mtd->index);
 	info("mtd%d: %s", mtd->index, mtd->name);
-	link->dev_node = &dev->node;
 	return 0;
 
  failed:
diff --git a/drivers/net/wireless/atmel_cs.c b/drivers/net/wireless/atmel_cs.c
index 759cdc4..c2746fc 100644
--- a/drivers/net/wireless/atmel_cs.c
+++ b/drivers/net/wireless/atmel_cs.c
@@ -85,41 +85,7 @@ static void atmel_release(struct pcmcia_device *link);
 
 static void atmel_detach(struct pcmcia_device *p_dev);
 
-/*
-   You'll also need to prototype all the functions that will actually
-   be used to talk to your device.  See 'pcmem_cs' for a good example
-   of a fully self-sufficient driver; the other drivers rely more or
-   less on other parts of the kernel.
-*/
-
-/*
-   A linked list of "instances" of the  atmelnet device.  Each actual
-   PCMCIA card corresponds to one device instance, and is described
-   by one struct pcmcia_device structure (defined in ds.h).
-
-   You may not want to use a linked list for this -- for example, the
-   memory card driver uses an array of struct pcmcia_device pointers, where minor
-   device numbers are used to derive the corresponding array index.
-*/
-
-/*
-   A driver needs to provide a dev_node_t structure for each device
-   on a card.  In some cases, there is only one device per card (for
-   example, ethernet cards, modems).  In other cases, there may be
-   many actual or logical devices (SCSI adapters, memory cards with
-   multiple partitions).  The dev_node_t structures need to be kept
-   in a linked list starting at the 'dev' field of a struct pcmcia_device
-   structure.  We allocate them in the card's private data structure,
-   because they generally shouldn't be allocated dynamically.
-
-   In this case, we also provide a flag to indicate if a device is
-   "stopped" due to a power management event, or card ejection.  The
-   device IO routines can use a flag like this to throttle IO to a
-   card that is not ready to accept it.
-*/
-
 typedef struct local_info_t {
-	dev_node_t	node;
 	struct net_device *eth_dev;
 } local_info_t;
 
@@ -297,14 +263,6 @@ static int atmel_config(struct pcmcia_device *link)
 			goto failed;
 
 
-	/*
-	  At this point, the dev_node_t structure(s) need to be
-	  initialized and arranged in a linked list at link->dev_node.
-	*/
-	strcpy(dev->node.dev_name, ((local_info_t*)link->priv)->eth_dev->name );
-	dev->node.major = dev->node.minor = 0;
-	link->dev_node = &dev->node;
-
 	return 0;
 
  failed:
diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c
index 7e5f4c0..56d7d90 100644
--- a/drivers/net/wireless/hostap/hostap_cs.c
+++ b/drivers/net/wireless/hostap/hostap_cs.c
@@ -38,7 +38,6 @@ MODULE_PARM_DESC(ignore_cis_vcc, "Ignore broken CIS VCC entry");
 
 /* struct local_info::hw_priv */
 struct hostap_cs_priv {
-	dev_node_t node;
 	struct pcmcia_device *link;
 	int sandisk_connectplus;
 };
@@ -624,8 +623,6 @@ static int prism2_config(struct pcmcia_device *link)
 	local = iface->local;
 	local->hw_priv = hw_priv;
 	hw_priv->link = link;
-	strcpy(hw_priv->node.dev_name, dev->name);
-	link->dev_node = &hw_priv->node;
 
 	ret = pcmcia_request_irq(link, prism2_interrupt);
 	if (ret)
@@ -664,11 +661,9 @@ static int prism2_config(struct pcmcia_device *link)
 	sandisk_enable_wireless(dev);
 
 	ret = prism2_hw_config(dev, 1);
-	if (!ret) {
+	if (!ret)
 		ret = hostap_hw_ready(dev);
-		if (ret == 0 && local->ddev)
-			strcpy(hw_priv->node.dev_name, local->ddev->name);
-	}
+
 	return ret;
 
  failed:
diff --git a/drivers/parport/parport_cs.c b/drivers/parport/parport_cs.c
index 80c9052..fd8cfe9 100644
--- a/drivers/parport/parport_cs.c
+++ b/drivers/parport/parport_cs.c
@@ -75,7 +75,6 @@ INT_MODULE_PARM(epp_mode, 1);
 typedef struct parport_info_t {
 	struct pcmcia_device	*p_dev;
     int			ndev;
-    dev_node_t		node;
     struct parport	*port;
 } parport_info_t;
 
@@ -193,11 +192,7 @@ static int parport_config(struct pcmcia_device *link)
     if (epp_mode)
 	p->modes |= PARPORT_MODE_TRISTATE | PARPORT_MODE_EPP;
     info->ndev = 1;
-    info->node.major = LP_MAJOR;
-    info->node.minor = p->number;
     info->port = p;
-    strcpy(info->node.dev_name, p->name);
-    link->dev_node = &info->node;
 
     return 0;
 
diff --git a/drivers/scsi/pcmcia/aha152x_stub.c b/drivers/scsi/pcmcia/aha152x_stub.c
index c1de4ba..9d70aef 100644
--- a/drivers/scsi/pcmcia/aha152x_stub.c
+++ b/drivers/scsi/pcmcia/aha152x_stub.c
@@ -80,7 +80,6 @@ MODULE_LICENSE("Dual MPL/GPL");
 
 typedef struct scsi_info_t {
 	struct pcmcia_device	*p_dev;
-    dev_node_t		node;
     struct Scsi_Host	*host;
 } scsi_info_t;
 
@@ -185,8 +184,6 @@ static int aha152x_config_cs(struct pcmcia_device *link)
 	goto failed;
     }
 
-    sprintf(info->node.dev_name, "scsi%d", host->host_no);
-    link->dev_node = &info->node;
     info->host = host;
 
     return 0;
diff --git a/drivers/scsi/pcmcia/fdomain_stub.c b/drivers/scsi/pcmcia/fdomain_stub.c
index 8cb6d71..21b1411 100644
--- a/drivers/scsi/pcmcia/fdomain_stub.c
+++ b/drivers/scsi/pcmcia/fdomain_stub.c
@@ -63,7 +63,6 @@ MODULE_LICENSE("Dual MPL/GPL");
 
 typedef struct scsi_info_t {
 	struct pcmcia_device	*p_dev;
-    dev_node_t		node;
     struct Scsi_Host	*host;
 } scsi_info_t;
 
@@ -155,8 +154,6 @@ static int fdomain_config(struct pcmcia_device *link)
 	    goto failed;
     scsi_scan_host(host);
 
-    sprintf(info->node.dev_name, "scsi%d", host->host_no);
-    link->dev_node = &info->node;
     info->host = host;
 
     return 0;
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c
index 24c78ed..0f0e112 100644
--- a/drivers/scsi/pcmcia/nsp_cs.c
+++ b/drivers/scsi/pcmcia/nsp_cs.c
@@ -1754,8 +1754,6 @@ static int nsp_cs_config(struct pcmcia_device *link)
 
 	scsi_scan_host(host);
 
-	snprintf(info->node.dev_name, sizeof(info->node.dev_name), "scsi%d", host->host_no);
-	link->dev_node  = &info->node;
 	info->host = host;
 
 	/* Finally, report what we've done */
@@ -1813,7 +1811,6 @@ static void nsp_cs_release(struct pcmcia_device *link)
 	if (info->host != NULL) {
 		scsi_remove_host(info->host);
 	}
-	link->dev_node = NULL;
 
 	if (link->win) {
 		if (data != NULL) {
diff --git a/drivers/scsi/pcmcia/nsp_cs.h b/drivers/scsi/pcmcia/nsp_cs.h
index 8c61a4f..d68c9f2 100644
--- a/drivers/scsi/pcmcia/nsp_cs.h
+++ b/drivers/scsi/pcmcia/nsp_cs.h
@@ -224,7 +224,6 @@
 typedef struct scsi_info_t {
 	struct pcmcia_device	*p_dev;
 	struct Scsi_Host      *host;
-	dev_node_t             node;
 	int                    stop;
 } scsi_info_t;
 
diff --git a/drivers/scsi/pcmcia/qlogic_stub.c b/drivers/scsi/pcmcia/qlogic_stub.c
index c3a4428..f0fc6ba 100644
--- a/drivers/scsi/pcmcia/qlogic_stub.c
+++ b/drivers/scsi/pcmcia/qlogic_stub.c
@@ -82,7 +82,6 @@ static struct scsi_host_template qlogicfas_driver_template = {
 
 typedef struct scsi_info_t {
 	struct pcmcia_device	*p_dev;
-	dev_node_t node;
 	struct Scsi_Host *host;
 	unsigned short manf_id;
 } scsi_info_t;
@@ -235,8 +234,6 @@ static int qlogic_config(struct pcmcia_device * link)
 		goto failed;
 	}
 
-	sprintf(info->node.dev_name, "scsi%d", host->host_no);
-	link->dev_node = &info->node;
 	info->host = host;
 
 	return 0;
diff --git a/drivers/scsi/pcmcia/sym53c500_cs.c b/drivers/scsi/pcmcia/sym53c500_cs.c
index 6eacf4c..a511641 100644
--- a/drivers/scsi/pcmcia/sym53c500_cs.c
+++ b/drivers/scsi/pcmcia/sym53c500_cs.c
@@ -191,7 +191,6 @@
 
 struct scsi_info_t {
 	struct pcmcia_device	*p_dev;
-	dev_node_t node;
 	struct Scsi_Host *host;
 	unsigned short manf_id;
 };
@@ -792,8 +791,6 @@ SYM53C500_config(struct pcmcia_device *link)
 	*/
 	data->fast_pio = USE_FAST_PIO;
 
-	sprintf(info->node.dev_name, "scsi%d", host->host_no);
-	link->dev_node = &info->node;
 	info->host = host;
 
 	if (scsi_add_host(host, NULL))
diff --git a/drivers/serial/serial_cs.c b/drivers/serial/serial_cs.c
index 7519d27..048bd89 100644
--- a/drivers/serial/serial_cs.c
+++ b/drivers/serial/serial_cs.c
@@ -89,7 +89,6 @@ struct serial_info {
 	int			manfid;
 	int			prodid;
 	int			c950ctrl;
-	dev_node_t		node[4];
 	int			line[4];
 	const struct serial_quirk *quirk;
 };
@@ -280,8 +279,6 @@ static void serial_remove(struct pcmcia_device *link)
 	for (i = 0; i < info->ndev; i++)
 		serial8250_unregister_port(info->line[i]);
 
-	info->p_dev->dev_node = NULL;
-
 	if (!info->slave)
 		pcmcia_disable_device(link);
 }
@@ -401,11 +398,6 @@ static int setup_serial(struct pcmcia_device *handle, struct serial_info * info,
 	}
 
 	info->line[info->ndev] = line;
-	sprintf(info->node[info->ndev].dev_name, "ttyS%d", line);
-	info->node[info->ndev].major = TTY_MAJOR;
-	info->node[info->ndev].minor = 0x40 + line;
-	if (info->ndev > 0)
-		info->node[info->ndev - 1].next = &info->node[info->ndev];
 	info->ndev++;
 
 	return 0;
@@ -702,7 +694,6 @@ static int serial_config(struct pcmcia_device * link)
 		if (info->quirk->post(link))
 			goto failed;
 
-	link->dev_node = &info->node[0];
 	return 0;
 
 failed:
diff --git a/drivers/telephony/ixj_pcmcia.c b/drivers/telephony/ixj_pcmcia.c
index d442fd3..99cb224 100644
--- a/drivers/telephony/ixj_pcmcia.c
+++ b/drivers/telephony/ixj_pcmcia.c
@@ -22,7 +22,6 @@
 
 typedef struct ixj_info_t {
 	int ndev;
-	dev_node_t node;
 	struct ixj *port;
 } ixj_info_t;
 
@@ -155,8 +154,6 @@ static int ixj_config(struct pcmcia_device * link)
 	j = ixj_pcmcia_probe(link->io.BasePort1, link->io.BasePort1 + 0x10);
 
 	info->ndev = 1;
-	info->node.major = PHONE_MAJOR;
-	link->dev_node = &info->node;
 	ixj_get_serial(link, j);
 	return 0;
 
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf.c b/sound/pcmcia/pdaudiocf/pdaudiocf.c
index 60fddf3..df110df 100644
--- a/sound/pcmcia/pdaudiocf/pdaudiocf.c
+++ b/sound/pcmcia/pdaudiocf/pdaudiocf.c
@@ -234,7 +234,6 @@ static int pdacf_config(struct pcmcia_device *link)
 	if (snd_pdacf_assign_resources(pdacf, link->io.BasePort1, link->irq) < 0)
 		goto failed;
 
-	link->dev_node = &pdacf->node;
 	return 0;
 
 failed:
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf.h b/sound/pcmcia/pdaudiocf/pdaudiocf.h
index b060183..a0a7ec6 100644
--- a/sound/pcmcia/pdaudiocf/pdaudiocf.h
+++ b/sound/pcmcia/pdaudiocf/pdaudiocf.h
@@ -117,7 +117,6 @@ struct snd_pdacf {
 	
 	/* pcmcia stuff */
 	struct pcmcia_device	*p_dev;
-	dev_node_t node;
 };
 
 static inline void pdacf_reg_write(struct snd_pdacf *chip, unsigned char reg, unsigned short val)
diff --git a/sound/pcmcia/vx/vxpocket.c b/sound/pcmcia/vx/vxpocket.c
index 4198395..5f21d10 100644
--- a/sound/pcmcia/vx/vxpocket.c
+++ b/sound/pcmcia/vx/vxpocket.c
@@ -210,7 +210,6 @@ static int snd_vxpocket_assign_resources(struct vx_core *chip, int port, int irq
 static int vxpocket_config(struct pcmcia_device *link)
 {
 	struct vx_core *chip = link->priv;
-	struct snd_vxpocket *vxp = (struct snd_vxpocket *)chip;
 	int ret;
 
 	snd_printdd(KERN_DEBUG "vxpocket_config called\n");
@@ -244,7 +243,6 @@ static int vxpocket_config(struct pcmcia_device *link)
 	if (snd_vxpocket_assign_resources(chip, link->io.BasePort1, link->irq) < 0)
 		goto failed;
 
-	link->dev_node = &vxp->node;
 	return 0;
 
 failed:
diff --git a/sound/pcmcia/vx/vxpocket.h b/sound/pcmcia/vx/vxpocket.h
index 27ea002..ea4df16 100644
--- a/sound/pcmcia/vx/vxpocket.h
+++ b/sound/pcmcia/vx/vxpocket.h
@@ -43,7 +43,6 @@ struct snd_vxpocket {
 
 	/* pcmcia stuff */
 	struct pcmcia_device	*p_dev;
-	dev_node_t node;
 };
 
 extern struct snd_vx_ops snd_vxpocket_ops;
-- 
1.6.3.3



From linux at dominikbrodowski.net  Sun Mar 21 19:07:28 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 22 Mar 2010 00:07:28 +0100
Subject: [RFC PATCH 10/19] pcmcia: dev_node removal (drivers with updated
	printk call)
In-Reply-To: <20100321230617.GA24791@comet.dominikbrodowski.net>
References: <20100321230617.GA24791@comet.dominikbrodowski.net>
Message-ID: <1269212857-25364-10-git-send-email-linux@dominikbrodowski.net>

As a second step, remove any usage of dev_node_t from drivers which
only wrote to this typedef/struct, except one printk() which can
easily be replaced by a dev_info()/dev_warn() call.

CC: Harald Welte <laforge at gnumonks.org>
CC: linux-ide at vger.kernel.org
CC: Karsten Keil <isdn at linux-pingi.de>
CC: linux-wireless at vger.kernel.org
CC: netdev at vger.kernel.org
CC: linux-usb at vger.kernel.org
Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 drivers/char/pcmcia/cm4000_cs.c    |    9 +-----
 drivers/char/pcmcia/synclink_cs.c  |   10 +-----
 drivers/ide/ide-cs.c               |   12 ++-----
 drivers/isdn/hardware/avm/avm_cs.c |   60 +++---------------------------------
 drivers/isdn/hisax/elsa_cs.c       |   27 +---------------
 drivers/isdn/hisax/sedlbauer_cs.c  |   37 +---------------------
 drivers/isdn/hisax/teles_cs.c      |   37 +---------------------
 drivers/net/wireless/airo_cs.c     |   47 +---------------------------
 drivers/usb/host/sl811_cs.c        |   10 +-----
 9 files changed, 22 insertions(+), 227 deletions(-)

diff --git a/drivers/char/pcmcia/cm4000_cs.c b/drivers/char/pcmcia/cm4000_cs.c
index c9bc896..251faa1 100644
--- a/drivers/char/pcmcia/cm4000_cs.c
+++ b/drivers/char/pcmcia/cm4000_cs.c
@@ -106,7 +106,6 @@ static int major;		/* major number we get from the kernel */
 
 struct cm4000_dev {
 	struct pcmcia_device *p_dev;
-	dev_node_t node;		/* OS node (major,minor) */
 
 	unsigned char atr[MAX_ATR];
 	unsigned char rbuf[512];
@@ -884,8 +883,7 @@ static void monitor_card(unsigned long p)
 		/* slow down warning, but prompt immediately after insertion */
 		if (dev->cwarn == 0 || dev->cwarn == 10) {
 			set_bit(IS_BAD_CARD, &dev->flags);
-			printk(KERN_WARNING MODULE_NAME ": device %s: ",
-			       dev->node.dev_name);
+			dev_warn(&dev->p_dev->dev, MODULE_NAME ": ");
 			if (test_bit(IS_BAD_CSUM, &dev->flags)) {
 				DEBUGP(4, dev, "ATR checksum (0x%.2x, should "
 				       "be zero) failed\n", dev->atr_csum);
@@ -1779,11 +1777,6 @@ static int cm4000_config(struct pcmcia_device * link, int devno)
 		goto cs_release;
 
 	dev = link->priv;
-	sprintf(dev->node.dev_name, DEVICE_NAME "%d", devno);
-	dev->node.major = major;
-	dev->node.minor = devno;
-	dev->node.next = NULL;
-	link->dev_node = &dev->node;
 
 	return 0;
 
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
index 027690b..308903e 100644
--- a/drivers/char/pcmcia/synclink_cs.c
+++ b/drivers/char/pcmcia/synclink_cs.c
@@ -220,7 +220,6 @@ typedef struct _mgslpc_info {
 
 	/* PCMCIA support */
 	struct pcmcia_device	*p_dev;
-	dev_node_t	      node;
 	int		      stop;
 
 	/* SPPP/Cisco HDLC device parts */
@@ -614,13 +613,8 @@ static int mgslpc_config(struct pcmcia_device *link)
     info->io_base = link->io.BasePort1;
     info->irq_level = link->irq;
 
-    /* add to linked list of devices */
-    sprintf(info->node.dev_name, "mgslpc0");
-    info->node.major = info->node.minor = 0;
-    link->dev_node = &info->node;
-
-    printk(KERN_INFO "%s: index 0x%02x:",
-	   info->node.dev_name, link->conf.ConfigIndex);
+    dev_info(&link->dev, "index 0x%02x:",
+	    link->conf.ConfigIndex);
     if (link->conf.Attributes & CONF_ENABLE_IRQ)
 	    printk(", irq %d", link->irq);
     if (link->io.NumPorts1)
diff --git a/drivers/ide/ide-cs.c b/drivers/ide/ide-cs.c
index afd1ab7..e3152b1 100644
--- a/drivers/ide/ide-cs.c
+++ b/drivers/ide/ide-cs.c
@@ -65,8 +65,7 @@ MODULE_LICENSE("Dual MPL/GPL");
 typedef struct ide_info_t {
 	struct pcmcia_device	*p_dev;
 	struct ide_host		*host;
-    int		ndev;
-    dev_node_t	node;
+	int			ndev;
 } ide_info_t;
 
 static void ide_release(struct pcmcia_device *);
@@ -308,13 +307,10 @@ static int ide_config(struct pcmcia_device *link)
 	goto failed;
 
     info->ndev = 1;
-    sprintf(info->node.dev_name, "hd%c", 'a' + host->ports[0]->index * 2);
-    info->node.major = host->ports[0]->major;
-    info->node.minor = 0;
     info->host = host;
-    link->dev_node = &info->node;
-    printk(KERN_INFO "ide-cs: %s: Vpp = %d.%d\n",
-	   info->node.dev_name, link->conf.Vpp / 10, link->conf.Vpp % 10);
+    dev_info(&link->dev, "ide-cs: hd%c: Vpp = %d.%d\n",
+	    'a' + host->ports[0]->index * 2,
+	    link->conf.Vpp / 10, link->conf.Vpp % 10);
 
     kfree(stk);
     return 0;
diff --git a/drivers/isdn/hardware/avm/avm_cs.c b/drivers/isdn/hardware/avm/avm_cs.c
index 0d485f6..8bbc452 100644
--- a/drivers/isdn/hardware/avm/avm_cs.c
+++ b/drivers/isdn/hardware/avm/avm_cs.c
@@ -61,31 +61,6 @@ static void avmcs_release(struct pcmcia_device *link);
 
 static void avmcs_detach(struct pcmcia_device *p_dev);
 
-/*
-   A linked list of "instances" of the skeleton device.  Each actual
-   PCMCIA card corresponds to one device instance, and is described
-   by one struct pcmcia_device structure (defined in ds.h).
-
-   You may not want to use a linked list for this -- for example, the
-   memory card driver uses an array of struct pcmcia_device pointers, where minor
-   device numbers are used to derive the corresponding array index.
-*/
-
-/*
-   A driver needs to provide a dev_node_t structure for each device
-   on a card.  In some cases, there is only one device per card (for
-   example, ethernet cards, modems).  In other cases, there may be
-   many actual or logical devices (SCSI adapters, memory cards with
-   multiple partitions).  The dev_node_t structures need to be kept
-   in a linked list starting at the 'dev' field of a struct pcmcia_device
-   structure.  We allocate them in the card's private data structure,
-   because they generally can't be allocated dynamically.
-*/
-   
-typedef struct local_info_t {
-    dev_node_t	node;
-} local_info_t;
-
 /*======================================================================
 
     avmcs_attach() creates an "instance" of the driver, allocating
@@ -100,7 +75,6 @@ typedef struct local_info_t {
 
 static int avmcs_probe(struct pcmcia_device *p_dev)
 {
-    local_info_t *local;
 
     /* The io structure describes IO port mapping */
     p_dev->io.NumPorts1 = 16;
@@ -113,16 +87,7 @@ static int avmcs_probe(struct pcmcia_device *p_dev)
     p_dev->conf.ConfigIndex = 1;
     p_dev->conf.Present = PRESENT_OPTION;
 
-    /* Allocate space for private device-specific data */
-    local = kzalloc(sizeof(local_info_t), GFP_KERNEL);
-    if (!local)
-        goto err;
-    p_dev->priv = local;
-
     return avmcs_config(p_dev);
-
- err:
-    return -ENOMEM;
 } /* avmcs_attach */
 
 /*======================================================================
@@ -137,7 +102,6 @@ static int avmcs_probe(struct pcmcia_device *p_dev)
 static void avmcs_detach(struct pcmcia_device *link)
 {
 	avmcs_release(link);
-	kfree(link->priv);
 } /* avmcs_detach */
 
 /*======================================================================
@@ -168,14 +132,11 @@ static int avmcs_configcheck(struct pcmcia_device *p_dev,
 
 static int avmcs_config(struct pcmcia_device *link)
 {
-    local_info_t *dev;
     int i = -1;
     char devname[128];
     int cardtype;
     int (*addcard)(unsigned int port, unsigned irq);
 
-    dev = link->priv;
-
     devname[0] = 0;
     if (link->prod_id[1])
 	    strlcpy(devname, link->prod_id[1], sizeof(devname));
@@ -204,15 +165,11 @@ static int avmcs_config(struct pcmcia_device *link)
 
     } while (0);
 
-    /* At this point, the dev_node_t structure(s) should be
-       initialized and arranged in a linked list at link->dev. */
-
     if (devname[0]) {
 	char *s = strrchr(devname, ' ');
 	if (!s)
 	   s = devname;
 	else s++;
-	strcpy(dev->node.dev_name, s);
         if (strcmp("M1", s) == 0) {
            cardtype = AVM_CARDTYPE_M1;
         } else if (strcmp("M2", s) == 0) {
@@ -220,14 +177,8 @@ static int avmcs_config(struct pcmcia_device *link)
 	} else {
            cardtype = AVM_CARDTYPE_B1;
 	}
-    } else {
-        strcpy(dev->node.dev_name, "b1");
+    } else
         cardtype = AVM_CARDTYPE_B1;
-    }
-
-    dev->node.major = 64;
-    dev->node.minor = 0;
-    link->dev_node = &dev->node;
 
     /* If any step failed, release any partially configured state */
     if (i != 0) {
@@ -243,12 +194,11 @@ static int avmcs_config(struct pcmcia_device *link)
         case AVM_CARDTYPE_B1: addcard = b1pcmcia_addcard_b1; break;
     }
     if ((i = (*addcard)(link->io.BasePort1, link->irq)) < 0) {
-        printk(KERN_ERR "avm_cs: failed to add AVM-%s-Controller at i/o %#x, irq %d\n",
-		dev->node.dev_name, link->io.BasePort1, link->irq);
-	avmcs_release(link);
-	return -ENODEV;
+	    dev_err(&link->dev, "avm_cs: failed to add AVM-Controller at i/o %#x, irq %d\n",
+		    link->io.BasePort1, link->irq);
+	    avmcs_release(link);
+	    return -ENODEV;
     }
-    dev->node.minor = i;
     return 0;
 
 } /* avmcs_config */
diff --git a/drivers/isdn/hisax/elsa_cs.c b/drivers/isdn/hisax/elsa_cs.c
index 242c434..04de232 100644
--- a/drivers/isdn/hisax/elsa_cs.c
+++ b/drivers/isdn/hisax/elsa_cs.c
@@ -87,24 +87,8 @@ static void elsa_cs_release(struct pcmcia_device *link);
 
 static void elsa_cs_detach(struct pcmcia_device *p_dev);
 
-/*
-   A driver needs to provide a dev_node_t structure for each device
-   on a card.  In some cases, there is only one device per card (for
-   example, ethernet cards, modems).  In other cases, there may be
-   many actual or logical devices (SCSI adapters, memory cards with
-   multiple partitions).  The dev_node_t structures need to be kept
-   in a linked list starting at the 'dev' field of a struct pcmcia_device
-   structure.  We allocate them in the card's private data structure,
-   because they generally shouldn't be allocated dynamically.
-   In this case, we also provide a flag to indicate if a device is
-   "stopped" due to a power management event, or card ejection.  The
-   device IO routines can use a flag like this to throttle IO to a
-   card that is not ready to accept it.
-*/
-
 typedef struct local_info_t {
 	struct pcmcia_device	*p_dev;
-    dev_node_t          node;
     int                 busy;
     int			cardnr;
 } local_info_t;
@@ -226,16 +210,9 @@ static int elsa_cs_config(struct pcmcia_device *link)
     if (i != 0)
 	goto failed;
 
-    /* At this point, the dev_node_t structure(s) should be
-       initialized and arranged in a linked list at link->dev. *//*  */
-    sprintf(dev->node.dev_name, "elsa");
-    dev->node.major = dev->node.minor = 0x0;
-
-    link->dev_node = &dev->node;
-
     /* Finally, report what we've done */
-    printk(KERN_INFO "%s: index 0x%02x: ",
-           dev->node.dev_name, link->conf.ConfigIndex);
+    dev_info(&link->dev, "index 0x%02x: ",
+	    link->conf.ConfigIndex);
     if (link->conf.Attributes & CONF_ENABLE_IRQ)
 	printk(", irq %d", link->irq);
     if (link->io.NumPorts1)
diff --git a/drivers/isdn/hisax/sedlbauer_cs.c b/drivers/isdn/hisax/sedlbauer_cs.c
index 967371b..a9ace20 100644
--- a/drivers/isdn/hisax/sedlbauer_cs.c
+++ b/drivers/isdn/hisax/sedlbauer_cs.c
@@ -87,32 +87,8 @@ static void sedlbauer_release(struct pcmcia_device *link);
 
 static void sedlbauer_detach(struct pcmcia_device *p_dev);
 
-/*
-   You'll also need to prototype all the functions that will actually
-   be used to talk to your device.  See 'memory_cs' for a good example
-   of a fully self-sufficient driver; the other drivers rely more or
-   less on other parts of the kernel.
-*/
-
-/*
-   A driver needs to provide a dev_node_t structure for each device
-   on a card.  In some cases, there is only one device per card (for
-   example, ethernet cards, modems).  In other cases, there may be
-   many actual or logical devices (SCSI adapters, memory cards with
-   multiple partitions).  The dev_node_t structures need to be kept
-   in a linked list starting at the 'dev' field of a struct pcmcia_device
-   structure.  We allocate them in the card's private data structure,
-   because they generally shouldn't be allocated dynamically.
-
-   In this case, we also provide a flag to indicate if a device is
-   "stopped" due to a power management event, or card ejection.  The
-   device IO routines can use a flag like this to throttle IO to a
-   card that is not ready to accept it.
-*/
-   
 typedef struct local_info_t {
 	struct pcmcia_device	*p_dev;
-    dev_node_t		node;
     int			stop;
     int			cardnr;
 } local_info_t;
@@ -279,7 +255,6 @@ static int sedlbauer_config_check(struct pcmcia_device *p_dev,
 
 static int sedlbauer_config(struct pcmcia_device *link)
 {
-    local_info_t *dev = link->priv;
     win_req_t *req;
     int ret;
     IsdnCard_t  icard;
@@ -315,17 +290,9 @@ static int sedlbauer_config(struct pcmcia_device *link)
     if (ret)
 	    goto failed;
 
-    /*
-      At this point, the dev_node_t structure(s) need to be
-      initialized and arranged in a linked list at link->dev.
-    */
-    sprintf(dev->node.dev_name, "sedlbauer");
-    dev->node.major = dev->node.minor = 0;
-    link->dev_node = &dev->node;
-
     /* Finally, report what we've done */
-    printk(KERN_INFO "%s: index 0x%02x:",
-	   dev->node.dev_name, link->conf.ConfigIndex);
+    dev_info(&link->dev, "index 0x%02x:",
+	   link->conf.ConfigIndex);
     if (link->conf.Vpp)
 	printk(", Vpp %d.%d", link->conf.Vpp/10, link->conf.Vpp%10);
     if (link->conf.Attributes & CONF_ENABLE_IRQ)
diff --git a/drivers/isdn/hisax/teles_cs.c b/drivers/isdn/hisax/teles_cs.c
index 75e075c..87ca96c 100644
--- a/drivers/isdn/hisax/teles_cs.c
+++ b/drivers/isdn/hisax/teles_cs.c
@@ -68,34 +68,8 @@ static void teles_cs_release(struct pcmcia_device *link);
 
 static void teles_detach(struct pcmcia_device *p_dev);
 
-/*
-   A linked list of "instances" of the teles_cs device.  Each actual
-   PCMCIA card corresponds to one device instance, and is described
-   by one struct pcmcia_device structure (defined in ds.h).
-
-   You may not want to use a linked list for this -- for example, the
-   memory card driver uses an array of struct pcmcia_device pointers, where minor
-   device numbers are used to derive the corresponding array index.
-*/
-
-/*
-   A driver needs to provide a dev_node_t structure for each device
-   on a card.  In some cases, there is only one device per card (for
-   example, ethernet cards, modems).  In other cases, there may be
-   many actual or logical devices (SCSI adapters, memory cards with
-   multiple partitions).  The dev_node_t structures need to be kept
-   in a linked list starting at the 'dev' field of a struct pcmcia_device
-   structure.  We allocate them in the card's private data structure,
-   because they generally shouldn't be allocated dynamically.
-   In this case, we also provide a flag to indicate if a device is
-   "stopped" due to a power management event, or card ejection.  The
-   device IO routines can use a flag like this to throttle IO to a
-   card that is not ready to accept it.
-*/
-
 typedef struct local_info_t {
 	struct pcmcia_device	*p_dev;
-    dev_node_t          node;
     int                 busy;
     int			cardnr;
 } local_info_t;
@@ -216,16 +190,9 @@ static int teles_cs_config(struct pcmcia_device *link)
     if (i != 0)
       goto cs_failed;
 
-    /* At this point, the dev_node_t structure(s) should be
-       initialized and arranged in a linked list at link->dev. *//*  */
-    sprintf(dev->node.dev_name, "teles");
-    dev->node.major = dev->node.minor = 0x0;
-
-    link->dev_node = &dev->node;
-
     /* Finally, report what we've done */
-    printk(KERN_INFO "%s: index 0x%02x:",
-           dev->node.dev_name, link->conf.ConfigIndex);
+    dev_info(&link->dev, "index 0x%02x:",
+	    link->conf.ConfigIndex);
     if (link->conf.Attributes & CONF_ENABLE_IRQ)
 	    printk(", irq %d", link->irq);
     if (link->io.NumPorts1)
diff --git a/drivers/net/wireless/airo_cs.c b/drivers/net/wireless/airo_cs.c
index 7867c51..33bdc6a 100644
--- a/drivers/net/wireless/airo_cs.c
+++ b/drivers/net/wireless/airo_cs.c
@@ -75,42 +75,7 @@ static void airo_release(struct pcmcia_device *link);
 
 static void airo_detach(struct pcmcia_device *p_dev);
 
-/*
-   You'll also need to prototype all the functions that will actually
-   be used to talk to your device.  See 'pcmem_cs' for a good example
-   of a fully self-sufficient driver; the other drivers rely more or
-   less on other parts of the kernel.
-*/
-
-/*
-   A linked list of "instances" of the  aironet device.  Each actual
-   PCMCIA card corresponds to one device instance, and is described
-   by one struct pcmcia_device structure (defined in ds.h).
-
-   You may not want to use a linked list for this -- for example, the
-   memory card driver uses an array of struct pcmcia_device pointers,
-   where minor device numbers are used to derive the corresponding
-   array index.
-*/
-
-/*
-   A driver needs to provide a dev_node_t structure for each device
-   on a card.  In some cases, there is only one device per card (for
-   example, ethernet cards, modems).  In other cases, there may be
-   many actual or logical devices (SCSI adapters, memory cards with
-   multiple partitions).  The dev_node_t structures need to be kept
-   in a linked list starting at the 'dev' field of a struct pcmcia_device
-   structure.  We allocate them in the card's private data structure,
-   because they generally shouldn't be allocated dynamically.
-
-   In this case, we also provide a flag to indicate if a device is
-   "stopped" due to a power management event, or card ejection.  The
-   device IO routines can use a flag like this to throttle IO to a
-   card that is not ready to accept it.
-*/
-
 typedef struct local_info_t {
-	dev_node_t	node;
 	struct net_device *eth_dev;
 } local_info_t;
 
@@ -311,17 +276,9 @@ static int airo_config(struct pcmcia_device *link)
 	if (!((local_info_t *)link->priv)->eth_dev)
 		goto failed;
 
-	/*
-	  At this point, the dev_node_t structure(s) need to be
-	  initialized and arranged in a linked list at link->dev_node.
-	*/
-	strcpy(dev->node.dev_name, ((local_info_t *)link->priv)->eth_dev->name);
-	dev->node.major = dev->node.minor = 0;
-	link->dev_node = &dev->node;
-
 	/* Finally, report what we've done */
-	printk(KERN_INFO "%s: index 0x%02x: ",
-	       dev->node.dev_name, link->conf.ConfigIndex);
+	dev_info(&link->dev, "index 0x%02x: ",
+	       link->conf.ConfigIndex);
 	if (link->conf.Vpp)
 		printk(", Vpp %d.%d", link->conf.Vpp/10, link->conf.Vpp%10);
 	printk(", irq %d", link->irq);
diff --git a/drivers/usb/host/sl811_cs.c b/drivers/usb/host/sl811_cs.c
index a712788..58cb73c 100644
--- a/drivers/usb/host/sl811_cs.c
+++ b/drivers/usb/host/sl811_cs.c
@@ -47,7 +47,6 @@ static const char driver_name[DEV_NAME_LEN]  = "sl811_cs";
 
 typedef struct local_info_t {
 	struct pcmcia_device	*p_dev;
-	dev_node_t		node;
 } local_info_t;
 
 static void sl811_cs_release(struct pcmcia_device * link);
@@ -185,7 +184,6 @@ static int sl811_cs_config_check(struct pcmcia_device *p_dev,
 static int sl811_cs_config(struct pcmcia_device *link)
 {
 	struct device		*parent = &link->dev;
-	local_info_t		*dev = link->priv;
 	int			ret;
 
 	dev_dbg(&link->dev, "sl811_cs_config\n");
@@ -204,12 +202,8 @@ static int sl811_cs_config(struct pcmcia_device *link)
 	if (ret)
 		goto failed;
 
-	sprintf(dev->node.dev_name, driver_name);
-	dev->node.major = dev->node.minor = 0;
-	link->dev_node = &dev->node;
-
-	printk(KERN_INFO "%s: index 0x%02x: ",
-	       dev->node.dev_name, link->conf.ConfigIndex);
+	dev_info(&link->dev, "index 0x%02x: ",
+		link->conf.ConfigIndex);
 	if (link->conf.Vpp)
 		printk(", Vpp %d.%d", link->conf.Vpp/10, link->conf.Vpp%10);
 	printk(", irq %d", link->irq);
-- 
1.6.3.3



From linux at dominikbrodowski.net  Sun Mar 21 19:07:23 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 22 Mar 2010 00:07:23 +0100
Subject: [RFC PATCH 05/19] pcmcia: replace struct irq with uint pcmcia_irq in
	struct pcmcia_socket
In-Reply-To: <20100321230617.GA24791@comet.dominikbrodowski.net>
References: <20100321230617.GA24791@comet.dominikbrodowski.net>
Message-ID: <1269212857-25364-5-git-send-email-linux@dominikbrodowski.net>

As we don't need the "Config" counter any more, we can simplify
struct pcmcia_socket.

Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 drivers/pcmcia/bfin_cf_pcmcia.c  |    2 +-
 drivers/pcmcia/cardbus.c         |    1 -
 drivers/pcmcia/cs.c              |    1 -
 drivers/pcmcia/omap_cf.c         |    2 +-
 drivers/pcmcia/pcmcia_ioctl.c    |    4 ++--
 drivers/pcmcia/pcmcia_resource.c |   31 ++++++++++---------------------
 include/pcmcia/ss.h              |    6 ++----
 7 files changed, 16 insertions(+), 31 deletions(-)

diff --git a/drivers/pcmcia/bfin_cf_pcmcia.c b/drivers/pcmcia/bfin_cf_pcmcia.c
index 2482ce7..1744f38 100644
--- a/drivers/pcmcia/bfin_cf_pcmcia.c
+++ b/drivers/pcmcia/bfin_cf_pcmcia.c
@@ -112,7 +112,7 @@ static int bfin_cf_get_status(struct pcmcia_socket *s, u_int *sp)
 
 	if (bfin_cf_present(cf->cd_pfx)) {
 		*sp = SS_READY | SS_DETECT | SS_POWERON | SS_3VCARD;
-		s->irq.AssignedIRQ = 0;
+		s->pcmcia_irq = 0;
 		s->pci_irq = cf->irq;
 
 	} else
diff --git a/drivers/pcmcia/cardbus.c b/drivers/pcmcia/cardbus.c
index e6ab2a4..9a58862 100644
--- a/drivers/pcmcia/cardbus.c
+++ b/drivers/pcmcia/cardbus.c
@@ -94,7 +94,6 @@ int __ref cb_alloc(struct pcmcia_socket *s)
 	pci_enable_bridges(bus);
 	pci_bus_add_devices(bus);
 
-	s->irq.AssignedIRQ = s->pci_irq;
 	return 0;
 }
 
diff --git a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c
index e679e70..2295837 100644
--- a/drivers/pcmcia/cs.c
+++ b/drivers/pcmcia/cs.c
@@ -396,7 +396,6 @@ static void socket_shutdown(struct pcmcia_socket *s)
 	s->socket = dead_socket;
 	s->ops->init(s);
 	s->ops->set_socket(s, &s->socket);
-	s->irq.AssignedIRQ = s->irq.Config = 0;
 	s->lock_count = 0;
 	kfree(s->fake_cis);
 	s->fake_cis = NULL;
diff --git a/drivers/pcmcia/omap_cf.c b/drivers/pcmcia/omap_cf.c
index 3ef9915..7d49ba0 100644
--- a/drivers/pcmcia/omap_cf.c
+++ b/drivers/pcmcia/omap_cf.c
@@ -116,7 +116,7 @@ static int omap_cf_get_status(struct pcmcia_socket *s, u_int *sp)
 
 		*sp = SS_READY | SS_DETECT | SS_POWERON | SS_3VCARD;
 		cf = container_of(s, struct omap_cf_socket, socket);
-		s->irq.AssignedIRQ = 0;
+		s->pcmcia_irq = 0;
 		s->pci_irq = cf->irq;
 	} else
 		*sp = 0;
diff --git a/drivers/pcmcia/pcmcia_ioctl.c b/drivers/pcmcia/pcmcia_ioctl.c
index 13a7132..5abbad5 100644
--- a/drivers/pcmcia/pcmcia_ioctl.c
+++ b/drivers/pcmcia/pcmcia_ioctl.c
@@ -350,7 +350,7 @@ static int pccard_get_configuration_info(struct pcmcia_socket *s,
 		if (s->state & SOCKET_CARDBUS_CONFIG) {
 			config->Attributes = CONF_VALID_CLIENT;
 			config->IntType = INT_CARDBUS;
-			config->AssignedIRQ = s->irq.AssignedIRQ;
+			config->AssignedIRQ = s->pcmcia_irq;
 			if (config->AssignedIRQ)
 				config->Attributes |= CONF_ENABLE_IRQ;
 			if (s->io[0].res) {
@@ -390,7 +390,7 @@ static int pccard_get_configuration_info(struct pcmcia_socket *s,
 	config->ExtStatus = c->ExtStatus;
 	config->Present = config->CardValues = c->CardValues;
 	config->IRQAttributes = c->irq.Attributes;
-	config->AssignedIRQ = s->irq.AssignedIRQ;
+	config->AssignedIRQ = s->pcmcia_irq;
 	config->BasePort1 = c->io.BasePort1;
 	config->NumPorts1 = c->io.NumPorts1;
 	config->Attributes1 = c->io.Attributes1;
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index e4b8fa0..fb08e80 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -429,13 +429,10 @@ static int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req)
 		dev_dbg(&s->dev, "IRQ attributes must match assigned ones\n");
 		goto out;
 	}
-	if (s->irq.AssignedIRQ != req->AssignedIRQ) {
+	if (s->pcmcia_irq != req->AssignedIRQ) {
 		dev_dbg(&s->dev, "IRQ must match assigned one\n");
 		goto out;
 	}
-	if (--s->irq.Config == 0) {
-		c->state &= ~CONFIG_IRQ_REQ;
-	}
 
 	if (req->Handler)
 		free_irq(req->AssignedIRQ, p_dev->priv);
@@ -532,7 +529,7 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev,
 	if (req->Attributes & CONF_ENABLE_SPKR)
 		s->socket.flags |= SS_SPKR_ENA;
 	if (req->Attributes & CONF_ENABLE_IRQ)
-		s->socket.io_irq = s->irq.AssignedIRQ;
+		s->socket.io_irq = s->pcmcia_irq;
 	else
 		s->socket.io_irq = 0;
 	s->ops->set_socket(s, &s->socket);
@@ -555,7 +552,7 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev,
 			if (req->Present & PRESENT_IOBASE_0)
 				c->Option |= COR_ADDR_DECODE;
 		}
-		if (c->state & CONFIG_IRQ_REQ)
+		if (req->Attributes & CONF_ENABLE_IRQ)
 			if (!(c->irq.Attributes & IRQ_FORCED_PULSE))
 				c->Option |= COR_LEVEL_REQ;
 		pcmcia_write_cis_mem(s, 1, (base + CISREG_COR)>>1, 1, &c->Option);
@@ -710,10 +707,6 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
 		dev_dbg(&s->dev, "Configuration is locked\n");
 		goto out;
 	}
-	if (c->state & CONFIG_IRQ_REQ) {
-		dev_dbg(&s->dev, "IRQ already configured\n");
-		goto out;
-	}
 
 	if (!irq) {
 		dev_dbg(&s->dev, "no IRQ available\n");
@@ -722,8 +715,6 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
 
 	if (!(req->Attributes & IRQ_TYPE_DYNAMIC_SHARING)) {
 		req->Attributes |= IRQ_TYPE_DYNAMIC_SHARING;
-		dev_printk(KERN_WARNING, &p_dev->dev, "pcmcia: "
-			"request for exclusive IRQ could not be fulfilled.\n");
 		dev_printk(KERN_WARNING, &p_dev->dev, "pcmcia: the driver "
 			"needs updating to supported shared IRQ lines.\n");
 	}
@@ -740,9 +731,7 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
 
 	c->irq.Attributes = req->Attributes;
 	req->AssignedIRQ = irq;
-	s->irq.Config++;
 
-	c->state |= CONFIG_IRQ_REQ;
 	p_dev->_irq = 1;
 
 	ret = 0;
@@ -794,7 +783,7 @@ static int pcmcia_setup_isa_irq(struct pcmcia_device *p_dev, int type)
 				  p_dev);
 		if (!ret) {
 			free_irq(irq, p_dev);
-			p_dev->irq_v = s->irq.AssignedIRQ = irq;
+			p_dev->irq_v = s->pcmcia_irq = irq;
 			pcmcia_used_irq[irq]++;
 			break;
 		}
@@ -805,8 +794,8 @@ static int pcmcia_setup_isa_irq(struct pcmcia_device *p_dev, int type)
 
 void pcmcia_cleanup_irq(struct pcmcia_socket *s)
 {
-	pcmcia_used_irq[s->irq.AssignedIRQ]--;
-	s->irq.AssignedIRQ = 0;
+	pcmcia_used_irq[s->pcmcia_irq]--;
+	s->pcmcia_irq = 0;
 }
 
 #else /* CONFIG_PCMCIA_PROBE */
@@ -818,7 +807,7 @@ static int pcmcia_setup_isa_irq(struct pcmcia_device *p_dev, int type)
 
 void pcmcia_cleanup_irq(struct pcmcia_socket *s)
 {
-	s->irq.AssignedIRQ = 0;
+	s->pcmcia_irq = 0;
 	return;
 }
 
@@ -839,8 +828,8 @@ int pcmcia_setup_irq(struct pcmcia_device *p_dev)
 		return 0;
 
 	/* already assigned? */
-	if (s->irq.AssignedIRQ) {
-		p_dev->irq_v = s->irq.AssignedIRQ;
+	if (s->pcmcia_irq) {
+		p_dev->irq_v = s->pcmcia_irq;
 		return 0;
 	}
 
@@ -854,7 +843,7 @@ int pcmcia_setup_irq(struct pcmcia_device *p_dev)
 
 	/* but use the PCI irq otherwise */
 	if (s->pci_irq) {
-		p_dev->irq_v = s->irq.AssignedIRQ = s->pci_irq;
+		p_dev->irq_v = s->pcmcia_irq = s->pci_irq;
 		return 0;
 	}
 
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h
index 32896a7..313c912 100644
--- a/include/pcmcia/ss.h
+++ b/include/pcmcia/ss.h
@@ -141,10 +141,6 @@ struct pcmcia_socket {
 	u_short				lock_count;
 	pccard_mem_map			cis_mem;
 	void __iomem 			*cis_virt;
-	struct {
-		u_int			AssignedIRQ;
-		u_int			Config;
-	} irq;
 	io_window_t			io[MAX_IO_WIN];
 	pccard_mem_map			win[MAX_WIN];
 	struct list_head		cis_cache;
@@ -236,6 +232,8 @@ struct pcmcia_socket {
 		u8			reserved:4;
 	} pcmcia_state;
 
+	/* IRQ to be used by PCMCIA devices. May not be IRQ 0. */
+	unsigned int			pcmcia_irq;
 
 #ifdef CONFIG_PCMCIA_IOCTL
 	struct user_info_t		*user;
-- 
1.6.3.3



From linux at dominikbrodowski.net  Sun Mar 21 19:07:35 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 22 Mar 2010 00:07:35 +0100
Subject: [RFC PATCH 17/19] pcmcia: move all pcmcia_resource_ops providers into
	one module
In-Reply-To: <20100321230617.GA24791@comet.dominikbrodowski.net>
References: <20100321230617.GA24791@comet.dominikbrodowski.net>
Message-ID: <1269212857-25364-17-git-send-email-linux@dominikbrodowski.net>

Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 drivers/pcmcia/Kconfig          |    2 +-
 drivers/pcmcia/Makefile         |    7 ++-
 drivers/pcmcia/cs_internal.h    |    8 +++
 drivers/pcmcia/rsrc_iodyn.c     |  107 +++++++++++++++++++++++++++++++++++++
 drivers/pcmcia/rsrc_mgr.c       |  110 +++++----------------------------------
 drivers/pcmcia/rsrc_nonstatic.c |   24 +++------
 6 files changed, 141 insertions(+), 117 deletions(-)
 create mode 100644 drivers/pcmcia/rsrc_iodyn.c

diff --git a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig
index d189e47..4c5b53f 100644
--- a/drivers/pcmcia/Kconfig
+++ b/drivers/pcmcia/Kconfig
@@ -317,7 +317,7 @@ config ELECTRA_CF
 	  PA Semi Electra eval board.
 
 config PCCARD_NONSTATIC
-	tristate
+	bool
 
 config PCCARD_IODYN
 	bool
diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile
index 8122b03..7031d0a 100644
--- a/drivers/pcmcia/Makefile
+++ b/drivers/pcmcia/Makefile
@@ -2,7 +2,7 @@
 # Makefile for the kernel pcmcia subsystem (c/o David Hinds)
 #
 
-pcmcia_core-y					+= cs.o rsrc_mgr.o socket_sysfs.o
+pcmcia_core-y					+= cs.o socket_sysfs.o
 pcmcia_core-$(CONFIG_CARDBUS)			+= cardbus.o
 obj-$(CONFIG_PCCARD)				+= pcmcia_core.o
 
@@ -10,7 +10,10 @@ pcmcia-y					+= ds.o pcmcia_resource.o cistpl.o pcmcia_cis.o
 pcmcia-$(CONFIG_PCMCIA_IOCTL)			+= pcmcia_ioctl.o
 obj-$(CONFIG_PCMCIA)				+= pcmcia.o
 
-obj-$(CONFIG_PCCARD_NONSTATIC)			+= rsrc_nonstatic.o
+pcmcia_rsrc-y					+= rsrc_mgr.o
+pcmcia_rsrc-$(CONFIG_PCCARD_NONSTATIC)		+= rsrc_nonstatic.o
+pcmcia_rsrc-$(CONFIG_PCCARD_IODYN)		+= rsrc_iodyn.o
+obj-$(CONFIG_PCCARD)				+= pcmcia_rsrc.o
 
 
 # socket drivers
diff --git a/drivers/pcmcia/cs_internal.h b/drivers/pcmcia/cs_internal.h
index 74d91c8..ab000ea 100644
--- a/drivers/pcmcia/cs_internal.h
+++ b/drivers/pcmcia/cs_internal.h
@@ -89,6 +89,14 @@ struct pccard_resource_ops {
 
 
 /*
+ * Stuff internal to module "pcmcia_rsrc":
+ */
+extern int static_init(struct pcmcia_socket *s);
+extern struct resource *pcmcia_make_resource(unsigned long start,
+					unsigned long end,
+					int flags, const char *name);
+
+/*
  * Stuff internal to module "pcmcia_core":
  */
 
diff --git a/drivers/pcmcia/rsrc_iodyn.c b/drivers/pcmcia/rsrc_iodyn.c
new file mode 100644
index 0000000..3fa808b
--- /dev/null
+++ b/drivers/pcmcia/rsrc_iodyn.c
@@ -0,0 +1,107 @@
+/*
+ * rsrc_iodyn.c -- Resource management routines for MEM-static sockets.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * The initial developer of the original code is David A. Hinds
+ * <dahinds at users.sourceforge.net>.  Portions created by David A. Hinds
+ * are Copyright (C) 1999 David A. Hinds.  All Rights Reserved.
+ *
+ * (C) 1999		David A. Hinds
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+
+#include <pcmcia/cs_types.h>
+#include <pcmcia/ss.h>
+#include <pcmcia/cs.h>
+#include <pcmcia/cistpl.h>
+#include "cs_internal.h"
+
+
+struct pcmcia_align_data {
+	unsigned long	mask;
+	unsigned long	offset;
+};
+
+static resource_size_t pcmcia_align(void *align_data,
+				const struct resource *res,
+				resource_size_t size, resource_size_t align)
+{
+	struct pcmcia_align_data *data = align_data;
+	resource_size_t start;
+
+	start = (res->start & ~data->mask) + data->offset;
+	if (start < res->start)
+		start += data->mask + 1;
+
+#ifdef CONFIG_X86
+	if (res->flags & IORESOURCE_IO) {
+		if (start & 0x300)
+			start = (start + 0x3ff) & ~0x3ff;
+	}
+#endif
+
+#ifdef CONFIG_M68K
+	if (res->flags & IORESOURCE_IO) {
+		if ((res->start + size - 1) >= 1024)
+			start = res->end;
+	}
+#endif
+
+	return start;
+}
+
+
+static int iodyn_adjust_io_region(struct resource *res, unsigned long r_start,
+		unsigned long r_end, struct pcmcia_socket *s)
+{
+	return adjust_resource(res, r_start, r_end - r_start + 1);
+}
+
+
+static struct resource *iodyn_find_io_region(unsigned long base, int num,
+		unsigned long align, struct pcmcia_socket *s)
+{
+	struct resource *res = pcmcia_make_resource(0, num, IORESOURCE_IO,
+						dev_name(&s->dev));
+	struct pcmcia_align_data data;
+	unsigned long min = base;
+	int ret;
+
+	if (align == 0)
+		align = 0x10000;
+
+	data.mask = align - 1;
+	data.offset = base & data.mask;
+
+#ifdef CONFIG_PCI
+	if (s->cb_dev) {
+		ret = pci_bus_alloc_resource(s->cb_dev->bus, res, num, 1,
+					     min, 0, pcmcia_align, &data);
+	} else
+#endif
+		ret = allocate_resource(&ioport_resource, res, num, min, ~0UL,
+					1, pcmcia_align, &data);
+
+	if (ret != 0) {
+		kfree(res);
+		res = NULL;
+	}
+	return res;
+}
+
+struct pccard_resource_ops pccard_iodyn_ops = {
+	.validate_mem = NULL,
+	.adjust_io_region = iodyn_adjust_io_region,
+	.find_io = iodyn_find_io_region,
+	.find_mem = NULL,
+	.add_io = NULL,
+	.add_mem = NULL,
+	.init = static_init,
+	.exit = NULL,
+};
+EXPORT_SYMBOL(pccard_iodyn_ops);
diff --git a/drivers/pcmcia/rsrc_mgr.c b/drivers/pcmcia/rsrc_mgr.c
index 452c83b..5728522 100644
--- a/drivers/pcmcia/rsrc_mgr.c
+++ b/drivers/pcmcia/rsrc_mgr.c
@@ -21,7 +21,7 @@
 #include <pcmcia/cistpl.h>
 #include "cs_internal.h"
 
-static int static_init(struct pcmcia_socket *s)
+int static_init(struct pcmcia_socket *s)
 {
 	/* the good thing about SS_CAP_STATIC_MAP sockets is
 	 * that they don't need a resource database */
@@ -31,118 +31,34 @@ static int static_init(struct pcmcia_socket *s)
 	return 0;
 }
 
-
-struct pccard_resource_ops pccard_static_ops = {
-	.validate_mem = NULL,
-	.adjust_io_region = NULL,
-	.find_io = NULL,
-	.find_mem = NULL,
-	.add_io = NULL,
-	.add_mem = NULL,
-	.init = static_init,
-	.exit = NULL,
-};
-EXPORT_SYMBOL(pccard_static_ops);
-
-
-#ifdef CONFIG_PCCARD_IODYN
-
-static struct resource *
-make_resource(unsigned long b, unsigned long n, int flags, char *name)
+struct resource *pcmcia_make_resource(unsigned long start, unsigned long end,
+				int flags, const char *name)
 {
 	struct resource *res = kzalloc(sizeof(*res), GFP_KERNEL);
 
 	if (res) {
 		res->name = name;
-		res->start = b;
-		res->end = b + n - 1;
+		res->start = start;
+		res->end = start + end - 1;
 		res->flags = flags;
 	}
 	return res;
 }
 
-struct pcmcia_align_data {
-	unsigned long	mask;
-	unsigned long	offset;
-};
-
-static resource_size_t pcmcia_align(void *align_data,
-				const struct resource *res,
-				resource_size_t size, resource_size_t align)
-{
-	struct pcmcia_align_data *data = align_data;
-	resource_size_t start;
-
-	start = (res->start & ~data->mask) + data->offset;
-	if (start < res->start)
-		start += data->mask + 1;
-
-#ifdef CONFIG_X86
-	if (res->flags & IORESOURCE_IO) {
-		if (start & 0x300)
-			start = (start + 0x3ff) & ~0x3ff;
-	}
-#endif
-
-#ifdef CONFIG_M68K
-	if (res->flags & IORESOURCE_IO) {
-		if ((res->start + size - 1) >= 1024)
-			start = res->end;
-	}
-#endif
-
-	return start;
-}
-
-
-static int iodyn_adjust_io_region(struct resource *res, unsigned long r_start,
-				      unsigned long r_end, struct pcmcia_socket *s)
-{
-	return adjust_resource(res, r_start, r_end - r_start + 1);
-}
-
-
-static struct resource *iodyn_find_io_region(unsigned long base, int num,
-		unsigned long align, struct pcmcia_socket *s)
-{
-	struct resource *res = make_resource(0, num, IORESOURCE_IO,
-					     dev_name(&s->dev));
-	struct pcmcia_align_data data;
-	unsigned long min = base;
-	int ret;
-
-	if (align == 0)
-		align = 0x10000;
 
-	data.mask = align - 1;
-	data.offset = base & data.mask;
-
-#ifdef CONFIG_PCI
-	if (s->cb_dev) {
-		ret = pci_bus_alloc_resource(s->cb_dev->bus, res, num, 1,
-					     min, 0, pcmcia_align, &data);
-	} else
-#endif
-		ret = allocate_resource(&ioport_resource, res, num, min, ~0UL,
-					1, pcmcia_align, &data);
-
-	if (ret != 0) {
-		kfree(res);
-		res = NULL;
-	}
-	return res;
-}
-
-struct pccard_resource_ops pccard_iodyn_ops = {
+struct pccard_resource_ops pccard_static_ops = {
 	.validate_mem = NULL,
-	.adjust_io_region = iodyn_adjust_io_region,
-	.find_io = iodyn_find_io_region,
+	.adjust_io_region = NULL,
+	.find_io = NULL,
 	.find_mem = NULL,
 	.add_io = NULL,
 	.add_mem = NULL,
 	.init = static_init,
 	.exit = NULL,
 };
-EXPORT_SYMBOL(pccard_iodyn_ops);
+EXPORT_SYMBOL(pccard_static_ops);
+
 
-#endif /* CONFIG_PCCARD_IODYN */
+MODULE_AUTHOR("David A. Hinds, Dominik Brodowski");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("rsrc_nonstatic");
diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c
index 4663b3f..92fe4a7 100644
--- a/drivers/pcmcia/rsrc_nonstatic.c
+++ b/drivers/pcmcia/rsrc_nonstatic.c
@@ -34,8 +34,10 @@
 #include <pcmcia/cistpl.h>
 #include "cs_internal.h"
 
+/* moved to rsrc_mgr.c
 MODULE_AUTHOR("David A. Hinds, Dominik Brodowski");
 MODULE_LICENSE("GPL");
+*/
 
 /* Parameters that can be set with 'insmod' */
 
@@ -70,27 +72,13 @@ struct socket_data {
 ======================================================================*/
 
 static struct resource *
-make_resource(resource_size_t b, resource_size_t n, int flags, const char *name)
-{
-	struct resource *res = kzalloc(sizeof(*res), GFP_KERNEL);
-
-	if (res) {
-		res->name = name;
-		res->start = b;
-		res->end = b + n - 1;
-		res->flags = flags;
-	}
-	return res;
-}
-
-static struct resource *
 claim_region(struct pcmcia_socket *s, resource_size_t base,
 		resource_size_t size, int type, char *name)
 {
 	struct resource *res, *parent;
 
 	parent = type & IORESOURCE_MEM ? &iomem_resource : &ioport_resource;
-	res = make_resource(base, size, type | IORESOURCE_BUSY, name);
+	res = pcmcia_make_resource(base, size, type | IORESOURCE_BUSY, name);
 
 	if (res) {
 #ifdef CONFIG_PCI
@@ -695,7 +683,8 @@ static int nonstatic_adjust_io_region(struct resource *res, unsigned long r_star
 static struct resource *nonstatic_find_io_region(unsigned long base, int num,
 		   unsigned long align, struct pcmcia_socket *s)
 {
-	struct resource *res = make_resource(0, num, IORESOURCE_IO, dev_name(&s->dev));
+	struct resource *res = pcmcia_make_resource(0, num, IORESOURCE_IO,
+						dev_name(&s->dev));
 	struct socket_data *s_data = s->resource_data;
 	struct pcmcia_align_data data;
 	unsigned long min = base;
@@ -727,7 +716,8 @@ static struct resource *nonstatic_find_io_region(unsigned long base, int num,
 static struct resource *nonstatic_find_mem_region(u_long base, u_long num,
 		u_long align, int low, struct pcmcia_socket *s)
 {
-	struct resource *res = make_resource(0, num, IORESOURCE_MEM, dev_name(&s->dev));
+	struct resource *res = pcmcia_make_resource(0, num, IORESOURCE_MEM,
+						dev_name(&s->dev));
 	struct socket_data *s_data = s->resource_data;
 	struct pcmcia_align_data data;
 	unsigned long min, max;
-- 
1.6.3.3



From linux at dominikbrodowski.net  Sun Mar 21 19:07:25 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 22 Mar 2010 00:07:25 +0100
Subject: [RFC PATCH 07/19] pcmcia: re-work pcmcia_request_irq()
In-Reply-To: <20100321230617.GA24791@comet.dominikbrodowski.net>
References: <20100321230617.GA24791@comet.dominikbrodowski.net>
Message-ID: <1269212857-25364-7-git-send-email-linux@dominikbrodowski.net>

Instead of the old pcmcia_request_irq() interface, drivers may now
choose between:

- calling request_irq/free_irq directly. Use the IRQ from *p_dev->irq.

- use pcmcia_request_irq(p_dev, handler_t); the PCMCIA core will
  clean up automatically on calls to pcmcia_disable_device() or
  device ejection.

- drivers still not capable of IRQF_SHARED (or not telling us so) may
  use the deprecated pcmcia_request_exclusive_irq() for the time
  being; they might receive a shared IRQ nonetheless.

CC: linux-bluetooth at vger.kernel.org
CC: netdev at vger.kernel.org
CC: linux-wireless at vger.kernel.org
CC: linux-serial at vger.kernel.org
CC: alsa-devel at alsa-project.org
CC: linux-usb at vger.kernel.org
CC: linux-ide at vger.kernel.org
Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 Documentation/pcmcia/driver-changes.txt          |   10 ++
 drivers/ata/pata_pcmcia.c                        |    6 +-
 drivers/bluetooth/bluecard_cs.c                  |    7 +-
 drivers/bluetooth/bt3c_cs.c                      |    7 +-
 drivers/bluetooth/btuart_cs.c                    |    7 +-
 drivers/bluetooth/dtl1_cs.c                      |    7 +-
 drivers/char/pcmcia/ipwireless/main.c            |   11 +--
 drivers/char/pcmcia/synclink_cs.c                |   12 +--
 drivers/ide/ide-cs.c                             |    8 +-
 drivers/isdn/hardware/avm/avm_cs.c               |   17 +--
 drivers/isdn/hisax/avma1_cs.c                    |   12 +--
 drivers/isdn/hisax/elsa_cs.c                     |   13 +--
 drivers/isdn/hisax/sedlbauer_cs.c                |   23 +---
 drivers/isdn/hisax/teles_cs.c                    |   13 +--
 drivers/net/pcmcia/3c574_cs.c                    |    6 +-
 drivers/net/pcmcia/3c589_cs.c                    |    7 +-
 drivers/net/pcmcia/axnet_cs.c                    |   13 +--
 drivers/net/pcmcia/com20020_cs.c                 |    8 +-
 drivers/net/pcmcia/fmvj18x_cs.c                  |   10 +--
 drivers/net/pcmcia/ibmtr_cs.c                    |    8 +-
 drivers/net/pcmcia/nmclan_cs.c                   |    6 +-
 drivers/net/pcmcia/pcnet_cs.c                    |    8 +-
 drivers/net/pcmcia/smc91c92_cs.c                 |    8 +-
 drivers/net/pcmcia/xirc2ps_cs.c                  |    7 +-
 drivers/net/wireless/airo_cs.c                   |   25 +---
 drivers/net/wireless/atmel_cs.c                  |   28 +----
 drivers/net/wireless/b43/pcmcia.c                |    5 +-
 drivers/net/wireless/hostap/hostap_cs.c          |   29 +----
 drivers/net/wireless/libertas/if_cs.c            |   21 +---
 drivers/net/wireless/orinoco/orinoco_cs.c        |   13 +--
 drivers/net/wireless/orinoco/spectrum_cs.c       |   13 +--
 drivers/net/wireless/ray_cs.c                    |    8 +-
 drivers/net/wireless/wl3501_cs.c                 |    8 +-
 drivers/parport/parport_cs.c                     |    8 +-
 drivers/pcmcia/ds.c                              |    3 +-
 drivers/pcmcia/pcmcia_resource.c                 |  137 +++++++++-------------
 drivers/scsi/pcmcia/aha152x_stub.c               |    6 +-
 drivers/scsi/pcmcia/fdomain_stub.c               |    6 +-
 drivers/scsi/pcmcia/nsp_cs.c                     |   20 +---
 drivers/scsi/pcmcia/qlogic_stub.c                |   10 +-
 drivers/scsi/pcmcia/sym53c500_cs.c               |    6 +-
 drivers/serial/serial_cs.c                       |   27 ++---
 drivers/ssb/main.c                               |    2 +-
 drivers/staging/comedi/drivers/cb_das16_cs.c     |   26 +---
 drivers/staging/comedi/drivers/das08_cs.c        |   16 +--
 drivers/staging/comedi/drivers/ni_daq_700.c      |   23 +---
 drivers/staging/comedi/drivers/ni_daq_dio24.c    |   23 +---
 drivers/staging/comedi/drivers/ni_labpc_cs.c     |   24 +---
 drivers/staging/comedi/drivers/ni_mio_cs.c       |    9 +-
 drivers/staging/comedi/drivers/quatech_daqp_cs.c |   22 +---
 drivers/staging/netwave/netwave_cs.c             |    8 +-
 drivers/staging/wavelan/wavelan_cs.c             |   15 +--
 drivers/staging/wlags49_h2/wl_cs.c               |    9 +-
 drivers/usb/host/sl811_cs.c                      |   18 +--
 include/pcmcia/cs.h                              |    7 -
 include/pcmcia/ds.h                              |   11 ++-
 sound/pcmcia/pdaudiocf/pdaudiocf.c               |    9 +-
 sound/pcmcia/vx/vxpocket.c                       |    8 +-
 58 files changed, 244 insertions(+), 593 deletions(-)

diff --git a/Documentation/pcmcia/driver-changes.txt b/Documentation/pcmcia/driver-changes.txt
index 446f43b..3268a9a 100644
--- a/Documentation/pcmcia/driver-changes.txt
+++ b/Documentation/pcmcia/driver-changes.txt
@@ -1,4 +1,14 @@
 This file details changes in 2.6 which affect PCMCIA card driver authors:
+* New IRQ request rules (as of 2.6.35)
+   Instead of the old pcmcia_request_irq() interface, drivers may now
+   choose between:
+   - calling request_irq/free_irq directly. Use the IRQ from *p_dev->irq.
+   - use pcmcia_request_irq(p_dev, handler_t); the PCMCIA core will
+     clean up automatically on calls to pcmcia_disable_device() or
+     device ejection.
+   - drivers still not capable of IRQF_SHARED (or not telling us so) may
+     use the deprecated pcmcia_request_exclusive_irq() for the time
+     being; they might receive a shared IRQ nonetheless.
 
 * no cs_error / CS_CHECK / CONFIG_PCMCIA_DEBUG (as of 2.6.33)
    Instead of the cs_error() callback or the CS_CHECK() macro, please use
diff --git a/drivers/ata/pata_pcmcia.c b/drivers/ata/pata_pcmcia.c
index 147de2f..1336216 100644
--- a/drivers/ata/pata_pcmcia.c
+++ b/drivers/ata/pata_pcmcia.c
@@ -267,7 +267,6 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)
 	pdev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
 	pdev->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
 	pdev->io.IOAddrLines = 3;
-	pdev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
 	pdev->conf.Attributes = CONF_ENABLE_IRQ;
 	pdev->conf.IntType = INT_MEMORY_AND_IO;
 
@@ -292,8 +291,7 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)
 	}
 	io_base = pdev->io.BasePort1;
 	ctl_base = stk->ctl_base;
-	ret = pcmcia_request_irq(pdev, &pdev->irq);
-	if (ret)
+	if (!pdev->irq)
 		goto failed;
 
 	ret = pcmcia_request_configuration(pdev, &pdev->conf);
@@ -343,7 +341,7 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)
 	}
 
 	/* activate */
-	ret = ata_host_activate(host, pdev->irq.AssignedIRQ, ata_sff_interrupt,
+	ret = ata_host_activate(host, pdev->irq, ata_sff_interrupt,
 				IRQF_SHARED, &pcmcia_sht);
 	if (ret)
 		goto failed;
diff --git a/drivers/bluetooth/bluecard_cs.c b/drivers/bluetooth/bluecard_cs.c
index d9bf87c..a34653d 100644
--- a/drivers/bluetooth/bluecard_cs.c
+++ b/drivers/bluetooth/bluecard_cs.c
@@ -869,9 +869,6 @@ static int bluecard_probe(struct pcmcia_device *link)
 
 	link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
 	link->io.NumPorts1 = 8;
-	link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
-
-	link->irq.Handler = bluecard_interrupt;
 
 	link->conf.Attributes = CONF_ENABLE_IRQ;
 	link->conf.IntType = INT_MEMORY_AND_IO;
@@ -908,9 +905,9 @@ static int bluecard_config(struct pcmcia_device *link)
 	if (i != 0)
 		goto failed;
 
-	i = pcmcia_request_irq(link, &link->irq);
+	i = pcmcia_request_irq(link, bluecard_interrupt);
 	if (i != 0)
-		link->irq.AssignedIRQ = 0;
+		goto failed;
 
 	i = pcmcia_request_configuration(link, &link->conf);
 	if (i != 0)
diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c
index 027cb8b..1ad9694 100644
--- a/drivers/bluetooth/bt3c_cs.c
+++ b/drivers/bluetooth/bt3c_cs.c
@@ -661,9 +661,6 @@ static int bt3c_probe(struct pcmcia_device *link)
 
 	link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
 	link->io.NumPorts1 = 8;
-	link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
-
-	link->irq.Handler = bt3c_interrupt;
 
 	link->conf.Attributes = CONF_ENABLE_IRQ;
 	link->conf.IntType = INT_MEMORY_AND_IO;
@@ -743,9 +740,9 @@ static int bt3c_config(struct pcmcia_device *link)
 	goto failed;
 
 found_port:
-	i = pcmcia_request_irq(link, &link->irq);
+	i = pcmcia_request_irq(link, &bt3c_interrupt);
 	if (i != 0)
-		link->irq.AssignedIRQ = 0;
+		goto failed;
 
 	i = pcmcia_request_configuration(link, &link->conf);
 	if (i != 0)
diff --git a/drivers/bluetooth/btuart_cs.c b/drivers/bluetooth/btuart_cs.c
index 60c0953..1073d66 100644
--- a/drivers/bluetooth/btuart_cs.c
+++ b/drivers/bluetooth/btuart_cs.c
@@ -590,9 +590,6 @@ static int btuart_probe(struct pcmcia_device *link)
 
 	link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
 	link->io.NumPorts1 = 8;
-	link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
-
-	link->irq.Handler = btuart_interrupt;
 
 	link->conf.Attributes = CONF_ENABLE_IRQ;
 	link->conf.IntType = INT_MEMORY_AND_IO;
@@ -672,9 +669,9 @@ static int btuart_config(struct pcmcia_device *link)
 	goto failed;
 
 found_port:
-	i = pcmcia_request_irq(link, &link->irq);
+	i = pcmcia_request_irq(link, btuart_interrupt);
 	if (i != 0)
-		link->irq.AssignedIRQ = 0;
+		goto failed;
 
 	i = pcmcia_request_configuration(link, &link->conf);
 	if (i != 0)
diff --git a/drivers/bluetooth/dtl1_cs.c b/drivers/bluetooth/dtl1_cs.c
index 1778831..3d72afd 100644
--- a/drivers/bluetooth/dtl1_cs.c
+++ b/drivers/bluetooth/dtl1_cs.c
@@ -575,9 +575,6 @@ static int dtl1_probe(struct pcmcia_device *link)
 
 	link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
 	link->io.NumPorts1 = 8;
-	link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
-
-	link->irq.Handler = dtl1_interrupt;
 
 	link->conf.Attributes = CONF_ENABLE_IRQ;
 	link->conf.IntType = INT_MEMORY_AND_IO;
@@ -621,9 +618,9 @@ static int dtl1_config(struct pcmcia_device *link)
 	if (pcmcia_loop_config(link, dtl1_confcheck, NULL) < 0)
 		goto failed;
 
-	i = pcmcia_request_irq(link, &link->irq);
+	i = pcmcia_request_irq(link, dtl1_interrupt);
 	if (i != 0)
-		link->irq.AssignedIRQ = 0;
+		goto failed;
 
 	i = pcmcia_request_configuration(link, &link->conf);
 	if (i != 0)
diff --git a/drivers/char/pcmcia/ipwireless/main.c b/drivers/char/pcmcia/ipwireless/main.c
index dff24da..2237890 100644
--- a/drivers/char/pcmcia/ipwireless/main.c
+++ b/drivers/char/pcmcia/ipwireless/main.c
@@ -195,9 +195,6 @@ static int config_ipwireless(struct ipw_dev *ipw)
 	link->conf.Attributes = CONF_ENABLE_IRQ;
 	link->conf.IntType = INT_MEMORY_AND_IO;
 
-	link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
-	link->irq.Handler = ipwireless_interrupt;
-
 	INIT_WORK(&ipw->work_reboot, signalled_reboot_work);
 
 	ipwireless_init_hardware_v1(ipw->hardware, link->io.BasePort1,
@@ -205,8 +202,7 @@ static int config_ipwireless(struct ipw_dev *ipw)
 				    ipw->is_v2_card, signalled_reboot_callback,
 				    ipw);
 
-	ret = pcmcia_request_irq(link, &link->irq);
-
+	ret = pcmcia_request_irq(link, ipwireless_interrupt);
 	if (ret != 0)
 		goto exit;
 
@@ -217,7 +213,7 @@ static int config_ipwireless(struct ipw_dev *ipw)
 			(unsigned int) link->io.BasePort1,
 			(unsigned int) (link->io.BasePort1 +
 				link->io.NumPorts1 - 1),
-			(unsigned int) link->irq.AssignedIRQ);
+			(unsigned int) link->irq);
 	if (ipw->attr_memory && ipw->common_memory)
 		printk(KERN_INFO IPWIRELESS_PCCARD_NAME
 			": attr memory 0x%08lx-0x%08lx, common memory 0x%08lx-0x%08lx\n",
@@ -271,8 +267,6 @@ exit:
 
 static void release_ipwireless(struct ipw_dev *ipw)
 {
-	pcmcia_disable_device(ipw->link);
-
 	if (ipw->common_memory) {
 		release_mem_region(ipw->request_common_memory.Base,
 				ipw->request_common_memory.Size);
@@ -288,7 +282,6 @@ static void release_ipwireless(struct ipw_dev *ipw)
 	if (ipw->attr_memory)
 		pcmcia_release_window(ipw->link, ipw->handle_attr_memory);
 
-	/* Break the link with Card Services */
 	pcmcia_disable_device(ipw->link);
 }
 
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
index c31a0d9..027690b 100644
--- a/drivers/char/pcmcia/synclink_cs.c
+++ b/drivers/char/pcmcia/synclink_cs.c
@@ -552,10 +552,6 @@ static int mgslpc_probe(struct pcmcia_device *link)
 
     /* Initialize the struct pcmcia_device structure */
 
-    /* Interrupt setup */
-    link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
-    link->irq.Handler = NULL;
-
     link->conf.Attributes = 0;
     link->conf.IntType = INT_MEMORY_AND_IO;
 
@@ -608,9 +604,7 @@ static int mgslpc_config(struct pcmcia_device *link)
     link->conf.ConfigIndex = 8;
     link->conf.Present = PRESENT_OPTION;
 
-    link->irq.Handler     = mgslpc_isr;
-
-    ret = pcmcia_request_irq(link, &link->irq);
+    ret = pcmcia_request_irq(link, mgslpc_isr);
     if (ret)
 	    goto failed;
     ret = pcmcia_request_configuration(link, &link->conf);
@@ -618,7 +612,7 @@ static int mgslpc_config(struct pcmcia_device *link)
 	    goto failed;
 
     info->io_base = link->io.BasePort1;
-    info->irq_level = link->irq.AssignedIRQ;
+    info->irq_level = link->irq;
 
     /* add to linked list of devices */
     sprintf(info->node.dev_name, "mgslpc0");
@@ -628,7 +622,7 @@ static int mgslpc_config(struct pcmcia_device *link)
     printk(KERN_INFO "%s: index 0x%02x:",
 	   info->node.dev_name, link->conf.ConfigIndex);
     if (link->conf.Attributes & CONF_ENABLE_IRQ)
-	    printk(", irq %d", link->irq.AssignedIRQ);
+	    printk(", irq %d", link->irq);
     if (link->io.NumPorts1)
 	    printk(", io 0x%04x-0x%04x", link->io.BasePort1,
 		   link->io.BasePort1+link->io.NumPorts1-1);
diff --git a/drivers/ide/ide-cs.c b/drivers/ide/ide-cs.c
index ab87e4f..afd1ab7 100644
--- a/drivers/ide/ide-cs.c
+++ b/drivers/ide/ide-cs.c
@@ -102,7 +102,6 @@ static int ide_probe(struct pcmcia_device *link)
     link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
     link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
     link->io.IOAddrLines = 3;
-    link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
     link->conf.Attributes = CONF_ENABLE_IRQ;
     link->conf.IntType = INT_MEMORY_AND_IO;
 
@@ -285,8 +284,7 @@ static int ide_config(struct pcmcia_device *link)
     io_base = link->io.BasePort1;
     ctl_base = stk->ctl_base;
 
-    ret = pcmcia_request_irq(link, &link->irq);
-    if (ret)
+    if (!link->irq)
 	    goto failed;
     ret = pcmcia_request_configuration(link, &link->conf);
     if (ret)
@@ -299,11 +297,11 @@ static int ide_config(struct pcmcia_device *link)
     if (is_kme)
 	outb(0x81, ctl_base+1);
 
-     host = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, link);
+     host = idecs_register(io_base, ctl_base, link->irq, link);
      if (host == NULL && link->io.NumPorts1 == 0x20) {
 	    outb(0x02, ctl_base + 0x10);
 	    host = idecs_register(io_base + 0x10, ctl_base + 0x10,
-				  link->irq.AssignedIRQ, link);
+				  link->irq, link);
     }
 
     if (host == NULL)
diff --git a/drivers/isdn/hardware/avm/avm_cs.c b/drivers/isdn/hardware/avm/avm_cs.c
index 94b796d..0d485f6 100644
--- a/drivers/isdn/hardware/avm/avm_cs.c
+++ b/drivers/isdn/hardware/avm/avm_cs.c
@@ -107,9 +107,6 @@ static int avmcs_probe(struct pcmcia_device *p_dev)
     p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
     p_dev->io.NumPorts2 = 0;
 
-    /* Interrupt setup */
-    p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
-
     /* General socket configuration */
     p_dev->conf.Attributes = CONF_ENABLE_IRQ;
     p_dev->conf.IntType = INT_MEMORY_AND_IO;
@@ -172,7 +169,7 @@ static int avmcs_configcheck(struct pcmcia_device *p_dev,
 static int avmcs_config(struct pcmcia_device *link)
 {
     local_info_t *dev;
-    int i;
+    int i = -1;
     char devname[128];
     int cardtype;
     int (*addcard)(unsigned int port, unsigned irq);
@@ -190,11 +187,7 @@ static int avmcs_config(struct pcmcia_device *link)
 	    return -ENODEV;
 
     do {
-	/*
-	 * allocate an interrupt line
-	 */
-	i = pcmcia_request_irq(link, &link->irq);
-	if (i != 0) {
+	if (!link->irq) {
 	    /* undo */
 	    pcmcia_disable_device(link);
 	    break;
@@ -249,9 +242,9 @@ static int avmcs_config(struct pcmcia_device *link)
 	default:
         case AVM_CARDTYPE_B1: addcard = b1pcmcia_addcard_b1; break;
     }
-    if ((i = (*addcard)(link->io.BasePort1, link->irq.AssignedIRQ)) < 0) {
+    if ((i = (*addcard)(link->io.BasePort1, link->irq)) < 0) {
         printk(KERN_ERR "avm_cs: failed to add AVM-%s-Controller at i/o %#x, irq %d\n",
-		dev->node.dev_name, link->io.BasePort1, link->irq.AssignedIRQ);
+		dev->node.dev_name, link->io.BasePort1, link->irq);
 	avmcs_release(link);
 	return -ENODEV;
     }
@@ -270,7 +263,7 @@ static int avmcs_config(struct pcmcia_device *link)
 
 static void avmcs_release(struct pcmcia_device *link)
 {
-	b1pcmcia_delcard(link->io.BasePort1, link->irq.AssignedIRQ);
+	b1pcmcia_delcard(link->io.BasePort1, link->irq);
 	pcmcia_disable_device(link);
 } /* avmcs_release */
 
diff --git a/drivers/isdn/hisax/avma1_cs.c b/drivers/isdn/hisax/avma1_cs.c
index e5deb15..96d0b5d 100644
--- a/drivers/isdn/hisax/avma1_cs.c
+++ b/drivers/isdn/hisax/avma1_cs.c
@@ -119,9 +119,6 @@ static int avma1cs_probe(struct pcmcia_device *p_dev)
     p_dev->io.Attributes2 = IO_DATA_PATH_WIDTH_16;
     p_dev->io.IOAddrLines = 5;
 
-    /* Interrupt setup */
-    p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
-
     /* General socket configuration */
     p_dev->conf.Attributes = CONF_ENABLE_IRQ;
     p_dev->conf.IntType = INT_MEMORY_AND_IO;
@@ -177,7 +174,7 @@ static int avma1cs_configcheck(struct pcmcia_device *p_dev,
 static int avma1cs_config(struct pcmcia_device *link)
 {
     local_info_t *dev;
-    int i;
+    int i = -1;
     char devname[128];
     IsdnCard_t	icard;
     int busy = 0;
@@ -197,8 +194,7 @@ static int avma1cs_config(struct pcmcia_device *link)
 	/*
 	 * allocate an interrupt line
 	 */
-	i = pcmcia_request_irq(link, &link->irq);
-	if (i != 0) {
+	if (!link->irq) {
 	    /* undo */
 	    pcmcia_disable_device(link);
 	    break;
@@ -230,9 +226,9 @@ static int avma1cs_config(struct pcmcia_device *link)
     }
 
     printk(KERN_NOTICE "avma1_cs: checking at i/o %#x, irq %d\n",
-				link->io.BasePort1, link->irq.AssignedIRQ);
+				link->io.BasePort1, link->irq);
 
-    icard.para[0] = link->irq.AssignedIRQ;
+    icard.para[0] = link->irq;
     icard.para[1] = link->io.BasePort1;
     icard.protocol = isdnprot;
     icard.typ = ISDN_CTYPE_A1_PCMCIA;
diff --git a/drivers/isdn/hisax/elsa_cs.c b/drivers/isdn/hisax/elsa_cs.c
index c9a30b1..242c434 100644
--- a/drivers/isdn/hisax/elsa_cs.c
+++ b/drivers/isdn/hisax/elsa_cs.c
@@ -136,10 +136,6 @@ static int elsa_cs_probe(struct pcmcia_device *link)
 
     local->cardnr = -1;
 
-    /* Interrupt setup */
-    link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
-    link->irq.Handler = NULL;
-
     /*
       General socket configuration defaults can go here.  In this
       client, we assume very little, and rely on the CIS for almost
@@ -223,11 +219,8 @@ static int elsa_cs_config(struct pcmcia_device *link)
     if (i != 0)
 	goto failed;
 
-    i = pcmcia_request_irq(link, &link->irq);
-    if (i != 0) {
-        link->irq.AssignedIRQ = 0;
+    if (!link->irq)
 	goto failed;
-    }
 
     i = pcmcia_request_configuration(link, &link->conf);
     if (i != 0)
@@ -244,7 +237,7 @@ static int elsa_cs_config(struct pcmcia_device *link)
     printk(KERN_INFO "%s: index 0x%02x: ",
            dev->node.dev_name, link->conf.ConfigIndex);
     if (link->conf.Attributes & CONF_ENABLE_IRQ)
-        printk(", irq %d", link->irq.AssignedIRQ);
+	printk(", irq %d", link->irq);
     if (link->io.NumPorts1)
         printk(", io 0x%04x-0x%04x", link->io.BasePort1,
                link->io.BasePort1+link->io.NumPorts1-1);
@@ -253,7 +246,7 @@ static int elsa_cs_config(struct pcmcia_device *link)
                link->io.BasePort2+link->io.NumPorts2-1);
     printk("\n");
 
-    icard.para[0] = link->irq.AssignedIRQ;
+    icard.para[0] = link->irq;
     icard.para[1] = link->io.BasePort1;
     icard.protocol = protocol;
     icard.typ = ISDN_CTYPE_ELSA_PCMCIA;
diff --git a/drivers/isdn/hisax/sedlbauer_cs.c b/drivers/isdn/hisax/sedlbauer_cs.c
index 7836ec3..967371b 100644
--- a/drivers/isdn/hisax/sedlbauer_cs.c
+++ b/drivers/isdn/hisax/sedlbauer_cs.c
@@ -143,10 +143,6 @@ static int sedlbauer_probe(struct pcmcia_device *link)
     local->p_dev = link;
     link->priv = local;
 
-    /* Interrupt setup */
-    link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
-    link->irq.Handler = NULL;
-
     /*
       General socket configuration defaults can go here.  In this
       client, we assume very little, and rely on the CIS for almost
@@ -227,9 +223,7 @@ static int sedlbauer_config_check(struct pcmcia_device *p_dev,
 	else if (dflt->vpp1.present & (1<<CISTPL_POWER_VNOM))
 		p_dev->conf.Vpp = dflt->vpp1.param[CISTPL_POWER_VNOM]/10000;
 
-	/* Do we need to allocate an interrupt? */
-	if (cfg->irq.IRQInfo1 || dflt->irq.IRQInfo1)
-		p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
+	p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
 
 	/* IO window settings */
 	p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
@@ -313,17 +307,6 @@ static int sedlbauer_config(struct pcmcia_device *link)
 	    goto failed;
 
     /*
-       Allocate an interrupt line.  Note that this does not assign a
-       handler to the interrupt, unless the 'Handler' member of the
-       irq structure is initialized.
-    */
-    if (link->conf.Attributes & CONF_ENABLE_IRQ) {
-	    ret = pcmcia_request_irq(link, &link->irq);
-	    if (ret)
-		    goto failed;
-    }
-	
-    /*
        This actually configures the PCMCIA socket -- setting up
        the I/O windows and the interrupt mapping, and putting the
        card and host interface into "Memory and IO" mode.
@@ -346,7 +329,7 @@ static int sedlbauer_config(struct pcmcia_device *link)
     if (link->conf.Vpp)
 	printk(", Vpp %d.%d", link->conf.Vpp/10, link->conf.Vpp%10);
     if (link->conf.Attributes & CONF_ENABLE_IRQ)
-	printk(", irq %d", link->irq.AssignedIRQ);
+	printk(", irq %d", link->irq);
     if (link->io.NumPorts1)
 	printk(", io 0x%04x-0x%04x", link->io.BasePort1,
 	       link->io.BasePort1+link->io.NumPorts1-1);
@@ -358,7 +341,7 @@ static int sedlbauer_config(struct pcmcia_device *link)
 	       req->Base+req->Size-1);
     printk("\n");
 
-    icard.para[0] = link->irq.AssignedIRQ;
+    icard.para[0] = link->irq;
     icard.para[1] = link->io.BasePort1;
     icard.protocol = protocol;
     icard.typ = ISDN_CTYPE_SEDLBAUER_PCMCIA;
diff --git a/drivers/isdn/hisax/teles_cs.c b/drivers/isdn/hisax/teles_cs.c
index b0c5976..75e075c 100644
--- a/drivers/isdn/hisax/teles_cs.c
+++ b/drivers/isdn/hisax/teles_cs.c
@@ -126,10 +126,6 @@ static int teles_probe(struct pcmcia_device *link)
     local->p_dev = link;
     link->priv = local;
 
-    /* Interrupt setup */
-    link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
-    link->irq.Handler = NULL;
-
     /*
       General socket configuration defaults can go here.  In this
       client, we assume very little, and rely on the CIS for almost
@@ -213,11 +209,8 @@ static int teles_cs_config(struct pcmcia_device *link)
     if (i != 0)
 	goto cs_failed;
 
-    i = pcmcia_request_irq(link, &link->irq);
-    if (i != 0) {
-        link->irq.AssignedIRQ = 0;
+    if (!link->irq)
         goto cs_failed;
-    }
 
     i = pcmcia_request_configuration(link, &link->conf);
     if (i != 0)
@@ -234,7 +227,7 @@ static int teles_cs_config(struct pcmcia_device *link)
     printk(KERN_INFO "%s: index 0x%02x:",
            dev->node.dev_name, link->conf.ConfigIndex);
     if (link->conf.Attributes & CONF_ENABLE_IRQ)
-        printk(", irq %d", link->irq.AssignedIRQ);
+	    printk(", irq %d", link->irq);
     if (link->io.NumPorts1)
         printk(", io 0x%04x-0x%04x", link->io.BasePort1,
                link->io.BasePort1+link->io.NumPorts1-1);
@@ -243,7 +236,7 @@ static int teles_cs_config(struct pcmcia_device *link)
                link->io.BasePort2+link->io.NumPorts2-1);
     printk("\n");
 
-    icard.para[0] = link->irq.AssignedIRQ;
+    icard.para[0] = link->irq;
     icard.para[1] = link->io.BasePort1;
     icard.protocol = protocol;
     icard.typ = ISDN_CTYPE_TELESPCMCIA;
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c
index 61e33cf..839a29c 100644
--- a/drivers/net/pcmcia/3c574_cs.c
+++ b/drivers/net/pcmcia/3c574_cs.c
@@ -282,8 +282,6 @@ static int tc574_probe(struct pcmcia_device *link)
 	spin_lock_init(&lp->window_lock);
 	link->io.NumPorts1 = 32;
 	link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
-	link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
-	link->irq.Handler = &el3_interrupt;
 	link->conf.Attributes = CONF_ENABLE_IRQ;
 	link->conf.IntType = INT_MEMORY_AND_IO;
 	link->conf.ConfigIndex = 1;
@@ -352,7 +350,7 @@ static int tc574_config(struct pcmcia_device *link)
 	if (i != 0)
 		goto failed;
 
-	ret = pcmcia_request_irq(link, &link->irq);
+	ret = pcmcia_request_irq(link, el3_interrupt);
 	if (ret)
 		goto failed;
 
@@ -360,7 +358,7 @@ static int tc574_config(struct pcmcia_device *link)
 	if (ret)
 		goto failed;
 
-	dev->irq = link->irq.AssignedIRQ;
+	dev->irq = link->irq;
 	dev->base_addr = link->io.BasePort1;
 
 	ioaddr = dev->base_addr;
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c
index 091e0b0..405d772 100644
--- a/drivers/net/pcmcia/3c589_cs.c
+++ b/drivers/net/pcmcia/3c589_cs.c
@@ -194,8 +194,7 @@ static int tc589_probe(struct pcmcia_device *link)
     spin_lock_init(&lp->lock);
     link->io.NumPorts1 = 16;
     link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
-    link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
-    link->irq.Handler = &el3_interrupt;
+
     link->conf.Attributes = CONF_ENABLE_IRQ;
     link->conf.IntType = INT_MEMORY_AND_IO;
     link->conf.ConfigIndex = 1;
@@ -271,7 +270,7 @@ static int tc589_config(struct pcmcia_device *link)
     if (i != 0)
 	goto failed;
 
-    ret = pcmcia_request_irq(link, &link->irq);
+    ret = pcmcia_request_irq(link, el3_interrupt);
     if (ret)
 	    goto failed;
 
@@ -279,7 +278,7 @@ static int tc589_config(struct pcmcia_device *link)
     if (ret)
 	    goto failed;
 	
-    dev->irq = link->irq.AssignedIRQ;
+    dev->irq = link->irq;
     dev->base_addr = link->io.BasePort1;
     ioaddr = dev->base_addr;
     EL3WINDOW(0);
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c
index 09291e6..41d2def 100644
--- a/drivers/net/pcmcia/axnet_cs.c
+++ b/drivers/net/pcmcia/axnet_cs.c
@@ -169,7 +169,6 @@ static int axnet_probe(struct pcmcia_device *link)
     info = PRIV(dev);
     info->p_dev = link;
     link->priv = dev;
-    link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
     link->conf.Attributes = CONF_ENABLE_IRQ;
     link->conf.IntType = INT_MEMORY_AND_IO;
 
@@ -266,12 +265,9 @@ static int try_io_port(struct pcmcia_device *link)
     int j, ret;
     if (link->io.NumPorts1 == 32) {
 	link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
-	if (link->io.NumPorts2 > 0) {
-	    /* for master/slave multifunction cards */
+	/* for master/slave multifunction cards */
+	if (link->io.NumPorts2 > 0)
 	    link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
-	    link->irq.Attributes =
-		IRQ_TYPE_DYNAMIC_SHARING;
-	}
     } else {
 	/* This should be two 16-port windows */
 	link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
@@ -337,8 +333,7 @@ static int axnet_config(struct pcmcia_device *link)
     if (ret != 0)
 	goto failed;
 
-    ret = pcmcia_request_irq(link, &link->irq);
-    if (ret)
+    if (!link->irq)
 	    goto failed;
     
     if (link->io.NumPorts2 == 8) {
@@ -350,7 +345,7 @@ static int axnet_config(struct pcmcia_device *link)
     if (ret)
 	    goto failed;
 
-    dev->irq = link->irq.AssignedIRQ;
+    dev->irq = link->irq;
     dev->base_addr = link->io.BasePort1;
 
     if (!get_prom(link)) {
diff --git a/drivers/net/pcmcia/com20020_cs.c b/drivers/net/pcmcia/com20020_cs.c
index 21d9c9d..278438b 100644
--- a/drivers/net/pcmcia/com20020_cs.c
+++ b/drivers/net/pcmcia/com20020_cs.c
@@ -163,7 +163,6 @@ static int com20020_probe(struct pcmcia_device *p_dev)
     p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
     p_dev->io.NumPorts1 = 16;
     p_dev->io.IOAddrLines = 16;
-    p_dev->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
     p_dev->conf.Attributes = CONF_ENABLE_IRQ;
     p_dev->conf.IntType = INT_MEMORY_AND_IO;
 
@@ -275,15 +274,14 @@ static int com20020_config(struct pcmcia_device *link)
     dev_dbg(&link->dev, "got ioaddr %Xh\n", ioaddr);
 
     dev_dbg(&link->dev, "request IRQ %d\n",
-	    link->irq.AssignedIRQ);
-    i = pcmcia_request_irq(link, &link->irq);
-    if (i != 0)
+	    link->irq);
+    if (!link->irq)
     {
 	dev_dbg(&link->dev, "requestIRQ failed totally!\n");
 	goto failed;
     }
 
-    dev->irq = link->irq.AssignedIRQ;
+    dev->irq = link->irq;
 
     ret = pcmcia_request_configuration(link, &link->conf);
     if (ret)
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c
index b9dc80b..31f1a03 100644
--- a/drivers/net/pcmcia/fmvj18x_cs.c
+++ b/drivers/net/pcmcia/fmvj18x_cs.c
@@ -254,10 +254,6 @@ static int fmvj18x_probe(struct pcmcia_device *link)
     link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
     link->io.IOAddrLines = 5;
 
-    /* Interrupt setup */
-    link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
-    link->irq.Handler = fjn_interrupt;
-
     /* General socket configuration */
     link->conf.Attributes = CONF_ENABLE_IRQ;
     link->conf.IntType = INT_MEMORY_AND_IO;
@@ -425,8 +421,6 @@ static int fmvj18x_config(struct pcmcia_device *link)
     }
 
     if (link->io.NumPorts2 != 0) {
-    	link->irq.Attributes =
-		IRQ_TYPE_DYNAMIC_SHARING;
 	ret = mfc_try_io_port(link);
 	if (ret != 0) goto failed;
     } else if (cardtype == UNGERMANN) {
@@ -437,14 +431,14 @@ static int fmvj18x_config(struct pcmcia_device *link)
 	    if (ret)
 		    goto failed;
     }
-    ret = pcmcia_request_irq(link, &link->irq);
+    ret = pcmcia_request_irq(link, fjn_interrupt);
     if (ret)
 	    goto failed;
     ret = pcmcia_request_configuration(link, &link->conf);
     if (ret)
 	    goto failed;
 
-    dev->irq = link->irq.AssignedIRQ;
+    dev->irq = link->irq;
     dev->base_addr = link->io.BasePort1;
 
     if (link->io.BasePort2 != 0) {
diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c
index 37f4a6f..0225cdf 100644
--- a/drivers/net/pcmcia/ibmtr_cs.c
+++ b/drivers/net/pcmcia/ibmtr_cs.c
@@ -156,8 +156,6 @@ static int __devinit ibmtr_attach(struct pcmcia_device *link)
     link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
     link->io.NumPorts1 = 4;
     link->io.IOAddrLines = 16;
-    link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
-    link->irq.Handler = ibmtr_interrupt;
     link->conf.Attributes = CONF_ENABLE_IRQ;
     link->conf.IntType = INT_MEMORY_AND_IO;
     link->conf.Present = PRESENT_OPTION;
@@ -238,11 +236,11 @@ static int __devinit ibmtr_config(struct pcmcia_device *link)
     }
     dev->base_addr = link->io.BasePort1;
 
-    ret = pcmcia_request_irq(link, &link->irq);
+    ret = pcmcia_request_exclusive_irq(link, ibmtr_interrupt);
     if (ret)
 	    goto failed;
-    dev->irq = link->irq.AssignedIRQ;
-    ti->irq = link->irq.AssignedIRQ;
+    dev->irq = link->irq;
+    ti->irq = link->irq;
     ti->global_int_enable=GLOBAL_INT_ENABLE+((dev->irq==9) ? 2 : dev->irq);
 
     /* Allocate the MMIO memory window */
diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c
index c717b14..b779e3a 100644
--- a/drivers/net/pcmcia/nmclan_cs.c
+++ b/drivers/net/pcmcia/nmclan_cs.c
@@ -463,8 +463,6 @@ static int nmclan_probe(struct pcmcia_device *link)
     link->io.NumPorts1 = 32;
     link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
     link->io.IOAddrLines = 5;
-    link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
-    link->irq.Handler = mace_interrupt;
     link->conf.Attributes = CONF_ENABLE_IRQ;
     link->conf.IntType = INT_MEMORY_AND_IO;
     link->conf.ConfigIndex = 1;
@@ -652,14 +650,14 @@ static int nmclan_config(struct pcmcia_device *link)
   ret = pcmcia_request_io(link, &link->io);
   if (ret)
 	  goto failed;
-  ret = pcmcia_request_irq(link, &link->irq);
+  ret = pcmcia_request_exclusive_irq(link, mace_interrupt);
   if (ret)
 	  goto failed;
   ret = pcmcia_request_configuration(link, &link->conf);
   if (ret)
 	  goto failed;
 
-  dev->irq = link->irq.AssignedIRQ;
+  dev->irq = link->irq;
   dev->base_addr = link->io.BasePort1;
 
   ioaddr = dev->base_addr;
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c
index 776cad2..22a3350 100644
--- a/drivers/net/pcmcia/pcnet_cs.c
+++ b/drivers/net/pcmcia/pcnet_cs.c
@@ -265,7 +265,6 @@ static int pcnet_probe(struct pcmcia_device *link)
     info->p_dev = link;
     link->priv = dev;
 
-    link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
     link->conf.Attributes = CONF_ENABLE_IRQ;
     link->conf.IntType = INT_MEMORY_AND_IO;
 
@@ -489,8 +488,6 @@ static int try_io_port(struct pcmcia_device *link)
 	if (link->io.NumPorts2 > 0) {
 	    /* for master/slave multifunction cards */
 	    link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
-	    link->irq.Attributes =
-		IRQ_TYPE_DYNAMIC_SHARING;
 	}
     } else {
 	/* This should be two 16-port windows */
@@ -560,8 +557,7 @@ static int pcnet_config(struct pcmcia_device *link)
     if (ret)
 	goto failed;
 
-    ret = pcmcia_request_irq(link, &link->irq);
-    if (ret)
+    if (!link->irq)
 	    goto failed;
 
     if (link->io.NumPorts2 == 8) {
@@ -575,7 +571,7 @@ static int pcnet_config(struct pcmcia_device *link)
     ret = pcmcia_request_configuration(link, &link->conf);
     if (ret)
 	    goto failed;
-    dev->irq = link->irq.AssignedIRQ;
+    dev->irq = link->irq;
     dev->base_addr = link->io.BasePort1;
     if (info->flags & HAS_MISC_REG) {
 	if ((if_port == 1) || (if_port == 2))
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c
index 5adc662..1257d10 100644
--- a/drivers/net/pcmcia/smc91c92_cs.c
+++ b/drivers/net/pcmcia/smc91c92_cs.c
@@ -329,8 +329,6 @@ static int smc91c92_probe(struct pcmcia_device *link)
     link->io.NumPorts1 = 16;
     link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
     link->io.IOAddrLines = 4;
-    link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
-    link->irq.Handler = &smc_interrupt;
     link->conf.Attributes = CONF_ENABLE_IRQ;
     link->conf.IntType = INT_MEMORY_AND_IO;
 
@@ -453,7 +451,6 @@ static int mhz_mfc_config(struct pcmcia_device *link)
 
     link->conf.Attributes |= CONF_ENABLE_SPKR;
     link->conf.Status = CCSR_AUDIO_ENA;
-    link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
     link->io.IOAddrLines = 16;
     link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
     link->io.NumPorts2 = 8;
@@ -651,7 +648,6 @@ static int osi_config(struct pcmcia_device *link)
 
     link->conf.Attributes |= CONF_ENABLE_SPKR;
     link->conf.Status = CCSR_AUDIO_ENA;
-    link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
     link->io.NumPorts1 = 64;
     link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
     link->io.NumPorts2 = 8;
@@ -876,7 +872,7 @@ static int smc91c92_config(struct pcmcia_device *link)
     if (i)
 	    goto config_failed;
 
-    i = pcmcia_request_irq(link, &link->irq);
+    i = pcmcia_request_irq(link, smc_interrupt);
     if (i)
 	    goto config_failed;
     i = pcmcia_request_configuration(link, &link->conf);
@@ -886,7 +882,7 @@ static int smc91c92_config(struct pcmcia_device *link)
     if (smc->manfid == MANFID_MOTOROLA)
 	mot_config(link);
 
-    dev->irq = link->irq.AssignedIRQ;
+    dev->irq = link->irq;
 
     if ((if_port >= 0) && (if_port <= 2))
 	dev->if_port = if_port;
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c
index 4d1802e..c9e7d7d 100644
--- a/drivers/net/pcmcia/xirc2ps_cs.c
+++ b/drivers/net/pcmcia/xirc2ps_cs.c
@@ -555,7 +555,6 @@ xirc2ps_probe(struct pcmcia_device *link)
     link->conf.Attributes = CONF_ENABLE_IRQ;
     link->conf.IntType = INT_MEMORY_AND_IO;
     link->conf.ConfigIndex = 1;
-    link->irq.Handler = xirc2ps_interrupt;
 
     /* Fill in card specific entries */
     dev->netdev_ops = &netdev_ops;
@@ -841,7 +840,6 @@ xirc2ps_config(struct pcmcia_device * link)
 	    link->conf.Attributes |= CONF_ENABLE_SPKR;
 	    link->conf.Status |= CCSR_AUDIO_ENA;
 	}
-	link->irq.Attributes |= IRQ_TYPE_DYNAMIC_SHARING;
 	link->io.NumPorts2 = 8;
 	link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
 	if (local->dingo) {
@@ -866,7 +864,6 @@ xirc2ps_config(struct pcmcia_device * link)
 	}
 	printk(KNOT_XIRC "no ports available\n");
     } else {
-	link->irq.Attributes |= IRQ_TYPE_DYNAMIC_SHARING;
 	link->io.NumPorts1 = 16;
 	for (ioaddr = 0x300; ioaddr < 0x400; ioaddr += 0x10) {
 	    link->io.BasePort1 = ioaddr;
@@ -885,7 +882,7 @@ xirc2ps_config(struct pcmcia_device * link)
      * Now allocate an interrupt line.	Note that this does not
      * actually assign a handler to the interrupt.
      */
-    if ((err=pcmcia_request_irq(link, &link->irq)))
+    if ((err=pcmcia_request_irq(link, xirc2ps_interrupt)))
 	goto config_error;
 
     /****************
@@ -982,7 +979,7 @@ xirc2ps_config(struct pcmcia_device * link)
 	printk(KNOT_XIRC "invalid if_port requested\n");
 
     /* we can now register the device with the net subsystem */
-    dev->irq = link->irq.AssignedIRQ;
+    dev->irq = link->irq;
     dev->base_addr = link->io.BasePort1;
 
     if (local->dingo)
diff --git a/drivers/net/wireless/airo_cs.c b/drivers/net/wireless/airo_cs.c
index f6036fb..7867c51 100644
--- a/drivers/net/wireless/airo_cs.c
+++ b/drivers/net/wireless/airo_cs.c
@@ -132,10 +132,6 @@ static int airo_probe(struct pcmcia_device *p_dev)
 
 	dev_dbg(&p_dev->dev, "airo_attach()\n");
 
-	/* Interrupt setup */
-	p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
-	p_dev->irq.Handler = NULL;
-
 	/*
 	  General socket configuration defaults can go here.  In this
 	  client, we assume very little, and rely on the CIS for almost
@@ -212,9 +208,7 @@ static int airo_cs_config_check(struct pcmcia_device *p_dev,
 	else if (dflt->vpp1.present & (1<<CISTPL_POWER_VNOM))
 		p_dev->conf.Vpp = dflt->vpp1.param[CISTPL_POWER_VNOM]/10000;
 
-	/* Do we need to allocate an interrupt? */
-	if (cfg->irq.IRQInfo1 || dflt->irq.IRQInfo1)
-		p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
+	p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
 
 	/* IO window settings */
 	p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
@@ -300,16 +294,8 @@ static int airo_config(struct pcmcia_device *link)
 	if (ret)
 		goto failed;
 
-	/*
-	  Allocate an interrupt line.  Note that this does not assign a
-	  handler to the interrupt, unless the 'Handler' member of the
-	  irq structure is initialized.
-	*/
-	if (link->conf.Attributes & CONF_ENABLE_IRQ) {
-		ret = pcmcia_request_irq(link, &link->irq);
-		if (ret)
-			goto failed;
-	}
+	if (!link->irq)
+		goto failed;
 
 	/*
 	  This actually configures the PCMCIA socket -- setting up
@@ -320,7 +306,7 @@ static int airo_config(struct pcmcia_device *link)
 	if (ret)
 		goto failed;
 	((local_info_t *)link->priv)->eth_dev =
-		init_airo_card(link->irq.AssignedIRQ,
+		init_airo_card(link->irq,
 			       link->io.BasePort1, 1, &link->dev);
 	if (!((local_info_t *)link->priv)->eth_dev)
 		goto failed;
@@ -338,8 +324,7 @@ static int airo_config(struct pcmcia_device *link)
 	       dev->node.dev_name, link->conf.ConfigIndex);
 	if (link->conf.Vpp)
 		printk(", Vpp %d.%d", link->conf.Vpp/10, link->conf.Vpp%10);
-	if (link->conf.Attributes & CONF_ENABLE_IRQ)
-		printk(", irq %d", link->irq.AssignedIRQ);
+	printk(", irq %d", link->irq);
 	if (link->io.NumPorts1)
 		printk(", io 0x%04x-0x%04x", link->io.BasePort1,
 		       link->io.BasePort1+link->io.NumPorts1-1);
diff --git a/drivers/net/wireless/atmel_cs.c b/drivers/net/wireless/atmel_cs.c
index 3240791..759cdc4 100644
--- a/drivers/net/wireless/atmel_cs.c
+++ b/drivers/net/wireless/atmel_cs.c
@@ -141,10 +141,6 @@ static int atmel_probe(struct pcmcia_device *p_dev)
 
 	dev_dbg(&p_dev->dev, "atmel_attach()\n");
 
-	/* Interrupt setup */
-	p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
-	p_dev->irq.Handler = NULL;
-
 	/*
 	  General socket configuration defaults can go here.  In this
 	  client, we assume very little, and rely on the CIS for almost
@@ -226,9 +222,7 @@ static int atmel_config_check(struct pcmcia_device *p_dev,
 	else if (dflt->vpp1.present & (1<<CISTPL_POWER_VNOM))
 		p_dev->conf.Vpp = dflt->vpp1.param[CISTPL_POWER_VNOM]/10000;
 
-	/* Do we need to allocate an interrupt? */
-	if (cfg->irq.IRQInfo1 || dflt->irq.IRQInfo1)
-		p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
+	p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
 
 	/* IO window settings */
 	p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
@@ -278,15 +272,9 @@ static int atmel_config(struct pcmcia_device *link)
 	if (pcmcia_loop_config(link, atmel_config_check, NULL))
 		goto failed;
 
-	/*
-	  Allocate an interrupt line.  Note that this does not assign a
-	  handler to the interrupt, unless the 'Handler' member of the
-	  irq structure is initialized.
-	*/
-	if (link->conf.Attributes & CONF_ENABLE_IRQ) {
-		ret = pcmcia_request_irq(link, &link->irq);
-		if (ret)
-			goto failed;
+	if (!link->irq) {
+		dev_err(&link->dev, "atmel: cannot assign IRQ: check that CONFIG_ISA is set in kernel config.");
+		goto failed;
 	}
 
 	/*
@@ -298,14 +286,8 @@ static int atmel_config(struct pcmcia_device *link)
 	if (ret)
 		goto failed;
 
-	if (link->irq.AssignedIRQ == 0) {
-		printk(KERN_ALERT
-		       "atmel: cannot assign IRQ: check that CONFIG_ISA is set in kernel config.");
-		goto failed;
-	}
-
 	((local_info_t*)link->priv)->eth_dev =
-		init_atmel_card(link->irq.AssignedIRQ,
+		init_atmel_card(link->irq,
 				link->io.BasePort1,
 				did ? did->driver_info : ATMEL_FW_TYPE_NONE,
 				&link->dev,
diff --git a/drivers/net/wireless/b43/pcmcia.c b/drivers/net/wireless/b43/pcmcia.c
index 984174b..b9ea107 100644
--- a/drivers/net/wireless/b43/pcmcia.c
+++ b/drivers/net/wireless/b43/pcmcia.c
@@ -97,10 +97,7 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev)
 	if (res != 0)
 		goto err_disable;
 
-	dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
-	dev->irq.Handler = NULL; /* The handler is registered later. */
-	res = pcmcia_request_irq(dev, &dev->irq);
-	if (res != 0)
+	if (!dev->irq)
 		goto err_disable;
 
 	res = pcmcia_request_configuration(dev, &dev->conf);
diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c
index d19748d..7e5f4c0 100644
--- a/drivers/net/wireless/hostap/hostap_cs.c
+++ b/drivers/net/wireless/hostap/hostap_cs.c
@@ -555,15 +555,7 @@ static int prism2_config_check(struct pcmcia_device *p_dev,
 		p_dev->conf.Vpp = dflt->vpp1.param[CISTPL_POWER_VNOM] / 10000;
 
 	/* Do we need to allocate an interrupt? */
-	if (cfg->irq.IRQInfo1 || dflt->irq.IRQInfo1)
-		p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
-	else if (!(p_dev->conf.Attributes & CONF_ENABLE_IRQ)) {
-		/* At least Compaq WL200 does not have IRQInfo1 set,
-		 * but it does not work without interrupts.. */
-		printk(KERN_WARNING "Config has no IRQ info, but trying to "
-		       "enable IRQ anyway..\n");
-		p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
-	}
+	p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
 
 	/* IO window settings */
 	PDEBUG(DEBUG_EXTRA, "IO window settings: cfg->io.nwin=%d "
@@ -635,18 +627,9 @@ static int prism2_config(struct pcmcia_device *link)
 	strcpy(hw_priv->node.dev_name, dev->name);
 	link->dev_node = &hw_priv->node;
 
-	/*
-	 * Allocate an interrupt line.  Note that this does not assign a
-	 * handler to the interrupt, unless the 'Handler' member of the
-	 * irq structure is initialized.
-	 */
-	if (link->conf.Attributes & CONF_ENABLE_IRQ) {
-		link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
-		link->irq.Handler = prism2_interrupt;
-		ret = pcmcia_request_irq(link, &link->irq);
-		if (ret)
-			goto failed;
-	}
+	ret = pcmcia_request_irq(link, prism2_interrupt);
+	if (ret)
+		goto failed;
 
 	/*
 	 * This actually configures the PCMCIA socket -- setting up
@@ -657,7 +640,7 @@ static int prism2_config(struct pcmcia_device *link)
 	if (ret)
 		goto failed;
 
-	dev->irq = link->irq.AssignedIRQ;
+	dev->irq = link->irq;
 	dev->base_addr = link->io.BasePort1;
 
 	/* Finally, report what we've done */
@@ -667,7 +650,7 @@ static int prism2_config(struct pcmcia_device *link)
 		printk(", Vpp %d.%d", link->conf.Vpp / 10,
 		       link->conf.Vpp % 10);
 	if (link->conf.Attributes & CONF_ENABLE_IRQ)
-		printk(", irq %d", link->irq.AssignedIRQ);
+		printk(", irq %d", link->irq);
 	if (link->io.NumPorts1)
 		printk(", io 0x%04x-0x%04x", link->io.BasePort1,
 		       link->io.BasePort1+link->io.NumPorts1-1);
diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c
index 1f6cb58..0c99b7d 100644
--- a/drivers/net/wireless/libertas/if_cs.c
+++ b/drivers/net/wireless/libertas/if_cs.c
@@ -776,7 +776,7 @@ static void if_cs_release(struct pcmcia_device *p_dev)
 
 	lbs_deb_enter(LBS_DEB_CS);
 
-	free_irq(p_dev->irq.AssignedIRQ, card);
+	free_irq(p_dev->irq, card);
 	pcmcia_disable_device(p_dev);
 	if (card->iobase)
 		ioport_unmap(card->iobase);
@@ -806,8 +806,7 @@ static int if_cs_ioprobe(struct pcmcia_device *p_dev,
 	p_dev->io.NumPorts1 = cfg->io.win[0].len;
 
 	/* Do we need to allocate an interrupt? */
-	if (cfg->irq.IRQInfo1)
-		p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
+	p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
 
 	/* IO window settings */
 	if (cfg->io.nwin != 1) {
@@ -836,9 +835,6 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
 	card->p_dev = p_dev;
 	p_dev->priv = card;
 
-	p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
-	p_dev->irq.Handler = NULL;
-
 	p_dev->conf.Attributes = 0;
 	p_dev->conf.IntType = INT_MEMORY_AND_IO;
 
@@ -853,13 +849,8 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
 	 * a handler to the interrupt, unless the 'Handler' member of
 	 * the irq structure is initialized.
 	 */
-	if (p_dev->conf.Attributes & CONF_ENABLE_IRQ) {
-		ret = pcmcia_request_irq(p_dev, &p_dev->irq);
-		if (ret) {
-			lbs_pr_err("error in pcmcia_request_irq\n");
-			goto out1;
-		}
-	}
+	if (!p_dev->irq)
+		goto out1;
 
 	/* Initialize io access */
 	card->iobase = ioport_map(p_dev->io.BasePort1, p_dev->io.NumPorts1);
@@ -882,7 +873,7 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
 
 	/* Finally, report what we've done */
 	lbs_deb_cs("irq %d, io 0x%04x-0x%04x\n",
-	       p_dev->irq.AssignedIRQ, p_dev->io.BasePort1,
+	       p_dev->irq, p_dev->io.BasePort1,
 	       p_dev->io.BasePort1 + p_dev->io.NumPorts1 - 1);
 
 	/*
@@ -939,7 +930,7 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
 	priv->fw_ready = 1;
 
 	/* Now actually get the IRQ */
-	ret = request_irq(p_dev->irq.AssignedIRQ, if_cs_interrupt,
+	ret = request_irq(p_dev->irq, if_cs_interrupt,
 		IRQF_SHARED, DRV_NAME, card);
 	if (ret) {
 		lbs_pr_err("error in request_irq\n");
diff --git a/drivers/net/wireless/orinoco/orinoco_cs.c b/drivers/net/wireless/orinoco/orinoco_cs.c
index 1d4ada1..5d29b11 100644
--- a/drivers/net/wireless/orinoco/orinoco_cs.c
+++ b/drivers/net/wireless/orinoco/orinoco_cs.c
@@ -119,10 +119,6 @@ orinoco_cs_probe(struct pcmcia_device *link)
 	card->p_dev = link;
 	link->priv = priv;
 
-	/* Interrupt setup */
-	link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
-	link->irq.Handler = orinoco_interrupt;
-
 	/* General socket configuration defaults can go here.  In this
 	 * client, we assume very little, and rely on the CIS for
 	 * almost everything.  In most clients, many details (i.e.,
@@ -258,12 +254,7 @@ orinoco_cs_config(struct pcmcia_device *link)
 		goto failed;
 	}
 
-	/*
-	 * Allocate an interrupt line.  Note that this does not assign
-	 * a handler to the interrupt, unless the 'Handler' member of
-	 * the irq structure is initialized.
-	 */
-	ret = pcmcia_request_irq(link, &link->irq);
+	ret = pcmcia_request_irq(link, orinoco_interrupt);
 	if (ret)
 		goto failed;
 
@@ -296,7 +287,7 @@ orinoco_cs_config(struct pcmcia_device *link)
 
 	/* Register an interface with the stack */
 	if (orinoco_if_add(priv, link->io.BasePort1,
-			   link->irq.AssignedIRQ) != 0) {
+			   link->irq) != 0) {
 		printk(KERN_ERR PFX "orinoco_if_add() failed\n");
 		goto failed;
 	}
diff --git a/drivers/net/wireless/orinoco/spectrum_cs.c b/drivers/net/wireless/orinoco/spectrum_cs.c
index 59bda24..7a8e056 100644
--- a/drivers/net/wireless/orinoco/spectrum_cs.c
+++ b/drivers/net/wireless/orinoco/spectrum_cs.c
@@ -193,10 +193,6 @@ spectrum_cs_probe(struct pcmcia_device *link)
 	card->p_dev = link;
 	link->priv = priv;
 
-	/* Interrupt setup */
-	link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
-	link->irq.Handler = orinoco_interrupt;
-
 	/* General socket configuration defaults can go here.  In this
 	 * client, we assume very little, and rely on the CIS for
 	 * almost everything.  In most clients, many details (i.e.,
@@ -332,12 +328,7 @@ spectrum_cs_config(struct pcmcia_device *link)
 		goto failed;
 	}
 
-	/*
-	 * Allocate an interrupt line.  Note that this does not assign
-	 * a handler to the interrupt, unless the 'Handler' member of
-	 * the irq structure is initialized.
-	 */
-	ret = pcmcia_request_irq(link, &link->irq);
+	ret = pcmcia_request_irq(link, orinoco_interrupt);
 	if (ret)
 		goto failed;
 
@@ -374,7 +365,7 @@ spectrum_cs_config(struct pcmcia_device *link)
 
 	/* Register an interface with the stack */
 	if (orinoco_if_add(priv, link->io.BasePort1,
-			   link->irq.AssignedIRQ) != 0) {
+			   link->irq) != 0) {
 		printk(KERN_ERR PFX "orinoco_if_add() failed\n");
 		goto failed;
 	}
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
index 7f0f855..e7ed2a4 100644
--- a/drivers/net/wireless/ray_cs.c
+++ b/drivers/net/wireless/ray_cs.c
@@ -321,10 +321,6 @@ static int ray_probe(struct pcmcia_device *p_dev)
 	p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
 	p_dev->io.IOAddrLines = 5;
 
-	/* Interrupt setup. For PCMCIA, driver takes what's given */
-	p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
-	p_dev->irq.Handler = &ray_interrupt;
-
 	/* General socket configuration */
 	p_dev->conf.Attributes = CONF_ENABLE_IRQ;
 	p_dev->conf.IntType = INT_MEMORY_AND_IO;
@@ -417,10 +413,10 @@ static int ray_config(struct pcmcia_device *link)
 	/* Now allocate an interrupt line.  Note that this does not
 	   actually assign a handler to the interrupt.
 	 */
-	ret = pcmcia_request_irq(link, &link->irq);
+	ret = pcmcia_request_irq(link, ray_interrupt);
 	if (ret)
 		goto failed;
-	dev->irq = link->irq.AssignedIRQ;
+	dev->irq = link->irq;
 
 	/* This actually configures the PCMCIA socket -- setting up
 	   the I/O windows and the interrupt mapping.
diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c
index 7b9621d..c43f05b 100644
--- a/drivers/net/wireless/wl3501_cs.c
+++ b/drivers/net/wireless/wl3501_cs.c
@@ -1897,10 +1897,6 @@ static int wl3501_probe(struct pcmcia_device *p_dev)
 	p_dev->io.Attributes1	= IO_DATA_PATH_WIDTH_8;
 	p_dev->io.IOAddrLines	= 5;
 
-	/* Interrupt setup */
-	p_dev->irq.Attributes	= IRQ_TYPE_DYNAMIC_SHARING;
-	p_dev->irq.Handler = wl3501_interrupt;
-
 	/* General socket configuration */
 	p_dev->conf.Attributes	= CONF_ENABLE_IRQ;
 	p_dev->conf.IntType	= INT_MEMORY_AND_IO;
@@ -1961,7 +1957,7 @@ static int wl3501_config(struct pcmcia_device *link)
 	/* Now allocate an interrupt line. Note that this does not actually
 	 * assign a handler to the interrupt. */
 
-	ret = pcmcia_request_irq(link, &link->irq);
+	ret = pcmcia_request_irq(link, wl3501_interrupt);
 	if (ret)
 		goto failed;
 
@@ -1972,7 +1968,7 @@ static int wl3501_config(struct pcmcia_device *link)
 	if (ret)
 		goto failed;
 
-	dev->irq = link->irq.AssignedIRQ;
+	dev->irq = link->irq;
 	dev->base_addr = link->io.BasePort1;
 	SET_NETDEV_DEV(dev, &link->dev);
 	if (register_netdev(dev)) {
diff --git a/drivers/parport/parport_cs.c b/drivers/parport/parport_cs.c
index 7dd370f..80c9052 100644
--- a/drivers/parport/parport_cs.c
+++ b/drivers/parport/parport_cs.c
@@ -105,7 +105,6 @@ static int parport_probe(struct pcmcia_device *link)
 
     link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
     link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
-    link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
     link->conf.Attributes = CONF_ENABLE_IRQ;
     link->conf.IntType = INT_MEMORY_AND_IO;
 
@@ -174,20 +173,19 @@ static int parport_config(struct pcmcia_device *link)
     if (ret)
 	    goto failed;
 
-    ret = pcmcia_request_irq(link, &link->irq);
-    if (ret)
+    if (!link->irq)
 	    goto failed;
     ret = pcmcia_request_configuration(link, &link->conf);
     if (ret)
 	    goto failed;
 
     p = parport_pc_probe_port(link->io.BasePort1, link->io.BasePort2,
-			      link->irq.AssignedIRQ, PARPORT_DMA_NONE,
+			      link->irq, PARPORT_DMA_NONE,
 			      &link->dev, IRQF_SHARED);
     if (p == NULL) {
 	printk(KERN_NOTICE "parport_cs: parport_pc_probe_port() at "
 	       "0x%3x, irq %u failed\n", link->io.BasePort1,
-	       link->irq.AssignedIRQ);
+	       link->irq);
 	goto failed;
     }
 
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index e0b1efc..74245cc 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -531,7 +531,6 @@ struct pcmcia_device *pcmcia_device_add(struct pcmcia_socket *s, unsigned int fu
 			p_dev->function_config = tmp_dev->function_config;
 			p_dev->io = tmp_dev->io;
 			p_dev->irq = tmp_dev->irq;
-			p_dev->irq_v = tmp_dev->irq_v;
 			kref_get(&p_dev->function_config->ref);
 		}
 
@@ -556,7 +555,7 @@ struct pcmcia_device *pcmcia_device_add(struct pcmcia_socket *s, unsigned int fu
 
 	dev_printk(KERN_NOTICE, &p_dev->dev,
 		   "pcmcia: registering new device %s (IRQ: %d)\n",
-		   p_dev->devname, p_dev->irq_v);
+		   p_dev->devname, p_dev->irq);
 
 	pcmcia_device_query(p_dev);
 
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index f629aac..c907a3f 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -407,41 +407,6 @@ out:
 } /* pcmcia_release_io */
 
 
-static int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req)
-{
-	struct pcmcia_socket *s = p_dev->socket;
-	config_t *c;
-	int ret = -EINVAL;
-
-	mutex_lock(&s->ops_mutex);
-
-	c = p_dev->function_config;
-
-	if (!p_dev->_irq)
-		goto out;
-
-	p_dev->_irq = 0;
-
-	if (c->state & CONFIG_LOCKED)
-		goto out;
-
-	if (s->pcmcia_irq != req->AssignedIRQ) {
-		dev_dbg(&s->dev, "IRQ must match assigned one\n");
-		goto out;
-	}
-
-	if (req->Handler)
-		free_irq(req->AssignedIRQ, p_dev->priv);
-
-	ret = 0;
-
-out:
-	mutex_unlock(&s->ops_mutex);
-
-	return ret;
-} /* pcmcia_release_irq */
-
-
 int pcmcia_release_window(struct pcmcia_device *p_dev, window_handle_t wh)
 {
 	struct pcmcia_socket *s = p_dev->socket;
@@ -679,61 +644,66 @@ out:
 EXPORT_SYMBOL(pcmcia_request_io);
 
 
-/** pcmcia_request_irq
+/**
+ * pcmcia_request_irq() - attempt to request a IRQ for a PCMCIA device
  *
- * Request_irq() reserves an irq for this client.
+ * pcmcia_request_irq() is a wrapper around request_irq which will allow
+ * the PCMCIA core to clean up the registration in pcmcia_disable_device().
+ * Drivers are free to use request_irq() directly, but then they need to
+ * call free_irq themselfves, too. Also, only IRQF_SHARED capable IRQ
+ * handlers are allowed.
  */
-
-int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
+int __must_check pcmcia_request_irq(struct pcmcia_device *p_dev,
+				    irq_handler_t handler)
 {
-	struct pcmcia_socket *s = p_dev->socket;
-	config_t *c;
-	int ret = -EINVAL, irq = p_dev->irq_v;
-	int type = IRQF_SHARED;
+	int ret;
 
-	mutex_lock(&s->ops_mutex);
+	if (!p_dev->irq)
+		return -EINVAL;
 
-	if (!(s->state & SOCKET_PRESENT)) {
-		dev_dbg(&s->dev, "No card present\n");
-		goto out;
-	}
-	c = p_dev->function_config;
-	if (c->state & CONFIG_LOCKED) {
-		dev_dbg(&s->dev, "Configuration is locked\n");
-		goto out;
-	}
+	ret = request_irq(p_dev->irq, handler, IRQF_SHARED,
+			p_dev->devname, p_dev->priv);
+	if (!ret)
+		p_dev->_irq = 1;
 
-	if (!irq) {
-		dev_dbg(&s->dev, "no IRQ available\n");
-		goto out;
-	}
+	return ret;
+}
+EXPORT_SYMBOL(pcmcia_request_irq);
 
-	if (!(req->Attributes & IRQ_TYPE_DYNAMIC_SHARING)) {
-		req->Attributes |= IRQ_TYPE_DYNAMIC_SHARING;
-		dev_printk(KERN_WARNING, &p_dev->dev, "pcmcia: the driver "
-			"needs updating to supported shared IRQ lines.\n");
-	}
 
-	if (req->Handler) {
-		ret = request_irq(irq, req->Handler, type,
-				  p_dev->devname, p_dev->priv);
-		if (ret) {
-			dev_printk(KERN_INFO, &s->dev,
-				"request_irq() failed\n");
-			goto out;
-		}
-	}
+/**
+ * pcmcia_request_exclusive_irq() - attempt to request an exclusive IRQ first
+ *
+ * pcmcia_request_exclusive_irq() is a wrapper around request_irq which
+ * attempts first to request an exclusive IRQ. If it fails, it also accepts
+ * a shared IRQ, but prints out a warning. PCMCIA drivers should allow for
+ * IRQ sharing and either use request_irq directly (then they need to call
+ * free_irq themselves, too), or the pcmcia_request_irq() function.
+ */
+int __must_check
+pcmcia_request_exclusive_irq(struct pcmcia_device *p_dev, irq_handler_t handler)
+{
+	int ret;
 
-	req->AssignedIRQ = irq;
+	if (!p_dev->irq)
+		return -EINVAL;
 
-	p_dev->_irq = 1;
+	ret = request_irq(p_dev->irq, handler, 0, p_dev->devname, p_dev->priv);
+	if (ret) {
+		ret = pcmcia_request_irq(p_dev, handler);
+		dev_printk(KERN_WARNING, &p_dev->dev, "pcmcia: "
+			"request for exclusive IRQ could not be fulfilled.\n");
+		dev_printk(KERN_WARNING, &p_dev->dev, "pcmcia: the driver "
+			"needs updating to supported shared IRQ lines.\n");
+	}
+	if (ret)
+		dev_printk(KERN_INFO, &p_dev->dev, "request_irq() failed\n");
+	else
+		p_dev->_irq = 1;
 
-	ret = 0;
-out:
-	mutex_unlock(&s->ops_mutex);
 	return ret;
-} /* pcmcia_request_irq */
-EXPORT_SYMBOL(pcmcia_request_irq);
+} /* pcmcia_request_exclusive_irq */
+EXPORT_SYMBOL(pcmcia_request_exclusive_irq);
 
 
 #ifdef CONFIG_PCMCIA_PROBE
@@ -777,7 +747,7 @@ static int pcmcia_setup_isa_irq(struct pcmcia_device *p_dev, int type)
 				  p_dev);
 		if (!ret) {
 			free_irq(irq, p_dev);
-			p_dev->irq_v = s->pcmcia_irq = irq;
+			p_dev->irq = s->pcmcia_irq = irq;
 			pcmcia_used_irq[irq]++;
 			break;
 		}
@@ -818,12 +788,12 @@ int pcmcia_setup_irq(struct pcmcia_device *p_dev)
 {
 	struct pcmcia_socket *s = p_dev->socket;
 
-	if (p_dev->irq_v)
+	if (p_dev->irq)
 		return 0;
 
 	/* already assigned? */
 	if (s->pcmcia_irq) {
-		p_dev->irq_v = s->pcmcia_irq;
+		p_dev->irq = s->pcmcia_irq;
 		return 0;
 	}
 
@@ -837,7 +807,7 @@ int pcmcia_setup_irq(struct pcmcia_device *p_dev)
 
 	/* but use the PCI irq otherwise */
 	if (s->pci_irq) {
-		p_dev->irq_v = s->pcmcia_irq = s->pci_irq;
+		p_dev->irq = s->pcmcia_irq = s->pci_irq;
 		return 0;
 	}
 
@@ -945,7 +915,8 @@ void pcmcia_disable_device(struct pcmcia_device *p_dev)
 {
 	pcmcia_release_configuration(p_dev);
 	pcmcia_release_io(p_dev, &p_dev->io);
-	pcmcia_release_irq(p_dev, &p_dev->irq);
+	if (p_dev->_irq)
+		free_irq(p_dev->irq, p_dev->priv);
 	if (p_dev->win)
 		pcmcia_release_window(p_dev, p_dev->win);
 }
diff --git a/drivers/scsi/pcmcia/aha152x_stub.c b/drivers/scsi/pcmcia/aha152x_stub.c
index 528733b..c1de4ba 100644
--- a/drivers/scsi/pcmcia/aha152x_stub.c
+++ b/drivers/scsi/pcmcia/aha152x_stub.c
@@ -105,7 +105,6 @@ static int aha152x_probe(struct pcmcia_device *link)
     link->io.NumPorts1 = 0x20;
     link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
     link->io.IOAddrLines = 10;
-    link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
     link->conf.Attributes = CONF_ENABLE_IRQ;
     link->conf.IntType = INT_MEMORY_AND_IO;
     link->conf.Present = PRESENT_OPTION;
@@ -160,8 +159,7 @@ static int aha152x_config_cs(struct pcmcia_device *link)
     if (ret)
 	    goto failed;
 
-    ret = pcmcia_request_irq(link, &link->irq);
-    if (ret)
+    if (!link->irq)
 	    goto failed;
 
     ret = pcmcia_request_configuration(link, &link->conf);
@@ -172,7 +170,7 @@ static int aha152x_config_cs(struct pcmcia_device *link)
     memset(&s, 0, sizeof(s));
     s.conf        = "PCMCIA setup";
     s.io_port     = link->io.BasePort1;
-    s.irq         = link->irq.AssignedIRQ;
+    s.irq         = link->irq;
     s.scsiid      = host_id;
     s.reconnect   = reconnect;
     s.parity      = parity;
diff --git a/drivers/scsi/pcmcia/fdomain_stub.c b/drivers/scsi/pcmcia/fdomain_stub.c
index 9140406..8cb6d71 100644
--- a/drivers/scsi/pcmcia/fdomain_stub.c
+++ b/drivers/scsi/pcmcia/fdomain_stub.c
@@ -88,7 +88,6 @@ static int fdomain_probe(struct pcmcia_device *link)
 	link->io.NumPorts1 = 0x10;
 	link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
 	link->io.IOAddrLines = 10;
-	link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
 	link->conf.Attributes = CONF_ENABLE_IRQ;
 	link->conf.IntType = INT_MEMORY_AND_IO;
 	link->conf.Present = PRESENT_OPTION;
@@ -133,8 +132,7 @@ static int fdomain_config(struct pcmcia_device *link)
     if (ret)
 	    goto failed;
 
-    ret = pcmcia_request_irq(link, &link->irq);
-    if (ret)
+    if (!link->irq)
 	    goto failed;
     ret = pcmcia_request_configuration(link, &link->conf);
     if (ret)
@@ -144,7 +142,7 @@ static int fdomain_config(struct pcmcia_device *link)
     release_region(link->io.BasePort1, link->io.NumPorts1);
 
     /* Set configuration options for the fdomain driver */
-    sprintf(str, "%d,%d", link->io.BasePort1, link->irq.AssignedIRQ);
+    sprintf(str, "%d,%d", link->io.BasePort1, link->irq);
     fdomain_setup(str);
 
     host = __fdomain_16x0_detect(&fdomain_driver_template);
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c
index 0212464..24c78ed 100644
--- a/drivers/scsi/pcmcia/nsp_cs.c
+++ b/drivers/scsi/pcmcia/nsp_cs.c
@@ -1563,13 +1563,6 @@ static int nsp_cs_probe(struct pcmcia_device *link)
 	link->io.Attributes1	 = IO_DATA_PATH_WIDTH_AUTO;
 	link->io.IOAddrLines	 = 10;	/* not used */
 
-	/* Interrupt setup */
-	link->irq.Attributes	 = IRQ_TYPE_EXCLUSIVE;
-
-	/* Interrupt handler */
-	link->irq.Handler	 = &nspintr;
-	link->irq.Attributes     |= IRQF_SHARED;
-
 	/* General socket configuration */
 	link->conf.Attributes	 = CONF_ENABLE_IRQ;
 	link->conf.IntType	 = INT_MEMORY_AND_IO;
@@ -1646,8 +1639,7 @@ static int nsp_cs_config_check(struct pcmcia_device *p_dev,
 		}
 
 		/* Do we need to allocate an interrupt? */
-		if (cfg->irq.IRQInfo1 || dflt->irq.IRQInfo1)
-			p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
+		p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
 
 		/* IO window settings */
 		p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
@@ -1720,10 +1712,8 @@ static int nsp_cs_config(struct pcmcia_device *link)
 	if (ret)
 		goto cs_failed;
 
-	if (link->conf.Attributes & CONF_ENABLE_IRQ) {
-		if (pcmcia_request_irq(link, &link->irq))
-			goto cs_failed;
-	}
+	if (pcmcia_request_irq(link, nspintr))
+		goto cs_failed;
 
 	ret = pcmcia_request_configuration(link, &link->conf);
 	if (ret)
@@ -1741,7 +1731,7 @@ static int nsp_cs_config(struct pcmcia_device *link)
 	/* Set port and IRQ */
 	data->BaseAddress = link->io.BasePort1;
 	data->NumAddress  = link->io.NumPorts1;
-	data->IrqNumber   = link->irq.AssignedIRQ;
+	data->IrqNumber   = link->irq;
 
 	nsp_dbg(NSP_DEBUG_INIT, "I/O[0x%x+0x%x] IRQ %d",
 		data->BaseAddress, data->NumAddress, data->IrqNumber);
@@ -1775,7 +1765,7 @@ static int nsp_cs_config(struct pcmcia_device *link)
 		printk(", Vpp %d.%d", link->conf.Vpp/10, link->conf.Vpp%10);
 	}
 	if (link->conf.Attributes & CONF_ENABLE_IRQ) {
-		printk(", irq %d", link->irq.AssignedIRQ);
+		printk(", irq %d", link->irq);
 	}
 	if (link->io.NumPorts1) {
 		printk(", io 0x%04x-0x%04x", link->io.BasePort1,
diff --git a/drivers/scsi/pcmcia/qlogic_stub.c b/drivers/scsi/pcmcia/qlogic_stub.c
index f85f094..c3a4428 100644
--- a/drivers/scsi/pcmcia/qlogic_stub.c
+++ b/drivers/scsi/pcmcia/qlogic_stub.c
@@ -161,7 +161,6 @@ static int qlogic_probe(struct pcmcia_device *link)
 	link->io.NumPorts1 = 16;
 	link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
 	link->io.IOAddrLines = 10;
-	link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
 	link->conf.Attributes = CONF_ENABLE_IRQ;
 	link->conf.IntType = INT_MEMORY_AND_IO;
 	link->conf.Present = PRESENT_OPTION;
@@ -209,8 +208,7 @@ static int qlogic_config(struct pcmcia_device * link)
 	if (ret)
 		goto failed;
 
-	ret = pcmcia_request_irq(link, &link->irq);
-	if (ret)
+	if (!link->irq)
 		goto failed;
 
 	ret = pcmcia_request_configuration(link, &link->conf);
@@ -227,10 +225,10 @@ static int qlogic_config(struct pcmcia_device * link)
 	/* The KXL-810AN has a bigger IO port window */
 	if (link->io.NumPorts1 == 32)
 		host = qlogic_detect(&qlogicfas_driver_template, link,
-			link->io.BasePort1 + 16, link->irq.AssignedIRQ);
+			link->io.BasePort1 + 16, link->irq);
 	else
 		host = qlogic_detect(&qlogicfas_driver_template, link,
-			link->io.BasePort1, link->irq.AssignedIRQ);
+			link->io.BasePort1, link->irq);
 	
 	if (!host) {
 		printk(KERN_INFO "%s: no SCSI devices found\n", qlogic_name);
@@ -258,7 +256,7 @@ static void qlogic_release(struct pcmcia_device *link)
 
 	scsi_remove_host(info->host);
 
-	free_irq(link->irq.AssignedIRQ, info->host);
+	free_irq(link->irq, info->host);
 	pcmcia_disable_device(link);
 
 	scsi_host_put(info->host);
diff --git a/drivers/scsi/pcmcia/sym53c500_cs.c b/drivers/scsi/pcmcia/sym53c500_cs.c
index e7564d8..6eacf4c 100644
--- a/drivers/scsi/pcmcia/sym53c500_cs.c
+++ b/drivers/scsi/pcmcia/sym53c500_cs.c
@@ -719,8 +719,7 @@ SYM53C500_config(struct pcmcia_device *link)
 	if (ret)
 		goto failed;
 
-	ret = pcmcia_request_irq(link, &link->irq);
-	if (ret)
+	if (!link->irq)
 		goto failed;
 
 	ret = pcmcia_request_configuration(link, &link->conf);
@@ -752,7 +751,7 @@ SYM53C500_config(struct pcmcia_device *link)
 	*	0x320, 0x330, 0x340, 0x350
 	*/
 	port_base = link->io.BasePort1;
-	irq_level = link->irq.AssignedIRQ;
+	irq_level = link->irq;
 
 	DEB(printk("SYM53C500: port_base=0x%x, irq=%d, fast_pio=%d\n",
 	    port_base, irq_level, USE_FAST_PIO);)
@@ -866,7 +865,6 @@ SYM53C500_probe(struct pcmcia_device *link)
 	link->io.NumPorts1 = 16;
 	link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
 	link->io.IOAddrLines = 10;
-	link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
 	link->conf.Attributes = CONF_ENABLE_IRQ;
 	link->conf.IntType = INT_MEMORY_AND_IO;
 
diff --git a/drivers/serial/serial_cs.c b/drivers/serial/serial_cs.c
index e91db4b..7519d27 100644
--- a/drivers/serial/serial_cs.c
+++ b/drivers/serial/serial_cs.c
@@ -334,7 +334,6 @@ static int serial_probe(struct pcmcia_device *link)
 
 	link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
 	link->io.NumPorts1 = 8;
-	link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
 	link->conf.Attributes = CONF_ENABLE_IRQ;
 	if (do_sound) {
 		link->conf.Attributes |= CONF_ENABLE_SPKR;
@@ -477,7 +476,7 @@ static int simple_config(struct pcmcia_device *link)
 		}
 		if (info->slave) {
 			return setup_serial(link, info, port,
-					    link->irq.AssignedIRQ);
+					    link->irq);
 		}
 	}
 
@@ -498,10 +497,6 @@ static int simple_config(struct pcmcia_device *link)
 	return -1;
 
 found_port:
-	i = pcmcia_request_irq(link, &link->irq);
-	if (i != 0)
-		link->irq.AssignedIRQ = 0;
-
 	if (info->multi && (info->manfid == MANFID_3COM))
 		link->conf.ConfigIndex &= ~(0x08);
 
@@ -514,7 +509,7 @@ found_port:
 	i = pcmcia_request_configuration(link, &link->conf);
 	if (i != 0)
 		return -1;
-	return setup_serial(link, info, link->io.BasePort1, link->irq.AssignedIRQ);
+	return setup_serial(link, info, link->io.BasePort1, link->irq);
 }
 
 static int multi_config_check(struct pcmcia_device *p_dev,
@@ -577,13 +572,9 @@ static int multi_config(struct pcmcia_device *link)
 		}
 	}
 
-	i = pcmcia_request_irq(link, &link->irq);
-	if (i != 0) {
-		/* FIXME: comment does not fit, error handling does not fit */
-		printk(KERN_NOTICE
-		       "serial_cs: no usable port range found, giving up\n");
-		link->irq.AssignedIRQ = 0;
-	}
+	if (!link->irq)
+		dev_warn(&link->dev,
+			"serial_cs: no usable IRQ found, continuing...\n");
 
 	/*
 	 * Apply any configuration quirks.
@@ -606,11 +597,11 @@ static int multi_config(struct pcmcia_device *link)
 		if (link->conf.ConfigIndex == 1 ||
 		    link->conf.ConfigIndex == 3) {
 			err = setup_serial(link, info, base2,
-					link->irq.AssignedIRQ);
+					link->irq);
 			base2 = link->io.BasePort1;
 		} else {
 			err = setup_serial(link, info, link->io.BasePort1,
-					link->irq.AssignedIRQ);
+					link->irq);
 		}
 		info->c950ctrl = base2;
 
@@ -624,10 +615,10 @@ static int multi_config(struct pcmcia_device *link)
 		return 0;
 	}
 
-	setup_serial(link, info, link->io.BasePort1, link->irq.AssignedIRQ);
+	setup_serial(link, info, link->io.BasePort1, link->irq);
 	for (i = 0; i < info->multi - 1; i++)
 		setup_serial(link, info, base2 + (8 * i),
-				link->irq.AssignedIRQ);
+				link->irq);
 	return 0;
 }
 
diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c
index 03dfd27..1f0bddb 100644
--- a/drivers/ssb/main.c
+++ b/drivers/ssb/main.c
@@ -489,7 +489,7 @@ static int ssb_devices_register(struct ssb_bus *bus)
 			break;
 		case SSB_BUSTYPE_PCMCIA:
 #ifdef CONFIG_SSB_PCMCIAHOST
-			sdev->irq = bus->host_pcmcia->irq.AssignedIRQ;
+			sdev->irq = bus->host_pcmcia->irq;
 			dev->parent = &bus->host_pcmcia->dev;
 #endif
 			break;
diff --git a/drivers/staging/comedi/drivers/cb_das16_cs.c b/drivers/staging/comedi/drivers/cb_das16_cs.c
index bc375e7..7711036 100644
--- a/drivers/staging/comedi/drivers/cb_das16_cs.c
+++ b/drivers/staging/comedi/drivers/cb_das16_cs.c
@@ -179,12 +179,12 @@ static int das16cs_attach(struct comedi_device *dev,
 	}
 	printk("\n");
 
-	ret = request_irq(link->irq.AssignedIRQ, das16cs_interrupt,
+	ret = request_irq(link->irq, das16cs_interrupt,
 			  IRQF_SHARED, "cb_das16_cs", dev);
 	if (ret < 0) {
 		return ret;
 	}
-	dev->irq = link->irq.AssignedIRQ;
+	dev->irq = link->irq;
 	printk("irq=%u ", dev->irq);
 
 	dev->board_ptr = das16cs_probe(dev, link);
@@ -701,10 +701,6 @@ static int das16cs_pcmcia_attach(struct pcmcia_device *link)
 	link->priv = local;
 
 	/* Initialize the pcmcia_device structure */
-	/* Interrupt setup */
-	link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
-	link->irq.Handler = NULL;
-
 	link->conf.Attributes = 0;
 	link->conf.IntType = INT_MEMORY_AND_IO;
 
@@ -739,8 +735,7 @@ static int das16cs_pcmcia_config_loop(struct pcmcia_device *p_dev,
 		return -EINVAL;
 
 	/* Do we need to allocate an interrupt? */
-	if (cfg->irq.IRQInfo1 || dflt->irq.IRQInfo1)
-		p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
+	p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
 
 	/* IO window settings */
 	p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
@@ -779,16 +774,9 @@ static void das16cs_pcmcia_config(struct pcmcia_device *link)
 		goto failed;
 	}
 
-	/*
-	   Allocate an interrupt line.  Note that this does not assign a
-	   handler to the interrupt, unless the 'Handler' member of the
-	   irq structure is initialized.
-	 */
-	if (link->conf.Attributes & CONF_ENABLE_IRQ) {
-		ret = pcmcia_request_irq(link, &link->irq);
-		if (ret)
-			goto failed;
-	}
+	if (!link->irq)
+		goto failed;
+
 	/*
 	   This actually configures the PCMCIA socket -- setting up
 	   the I/O windows and the interrupt mapping, and putting the
@@ -810,7 +798,7 @@ static void das16cs_pcmcia_config(struct pcmcia_device *link)
 	printk(KERN_INFO "%s: index 0x%02x",
 	       dev->node.dev_name, link->conf.ConfigIndex);
 	if (link->conf.Attributes & CONF_ENABLE_IRQ)
-		printk(", irq %u", link->irq.AssignedIRQ);
+		printk(", irq %u", link->irq);
 	if (link->io.NumPorts1)
 		printk(", io 0x%04x-0x%04x", link->io.BasePort1,
 		       link->io.BasePort1 + link->io.NumPorts1 - 1);
diff --git a/drivers/staging/comedi/drivers/das08_cs.c b/drivers/staging/comedi/drivers/das08_cs.c
index f12ef1c..906cc2a 100644
--- a/drivers/staging/comedi/drivers/das08_cs.c
+++ b/drivers/staging/comedi/drivers/das08_cs.c
@@ -171,10 +171,6 @@ static int das08_pcmcia_attach(struct pcmcia_device *link)
 	local->link = link;
 	link->priv = local;
 
-	/* Interrupt setup */
-	link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
-	link->irq.Handler = NULL;
-
 	/*
 	   General socket configuration defaults can go here.  In this
 	   client, we assume very little, and rely on the CIS for almost
@@ -228,8 +224,7 @@ static int das08_pcmcia_config_loop(struct pcmcia_device *p_dev,
 		return -ENODEV;
 
 	/* Do we need to allocate an interrupt? */
-	if (cfg->irq.IRQInfo1 || dflt->irq.IRQInfo1)
-		p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
+	p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
 
 	/* IO window settings */
 	p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
@@ -276,11 +271,8 @@ static void das08_pcmcia_config(struct pcmcia_device *link)
 		goto failed;
 	}
 
-	if (link->conf.Attributes & CONF_ENABLE_IRQ) {
-		ret = pcmcia_request_irq(link, &link->irq);
-		if (ret)
-			goto failed;
-	}
+	if (!link->irq)
+		goto failed;
 
 	/*
 	   This actually configures the PCMCIA socket -- setting up
@@ -303,7 +295,7 @@ static void das08_pcmcia_config(struct pcmcia_device *link)
 	printk(KERN_INFO "%s: index 0x%02x",
 	       dev->node.dev_name, link->conf.ConfigIndex);
 	if (link->conf.Attributes & CONF_ENABLE_IRQ)
-		printk(", irq %u", link->irq.AssignedIRQ);
+		printk(", irq %u", link->irq);
 	if (link->io.NumPorts1)
 		printk(", io 0x%04x-0x%04x", link->io.BasePort1,
 		       link->io.BasePort1 + link->io.NumPorts1 - 1);
diff --git a/drivers/staging/comedi/drivers/ni_daq_700.c b/drivers/staging/comedi/drivers/ni_daq_700.c
index c9b0395..04fa19a 100644
--- a/drivers/staging/comedi/drivers/ni_daq_700.c
+++ b/drivers/staging/comedi/drivers/ni_daq_700.c
@@ -379,7 +379,7 @@ static int dio700_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 			return -EIO;
 		iobase = link->io.BasePort1;
 #ifdef incomplete
-		irq = link->irq.AssignedIRQ;
+		irq = link->irq;
 #endif
 		break;
 	default:
@@ -501,10 +501,6 @@ static int dio700_cs_attach(struct pcmcia_device *link)
 	local->link = link;
 	link->priv = local;
 
-	/* Interrupt setup */
-	link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
-	link->irq.Handler = NULL;
-
 	/*
 	   General socket configuration defaults can go here.  In this
 	   client, we assume very little, and rely on the CIS for almost
@@ -576,8 +572,7 @@ static int dio700_pcmcia_config_loop(struct pcmcia_device *p_dev,
 	}
 
 	/* Do we need to allocate an interrupt? */
-	if (cfg->irq.IRQInfo1 || dflt->irq.IRQInfo1)
-		p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
+	p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
 
 	/* IO window settings */
 	p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
@@ -638,16 +633,8 @@ static void dio700_config(struct pcmcia_device *link)
 		goto failed;
 	}
 
-	/*
-	   Allocate an interrupt line.  Note that this does not assign a
-	   handler to the interrupt, unless the 'Handler' member of the
-	   irq structure is initialized.
-	 */
-	if (link->conf.Attributes & CONF_ENABLE_IRQ) {
-		ret = pcmcia_request_irq(link, &link->irq);
-		if (ret)
-			goto failed;
-	}
+	if (!link->irq)
+		goto failed;
 
 	/*
 	   This actually configures the PCMCIA socket -- setting up
@@ -670,7 +657,7 @@ static void dio700_config(struct pcmcia_device *link)
 	printk(KERN_INFO "%s: index 0x%02x",
 	       dev->node.dev_name, link->conf.ConfigIndex);
 	if (link->conf.Attributes & CONF_ENABLE_IRQ)
-		printk(", irq %d", link->irq.AssignedIRQ);
+		printk(", irq %d", link->irq);
 	if (link->io.NumPorts1)
 		printk(", io 0x%04x-0x%04x", link->io.BasePort1,
 		       link->io.BasePort1 + link->io.NumPorts1 - 1);
diff --git a/drivers/staging/comedi/drivers/ni_daq_dio24.c b/drivers/staging/comedi/drivers/ni_daq_dio24.c
index 9017be3..4b0c608 100644
--- a/drivers/staging/comedi/drivers/ni_daq_dio24.c
+++ b/drivers/staging/comedi/drivers/ni_daq_dio24.c
@@ -130,7 +130,7 @@ static int dio24_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 			return -EIO;
 		iobase = link->io.BasePort1;
 #ifdef incomplete
-		irq = link->irq.AssignedIRQ;
+		irq = link->irq;
 #endif
 		break;
 	default:
@@ -252,10 +252,6 @@ static int dio24_cs_attach(struct pcmcia_device *link)
 	local->link = link;
 	link->priv = local;
 
-	/* Interrupt setup */
-	link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
-	link->irq.Handler = NULL;
-
 	/*
 	   General socket configuration defaults can go here.  In this
 	   client, we assume very little, and rely on the CIS for almost
@@ -327,8 +323,7 @@ static int dio24_pcmcia_config_loop(struct pcmcia_device *p_dev,
 	}
 
 	/* Do we need to allocate an interrupt? */
-	if (cfg->irq.IRQInfo1 || dflt->irq.IRQInfo1)
-		p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
+	p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
 
 	/* IO window settings */
 	p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
@@ -389,16 +384,8 @@ static void dio24_config(struct pcmcia_device *link)
 		goto failed;
 	}
 
-	/*
-	   Allocate an interrupt line.  Note that this does not assign a
-	   handler to the interrupt, unless the 'Handler' member of the
-	   irq structure is initialized.
-	 */
-	if (link->conf.Attributes & CONF_ENABLE_IRQ) {
-		ret = pcmcia_request_irq(link, &link->irq);
-		if (ret)
-			goto failed;
-	}
+	if (!link->irq)
+		goto failed;
 
 	/*
 	   This actually configures the PCMCIA socket -- setting up
@@ -421,7 +408,7 @@ static void dio24_config(struct pcmcia_device *link)
 	printk(KERN_INFO "%s: index 0x%02x",
 	       dev->node.dev_name, link->conf.ConfigIndex);
 	if (link->conf.Attributes & CONF_ENABLE_IRQ)
-		printk(", irq %d", link->irq.AssignedIRQ);
+		printk(", irq %d", link->irq);
 	if (link->io.NumPorts1)
 		printk(", io 0x%04x-0x%04x", link->io.BasePort1,
 		       link->io.BasePort1 + link->io.NumPorts1 - 1);
diff --git a/drivers/staging/comedi/drivers/ni_labpc_cs.c b/drivers/staging/comedi/drivers/ni_labpc_cs.c
index 5a0e5b9..53caa78 100644
--- a/drivers/staging/comedi/drivers/ni_labpc_cs.c
+++ b/drivers/staging/comedi/drivers/ni_labpc_cs.c
@@ -143,7 +143,7 @@ static int labpc_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 		if (!link)
 			return -EIO;
 		iobase = link->io.BasePort1;
-		irq = link->irq.AssignedIRQ;
+		irq = link->irq;
 		break;
 	default:
 		printk("bug! couldn't determine board type\n");
@@ -228,10 +228,6 @@ static int labpc_cs_attach(struct pcmcia_device *link)
 	local->link = link;
 	link->priv = local;
 
-	/* Interrupt setup */
-	link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
-	link->irq.Handler = NULL;
-
 	/*
 	   General socket configuration defaults can go here.  In this
 	   client, we assume very little, and rely on the CIS for almost
@@ -305,9 +301,7 @@ static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev,
 	}
 
 	/* Do we need to allocate an interrupt? */
-	if (cfg->irq.IRQInfo1 || dflt->irq.IRQInfo1)
-		p_dev->conf.Attributes |=
-			(CONF_ENABLE_IRQ | CONF_ENABLE_PULSE_IRQ);
+	p_dev->conf.Attributes |= CONF_ENABLE_IRQ | CONF_ENABLE_PULSE_IRQ;
 
 	/* IO window settings */
 	p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
@@ -367,16 +361,8 @@ static void labpc_config(struct pcmcia_device *link)
 		goto failed;
 	}
 
-	/*
-	   Allocate an interrupt line.  Note that this does not assign a
-	   handler to the interrupt, unless the 'Handler' member of the
-	   irq structure is initialized.
-	 */
-	if (link->conf.Attributes & CONF_ENABLE_IRQ) {
-		ret = pcmcia_request_irq(link, &link->irq);
-		if (ret)
-			goto failed;
-	}
+	if (!link->irq)
+		goto failed;
 
 	/*
 	   This actually configures the PCMCIA socket -- setting up
@@ -399,7 +385,7 @@ static void labpc_config(struct pcmcia_device *link)
 	printk(KERN_INFO "%s: index 0x%02x",
 	       dev->node.dev_name, link->conf.ConfigIndex);
 	if (link->conf.Attributes & CONF_ENABLE_IRQ)
-		printk(", irq %d", link->irq.AssignedIRQ);
+		printk(", irq %d", link->irq);
 	if (link->io.NumPorts1)
 		printk(", io 0x%04x-0x%04x", link->io.BasePort1,
 		       link->io.BasePort1 + link->io.NumPorts1 - 1);
diff --git a/drivers/staging/comedi/drivers/ni_mio_cs.c b/drivers/staging/comedi/drivers/ni_mio_cs.c
index dc4849a..a6007ab 100644
--- a/drivers/staging/comedi/drivers/ni_mio_cs.c
+++ b/drivers/staging/comedi/drivers/ni_mio_cs.c
@@ -272,7 +272,6 @@ static int cs_attach(struct pcmcia_device *link)
 {
 	link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
 	link->io.NumPorts1 = 16;
-	link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
 	link->conf.Attributes = CONF_ENABLE_IRQ;
 	link->conf.IntType = INT_MEMORY_AND_IO;
 
@@ -344,10 +343,8 @@ static void mio_cs_config(struct pcmcia_device *link)
 		return;
 	}
 
-	ret = pcmcia_request_irq(link, &link->irq);
-	if (ret) {
-		printk("pcmcia_request_irq() returned error: %i\n", ret);
-	}
+	if (!link->irq)
+		dev_info(&link->dev, "no IRQ available\n");
 
 	ret = pcmcia_request_configuration(link, &link->conf);
 
@@ -369,7 +366,7 @@ static int mio_cs_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	dev->driver = &driver_ni_mio_cs;
 	dev->iobase = link->io.BasePort1;
 
-	irq = link->irq.AssignedIRQ;
+	irq = link->irq;
 
 	printk("comedi%d: %s: DAQCard: io 0x%04lx, irq %u, ",
 	       dev->minor, dev->driver->driver_name, dev->iobase, irq);
diff --git a/drivers/staging/comedi/drivers/quatech_daqp_cs.c b/drivers/staging/comedi/drivers/quatech_daqp_cs.c
index 3325f24..7aa17f9 100644
--- a/drivers/staging/comedi/drivers/quatech_daqp_cs.c
+++ b/drivers/staging/comedi/drivers/quatech_daqp_cs.c
@@ -1040,10 +1040,6 @@ static int daqp_cs_attach(struct pcmcia_device *link)
 	local->link = link;
 	link->priv = local;
 
-	/* Interrupt setup */
-	link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
-	link->irq.Handler = daqp_interrupt;
-
 	/*
 	   General socket configuration defaults can go here.  In this
 	   client, we assume very little, and rely on the CIS for almost
@@ -1105,8 +1101,7 @@ static int daqp_pcmcia_config_loop(struct pcmcia_device *p_dev,
 		return -ENODEV;
 
 	/* Do we need to allocate an interrupt? */
-	if (cfg->irq.IRQInfo1 || dflt->irq.IRQInfo1)
-		p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
+	p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
 
 	/* IO window settings */
 	p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
@@ -1144,16 +1139,9 @@ static void daqp_cs_config(struct pcmcia_device *link)
 		goto failed;
 	}
 
-	/*
-	   Allocate an interrupt line.  Note that this does not assign a
-	   handler to the interrupt, unless the 'Handler' member of the
-	   irq structure is initialized.
-	 */
-	if (link->conf.Attributes & CONF_ENABLE_IRQ) {
-		ret = pcmcia_request_irq(link, &link->irq);
-		if (ret)
-			goto failed;
-	}
+	ret = pcmcia_request_irq(link, daqp_interrupt);
+	if (ret)
+		goto failed;
 
 	/*
 	   This actually configures the PCMCIA socket -- setting up
@@ -1180,7 +1168,7 @@ static void daqp_cs_config(struct pcmcia_device *link)
 	printk(KERN_INFO "%s: index 0x%02x",
 	       dev->node.dev_name, link->conf.ConfigIndex);
 	if (link->conf.Attributes & CONF_ENABLE_IRQ)
-		printk(", irq %u", link->irq.AssignedIRQ);
+		printk(", irq %u", link->irq);
 	if (link->io.NumPorts1)
 		printk(", io 0x%04x-0x%04x", link->io.BasePort1,
 		       link->io.BasePort1 + link->io.NumPorts1 - 1);
diff --git a/drivers/staging/netwave/netwave_cs.c b/drivers/staging/netwave/netwave_cs.c
index 26477fd..1206b9c 100644
--- a/drivers/staging/netwave/netwave_cs.c
+++ b/drivers/staging/netwave/netwave_cs.c
@@ -382,10 +382,6 @@ static int netwave_probe(struct pcmcia_device *link)
        link->io.Attributes2 = IO_DATA_PATH_WIDTH_16; */
     link->io.IOAddrLines = 5;
     
-    /* Interrupt setup */
-    link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
-    link->irq.Handler = &netwave_interrupt;
-    
     /* General socket configuration */
     link->conf.Attributes = CONF_ENABLE_IRQ;
     link->conf.IntType = INT_MEMORY_AND_IO;
@@ -732,7 +728,7 @@ static int netwave_pcmcia_config(struct pcmcia_device *link) {
      *  Now allocate an interrupt line.  Note that this does not
      *  actually assign a handler to the interrupt.
      */
-    ret = pcmcia_request_irq(link, &link->irq);
+    ret = pcmcia_request_irq(link, netwave_interrupt);
     if (ret)
 	    goto failed;
 
@@ -767,7 +763,7 @@ static int netwave_pcmcia_config(struct pcmcia_device *link) {
     ramBase = ioremap(req.Base, 0x8000);
     priv->ramBase = ramBase;
 
-    dev->irq = link->irq.AssignedIRQ;
+    dev->irq = link->irq;
     dev->base_addr = link->io.BasePort1;
     SET_NETDEV_DEV(dev, &link->dev);
 
diff --git a/drivers/staging/wavelan/wavelan_cs.c b/drivers/staging/wavelan/wavelan_cs.c
index 04f691d..37fa855 100644
--- a/drivers/staging/wavelan/wavelan_cs.c
+++ b/drivers/staging/wavelan/wavelan_cs.c
@@ -3850,12 +3850,8 @@ wv_pcmcia_config(struct pcmcia_device *	link)
       if (i != 0)
 	  break;
 
-      /*
-       * Now allocate an interrupt line.  Note that this does not
-       * actually assign a handler to the interrupt.
-       */
-      i = pcmcia_request_irq(link, &link->irq);
-      if (i != 0)
+      i = pcmcia_request_interrupt(link, wavelan_interrupt);
+      if (!i)
 	  break;
 
       /*
@@ -3890,7 +3886,7 @@ wv_pcmcia_config(struct pcmcia_device *	link)
 	  break;
 
       /* Feed device with this info... */
-      dev->irq = link->irq.AssignedIRQ;
+      dev->irq = link->irq;
       dev->base_addr = link->io.BasePort1;
       netif_start_queue(dev);
 
@@ -4437,10 +4433,6 @@ wavelan_probe(struct pcmcia_device *p_dev)
   p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
   p_dev->io.IOAddrLines = 3;
 
-  /* Interrupt setup */
-  p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
-  p_dev->irq.Handler = wavelan_interrupt;
-
   /* General socket configuration */
   p_dev->conf.Attributes = CONF_ENABLE_IRQ;
   p_dev->conf.IntType = INT_MEMORY_AND_IO;
@@ -4487,7 +4479,6 @@ wavelan_probe(struct pcmcia_device *p_dev)
 
   ret = wv_hw_config(dev);
   if (ret) {
-	  dev->irq = 0;
 	  pcmcia_disable_device(p_dev);
 	  return ret;
   }
diff --git a/drivers/staging/wlags49_h2/wl_cs.c b/drivers/staging/wlags49_h2/wl_cs.c
index 811a8da..b2eb158 100644
--- a/drivers/staging/wlags49_h2/wl_cs.c
+++ b/drivers/staging/wlags49_h2/wl_cs.c
@@ -157,15 +157,12 @@ static int wl_adapter_attach(struct pcmcia_device *link)
     link->io.NumPorts1      = HCF_NUM_IO_PORTS;
     link->io.Attributes1    = IO_DATA_PATH_WIDTH_16;
     link->io.IOAddrLines    = 6;
-    link->irq.Attributes    = IRQ_TYPE_DYNAMIC_SHARING | IRQ_HANDLE_PRESENT;
-    link->irq.IRQInfo1      = IRQ_INFO2_VALID | IRQ_LEVEL_ID;
-    link->irq.Handler       = &wl_isr;
     link->conf.Attributes   = CONF_ENABLE_IRQ;
     link->conf.IntType      = INT_MEMORY_AND_IO;
     link->conf.ConfigIndex  = 5;
     link->conf.Present      = PRESENT_OPTION;
 
-    link->priv = link->irq.Instance = dev;
+    link->priv = dev;
     lp = wl_priv(dev);
     lp->link = link;
 
@@ -319,11 +316,11 @@ void wl_adapter_insert( struct pcmcia_device *link )
     link->conf.Attributes |= CONF_ENABLE_IRQ;
 
     CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io));
-    CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
+    CS_CHECK(RequestIRQ, pcmcia_request_irq(link, wl_isr));
     CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
 
 
-    dev->irq        = link->irq.AssignedIRQ;
+    dev->irq        = link->irq;
     dev->base_addr  = link->io.BasePort1;
 
     SET_NETDEV_DEV(dev, &handle_to_dev(link));
diff --git a/drivers/usb/host/sl811_cs.c b/drivers/usb/host/sl811_cs.c
index 39d253e..a712788 100644
--- a/drivers/usb/host/sl811_cs.c
+++ b/drivers/usb/host/sl811_cs.c
@@ -163,8 +163,7 @@ static int sl811_cs_config_check(struct pcmcia_device *p_dev,
 			dflt->vpp1.param[CISTPL_POWER_VNOM]/10000;
 
 	/* we need an interrupt */
-	if (cfg->irq.IRQInfo1 || dflt->irq.IRQInfo1)
-		p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
+	p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
 
 	/* IO window settings */
 	p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
@@ -197,11 +196,8 @@ static int sl811_cs_config(struct pcmcia_device *link)
 	/* require an IRQ and two registers */
 	if (!link->io.NumPorts1 || link->io.NumPorts1 < 2)
 		goto failed;
-	if (link->conf.Attributes & CONF_ENABLE_IRQ) {
-		ret = pcmcia_request_irq(link, &link->irq);
-		if (ret)
-			goto failed;
-	} else
+
+	if (!link->irq)
 		goto failed;
 
 	ret = pcmcia_request_configuration(link, &link->conf);
@@ -216,12 +212,12 @@ static int sl811_cs_config(struct pcmcia_device *link)
 	       dev->node.dev_name, link->conf.ConfigIndex);
 	if (link->conf.Vpp)
 		printk(", Vpp %d.%d", link->conf.Vpp/10, link->conf.Vpp%10);
-	printk(", irq %d", link->irq.AssignedIRQ);
+	printk(", irq %d", link->irq);
 	printk(", io 0x%04x-0x%04x", link->io.BasePort1,
 	       link->io.BasePort1+link->io.NumPorts1-1);
 	printk("\n");
 
-	if (sl811_hc_init(parent, link->io.BasePort1, link->irq.AssignedIRQ)
+	if (sl811_hc_init(parent, link->io.BasePort1, link->irq)
 			< 0) {
 failed:
 		printk(KERN_WARNING "sl811_cs_config failed\n");
@@ -241,10 +237,6 @@ static int sl811_cs_probe(struct pcmcia_device *link)
 	local->p_dev = link;
 	link->priv = local;
 
-	/* Initialize */
-	link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
-	link->irq.Handler = NULL;
-
 	link->conf.Attributes = 0;
 	link->conf.IntType = INT_MEMORY_AND_IO;
 
diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h
index af61571..a04e6ca 100644
--- a/include/pcmcia/cs.h
+++ b/include/pcmcia/cs.h
@@ -114,13 +114,6 @@ typedef struct io_req_t {
 #define IO_DATA_PATH_WIDTH_16	0x08
 #define IO_DATA_PATH_WIDTH_AUTO	0x10
 
-/* For RequestIRQ and ReleaseIRQ */
-typedef struct irq_req_t {
-	u_int		Attributes;
-	u_int		AssignedIRQ;
-	irq_handler_t	Handler;
-} irq_req_t;
-
 /* Attributes for RequestIRQ and ReleaseIRQ */
 #define IRQ_TYPE			0x03
 #define IRQ_TYPE_EXCLUSIVE		0x00
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
index f70c5c1..81b6d86 100644
--- a/include/pcmcia/ds.h
+++ b/include/pcmcia/ds.h
@@ -90,12 +90,11 @@ struct pcmcia_device {
 	dev_node_t		*dev_node;
 	u_int			open;
 	io_req_t		io;
-	irq_req_t		irq;
 	config_req_t		conf;
 	window_handle_t		win;
 
 	/* device setup */
-	unsigned int		irq_v; /* do not use directly yet */
+	unsigned int		irq;
 
 	/* Is the device suspended, or in the process of
 	 * being removed? */
@@ -195,7 +194,13 @@ int pcmcia_access_configuration_register(struct pcmcia_device *p_dev,
 
 /* device configuration */
 int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req);
-int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req);
+
+int __must_check __deprecated
+pcmcia_request_exclusive_irq(struct pcmcia_device *p_dev,
+				irq_handler_t handler);
+int __must_check pcmcia_request_irq(struct pcmcia_device *p_dev,
+				irq_handler_t handler);
+
 int pcmcia_request_configuration(struct pcmcia_device *p_dev,
 				 config_req_t *req);
 
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf.c b/sound/pcmcia/pdaudiocf/pdaudiocf.c
index dcf8539..60fddf3 100644
--- a/sound/pcmcia/pdaudiocf/pdaudiocf.c
+++ b/sound/pcmcia/pdaudiocf/pdaudiocf.c
@@ -142,11 +142,6 @@ static int snd_pdacf_probe(struct pcmcia_device *link)
 	link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
 	link->io.NumPorts1 = 16;
 
-	link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
-	/* FIXME: This driver should be updated to allow for dynamic IRQ sharing */
-	/* link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; */
-
-	link->irq.Handler = pdacf_interrupt;
 	link->conf.Attributes = CONF_ENABLE_IRQ | CONF_ENABLE_PULSE_IRQ;
 	link->conf.IntType = INT_MEMORY_AND_IO;
 	link->conf.ConfigIndex = 1;
@@ -228,7 +223,7 @@ static int pdacf_config(struct pcmcia_device *link)
 	if (ret)
 		goto failed;
 
-	ret = pcmcia_request_irq(link, &link->irq);
+	ret = pcmcia_request_exclusive_irq(link, pdacf_interrupt);
 	if (ret)
 		goto failed;
 
@@ -236,7 +231,7 @@ static int pdacf_config(struct pcmcia_device *link)
 	if (ret)
 		goto failed;
 
-	if (snd_pdacf_assign_resources(pdacf, link->io.BasePort1, link->irq.AssignedIRQ) < 0)
+	if (snd_pdacf_assign_resources(pdacf, link->io.BasePort1, link->irq) < 0)
 		goto failed;
 
 	link->dev_node = &pdacf->node;
diff --git a/sound/pcmcia/vx/vxpocket.c b/sound/pcmcia/vx/vxpocket.c
index 7be3b33..4198395 100644
--- a/sound/pcmcia/vx/vxpocket.c
+++ b/sound/pcmcia/vx/vxpocket.c
@@ -161,10 +161,6 @@ static int snd_vxpocket_new(struct snd_card *card, int ibl,
 	link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
 	link->io.NumPorts1 = 16;
 
-	link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
-
-	link->irq.Handler = &snd_vx_irq_handler;
-
 	link->conf.Attributes = CONF_ENABLE_IRQ;
 	link->conf.IntType = INT_MEMORY_AND_IO;
 	link->conf.ConfigIndex = 1;
@@ -234,7 +230,7 @@ static int vxpocket_config(struct pcmcia_device *link)
 	if (ret)
 		goto failed;
 
-	ret = pcmcia_request_irq(link, &link->irq);
+	ret = pcmcia_request_exclusive_irq(link, snd_vx_irq_handler);
 	if (ret)
 		goto failed;
 
@@ -245,7 +241,7 @@ static int vxpocket_config(struct pcmcia_device *link)
 	chip->dev = &link->dev;
 	snd_card_set_dev(chip->card, chip->dev);
 
-	if (snd_vxpocket_assign_resources(chip, link->io.BasePort1, link->irq.AssignedIRQ) < 0)
+	if (snd_vxpocket_assign_resources(chip, link->io.BasePort1, link->irq) < 0)
 		goto failed;
 
 	link->dev_node = &vxp->node;
-- 
1.6.3.3



From linux at dominikbrodowski.net  Sun Mar 21 19:07:34 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 22 Mar 2010 00:07:34 +0100
Subject: [RFC PATCH 16/19] pcmcia: move high level CIS access code to separate
	file
In-Reply-To: <20100321230617.GA24791@comet.dominikbrodowski.net>
References: <20100321230617.GA24791@comet.dominikbrodowski.net>
Message-ID: <1269212857-25364-16-git-send-email-linux@dominikbrodowski.net>

No code changes.

Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 drivers/pcmcia/Makefile          |    2 +-
 drivers/pcmcia/cistpl.c          |  100 -----------
 drivers/pcmcia/pcmcia_cis.c      |  355 ++++++++++++++++++++++++++++++++++++++
 drivers/pcmcia/pcmcia_resource.c |  230 ------------------------
 4 files changed, 356 insertions(+), 331 deletions(-)
 create mode 100644 drivers/pcmcia/pcmcia_cis.c

diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile
index 381b031..8122b03 100644
--- a/drivers/pcmcia/Makefile
+++ b/drivers/pcmcia/Makefile
@@ -6,7 +6,7 @@ pcmcia_core-y					+= cs.o rsrc_mgr.o socket_sysfs.o
 pcmcia_core-$(CONFIG_CARDBUS)			+= cardbus.o
 obj-$(CONFIG_PCCARD)				+= pcmcia_core.o
 
-pcmcia-y					+= ds.o pcmcia_resource.o cistpl.o
+pcmcia-y					+= ds.o pcmcia_resource.o cistpl.o pcmcia_cis.o
 pcmcia-$(CONFIG_PCMCIA_IOCTL)			+= pcmcia_ioctl.o
 obj-$(CONFIG_PCMCIA)				+= pcmcia.o
 
diff --git a/drivers/pcmcia/cistpl.c b/drivers/pcmcia/cistpl.c
index f230f65..71435b1 100644
--- a/drivers/pcmcia/cistpl.c
+++ b/drivers/pcmcia/cistpl.c
@@ -1362,106 +1362,6 @@ EXPORT_SYMBOL(pcmcia_parse_tuple);
 
 
 /**
- * pccard_read_tuple() - internal CIS tuple access
- * @s:		the struct pcmcia_socket where the card is inserted
- * @function:	the device function we loop for
- * @code:	which CIS code shall we look for?
- * @parse:	buffer where the tuple shall be parsed (or NULL, if no parse)
- *
- * pccard_read_tuple() reads out one tuple and attempts to parse it
- */
-int pccard_read_tuple(struct pcmcia_socket *s, unsigned int function,
-		cisdata_t code, void *parse)
-{
-	tuple_t tuple;
-	cisdata_t *buf;
-	int ret;
-
-	buf = kmalloc(256, GFP_KERNEL);
-	if (buf == NULL) {
-		dev_printk(KERN_WARNING, &s->dev, "no memory to read tuple\n");
-		return -ENOMEM;
-	}
-	tuple.DesiredTuple = code;
-	tuple.Attributes = 0;
-	if (function == BIND_FN_ALL)
-		tuple.Attributes = TUPLE_RETURN_COMMON;
-	ret = pccard_get_first_tuple(s, function, &tuple);
-	if (ret != 0)
-		goto done;
-	tuple.TupleData = buf;
-	tuple.TupleOffset = 0;
-	tuple.TupleDataMax = 255;
-	ret = pccard_get_tuple_data(s, &tuple);
-	if (ret != 0)
-		goto done;
-	ret = pcmcia_parse_tuple(&tuple, parse);
-done:
-	kfree(buf);
-	return ret;
-}
-
-
-/**
- * pccard_loop_tuple() - loop over tuples in the CIS
- * @s:		the struct pcmcia_socket where the card is inserted
- * @function:	the device function we loop for
- * @code:	which CIS code shall we look for?
- * @parse:	buffer where the tuple shall be parsed (or NULL, if no parse)
- * @priv_data:	private data to be passed to the loop_tuple function.
- * @loop_tuple:	function to call for each CIS entry of type @function. IT
- *		gets passed the raw tuple, the paresed tuple (if @parse is
- *		set) and @priv_data.
- *
- * pccard_loop_tuple() loops over all CIS entries of type @function, and
- * calls the @loop_tuple function for each entry. If the call to @loop_tuple
- * returns 0, the loop exits. Returns 0 on success or errorcode otherwise.
- */
-int pccard_loop_tuple(struct pcmcia_socket *s, unsigned int function,
-		      cisdata_t code, cisparse_t *parse, void *priv_data,
-		      int (*loop_tuple) (tuple_t *tuple,
-					 cisparse_t *parse,
-					 void *priv_data))
-{
-	tuple_t tuple;
-	cisdata_t *buf;
-	int ret;
-
-	buf = kzalloc(256, GFP_KERNEL);
-	if (buf == NULL) {
-		dev_printk(KERN_WARNING, &s->dev, "no memory to read tuple\n");
-		return -ENOMEM;
-	}
-
-	tuple.TupleData = buf;
-	tuple.TupleDataMax = 255;
-	tuple.TupleOffset = 0;
-	tuple.DesiredTuple = code;
-	tuple.Attributes = 0;
-
-	ret = pccard_get_first_tuple(s, function, &tuple);
-	while (!ret) {
-		if (pccard_get_tuple_data(s, &tuple))
-			goto next_entry;
-
-		if (parse)
-			if (pcmcia_parse_tuple(&tuple, parse))
-				goto next_entry;
-
-		ret = loop_tuple(&tuple, parse, priv_data);
-		if (!ret)
-			break;
-
-next_entry:
-		ret = pccard_get_next_tuple(s, function, &tuple);
-	}
-
-	kfree(buf);
-	return ret;
-}
-
-
-/**
  * pccard_validate_cis() - check whether card has a sensible CIS
  * @s:		the struct pcmcia_socket we are to check
  * @info:	returns the number of tuples in the (valid) CIS, or 0
diff --git a/drivers/pcmcia/pcmcia_cis.c b/drivers/pcmcia/pcmcia_cis.c
new file mode 100644
index 0000000..7406387
--- /dev/null
+++ b/drivers/pcmcia/pcmcia_cis.c
@@ -0,0 +1,355 @@
+/*
+ * PCMCIA high-level CIS access functions
+ *
+ * The initial developer of the original code is David A. Hinds
+ * <dahinds at users.sourceforge.net>.  Portions created by David A. Hinds
+ * are Copyright (C) 1999 David A. Hinds.  All Rights Reserved.
+ *
+ * Copyright (C) 1999	     David A. Hinds
+ * Copyright (C) 2004-2009   Dominik Brodowski
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/netdevice.h>
+
+#include <pcmcia/cs_types.h>
+#include <pcmcia/cisreg.h>
+#include <pcmcia/cistpl.h>
+#include <pcmcia/ss.h>
+#include <pcmcia/cs.h>
+#include <pcmcia/ds.h>
+#include "cs_internal.h"
+
+
+/**
+ * pccard_read_tuple() - internal CIS tuple access
+ * @s:		the struct pcmcia_socket where the card is inserted
+ * @function:	the device function we loop for
+ * @code:	which CIS code shall we look for?
+ * @parse:	buffer where the tuple shall be parsed (or NULL, if no parse)
+ *
+ * pccard_read_tuple() reads out one tuple and attempts to parse it
+ */
+int pccard_read_tuple(struct pcmcia_socket *s, unsigned int function,
+		cisdata_t code, void *parse)
+{
+	tuple_t tuple;
+	cisdata_t *buf;
+	int ret;
+
+	buf = kmalloc(256, GFP_KERNEL);
+	if (buf == NULL) {
+		dev_printk(KERN_WARNING, &s->dev, "no memory to read tuple\n");
+		return -ENOMEM;
+	}
+	tuple.DesiredTuple = code;
+	tuple.Attributes = 0;
+	if (function == BIND_FN_ALL)
+		tuple.Attributes = TUPLE_RETURN_COMMON;
+	ret = pccard_get_first_tuple(s, function, &tuple);
+	if (ret != 0)
+		goto done;
+	tuple.TupleData = buf;
+	tuple.TupleOffset = 0;
+	tuple.TupleDataMax = 255;
+	ret = pccard_get_tuple_data(s, &tuple);
+	if (ret != 0)
+		goto done;
+	ret = pcmcia_parse_tuple(&tuple, parse);
+done:
+	kfree(buf);
+	return ret;
+}
+
+
+/**
+ * pccard_loop_tuple() - loop over tuples in the CIS
+ * @s:		the struct pcmcia_socket where the card is inserted
+ * @function:	the device function we loop for
+ * @code:	which CIS code shall we look for?
+ * @parse:	buffer where the tuple shall be parsed (or NULL, if no parse)
+ * @priv_data:	private data to be passed to the loop_tuple function.
+ * @loop_tuple:	function to call for each CIS entry of type @function. IT
+ *		gets passed the raw tuple, the paresed tuple (if @parse is
+ *		set) and @priv_data.
+ *
+ * pccard_loop_tuple() loops over all CIS entries of type @function, and
+ * calls the @loop_tuple function for each entry. If the call to @loop_tuple
+ * returns 0, the loop exits. Returns 0 on success or errorcode otherwise.
+ */
+int pccard_loop_tuple(struct pcmcia_socket *s, unsigned int function,
+		      cisdata_t code, cisparse_t *parse, void *priv_data,
+		      int (*loop_tuple) (tuple_t *tuple,
+					 cisparse_t *parse,
+					 void *priv_data))
+{
+	tuple_t tuple;
+	cisdata_t *buf;
+	int ret;
+
+	buf = kzalloc(256, GFP_KERNEL);
+	if (buf == NULL) {
+		dev_printk(KERN_WARNING, &s->dev, "no memory to read tuple\n");
+		return -ENOMEM;
+	}
+
+	tuple.TupleData = buf;
+	tuple.TupleDataMax = 255;
+	tuple.TupleOffset = 0;
+	tuple.DesiredTuple = code;
+	tuple.Attributes = 0;
+
+	ret = pccard_get_first_tuple(s, function, &tuple);
+	while (!ret) {
+		if (pccard_get_tuple_data(s, &tuple))
+			goto next_entry;
+
+		if (parse)
+			if (pcmcia_parse_tuple(&tuple, parse))
+				goto next_entry;
+
+		ret = loop_tuple(&tuple, parse, priv_data);
+		if (!ret)
+			break;
+
+next_entry:
+		ret = pccard_get_next_tuple(s, function, &tuple);
+	}
+
+	kfree(buf);
+	return ret;
+}
+
+struct pcmcia_cfg_mem {
+	struct pcmcia_device *p_dev;
+	void *priv_data;
+	int (*conf_check) (struct pcmcia_device *p_dev,
+			   cistpl_cftable_entry_t *cfg,
+			   cistpl_cftable_entry_t *dflt,
+			   unsigned int vcc,
+			   void *priv_data);
+	cisparse_t parse;
+	cistpl_cftable_entry_t dflt;
+};
+
+/**
+ * pcmcia_do_loop_config() - internal helper for pcmcia_loop_config()
+ *
+ * pcmcia_do_loop_config() is the internal callback for the call from
+ * pcmcia_loop_config() to pccard_loop_tuple(). Data is transferred
+ * by a struct pcmcia_cfg_mem.
+ */
+static int pcmcia_do_loop_config(tuple_t *tuple, cisparse_t *parse, void *priv)
+{
+	cistpl_cftable_entry_t *cfg = &parse->cftable_entry;
+	struct pcmcia_cfg_mem *cfg_mem = priv;
+
+	/* default values */
+	cfg_mem->p_dev->conf.ConfigIndex = cfg->index;
+	if (cfg->flags & CISTPL_CFTABLE_DEFAULT)
+		cfg_mem->dflt = *cfg;
+
+	return cfg_mem->conf_check(cfg_mem->p_dev, cfg, &cfg_mem->dflt,
+				   cfg_mem->p_dev->socket->socket.Vcc,
+				   cfg_mem->priv_data);
+}
+
+/**
+ * pcmcia_loop_config() - loop over configuration options
+ * @p_dev:	the struct pcmcia_device which we need to loop for.
+ * @conf_check:	function to call for each configuration option.
+ *		It gets passed the struct pcmcia_device, the CIS data
+ *		describing the configuration option, and private data
+ *		being passed to pcmcia_loop_config()
+ * @priv_data:	private data to be passed to the conf_check function.
+ *
+ * pcmcia_loop_config() loops over all configuration options, and calls
+ * the driver-specific conf_check() for each one, checking whether
+ * it is a valid one. Returns 0 on success or errorcode otherwise.
+ */
+int pcmcia_loop_config(struct pcmcia_device *p_dev,
+		       int	(*conf_check)	(struct pcmcia_device *p_dev,
+						 cistpl_cftable_entry_t *cfg,
+						 cistpl_cftable_entry_t *dflt,
+						 unsigned int vcc,
+						 void *priv_data),
+		       void *priv_data)
+{
+	struct pcmcia_cfg_mem *cfg_mem;
+	int ret;
+
+	cfg_mem = kzalloc(sizeof(struct pcmcia_cfg_mem), GFP_KERNEL);
+	if (cfg_mem == NULL)
+		return -ENOMEM;
+
+	cfg_mem->p_dev = p_dev;
+	cfg_mem->conf_check = conf_check;
+	cfg_mem->priv_data = priv_data;
+
+	ret = pccard_loop_tuple(p_dev->socket, p_dev->func,
+				CISTPL_CFTABLE_ENTRY, &cfg_mem->parse,
+				cfg_mem, pcmcia_do_loop_config);
+
+	kfree(cfg_mem);
+	return ret;
+}
+EXPORT_SYMBOL(pcmcia_loop_config);
+
+
+struct pcmcia_loop_mem {
+	struct pcmcia_device *p_dev;
+	void *priv_data;
+	int (*loop_tuple) (struct pcmcia_device *p_dev,
+			   tuple_t *tuple,
+			   void *priv_data);
+};
+
+/**
+ * pcmcia_do_loop_tuple() - internal helper for pcmcia_loop_config()
+ *
+ * pcmcia_do_loop_tuple() is the internal callback for the call from
+ * pcmcia_loop_tuple() to pccard_loop_tuple(). Data is transferred
+ * by a struct pcmcia_cfg_mem.
+ */
+static int pcmcia_do_loop_tuple(tuple_t *tuple, cisparse_t *parse, void *priv)
+{
+	struct pcmcia_loop_mem *loop = priv;
+
+	return loop->loop_tuple(loop->p_dev, tuple, loop->priv_data);
+};
+
+/**
+ * pcmcia_loop_tuple() - loop over tuples in the CIS
+ * @p_dev:	the struct pcmcia_device which we need to loop for.
+ * @code:	which CIS code shall we look for?
+ * @priv_data:	private data to be passed to the loop_tuple function.
+ * @loop_tuple:	function to call for each CIS entry of type @function. IT
+ *		gets passed the raw tuple and @priv_data.
+ *
+ * pcmcia_loop_tuple() loops over all CIS entries of type @function, and
+ * calls the @loop_tuple function for each entry. If the call to @loop_tuple
+ * returns 0, the loop exits. Returns 0 on success or errorcode otherwise.
+ */
+int pcmcia_loop_tuple(struct pcmcia_device *p_dev, cisdata_t code,
+		      int (*loop_tuple) (struct pcmcia_device *p_dev,
+					 tuple_t *tuple,
+					 void *priv_data),
+		      void *priv_data)
+{
+	struct pcmcia_loop_mem loop = {
+		.p_dev = p_dev,
+		.loop_tuple = loop_tuple,
+		.priv_data = priv_data};
+
+	return pccard_loop_tuple(p_dev->socket, p_dev->func, code, NULL,
+				 &loop, pcmcia_do_loop_tuple);
+}
+EXPORT_SYMBOL(pcmcia_loop_tuple);
+
+
+struct pcmcia_loop_get {
+	size_t len;
+	cisdata_t **buf;
+};
+
+/**
+ * pcmcia_do_get_tuple() - internal helper for pcmcia_get_tuple()
+ *
+ * pcmcia_do_get_tuple() is the internal callback for the call from
+ * pcmcia_get_tuple() to pcmcia_loop_tuple(). As we're only interested in
+ * the first tuple, return 0 unconditionally. Create a memory buffer large
+ * enough to hold the content of the tuple, and fill it with the tuple data.
+ * The caller is responsible to free the buffer.
+ */
+static int pcmcia_do_get_tuple(struct pcmcia_device *p_dev, tuple_t *tuple,
+			       void *priv)
+{
+	struct pcmcia_loop_get *get = priv;
+
+	*get->buf = kzalloc(tuple->TupleDataLen, GFP_KERNEL);
+	if (*get->buf) {
+		get->len = tuple->TupleDataLen;
+		memcpy(*get->buf, tuple->TupleData, tuple->TupleDataLen);
+	} else
+		dev_dbg(&p_dev->dev, "do_get_tuple: out of memory\n");
+	return 0;
+}
+
+/**
+ * pcmcia_get_tuple() - get first tuple from CIS
+ * @p_dev:	the struct pcmcia_device which we need to loop for.
+ * @code:	which CIS code shall we look for?
+ * @buf:        pointer to store the buffer to.
+ *
+ * pcmcia_get_tuple() gets the content of the first CIS entry of type @code.
+ * It returns the buffer length (or zero). The caller is responsible to free
+ * the buffer passed in @buf.
+ */
+size_t pcmcia_get_tuple(struct pcmcia_device *p_dev, cisdata_t code,
+			unsigned char **buf)
+{
+	struct pcmcia_loop_get get = {
+		.len = 0,
+		.buf = buf,
+	};
+
+	*get.buf = NULL;
+	pcmcia_loop_tuple(p_dev, code, pcmcia_do_get_tuple, &get);
+
+	return get.len;
+}
+EXPORT_SYMBOL(pcmcia_get_tuple);
+
+
+/**
+ * pcmcia_do_get_mac() - internal helper for pcmcia_get_mac_from_cis()
+ *
+ * pcmcia_do_get_mac() is the internal callback for the call from
+ * pcmcia_get_mac_from_cis() to pcmcia_loop_tuple(). We check whether the
+ * tuple contains a proper LAN_NODE_ID of length 6, and copy the data
+ * to struct net_device->dev_addr[i].
+ */
+static int pcmcia_do_get_mac(struct pcmcia_device *p_dev, tuple_t *tuple,
+			     void *priv)
+{
+	struct net_device *dev = priv;
+	int i;
+
+	if (tuple->TupleData[0] != CISTPL_FUNCE_LAN_NODE_ID)
+		return -EINVAL;
+	if (tuple->TupleDataLen < ETH_ALEN + 2) {
+		dev_warn(&p_dev->dev, "Invalid CIS tuple length for "
+			"LAN_NODE_ID\n");
+		return -EINVAL;
+	}
+
+	if (tuple->TupleData[1] != ETH_ALEN) {
+		dev_warn(&p_dev->dev, "Invalid header for LAN_NODE_ID\n");
+		return -EINVAL;
+	}
+	for (i = 0; i < 6; i++)
+		dev->dev_addr[i] = tuple->TupleData[i+2];
+	return 0;
+}
+
+/**
+ * pcmcia_get_mac_from_cis() - read out MAC address from CISTPL_FUNCE
+ * @p_dev:	the struct pcmcia_device for which we want the address.
+ * @dev:	a properly prepared struct net_device to store the info to.
+ *
+ * pcmcia_get_mac_from_cis() reads out the hardware MAC address from
+ * CISTPL_FUNCE and stores it into struct net_device *dev->dev_addr which
+ * must be set up properly by the driver (see examples!).
+ */
+int pcmcia_get_mac_from_cis(struct pcmcia_device *p_dev, struct net_device *dev)
+{
+	return pcmcia_loop_tuple(p_dev, CISTPL_FUNCE, pcmcia_do_get_mac, dev);
+}
+EXPORT_SYMBOL(pcmcia_get_mac_from_cis);
+
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index c907a3f..8bd23c8 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -20,7 +20,6 @@
 #include <linux/delay.h>
 #include <linux/pci.h>
 #include <linux/device.h>
-#include <linux/netdevice.h>
 
 #include <asm/irq.h>
 
@@ -921,232 +920,3 @@ void pcmcia_disable_device(struct pcmcia_device *p_dev)
 		pcmcia_release_window(p_dev, p_dev->win);
 }
 EXPORT_SYMBOL(pcmcia_disable_device);
-
-
-struct pcmcia_cfg_mem {
-	struct pcmcia_device *p_dev;
-	void *priv_data;
-	int (*conf_check) (struct pcmcia_device *p_dev,
-			   cistpl_cftable_entry_t *cfg,
-			   cistpl_cftable_entry_t *dflt,
-			   unsigned int vcc,
-			   void *priv_data);
-	cisparse_t parse;
-	cistpl_cftable_entry_t dflt;
-};
-
-/**
- * pcmcia_do_loop_config() - internal helper for pcmcia_loop_config()
- *
- * pcmcia_do_loop_config() is the internal callback for the call from
- * pcmcia_loop_config() to pccard_loop_tuple(). Data is transferred
- * by a struct pcmcia_cfg_mem.
- */
-static int pcmcia_do_loop_config(tuple_t *tuple, cisparse_t *parse, void *priv)
-{
-	cistpl_cftable_entry_t *cfg = &parse->cftable_entry;
-	struct pcmcia_cfg_mem *cfg_mem = priv;
-
-	/* default values */
-	cfg_mem->p_dev->conf.ConfigIndex = cfg->index;
-	if (cfg->flags & CISTPL_CFTABLE_DEFAULT)
-		cfg_mem->dflt = *cfg;
-
-	return cfg_mem->conf_check(cfg_mem->p_dev, cfg, &cfg_mem->dflt,
-				   cfg_mem->p_dev->socket->socket.Vcc,
-				   cfg_mem->priv_data);
-}
-
-/**
- * pcmcia_loop_config() - loop over configuration options
- * @p_dev:	the struct pcmcia_device which we need to loop for.
- * @conf_check:	function to call for each configuration option.
- *		It gets passed the struct pcmcia_device, the CIS data
- *		describing the configuration option, and private data
- *		being passed to pcmcia_loop_config()
- * @priv_data:	private data to be passed to the conf_check function.
- *
- * pcmcia_loop_config() loops over all configuration options, and calls
- * the driver-specific conf_check() for each one, checking whether
- * it is a valid one. Returns 0 on success or errorcode otherwise.
- */
-int pcmcia_loop_config(struct pcmcia_device *p_dev,
-		       int	(*conf_check)	(struct pcmcia_device *p_dev,
-						 cistpl_cftable_entry_t *cfg,
-						 cistpl_cftable_entry_t *dflt,
-						 unsigned int vcc,
-						 void *priv_data),
-		       void *priv_data)
-{
-	struct pcmcia_cfg_mem *cfg_mem;
-	int ret;
-
-	cfg_mem = kzalloc(sizeof(struct pcmcia_cfg_mem), GFP_KERNEL);
-	if (cfg_mem == NULL)
-		return -ENOMEM;
-
-	cfg_mem->p_dev = p_dev;
-	cfg_mem->conf_check = conf_check;
-	cfg_mem->priv_data = priv_data;
-
-	ret = pccard_loop_tuple(p_dev->socket, p_dev->func,
-				CISTPL_CFTABLE_ENTRY, &cfg_mem->parse,
-				cfg_mem, pcmcia_do_loop_config);
-
-	kfree(cfg_mem);
-	return ret;
-}
-EXPORT_SYMBOL(pcmcia_loop_config);
-
-
-struct pcmcia_loop_mem {
-	struct pcmcia_device *p_dev;
-	void *priv_data;
-	int (*loop_tuple) (struct pcmcia_device *p_dev,
-			   tuple_t *tuple,
-			   void *priv_data);
-};
-
-/**
- * pcmcia_do_loop_tuple() - internal helper for pcmcia_loop_config()
- *
- * pcmcia_do_loop_tuple() is the internal callback for the call from
- * pcmcia_loop_tuple() to pccard_loop_tuple(). Data is transferred
- * by a struct pcmcia_cfg_mem.
- */
-static int pcmcia_do_loop_tuple(tuple_t *tuple, cisparse_t *parse, void *priv)
-{
-	struct pcmcia_loop_mem *loop = priv;
-
-	return loop->loop_tuple(loop->p_dev, tuple, loop->priv_data);
-};
-
-/**
- * pcmcia_loop_tuple() - loop over tuples in the CIS
- * @p_dev:	the struct pcmcia_device which we need to loop for.
- * @code:	which CIS code shall we look for?
- * @priv_data:	private data to be passed to the loop_tuple function.
- * @loop_tuple:	function to call for each CIS entry of type @function. IT
- *		gets passed the raw tuple and @priv_data.
- *
- * pcmcia_loop_tuple() loops over all CIS entries of type @function, and
- * calls the @loop_tuple function for each entry. If the call to @loop_tuple
- * returns 0, the loop exits. Returns 0 on success or errorcode otherwise.
- */
-int pcmcia_loop_tuple(struct pcmcia_device *p_dev, cisdata_t code,
-		      int (*loop_tuple) (struct pcmcia_device *p_dev,
-					 tuple_t *tuple,
-					 void *priv_data),
-		      void *priv_data)
-{
-	struct pcmcia_loop_mem loop = {
-		.p_dev = p_dev,
-		.loop_tuple = loop_tuple,
-		.priv_data = priv_data};
-
-	return pccard_loop_tuple(p_dev->socket, p_dev->func, code, NULL,
-				 &loop, pcmcia_do_loop_tuple);
-}
-EXPORT_SYMBOL(pcmcia_loop_tuple);
-
-
-struct pcmcia_loop_get {
-	size_t len;
-	cisdata_t **buf;
-};
-
-/**
- * pcmcia_do_get_tuple() - internal helper for pcmcia_get_tuple()
- *
- * pcmcia_do_get_tuple() is the internal callback for the call from
- * pcmcia_get_tuple() to pcmcia_loop_tuple(). As we're only interested in
- * the first tuple, return 0 unconditionally. Create a memory buffer large
- * enough to hold the content of the tuple, and fill it with the tuple data.
- * The caller is responsible to free the buffer.
- */
-static int pcmcia_do_get_tuple(struct pcmcia_device *p_dev, tuple_t *tuple,
-			       void *priv)
-{
-	struct pcmcia_loop_get *get = priv;
-
-	*get->buf = kzalloc(tuple->TupleDataLen, GFP_KERNEL);
-	if (*get->buf) {
-		get->len = tuple->TupleDataLen;
-		memcpy(*get->buf, tuple->TupleData, tuple->TupleDataLen);
-	} else
-		dev_dbg(&p_dev->dev, "do_get_tuple: out of memory\n");
-	return 0;
-}
-
-/**
- * pcmcia_get_tuple() - get first tuple from CIS
- * @p_dev:	the struct pcmcia_device which we need to loop for.
- * @code:	which CIS code shall we look for?
- * @buf:        pointer to store the buffer to.
- *
- * pcmcia_get_tuple() gets the content of the first CIS entry of type @code.
- * It returns the buffer length (or zero). The caller is responsible to free
- * the buffer passed in @buf.
- */
-size_t pcmcia_get_tuple(struct pcmcia_device *p_dev, cisdata_t code,
-			unsigned char **buf)
-{
-	struct pcmcia_loop_get get = {
-		.len = 0,
-		.buf = buf,
-	};
-
-	*get.buf = NULL;
-	pcmcia_loop_tuple(p_dev, code, pcmcia_do_get_tuple, &get);
-
-	return get.len;
-}
-EXPORT_SYMBOL(pcmcia_get_tuple);
-
-
-/**
- * pcmcia_do_get_mac() - internal helper for pcmcia_get_mac_from_cis()
- *
- * pcmcia_do_get_mac() is the internal callback for the call from
- * pcmcia_get_mac_from_cis() to pcmcia_loop_tuple(). We check whether the
- * tuple contains a proper LAN_NODE_ID of length 6, and copy the data
- * to struct net_device->dev_addr[i].
- */
-static int pcmcia_do_get_mac(struct pcmcia_device *p_dev, tuple_t *tuple,
-			     void *priv)
-{
-	struct net_device *dev = priv;
-	int i;
-
-	if (tuple->TupleData[0] != CISTPL_FUNCE_LAN_NODE_ID)
-		return -EINVAL;
-	if (tuple->TupleDataLen < ETH_ALEN + 2) {
-		dev_warn(&p_dev->dev, "Invalid CIS tuple length for "
-			"LAN_NODE_ID\n");
-		return -EINVAL;
-	}
-
-	if (tuple->TupleData[1] != ETH_ALEN) {
-		dev_warn(&p_dev->dev, "Invalid header for LAN_NODE_ID\n");
-		return -EINVAL;
-	}
-	for (i = 0; i < 6; i++)
-		dev->dev_addr[i] = tuple->TupleData[i+2];
-	return 0;
-}
-
-/**
- * pcmcia_get_mac_from_cis() - read out MAC address from CISTPL_FUNCE
- * @p_dev:	the struct pcmcia_device for which we want the address.
- * @dev:	a properly prepared struct net_device to store the info to.
- *
- * pcmcia_get_mac_from_cis() reads out the hardware MAC address from
- * CISTPL_FUNCE and stores it into struct net_device *dev->dev_addr which
- * must be set up properly by the driver (see examples!).
- */
-int pcmcia_get_mac_from_cis(struct pcmcia_device *p_dev, struct net_device *dev)
-{
-	return pcmcia_loop_tuple(p_dev, CISTPL_FUNCE, pcmcia_do_get_mac, dev);
-}
-EXPORT_SYMBOL(pcmcia_get_mac_from_cis);
-
-- 
1.6.3.3



From linux at dominikbrodowski.net  Sun Mar 21 19:07:30 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 22 Mar 2010 00:07:30 +0100
Subject: [RFC PATCH 12/19] pcmcia: dev_node removal (remaining drivers)
In-Reply-To: <20100321230617.GA24791@comet.dominikbrodowski.net>
References: <20100321230617.GA24791@comet.dominikbrodowski.net>
Message-ID: <1269212857-25364-12-git-send-email-linux@dominikbrodowski.net>

As a fourth step, remove any remaining usages of
dev_node_t from drivers:

- ipwireless can be simplified a bit, as we do not need
  to pass around the (write-only) dev_node_t around.

- avma1_cs can be simplified as well, if we only keep the
  minor number around as "priv" data, not a full-fledged
  struct.

CC: Jiri Kosina <jkosina at suse.cz>
CC: David Sterba <dsterba at suse.cz>
CC: Karsten Keil <isdn at linux-pingi.de>
Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 drivers/char/pcmcia/ipwireless/main.c |    8 +----
 drivers/char/pcmcia/ipwireless/main.h |    1 -
 drivers/char/pcmcia/ipwireless/tty.c  |   19 +++---------
 drivers/char/pcmcia/ipwireless/tty.h  |    3 +-
 drivers/isdn/hisax/avma1_cs.c         |   51 ++-------------------------------
 5 files changed, 10 insertions(+), 72 deletions(-)

diff --git a/drivers/char/pcmcia/ipwireless/main.c b/drivers/char/pcmcia/ipwireless/main.c
index 2237890..63c32e3 100644
--- a/drivers/char/pcmcia/ipwireless/main.c
+++ b/drivers/char/pcmcia/ipwireless/main.c
@@ -228,8 +228,7 @@ static int config_ipwireless(struct ipw_dev *ipw)
 	if (!ipw->network)
 		goto exit;
 
-	ipw->tty = ipwireless_tty_create(ipw->hardware, ipw->network,
-			ipw->nodes);
+	ipw->tty = ipwireless_tty_create(ipw->hardware, ipw->network);
 	if (!ipw->tty)
 		goto exit;
 
@@ -244,8 +243,6 @@ static int config_ipwireless(struct ipw_dev *ipw)
 	if (ret != 0)
 		goto exit;
 
-	link->dev_node = &ipw->nodes[0];
-
 	return 0;
 
 exit:
@@ -306,9 +303,6 @@ static int ipwireless_attach(struct pcmcia_device *link)
 	ipw->link = link;
 	link->priv = ipw;
 
-	/* Link this device into our device list. */
-	link->dev_node = &ipw->nodes[0];
-
 	ipw->hardware = ipwireless_hardware_create();
 	if (!ipw->hardware) {
 		kfree(ipw);
diff --git a/drivers/char/pcmcia/ipwireless/main.h b/drivers/char/pcmcia/ipwireless/main.h
index 0e0363a..96d0ef3 100644
--- a/drivers/char/pcmcia/ipwireless/main.h
+++ b/drivers/char/pcmcia/ipwireless/main.h
@@ -54,7 +54,6 @@ struct ipw_dev {
 	void __iomem *common_memory;
 	win_req_t request_common_memory;
 
-	dev_node_t nodes[2];
 	/* Reference to attribute memory, containing CIS data */
 	void *attribute_memory;
 
diff --git a/drivers/char/pcmcia/ipwireless/tty.c b/drivers/char/pcmcia/ipwireless/tty.c
index 2bb7874..1a2c2c3 100644
--- a/drivers/char/pcmcia/ipwireless/tty.c
+++ b/drivers/char/pcmcia/ipwireless/tty.c
@@ -487,7 +487,7 @@ static int ipw_ioctl(struct tty_struct *linux_tty, struct file *file,
 	return tty_mode_ioctl(linux_tty, file, cmd , arg);
 }
 
-static int add_tty(dev_node_t *nodesp, int j,
+static int add_tty(int j,
 		    struct ipw_hardware *hardware,
 		    struct ipw_network *network, int channel_idx,
 		    int secondary_channel_idx, int tty_type)
@@ -510,19 +510,13 @@ static int add_tty(dev_node_t *nodesp, int j,
 		ipwireless_associate_network_tty(network,
 						 secondary_channel_idx,
 						 ttys[j]);
-	if (nodesp != NULL) {
-		sprintf(nodesp->dev_name, "ttyIPWp%d", j);
-		nodesp->major = ipw_tty_driver->major;
-		nodesp->minor = j + ipw_tty_driver->minor_start;
-	}
 	if (get_tty(j + ipw_tty_driver->minor_start) == ttys[j])
 		report_registering(ttys[j]);
 	return 0;
 }
 
 struct ipw_tty *ipwireless_tty_create(struct ipw_hardware *hardware,
-				      struct ipw_network *network,
-				      dev_node_t *nodes)
+				      struct ipw_network *network)
 {
 	int i, j;
 
@@ -539,26 +533,23 @@ struct ipw_tty *ipwireless_tty_create(struct ipw_hardware *hardware,
 		if (allfree) {
 			j = i;
 
-			if (add_tty(&nodes[0], j, hardware, network,
+			if (add_tty(j, hardware, network,
 					IPW_CHANNEL_DIALLER, IPW_CHANNEL_RAS,
 					TTYTYPE_MODEM))
 				return NULL;
 
 			j += IPWIRELESS_PCMCIA_MINOR_RANGE;
-			if (add_tty(&nodes[1], j, hardware, network,
+			if (add_tty(j, hardware, network,
 					IPW_CHANNEL_DIALLER, -1,
 					TTYTYPE_MONITOR))
 				return NULL;
 
 			j += IPWIRELESS_PCMCIA_MINOR_RANGE;
-			if (add_tty(NULL, j, hardware, network,
+			if (add_tty(j, hardware, network,
 					IPW_CHANNEL_RAS, -1,
 					TTYTYPE_RAS_RAW))
 				return NULL;
 
-			nodes[0].next = &nodes[1];
-			nodes[1].next = NULL;
-
 			return ttys[i];
 		}
 	}
diff --git a/drivers/char/pcmcia/ipwireless/tty.h b/drivers/char/pcmcia/ipwireless/tty.h
index b0deb91..4da6c20 100644
--- a/drivers/char/pcmcia/ipwireless/tty.h
+++ b/drivers/char/pcmcia/ipwireless/tty.h
@@ -34,8 +34,7 @@ int ipwireless_tty_init(void);
 void ipwireless_tty_release(void);
 
 struct ipw_tty *ipwireless_tty_create(struct ipw_hardware *hw,
-				      struct ipw_network *net,
-				      dev_node_t *nodes);
+				      struct ipw_network *net);
 void ipwireless_tty_free(struct ipw_tty *tty);
 void ipwireless_tty_received(struct ipw_tty *tty, unsigned char *data,
 			     unsigned int length);
diff --git a/drivers/isdn/hisax/avma1_cs.c b/drivers/isdn/hisax/avma1_cs.c
index 96d0b5d..0b710a6 100644
--- a/drivers/isdn/hisax/avma1_cs.c
+++ b/drivers/isdn/hisax/avma1_cs.c
@@ -62,31 +62,6 @@ static void avma1cs_release(struct pcmcia_device *link);
 static void avma1cs_detach(struct pcmcia_device *p_dev);
 
 
-/*
-   A linked list of "instances" of the skeleton device.  Each actual
-   PCMCIA card corresponds to one device instance, and is described
-   by one struct pcmcia_device structure (defined in ds.h).
-
-   You may not want to use a linked list for this -- for example, the
-   memory card driver uses an array of struct pcmcia_device pointers, where minor
-   device numbers are used to derive the corresponding array index.
-*/
-
-/*
-   A driver needs to provide a dev_node_t structure for each device
-   on a card.  In some cases, there is only one device per card (for
-   example, ethernet cards, modems).  In other cases, there may be
-   many actual or logical devices (SCSI adapters, memory cards with
-   multiple partitions).  The dev_node_t structures need to be kept
-   in a linked list starting at the 'dev' field of a struct pcmcia_device
-   structure.  We allocate them in the card's private data structure,
-   because they generally can't be allocated dynamically.
-*/
-   
-typedef struct local_info_t {
-    dev_node_t	node;
-} local_info_t;
-
 /*======================================================================
 
     avma1cs_attach() creates an "instance" of the driver, allocating
@@ -101,17 +76,8 @@ typedef struct local_info_t {
 
 static int avma1cs_probe(struct pcmcia_device *p_dev)
 {
-    local_info_t *local;
-
     dev_dbg(&p_dev->dev, "avma1cs_attach()\n");
 
-    /* Allocate space for private device-specific data */
-    local = kzalloc(sizeof(local_info_t), GFP_KERNEL);
-    if (!local)
-	return -ENOMEM;
-
-    p_dev->priv = local;
-
     /* The io structure describes IO port mapping */
     p_dev->io.NumPorts1 = 16;
     p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
@@ -173,14 +139,11 @@ static int avma1cs_configcheck(struct pcmcia_device *p_dev,
 
 static int avma1cs_config(struct pcmcia_device *link)
 {
-    local_info_t *dev;
     int i = -1;
     char devname[128];
     IsdnCard_t	icard;
     int busy = 0;
 
-    dev = link->priv;
-
     dev_dbg(&link->dev, "avma1cs_config(0x%p)\n", link);
 
     devname[0] = 0;
@@ -211,14 +174,6 @@ static int avma1cs_config(struct pcmcia_device *link)
 
     } while (0);
 
-    /* At this point, the dev_node_t structure(s) should be
-       initialized and arranged in a linked list at link->dev. */
-
-    strcpy(dev->node.dev_name, "A1");
-    dev->node.major = 45;
-    dev->node.minor = 0;
-    link->dev_node = &dev->node;
-
     /* If any step failed, release any partially configured state */
     if (i != 0) {
 	avma1cs_release(link);
@@ -239,7 +194,7 @@ static int avma1cs_config(struct pcmcia_device *link)
 	avma1cs_release(link);
 	return -ENODEV;
     }
-    dev->node.minor = i;
+    link->priv = (void *) (unsigned long) i;
 
     return 0;
 } /* avma1cs_config */
@@ -254,12 +209,12 @@ static int avma1cs_config(struct pcmcia_device *link)
 
 static void avma1cs_release(struct pcmcia_device *link)
 {
-	local_info_t *local = link->priv;
+	unsigned long minor = (unsigned long) link->priv;
 
 	dev_dbg(&link->dev, "avma1cs_release(0x%p)\n", link);
 
 	/* now unregister function with hisax */
-	HiSax_closecard(local->node.minor);
+	HiSax_closecard(minor);
 
 	pcmcia_disable_device(link);
 } /* avma1cs_release */
-- 
1.6.3.3



From linux at dominikbrodowski.net  Sun Mar 21 19:06:17 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 22 Mar 2010 00:06:17 +0100
Subject: [RFC] PCMCIA patches for 2.6.36-rc1
Message-ID: <20100321230617.GA24791@comet.dominikbrodowski.net>

Hey,

here's a rather large patch series again with a few PCMCIA cleanup patches
intended for submission after 2.6.35 is released. The patches will be sent
to the PCMCIA list shortly, with CC to other lists if deemed appropriate.
Also, they can be found in the "pcmcia-test" branch at

        git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git pcmcia-test

and gitweb at

	http://git.kernel.org/?p=linux/kernel/git/brodo/pcmcia-2.6.git;a=shortlog;h=refs/heads/pcmcia-test

As usual, I'm interested in your input to this patch series.

Best,
	Dominik


Dominik Brodowski (19):
      pcmcia: remove pcmcia_add_device_lock
      pcmcia: remove unused mem_op.h
      pcmcia: remove unused IRQ modification feature
      pcmcia: setup IRQ to be used by PCMCIA drivers at card insert
      pcmcia: replace struct irq with uint pcmcia_irq in struct pcmcia_socket
      pcmcia: pass FORCED_PULSE parameter in pcmcia_request_configuration()
      pcmcia: re-work pcmcia_request_irq()
      pcmcia: clean up cs.h
      pcmcia: dev_node removal (write-only drivers)
      pcmcia: dev_node removal (drivers with updated printk call)
      pcmcia: dev_node removal (drivers with unregister_netdev check)
      pcmcia: dev_node removal (remaining drivers)
      pcmcia: dev_node removal (core)
      power: support _noirq actions on device types and classes
      pcmcia: use dev_pm_ops for class pcmcia_socket_class
      pcmcia: move high level CIS access code to separate file
      pcmcia: move all pcmcia_resource_ops providers into one module
      pcmcia: clarify alloc_io_space, move it to resource handlers
      pata_pcmcia: get rid of extra indirection

 Documentation/pcmcia/driver-changes.txt          |   13 +
 drivers/ata/pata_pcmcia.c                        |   47 +--
 drivers/base/power/main.c                        |   31 ++
 drivers/bluetooth/bluecard_cs.c                  |   11 +-
 drivers/bluetooth/bt3c_cs.c                      |   11 +-
 drivers/bluetooth/btuart_cs.c                    |   11 +-
 drivers/bluetooth/dtl1_cs.c                      |   11 +-
 drivers/char/pcmcia/cm4000_cs.c                  |    9 +-
 drivers/char/pcmcia/cm4040_cs.c                  |    5 -
 drivers/char/pcmcia/ipwireless/main.c            |   19 +-
 drivers/char/pcmcia/ipwireless/main.h            |    1 -
 drivers/char/pcmcia/ipwireless/tty.c             |   19 +-
 drivers/char/pcmcia/ipwireless/tty.h             |    3 +-
 drivers/char/pcmcia/synclink_cs.c                |   22 +-
 drivers/ide/ide-cs.c                             |   20 +-
 drivers/isdn/hardware/avm/avm_cs.c               |   75 +---
 drivers/isdn/hisax/avma1_cs.c                    |   63 +--
 drivers/isdn/hisax/elsa_cs.c                     |   40 +--
 drivers/isdn/hisax/sedlbauer_cs.c                |   60 +--
 drivers/isdn/hisax/teles_cs.c                    |   50 +--
 drivers/mtd/maps/pcmciamtd.c                     |    3 -
 drivers/net/pcmcia/3c574_cs.c                    |   15 +-
 drivers/net/pcmcia/3c589_cs.c                    |   16 +-
 drivers/net/pcmcia/axnet_cs.c                    |   21 +-
 drivers/net/pcmcia/com20020_cs.c                 |   29 +-
 drivers/net/pcmcia/fmvj18x_cs.c                  |   18 +-
 drivers/net/pcmcia/ibmtr_cs.c                    |   16 +-
 drivers/net/pcmcia/nmclan_cs.c                   |   14 +-
 drivers/net/pcmcia/pcnet_cs.c                    |   16 +-
 drivers/net/pcmcia/smc91c92_cs.c                 |   17 +-
 drivers/net/pcmcia/xirc2ps_cs.c                  |   36 +--
 drivers/net/wireless/airo_cs.c                   |   72 +---
 drivers/net/wireless/atmel_cs.c                  |   70 +---
 drivers/net/wireless/b43/pcmcia.c                |    5 +-
 drivers/net/wireless/hostap/hostap_cs.c          |   38 +-
 drivers/net/wireless/libertas/if_cs.c            |   21 +-
 drivers/net/wireless/orinoco/orinoco_cs.c        |   27 +-
 drivers/net/wireless/orinoco/spectrum_cs.c       |   27 +-
 drivers/net/wireless/ray_cs.c                    |   15 +-
 drivers/net/wireless/ray_cs.h                    |    1 -
 drivers/net/wireless/wl3501.h                    |    1 -
 drivers/net/wireless/wl3501_cs.c                 |   23 +-
 drivers/parport/parport_cs.c                     |   13 +-
 drivers/pcmcia/Kconfig                           |    2 +-
 drivers/pcmcia/Makefile                          |    9 +-
 drivers/pcmcia/at91_cf.c                         |    2 -
 drivers/pcmcia/au1000_generic.c                  |   13 -
 drivers/pcmcia/bfin_cf_pcmcia.c                  |   14 +-
 drivers/pcmcia/cardbus.c                         |    1 -
 drivers/pcmcia/cistpl.c                          |  100 ----
 drivers/pcmcia/cs.c                              |  125 +++---
 drivers/pcmcia/cs_internal.h                     |   22 +-
 drivers/pcmcia/db1xxx_ss.c                       |   27 -
 drivers/pcmcia/ds.c                              |   34 +-
 drivers/pcmcia/i82092.c                          |   16 -
 drivers/pcmcia/i82365.c                          |   11 -
 drivers/pcmcia/m32r_cfc.c                        |   11 -
 drivers/pcmcia/m32r_pcc.c                        |   12 -
 drivers/pcmcia/m8xx_pcmcia.c                     |   17 -
 drivers/pcmcia/omap_cf.c                         |   14 +-
 drivers/pcmcia/pcmcia_cis.c                      |  355 ++++++++++++
 drivers/pcmcia/pcmcia_ioctl.c                    |   19 +-
 drivers/pcmcia/pcmcia_resource.c                 |  621 ++++++----------------
 drivers/pcmcia/pd6729.c                          |   16 -
 drivers/pcmcia/pxa2xx_base.c                     |    8 +-
 drivers/pcmcia/rsrc_iodyn.c                      |  171 ++++++
 drivers/pcmcia/rsrc_mgr.c                        |  112 +----
 drivers/pcmcia/rsrc_nonstatic.c                  |  129 ++++-
 drivers/pcmcia/sa1100_generic.c                  |   13 -
 drivers/pcmcia/sa1111_generic.c                  |   12 -
 drivers/pcmcia/tcic.c                            |   12 -
 drivers/pcmcia/vrc4171_card.c                    |   13 -
 drivers/pcmcia/yenta_socket.c                    |   17 +-
 drivers/scsi/pcmcia/aha152x_stub.c               |    9 +-
 drivers/scsi/pcmcia/fdomain_stub.c               |    9 +-
 drivers/scsi/pcmcia/nsp_cs.c                     |   23 +-
 drivers/scsi/pcmcia/nsp_cs.h                     |    1 -
 drivers/scsi/pcmcia/qlogic_stub.c                |   13 +-
 drivers/scsi/pcmcia/sym53c500_cs.c               |    9 +-
 drivers/serial/serial_cs.c                       |   36 +-
 drivers/ssb/main.c                               |    2 +-
 drivers/staging/comedi/drivers/cb_das16_cs.c     |   26 +-
 drivers/staging/comedi/drivers/das08_cs.c        |   16 +-
 drivers/staging/comedi/drivers/ni_daq_700.c      |   23 +-
 drivers/staging/comedi/drivers/ni_daq_dio24.c    |   23 +-
 drivers/staging/comedi/drivers/ni_labpc_cs.c     |   23 +-
 drivers/staging/comedi/drivers/ni_mio_cs.c       |    9 +-
 drivers/staging/comedi/drivers/quatech_daqp_cs.c |   22 +-
 drivers/staging/netwave/netwave_cs.c             |    9 +-
 drivers/staging/wavelan/wavelan_cs.c             |   15 +-
 drivers/staging/wlags49_h2/wl_cs.c               |    9 +-
 drivers/telephony/ixj_pcmcia.c                   |    3 -
 drivers/usb/host/sl811_cs.c                      |   28 +-
 include/pcmcia/cs.h                              |   19 +-
 include/pcmcia/ds.h                              |   29 +-
 include/pcmcia/mem_op.h                          |  116 ----
 include/pcmcia/ss.h                              |   12 +-
 sound/pcmcia/pdaudiocf/pdaudiocf.c               |   12 +-
 sound/pcmcia/pdaudiocf/pdaudiocf.h               |    1 -
 sound/pcmcia/vx/vxpocket.c                       |   10 +-
 sound/pcmcia/vx/vxpocket.h                       |    1 -
 101 files changed, 1205 insertions(+), 2266 deletions(-)
 create mode 100644 drivers/pcmcia/pcmcia_cis.c
 create mode 100644 drivers/pcmcia/rsrc_iodyn.c
 delete mode 100644 include/pcmcia/mem_op.h


From linux at dominikbrodowski.net  Sun Mar 21 19:07:19 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 22 Mar 2010 00:07:19 +0100
Subject: [RFC PATCH 01/19] pcmcia: remove pcmcia_add_device_lock
In-Reply-To: <20100321230617.GA24791@comet.dominikbrodowski.net>
References: <20100321230617.GA24791@comet.dominikbrodowski.net>
Message-ID: <1269212857-25364-1-git-send-email-linux@dominikbrodowski.net>

As all cards to pcmcia_device_add() are already locked by skt_mutex, and
the critical sections inside this function are further protected by
ops_mutex, there's no need to keep a third lock around. Therfore, remove
pcmcia_add_device_lock.

Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 drivers/pcmcia/ds.c |   18 ++----------------
 1 files changed, 2 insertions(+), 16 deletions(-)

diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index ad93ebd..a2b0d69 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -479,15 +479,6 @@ static int pcmcia_device_query(struct pcmcia_device *p_dev)
 }
 
 
-/* device_add_lock is needed to avoid double registration by cardmgr and kernel.
- * Serializes pcmcia_device_add; will most likely be removed in future.
- *
- * While it has the caveat that adding new PCMCIA devices inside(!) device_register()
- * won't work, this doesn't matter much at the moment: the driver core doesn't
- * support it either.
- */
-static DEFINE_MUTEX(device_add_lock);
-
 struct pcmcia_device *pcmcia_device_add(struct pcmcia_socket *s, unsigned int function)
 {
 	struct pcmcia_device *p_dev, *tmp_dev;
@@ -497,8 +488,6 @@ struct pcmcia_device *pcmcia_device_add(struct pcmcia_socket *s, unsigned int fu
 	if (!s)
 		return NULL;
 
-	mutex_lock(&device_add_lock);
-
 	pr_debug("adding device to %d, function %d\n", s->sock, function);
 
 	p_dev = kzalloc(sizeof(struct pcmcia_device), GFP_KERNEL);
@@ -534,8 +523,8 @@ struct pcmcia_device *pcmcia_device_add(struct pcmcia_socket *s, unsigned int fu
 
 	/*
 	 * p_dev->function_config must be the same for all card functions.
-	 * Note that this is serialized by the device_add_lock, so that
-	 * only one such struct will be created.
+	 * Note that this is serialized by ops_mutex, so that only one
+	 * such struct will be created.
 	 */
 	list_for_each_entry(tmp_dev, &s->devices_list, socket_device_list)
 		if (p_dev->func == tmp_dev->func) {
@@ -568,8 +557,6 @@ struct pcmcia_device *pcmcia_device_add(struct pcmcia_socket *s, unsigned int fu
 	if (device_register(&p_dev->dev))
 		goto err_unreg;
 
-	mutex_unlock(&device_add_lock);
-
 	return p_dev;
 
  err_unreg:
@@ -587,7 +574,6 @@ struct pcmcia_device *pcmcia_device_add(struct pcmcia_socket *s, unsigned int fu
 	kfree(p_dev->devname);
 	kfree(p_dev);
  err_put:
-	mutex_unlock(&device_add_lock);
 	pcmcia_put_socket(s);
 
 	return NULL;
-- 
1.6.3.3



From linux at dominikbrodowski.net  Sun Mar 21 19:07:33 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 22 Mar 2010 00:07:33 +0100
Subject: [RFC PATCH 15/19] pcmcia: use dev_pm_ops for class pcmcia_socket_class
In-Reply-To: <20100321230617.GA24791@comet.dominikbrodowski.net>
References: <20100321230617.GA24791@comet.dominikbrodowski.net>
Message-ID: <1269212857-25364-15-git-send-email-linux@dominikbrodowski.net>

Instead of requiring PCMCIA socket drivers to call various functions
during their (bus) resume and suspend functions, register an own
dev_pm_ops for this class.

With regard to the asymmetry with only _noirq suspend, but split up
resume, please see bug 14334 and commit 9905d1b411946fb3 .

Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 drivers/pcmcia/at91_cf.c        |    2 -
 drivers/pcmcia/au1000_generic.c |   13 ----
 drivers/pcmcia/bfin_cf_pcmcia.c |   12 ----
 drivers/pcmcia/cs.c             |  124 ++++++++++++++++++++-------------------
 drivers/pcmcia/db1xxx_ss.c      |   27 ---------
 drivers/pcmcia/i82092.c         |   16 -----
 drivers/pcmcia/i82365.c         |   11 ----
 drivers/pcmcia/m32r_cfc.c       |   11 ----
 drivers/pcmcia/m32r_pcc.c       |   12 ----
 drivers/pcmcia/m8xx_pcmcia.c    |   17 -----
 drivers/pcmcia/omap_cf.c        |   12 ----
 drivers/pcmcia/pd6729.c         |   16 -----
 drivers/pcmcia/pxa2xx_base.c    |    8 +--
 drivers/pcmcia/sa1100_generic.c |   13 ----
 drivers/pcmcia/sa1111_generic.c |   12 ----
 drivers/pcmcia/tcic.c           |   12 ----
 drivers/pcmcia/vrc4171_card.c   |   13 ----
 drivers/pcmcia/yenta_socket.c   |   17 +-----
 include/pcmcia/ss.h             |    6 --
 19 files changed, 66 insertions(+), 288 deletions(-)

diff --git a/drivers/pcmcia/at91_cf.c b/drivers/pcmcia/at91_cf.c
index 5d22807..fb904f4 100644
--- a/drivers/pcmcia/at91_cf.c
+++ b/drivers/pcmcia/at91_cf.c
@@ -361,7 +361,6 @@ static int at91_cf_suspend(struct platform_device *pdev, pm_message_t mesg)
 	struct at91_cf_socket	*cf = platform_get_drvdata(pdev);
 	struct at91_cf_data	*board = cf->board;
 
-	pcmcia_socket_dev_suspend(&pdev->dev);
 	if (device_may_wakeup(&pdev->dev)) {
 		enable_irq_wake(board->det_pin);
 		if (board->irq_pin)
@@ -381,7 +380,6 @@ static int at91_cf_resume(struct platform_device *pdev)
 			disable_irq_wake(board->irq_pin);
 	}
 
-	pcmcia_socket_dev_resume(&pdev->dev);
 	return 0;
 }
 
diff --git a/drivers/pcmcia/au1000_generic.c b/drivers/pcmcia/au1000_generic.c
index 171c8a6..ac4d089 100644
--- a/drivers/pcmcia/au1000_generic.c
+++ b/drivers/pcmcia/au1000_generic.c
@@ -510,17 +510,6 @@ static int au1x00_drv_pcmcia_probe(struct platform_device *dev)
 	return ret;
 }
 
-static int au1x00_drv_pcmcia_suspend(struct platform_device *dev,
-				     pm_message_t state)
-{
-	return pcmcia_socket_dev_suspend(&dev->dev);
-}
-
-static int au1x00_drv_pcmcia_resume(struct platform_device *dev)
-{
-	return pcmcia_socket_dev_resume(&dev->dev);
-}
-
 static struct platform_driver au1x00_pcmcia_driver = {
 	.driver = {
 		.name		= "au1x00-pcmcia",
@@ -528,8 +517,6 @@ static struct platform_driver au1x00_pcmcia_driver = {
 	},
 	.probe		= au1x00_drv_pcmcia_probe,
 	.remove		= au1x00_drv_pcmcia_remove,
-	.suspend 	= au1x00_drv_pcmcia_suspend,
-	.resume 	= au1x00_drv_pcmcia_resume,
 };
 
 
diff --git a/drivers/pcmcia/bfin_cf_pcmcia.c b/drivers/pcmcia/bfin_cf_pcmcia.c
index 1744f38..b16f209 100644
--- a/drivers/pcmcia/bfin_cf_pcmcia.c
+++ b/drivers/pcmcia/bfin_cf_pcmcia.c
@@ -300,16 +300,6 @@ static int __devexit bfin_cf_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static int bfin_cf_suspend(struct platform_device *pdev, pm_message_t mesg)
-{
-	return pcmcia_socket_dev_suspend(&pdev->dev);
-}
-
-static int bfin_cf_resume(struct platform_device *pdev)
-{
-	return pcmcia_socket_dev_resume(&pdev->dev);
-}
-
 static struct platform_driver bfin_cf_driver = {
 	.driver = {
 		   .name = (char *)driver_name,
@@ -317,8 +307,6 @@ static struct platform_driver bfin_cf_driver = {
 		   },
 	.probe = bfin_cf_probe,
 	.remove = __devexit_p(bfin_cf_remove),
-	.suspend = bfin_cf_suspend,
-	.resume = bfin_cf_resume,
 };
 
 static int __init bfin_cf_init(void)
diff --git a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c
index 2295837..4c1bb8a 100644
--- a/drivers/pcmcia/cs.c
+++ b/drivers/pcmcia/cs.c
@@ -76,65 +76,6 @@ DECLARE_RWSEM(pcmcia_socket_list_rwsem);
 EXPORT_SYMBOL(pcmcia_socket_list_rwsem);
 
 
-/*
- * Low-level PCMCIA socket drivers need to register with the PCCard
- * core using pcmcia_register_socket.
- *
- * socket drivers are expected to use the following callbacks in their
- * .drv struct:
- *  - pcmcia_socket_dev_suspend
- *  - pcmcia_socket_dev_resume
- * These functions check for the appropriate struct pcmcia_soket arrays,
- * and pass them to the low-level functions pcmcia_{suspend,resume}_socket
- */
-static int socket_early_resume(struct pcmcia_socket *skt);
-static int socket_late_resume(struct pcmcia_socket *skt);
-static int socket_resume(struct pcmcia_socket *skt);
-static int socket_suspend(struct pcmcia_socket *skt);
-
-static void pcmcia_socket_dev_run(struct device *dev,
-				  int (*cb)(struct pcmcia_socket *))
-{
-	struct pcmcia_socket *socket;
-
-	down_read(&pcmcia_socket_list_rwsem);
-	list_for_each_entry(socket, &pcmcia_socket_list, socket_list) {
-		if (socket->dev.parent != dev)
-			continue;
-		mutex_lock(&socket->skt_mutex);
-		cb(socket);
-		mutex_unlock(&socket->skt_mutex);
-	}
-	up_read(&pcmcia_socket_list_rwsem);
-}
-
-int pcmcia_socket_dev_suspend(struct device *dev)
-{
-	pcmcia_socket_dev_run(dev, socket_suspend);
-	return 0;
-}
-EXPORT_SYMBOL(pcmcia_socket_dev_suspend);
-
-void pcmcia_socket_dev_early_resume(struct device *dev)
-{
-	pcmcia_socket_dev_run(dev, socket_early_resume);
-}
-EXPORT_SYMBOL(pcmcia_socket_dev_early_resume);
-
-void pcmcia_socket_dev_late_resume(struct device *dev)
-{
-	pcmcia_socket_dev_run(dev, socket_late_resume);
-}
-EXPORT_SYMBOL(pcmcia_socket_dev_late_resume);
-
-int pcmcia_socket_dev_resume(struct device *dev)
-{
-	pcmcia_socket_dev_run(dev, socket_resume);
-	return 0;
-}
-EXPORT_SYMBOL(pcmcia_socket_dev_resume);
-
-
 struct pcmcia_socket *pcmcia_get_socket(struct pcmcia_socket *skt)
 {
 	struct device *dev = get_device(&skt->dev);
@@ -577,12 +518,18 @@ static int socket_early_resume(struct pcmcia_socket *skt)
 
 static int socket_late_resume(struct pcmcia_socket *skt)
 {
+	int ret;
+
 	mutex_lock(&skt->ops_mutex);
 	skt->state &= ~SOCKET_SUSPEND;
 	mutex_unlock(&skt->ops_mutex);
 
-	if (!(skt->state & SOCKET_PRESENT))
-		return socket_insert(skt);
+	if (!(skt->state & SOCKET_PRESENT)) {
+		ret = socket_insert(skt);
+		if (ret == -ENODEV)
+			ret = 0;
+		return ret;
+	}
 
 	if (skt->resume_status) {
 		socket_shutdown(skt);
@@ -918,11 +865,66 @@ static void pcmcia_release_socket_class(struct class *data)
 }
 
 
+#ifdef CONFIG_PM
+
+static int __pcmcia_pm_op(struct device *dev,
+			  int (*callback) (struct pcmcia_socket *skt))
+{
+	struct pcmcia_socket *s = container_of(dev, struct pcmcia_socket, dev);
+	int ret;
+
+	mutex_lock(&s->skt_mutex);
+	ret = callback(s);
+	mutex_unlock(&s->skt_mutex);
+
+	return ret;
+}
+
+static int pcmcia_socket_dev_suspend_noirq(struct device *dev)
+{
+	return __pcmcia_pm_op(dev, socket_suspend);
+}
+
+static int pcmcia_socket_dev_resume_noirq(struct device *dev)
+{
+	return __pcmcia_pm_op(dev, socket_early_resume);
+}
+
+static int pcmcia_socket_dev_resume(struct device *dev)
+{
+	return __pcmcia_pm_op(dev, socket_late_resume);
+}
+
+static const struct dev_pm_ops pcmcia_socket_pm_ops = {
+	/* dev_resume may be called with IRQs enabled */
+	SET_SYSTEM_SLEEP_PM_OPS(NULL,
+				pcmcia_socket_dev_resume)
+
+	/* late suspend must be called with IRQs disabled */
+	.suspend_noirq = pcmcia_socket_dev_suspend_noirq,
+	.freeze_noirq = pcmcia_socket_dev_suspend_noirq,
+	.poweroff_noirq = pcmcia_socket_dev_suspend_noirq,
+
+	/* early resume must be called with IRQs disabled */
+	.resume_noirq = pcmcia_socket_dev_resume_noirq,
+	.thaw_noirq = pcmcia_socket_dev_resume_noirq,
+	.restore_noirq = pcmcia_socket_dev_resume_noirq,
+};
+
+#define PCMCIA_SOCKET_CLASS_PM_OPS (&pcmcia_socket_pm_ops)
+
+#else /* CONFIG_PM */
+
+#define PCMCIA_SOCKET_CLASS_PM_OPS NULL
+
+#endif /* CONFIG_PM */
+
 struct class pcmcia_socket_class = {
 	.name = "pcmcia_socket",
 	.dev_uevent = pcmcia_socket_uevent,
 	.dev_release = pcmcia_release_socket,
 	.class_release = pcmcia_release_socket_class,
+	.pm = PCMCIA_SOCKET_CLASS_PM_OPS,
 };
 EXPORT_SYMBOL(pcmcia_socket_class);
 
diff --git a/drivers/pcmcia/db1xxx_ss.c b/drivers/pcmcia/db1xxx_ss.c
index 9254ab0..a520193 100644
--- a/drivers/pcmcia/db1xxx_ss.c
+++ b/drivers/pcmcia/db1xxx_ss.c
@@ -558,37 +558,10 @@ static int __devexit db1x_pcmcia_socket_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM
-static int db1x_pcmcia_suspend(struct device *dev)
-{
-	return pcmcia_socket_dev_suspend(dev);
-}
-
-static int db1x_pcmcia_resume(struct device *dev)
-{
-	return pcmcia_socket_dev_resume(dev);
-}
-
-static struct dev_pm_ops db1x_pcmcia_pmops = {
-	.resume		= db1x_pcmcia_resume,
-	.suspend	= db1x_pcmcia_suspend,
-	.thaw		= db1x_pcmcia_resume,
-	.freeze		= db1x_pcmcia_suspend,
-};
-
-#define DB1XXX_SS_PMOPS &db1x_pcmcia_pmops
-
-#else
-
-#define DB1XXX_SS_PMOPS NULL
-
-#endif
-
 static struct platform_driver db1x_pcmcia_socket_driver = {
 	.driver	= {
 		.name	= "db1xxx_pcmcia",
 		.owner	= THIS_MODULE,
-		.pm	= DB1XXX_SS_PMOPS
 	},
 	.probe		= db1x_pcmcia_socket_probe,
 	.remove		= __devexit_p(db1x_pcmcia_socket_remove),
diff --git a/drivers/pcmcia/i82092.c b/drivers/pcmcia/i82092.c
index f5da626..3003bb3 100644
--- a/drivers/pcmcia/i82092.c
+++ b/drivers/pcmcia/i82092.c
@@ -39,27 +39,11 @@ static struct pci_device_id i82092aa_pci_ids[] = {
 };
 MODULE_DEVICE_TABLE(pci, i82092aa_pci_ids);
 
-#ifdef CONFIG_PM
-static int i82092aa_socket_suspend (struct pci_dev *dev, pm_message_t state)
-{
-	return pcmcia_socket_dev_suspend(&dev->dev);
-}
-
-static int i82092aa_socket_resume (struct pci_dev *dev)
-{
-	return pcmcia_socket_dev_resume(&dev->dev);
-}
-#endif
-
 static struct pci_driver i82092aa_pci_driver = {
 	.name           = "i82092aa",
 	.id_table       = i82092aa_pci_ids,
 	.probe          = i82092aa_pci_probe,
 	.remove         = __devexit_p(i82092aa_pci_remove),
-#ifdef CONFIG_PM
-	.suspend        = i82092aa_socket_suspend,
-	.resume         = i82092aa_socket_resume,
-#endif
 };
 
 
diff --git a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c
index c13fd93..d53d9b5 100644
--- a/drivers/pcmcia/i82365.c
+++ b/drivers/pcmcia/i82365.c
@@ -1223,16 +1223,7 @@ static int pcic_init(struct pcmcia_socket *s)
 	return 0;
 }
 
-static int i82365_drv_pcmcia_suspend(struct platform_device *dev,
-				     pm_message_t state)
-{
-	return pcmcia_socket_dev_suspend(&dev->dev);
-}
 
-static int i82365_drv_pcmcia_resume(struct platform_device *dev)
-{
-	return pcmcia_socket_dev_resume(&dev->dev);
-}
 static struct pccard_operations pcic_operations = {
 	.init			= pcic_init,
 	.get_status		= pcic_get_status,
@@ -1248,8 +1239,6 @@ static struct platform_driver i82365_driver = {
 		.name = "i82365",
 		.owner		= THIS_MODULE,
 	},
-	.suspend 	= i82365_drv_pcmcia_suspend,
-	.resume 	= i82365_drv_pcmcia_resume,
 };
 
 static struct platform_device *i82365_device;
diff --git a/drivers/pcmcia/m32r_cfc.c b/drivers/pcmcia/m32r_cfc.c
index 0ece2cd..ab21264 100644
--- a/drivers/pcmcia/m32r_cfc.c
+++ b/drivers/pcmcia/m32r_cfc.c
@@ -685,16 +685,7 @@ static struct pccard_operations pcc_operations = {
 	.set_mem_map		= pcc_set_mem_map,
 };
 
-static int cfc_drv_pcmcia_suspend(struct platform_device *dev,
-				     pm_message_t state)
-{
-	return pcmcia_socket_dev_suspend(&dev->dev);
-}
 
-static int cfc_drv_pcmcia_resume(struct platform_device *dev)
-{
-	return pcmcia_socket_dev_resume(&dev->dev);
-}
 /*====================================================================*/
 
 static struct platform_driver pcc_driver = {
@@ -702,8 +693,6 @@ static struct platform_driver pcc_driver = {
 		.name		= "cfc",
 		.owner		= THIS_MODULE,
 	},
-	.suspend 	= cfc_drv_pcmcia_suspend,
-	.resume 	= cfc_drv_pcmcia_resume,
 };
 
 static struct platform_device pcc_device = {
diff --git a/drivers/pcmcia/m32r_pcc.c b/drivers/pcmcia/m32r_pcc.c
index 72844c5..0caf3db 100644
--- a/drivers/pcmcia/m32r_pcc.c
+++ b/drivers/pcmcia/m32r_pcc.c
@@ -663,16 +663,6 @@ static struct pccard_operations pcc_operations = {
 	.set_mem_map		= pcc_set_mem_map,
 };
 
-static int pcc_drv_pcmcia_suspend(struct platform_device *dev,
-				     pm_message_t state)
-{
-	return pcmcia_socket_dev_suspend(&dev->dev);
-}
-
-static int pcc_drv_pcmcia_resume(struct platform_device *dev)
-{
-	return pcmcia_socket_dev_resume(&dev->dev);
-}
 /*====================================================================*/
 
 static struct platform_driver pcc_driver = {
@@ -680,8 +670,6 @@ static struct platform_driver pcc_driver = {
 		.name		= "pcc",
 		.owner		= THIS_MODULE,
 	},
-	.suspend 	= pcc_drv_pcmcia_suspend,
-	.resume 	= pcc_drv_pcmcia_resume,
 };
 
 static struct platform_device pcc_device = {
diff --git a/drivers/pcmcia/m8xx_pcmcia.c b/drivers/pcmcia/m8xx_pcmcia.c
index 61c2159..01ef7de 100644
--- a/drivers/pcmcia/m8xx_pcmcia.c
+++ b/drivers/pcmcia/m8xx_pcmcia.c
@@ -1288,21 +1288,6 @@ static int m8xx_remove(struct of_device *ofdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM
-static int m8xx_suspend(struct platform_device *pdev, pm_message_t state)
-{
-	return pcmcia_socket_dev_suspend(&pdev->dev);
-}
-
-static int m8xx_resume(struct platform_device *pdev)
-{
-	return pcmcia_socket_dev_resume(&pdev->dev);
-}
-#else
-#define m8xx_suspend NULL
-#define m8xx_resume NULL
-#endif
-
 static const struct of_device_id m8xx_pcmcia_match[] = {
 	{
 	 .type = "pcmcia",
@@ -1318,8 +1303,6 @@ static struct of_platform_driver m8xx_pcmcia_driver = {
 	.match_table = m8xx_pcmcia_match,
 	.probe = m8xx_probe,
 	.remove = m8xx_remove,
-	.suspend = m8xx_suspend,
-	.resume = m8xx_resume,
 };
 
 static int __init m8xx_init(void)
diff --git a/drivers/pcmcia/omap_cf.c b/drivers/pcmcia/omap_cf.c
index 7d49ba0..eef5f1c 100644
--- a/drivers/pcmcia/omap_cf.c
+++ b/drivers/pcmcia/omap_cf.c
@@ -330,24 +330,12 @@ static int __exit omap_cf_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static int omap_cf_suspend(struct platform_device *pdev, pm_message_t mesg)
-{
-	return pcmcia_socket_dev_suspend(&pdev->dev);
-}
-
-static int omap_cf_resume(struct platform_device *pdev)
-{
-	return pcmcia_socket_dev_resume(&pdev->dev);
-}
-
 static struct platform_driver omap_cf_driver = {
 	.driver = {
 		.name	= (char *) driver_name,
 		.owner	= THIS_MODULE,
 	},
 	.remove		= __exit_p(omap_cf_remove),
-	.suspend	= omap_cf_suspend,
-	.resume		= omap_cf_resume,
 };
 
 static int __init omap_cf_init(void)
diff --git a/drivers/pcmcia/pd6729.c b/drivers/pcmcia/pd6729.c
index 47f342f..4a34268 100644
--- a/drivers/pcmcia/pd6729.c
+++ b/drivers/pcmcia/pd6729.c
@@ -764,18 +764,6 @@ static void __devexit pd6729_pci_remove(struct pci_dev *dev)
 	kfree(socket);
 }
 
-#ifdef CONFIG_PM
-static int pd6729_socket_suspend(struct pci_dev *dev, pm_message_t state)
-{
-	return pcmcia_socket_dev_suspend(&dev->dev);
-}
-
-static int pd6729_socket_resume(struct pci_dev *dev)
-{
-	return pcmcia_socket_dev_resume(&dev->dev);
-}
-#endif
-
 static struct pci_device_id pd6729_pci_ids[] = {
 	{
 		.vendor		= PCI_VENDOR_ID_CIRRUS,
@@ -792,10 +780,6 @@ static struct pci_driver pd6729_pci_driver = {
 	.id_table	= pd6729_pci_ids,
 	.probe		= pd6729_pci_probe,
 	.remove		= __devexit_p(pd6729_pci_remove),
-#ifdef CONFIG_PM
-	.suspend	= pd6729_socket_suspend,
-	.resume		= pd6729_socket_resume,
-#endif
 };
 
 static int pd6729_module_init(void)
diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c
index 76e640b..0a876fa 100644
--- a/drivers/pcmcia/pxa2xx_base.c
+++ b/drivers/pcmcia/pxa2xx_base.c
@@ -325,19 +325,13 @@ static int pxa2xx_drv_pcmcia_remove(struct platform_device *dev)
 	return 0;
 }
 
-static int pxa2xx_drv_pcmcia_suspend(struct device *dev)
-{
-	return pcmcia_socket_dev_suspend(dev);
-}
-
 static int pxa2xx_drv_pcmcia_resume(struct device *dev)
 {
 	pxa2xx_configure_sockets(dev);
-	return pcmcia_socket_dev_resume(dev);
+	return 0;
 }
 
 static const struct dev_pm_ops pxa2xx_drv_pcmcia_pm_ops = {
-	.suspend	= pxa2xx_drv_pcmcia_suspend,
 	.resume		= pxa2xx_drv_pcmcia_resume,
 };
 
diff --git a/drivers/pcmcia/sa1100_generic.c b/drivers/pcmcia/sa1100_generic.c
index 8db86b9..5188962 100644
--- a/drivers/pcmcia/sa1100_generic.c
+++ b/drivers/pcmcia/sa1100_generic.c
@@ -95,17 +95,6 @@ static int sa11x0_drv_pcmcia_remove(struct platform_device *dev)
 	return 0;
 }
 
-static int sa11x0_drv_pcmcia_suspend(struct platform_device *dev,
-				     pm_message_t state)
-{
-	return pcmcia_socket_dev_suspend(&dev->dev);
-}
-
-static int sa11x0_drv_pcmcia_resume(struct platform_device *dev)
-{
-	return pcmcia_socket_dev_resume(&dev->dev);
-}
-
 static struct platform_driver sa11x0_pcmcia_driver = {
 	.driver = {
 		.name		= "sa11x0-pcmcia",
@@ -113,8 +102,6 @@ static struct platform_driver sa11x0_pcmcia_driver = {
 	},
 	.probe		= sa11x0_drv_pcmcia_probe,
 	.remove		= sa11x0_drv_pcmcia_remove,
-	.suspend 	= sa11x0_drv_pcmcia_suspend,
-	.resume 	= sa11x0_drv_pcmcia_resume,
 };
 
 /* sa11x0_pcmcia_init()
diff --git a/drivers/pcmcia/sa1111_generic.c b/drivers/pcmcia/sa1111_generic.c
index db79ca6..799e979 100644
--- a/drivers/pcmcia/sa1111_generic.c
+++ b/drivers/pcmcia/sa1111_generic.c
@@ -213,16 +213,6 @@ static int __devexit pcmcia_remove(struct sa1111_dev *dev)
 	return 0;
 }
 
-static int pcmcia_suspend(struct sa1111_dev *dev, pm_message_t state)
-{
-	return pcmcia_socket_dev_suspend(&dev->dev);
-}
-
-static int pcmcia_resume(struct sa1111_dev *dev)
-{
-	return pcmcia_socket_dev_resume(&dev->dev);
-}
-
 static struct sa1111_driver pcmcia_driver = {
 	.drv = {
 		.name	= "sa1111-pcmcia",
@@ -230,8 +220,6 @@ static struct sa1111_driver pcmcia_driver = {
 	.devid		= SA1111_DEVID_PCMCIA,
 	.probe		= pcmcia_probe,
 	.remove		= __devexit_p(pcmcia_remove),
-	.suspend	= pcmcia_suspend,
-	.resume		= pcmcia_resume,
 };
 
 static int __init sa1111_drv_pcmcia_init(void)
diff --git a/drivers/pcmcia/tcic.c b/drivers/pcmcia/tcic.c
index 12c49ee..bac85f3 100644
--- a/drivers/pcmcia/tcic.c
+++ b/drivers/pcmcia/tcic.c
@@ -348,16 +348,6 @@ static int __init get_tcic_id(void)
     return id;
 }
 
-static int tcic_drv_pcmcia_suspend(struct platform_device *dev,
-				     pm_message_t state)
-{
-	return pcmcia_socket_dev_suspend(&dev->dev);
-}
-
-static int tcic_drv_pcmcia_resume(struct platform_device *dev)
-{
-	return pcmcia_socket_dev_resume(&dev->dev);
-}
 /*====================================================================*/
 
 static struct platform_driver tcic_driver = {
@@ -365,8 +355,6 @@ static struct platform_driver tcic_driver = {
 		.name = "tcic-pcmcia",
 		.owner		= THIS_MODULE,
 	},
-	.suspend 	= tcic_drv_pcmcia_suspend,
-	.resume 	= tcic_drv_pcmcia_resume,
 };
 
 static struct platform_device tcic_device = {
diff --git a/drivers/pcmcia/vrc4171_card.c b/drivers/pcmcia/vrc4171_card.c
index aaccdb9..86e4a1a 100644
--- a/drivers/pcmcia/vrc4171_card.c
+++ b/drivers/pcmcia/vrc4171_card.c
@@ -705,24 +705,11 @@ static int __devinit vrc4171_card_setup(char *options)
 
 __setup("vrc4171_card=", vrc4171_card_setup);
 
-static int vrc4171_card_suspend(struct platform_device *dev,
-				     pm_message_t state)
-{
-	return pcmcia_socket_dev_suspend(&dev->dev);
-}
-
-static int vrc4171_card_resume(struct platform_device *dev)
-{
-	return pcmcia_socket_dev_resume(&dev->dev);
-}
-
 static struct platform_driver vrc4171_card_driver = {
 	.driver = {
 		.name		= vrc4171_card_name,
 		.owner		= THIS_MODULE,
 	},
-	.suspend	= vrc4171_card_suspend,
-	.resume		= vrc4171_card_resume,
 };
 
 static int __devinit vrc4171_card_init(void)
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
index 418988a..f19ad02 100644
--- a/drivers/pcmcia/yenta_socket.c
+++ b/drivers/pcmcia/yenta_socket.c
@@ -1290,12 +1290,9 @@ static int yenta_dev_suspend_noirq(struct device *dev)
 {
 	struct pci_dev *pdev = to_pci_dev(dev);
 	struct yenta_socket *socket = pci_get_drvdata(pdev);
-	int ret;
-
-	ret = pcmcia_socket_dev_suspend(dev);
 
 	if (!socket)
-		return ret;
+		return 0;
 
 	if (socket->type && socket->type->save_state)
 		socket->type->save_state(socket);
@@ -1312,7 +1309,7 @@ static int yenta_dev_suspend_noirq(struct device *dev)
 	 */
 	/* pci_set_power_state(dev, 3); */
 
-	return ret;
+	return 0;
 }
 
 static int yenta_dev_resume_noirq(struct device *dev)
@@ -1336,26 +1333,16 @@ static int yenta_dev_resume_noirq(struct device *dev)
 	if (socket->type && socket->type->restore_state)
 		socket->type->restore_state(socket);
 
-	pcmcia_socket_dev_early_resume(dev);
-	return 0;
-}
-
-static int yenta_dev_resume(struct device *dev)
-{
-	pcmcia_socket_dev_late_resume(dev);
 	return 0;
 }
 
 static const struct dev_pm_ops yenta_pm_ops = {
 	.suspend_noirq = yenta_dev_suspend_noirq,
 	.resume_noirq = yenta_dev_resume_noirq,
-	.resume = yenta_dev_resume,
 	.freeze_noirq = yenta_dev_suspend_noirq,
 	.thaw_noirq = yenta_dev_resume_noirq,
-	.thaw = yenta_dev_resume,
 	.poweroff_noirq = yenta_dev_suspend_noirq,
 	.restore_noirq = yenta_dev_resume_noirq,
-	.restore = yenta_dev_resume,
 };
 
 #define YENTA_PM_OPS	(&yenta_pm_ops)
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h
index 313c912..5a109c8 100644
--- a/include/pcmcia/ss.h
+++ b/include/pcmcia/ss.h
@@ -275,12 +275,6 @@ extern struct pccard_resource_ops pccard_nonstatic_ops;
 #endif
 
 
-/* socket drivers are expected to use these callbacks in their .drv struct */
-extern int pcmcia_socket_dev_suspend(struct device *dev);
-extern void pcmcia_socket_dev_early_resume(struct device *dev);
-extern void pcmcia_socket_dev_late_resume(struct device *dev);
-extern int pcmcia_socket_dev_resume(struct device *dev);
-
 /* socket drivers use this callback in their IRQ handler */
 extern void pcmcia_parse_events(struct pcmcia_socket *socket,
 				unsigned int events);
-- 
1.6.3.3



From jkosina at suse.cz  Sun Mar 21 19:17:42 2010
From: jkosina at suse.cz (Jiri Kosina)
Date: Mon, 22 Mar 2010 00:17:42 +0100 (CET)
Subject: [RFC PATCH 12/19] pcmcia: dev_node removal (remaining drivers)
In-Reply-To: <1269212857-25364-12-git-send-email-linux@dominikbrodowski.net>
References: <20100321230617.GA24791@comet.dominikbrodowski.net>
	<1269212857-25364-12-git-send-email-linux@dominikbrodowski.net>
Message-ID: <alpine.LNX.2.00.1003220017170.18642@pobox.suse.cz>

On Mon, 22 Mar 2010, Dominik Brodowski wrote:

> As a fourth step, remove any remaining usages of
> dev_node_t from drivers:
> 
> - ipwireless can be simplified a bit, as we do not need
>   to pass around the (write-only) dev_node_t around.
> 
> - avma1_cs can be simplified as well, if we only keep the
>   minor number around as "priv" data, not a full-fledged
>   struct.
> 
> CC: Jiri Kosina <jkosina at suse.cz>
> CC: David Sterba <dsterba at suse.cz>
> CC: Karsten Keil <isdn at linux-pingi.de>
> Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>

Acked-by: Jiri Kosina <jkosina at suse.cz>

Thanks Dominik.

-- 
Jiri Kosina
SUSE Labs, Novell Inc.


From komurojun-mbn at nifty.com  Sun Mar 21 20:40:22 2010
From: komurojun-mbn at nifty.com (Komuro)
Date: Mon, 22 Mar 2010 09:40:22 +0900
Subject: [BUG? kernel 2.6.34-rc1-git8] cs: IO port probe 0x0-0xcf7: clean.
In-Reply-To: <20100321065539.57cb2c96.komurojun-mbn@nifty.com>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<1257971899-9274-9-git-send-email-linux@dominikbrodowski.net>
	<20091213212556.03d83e1f.komurojun-mbn@nifty.com>
	<20100228153933.f6fe6f81.komurojun-mbn@nifty.com>
	<20100320063919.f7cd4421.komurojun-mbn@nifty.com>
	<20100321065539.57cb2c96.komurojun-mbn@nifty.com>
Message-ID: <20100322094022.742e85a9.komurojun-mbn@nifty.com>

Hi,

>> I don't add "include port 0x0-0xcf7" in /etc/pcmcia/config.opts.
>> but recent kernel probes this ioport range ...
>
>That's because the parent PCI bridge offers these resources for downstream
>users, such as yenta_cardbus. So that's not a bug.


Actually, ioport 0x0-0xff is used for onboard legacy devices.
So it should be excluded?


0000-0cf7 : PCI Bus 0000:00
  0000-001f : dma1
  0020-0021 : pic1
  0040-0043 : timer0
  0050-0053 : timer1
  0060-0060 : keyboard
  0064-0064 : keyboard
  0070-0077 : rtc0
  0080-008f : dma page reg
  00a0-00a1 : pic2
  00c0-00df : dma2
  00f0-00ff : fpu


From isdn at linux-pingi.de  Mon Mar 22 01:22:28 2010
From: isdn at linux-pingi.de (Karsten Keil)
Date: Mon, 22 Mar 2010 06:22:28 +0100
Subject: [RFC PATCH 10/19] pcmcia: dev_node removal (drivers with updated
	printk call)
In-Reply-To: <1269212857-25364-10-git-send-email-linux@dominikbrodowski.net>
References: <20100321230617.GA24791@comet.dominikbrodowski.net>
	<1269212857-25364-10-git-send-email-linux@dominikbrodowski.net>
Message-ID: <201003220622.28507.isdn@linux-pingi.de>

On Montag, 22. M?rz 2010 00:07:28 Dominik Brodowski wrote:
> As a second step, remove any usage of dev_node_t from drivers which
> only wrote to this typedef/struct, except one printk() which can
> easily be replaced by a dev_info()/dev_warn() call.
> 
> CC: Harald Welte <laforge at gnumonks.org>
> CC: linux-ide at vger.kernel.org
> CC: Karsten Keil <isdn at linux-pingi.de>
> CC: linux-wireless at vger.kernel.org
> CC: netdev at vger.kernel.org
> CC: linux-usb at vger.kernel.org
> Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>

Acked-by: Karsten Keil  <isdn at linux-pingi.de>

Thanks.


From isdn at linux-pingi.de  Mon Mar 22 01:23:54 2010
From: isdn at linux-pingi.de (Karsten Keil)
Date: Mon, 22 Mar 2010 06:23:54 +0100
Subject: [RFC PATCH 12/19] pcmcia: dev_node removal (remaining drivers)
In-Reply-To: <1269212857-25364-12-git-send-email-linux@dominikbrodowski.net>
References: <20100321230617.GA24791@comet.dominikbrodowski.net>
	<1269212857-25364-12-git-send-email-linux@dominikbrodowski.net>
Message-ID: <201003220623.54633.isdn@linux-pingi.de>

On Montag, 22. M?rz 2010 00:07:30 Dominik Brodowski wrote:
> As a fourth step, remove any remaining usages of
> dev_node_t from drivers:
> 
> - ipwireless can be simplified a bit, as we do not need
>   to pass around the (write-only) dev_node_t around.
> 
> - avma1_cs can be simplified as well, if we only keep the
>   minor number around as "priv" data, not a full-fledged
>   struct.
> 
> CC: Jiri Kosina <jkosina at suse.cz>
> CC: David Sterba <dsterba at suse.cz>
> CC: Karsten Keil <isdn at linux-pingi.de>
> Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
> 
Acked-by: Karsten Keil  <isdn at linux-pingi.de>

Thanks.


From linux at dominikbrodowski.net  Mon Mar 22 04:27:02 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 22 Mar 2010 09:27:02 +0100
Subject: [BUG? kernel 2.6.34-rc1-git8] cs: IO port probe 0x0-0xcf7: clean.
In-Reply-To: <20100322094022.742e85a9.komurojun-mbn@nifty.com>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<1257971899-9274-9-git-send-email-linux@dominikbrodowski.net>
	<20091213212556.03d83e1f.komurojun-mbn@nifty.com>
	<20100228153933.f6fe6f81.komurojun-mbn@nifty.com>
	<20100320063919.f7cd4421.komurojun-mbn@nifty.com>
	<20100321065539.57cb2c96.komurojun-mbn@nifty.com>
	<20100322094022.742e85a9.komurojun-mbn@nifty.com>
Message-ID: <20100322082702.GA22975@isilmar.linta.de>

Hey,

On Mon, Mar 22, 2010 at 09:40:22AM +0900, Komuro wrote:
> >> I don't add "include port 0x0-0xcf7" in /etc/pcmcia/config.opts.
> >> but recent kernel probes this ioport range ...
> >
> >That's because the parent PCI bridge offers these resources for downstream
> >users, such as yenta_cardbus. So that's not a bug.
> 
> 
> Actually, ioport 0x0-0xff is used for onboard legacy devices.
> So it should be excluded?

Probably -- and none of the devices listed below seem to actually be PCI
devcices... However, I have no idea why there is a "PCI Bus 0000:00" here.
Oh wait. Is this the PC in which both pd6729 and yenta_socket are installed?

Its dmesg contained:

pci_root PNP0A03:00: host bridge window [io  0x0000-0x0cf7] (ignored)
	[because of pci=use_crs being disabled on this system)

but later on

pci 0000:00:11.6: reg 10: [io  0x0000-0x00ff]

this PCI device actually requests io from 0x00 to 0xff! Which PCI device is
it? Later on:

pnp 00:0a: disabling [io  0x0010-0x001f] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x0022-0x003f] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x0044-0x005f] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x0062-0x0063] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x0065-0x006f] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x0072-0x007f] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x0080] because it overlaps 0000:00:11.6 BAR 0 [io 0x0000-0x00ff]
pnp 00:0a: disabling [io  0x0084-0x0086] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x0088] because it overlaps 0000:00:11.6 BAR 0 [io 0x0000-0x00ff]
pnp 00:0a: disabling [io  0x008c-0x008e] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x0090-0x009f] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x00a2-0x00bf] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x00e0-0x00ef] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]

So -- we could either manually exclude <0xff on x86{_64}, we could ask the
PCI people to fix this (or why they consider 0x00-0xff to be valid here)...
What do you think?

Best,
	Dominik

> 0000-0cf7 : PCI Bus 0000:00
>   0000-001f : dma1
>   0020-0021 : pic1
>   0040-0043 : timer0
>   0050-0053 : timer1
>   0060-0060 : keyboard
>   0064-0064 : keyboard
>   0070-0077 : rtc0
>   0080-008f : dma page reg
>   00a0-00a1 : pic2
>   00c0-00df : dma2
>   00f0-00ff : fpu
> 
> _______________________________________________
> Linux PCMCIA reimplementation list
> http://lists.infradead.org/mailman/listinfo/linux-pcmcia


From linux at dominikbrodowski.net  Mon Mar 22 04:30:31 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 22 Mar 2010 09:30:31 +0100
Subject: [BUG? kernel 2.6.34-rc1-git8] cs: IO port probe 0x0-0xcf7: clean.
In-Reply-To: <20100322082702.GA22975@isilmar.linta.de>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<1257971899-9274-9-git-send-email-linux@dominikbrodowski.net>
	<20091213212556.03d83e1f.komurojun-mbn@nifty.com>
	<20100228153933.f6fe6f81.komurojun-mbn@nifty.com>
	<20100320063919.f7cd4421.komurojun-mbn@nifty.com>
	<20100321065539.57cb2c96.komurojun-mbn@nifty.com>
	<20100322094022.742e85a9.komurojun-mbn@nifty.com>
	<20100322082702.GA22975@isilmar.linta.de>
Message-ID: <20100322083031.GA25859@isilmar.linta.de>

Addendum:

Could you send a "lspci -vvv" (again), please? Also, what's
s->cb_dev->bus->number ?

Best,
	Dominik


From komurojun-mbn at nifty.com  Mon Mar 22 05:38:32 2010
From: komurojun-mbn at nifty.com (Komuro)
Date: Mon, 22 Mar 2010 18:38:32 +0900
Subject: [BUG? kernel 2.6.34-rc1-git8] cs: IO port probe 0x0-0xcf7: clean.
In-Reply-To: <20100322094022.742e85a9.komurojun-mbn@nifty.com>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<1257971899-9274-9-git-send-email-linux@dominikbrodowski.net>
	<20091213212556.03d83e1f.komurojun-mbn@nifty.com>
	<20100228153933.f6fe6f81.komurojun-mbn@nifty.com>
	<20100320063919.f7cd4421.komurojun-mbn@nifty.com>
	<20100321065539.57cb2c96.komurojun-mbn@nifty.com>
	<20100322094022.742e85a9.komurojun-mbn@nifty.com>
Message-ID: <20100322183832.f07b9191.komurojun-mbn@nifty.com>

Hi,

>> Actually, ioport 0x0-0xff is used for onboard legacy devices.
>> So it should be excluded?
>
>Probably -- and none of the devices listed below seem to actually be PCI
>devcices... However, I have no idea why there is a "PCI Bus 0000:00" here.
>Oh wait. Is this the PC in which both pd6729 and yenta_socket are installed?

sorry,
This PC is different with the PC with pd6729 and yenta_socket are installed.

Here is the dmesg and lspci -vvv


[dmesg]
Initializing cgroup subsys cpuset
Initializing cgroup subsys cpu
Linux version 2.6.34-rc2 (root at localhost.localdomain) (gcc version 4.4.0 20090506 (Red Hat 4.4.0-4) (GCC) ) #1 SMP Sun Mar 21 20:58:10 JST 2010
BIOS-provided physical RAM map:
 BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
 BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
 BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved)
 BIOS-e820: 0000000000100000 - 00000000b7b6c000 (usable)
 BIOS-e820: 00000000b7b6c000 - 00000000b7bbf000 (reserved)
 BIOS-e820: 00000000b7bbf000 - 00000000b7c86000 (usable)
 BIOS-e820: 00000000b7c86000 - 00000000b7cbf000 (ACPI NVS)
 BIOS-e820: 00000000b7cbf000 - 00000000b7ced000 (usable)
 BIOS-e820: 00000000b7ced000 - 00000000b7cff000 (ACPI data)
 BIOS-e820: 00000000b7cff000 - 00000000b7d00000 (usable)
 BIOS-e820: 00000000b7d00000 - 00000000c0000000 (reserved)
 BIOS-e820: 00000000f8000000 - 00000000fc000000 (reserved)
 BIOS-e820: 00000000fec00000 - 00000000fec01000 (reserved)
 BIOS-e820: 00000000fed10000 - 00000000fed14000 (reserved)
 BIOS-e820: 00000000fed18000 - 00000000fed1a000 (reserved)
 BIOS-e820: 00000000fed1c000 - 00000000fed20000 (reserved)
 BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved)
 BIOS-e820: 00000000fff00000 - 0000000100000000 (reserved)
 BIOS-e820: 0000000100000000 - 0000000140000000 (usable)
NX (Execute Disable) protection: active
DMI 2.4 present.
e820 update range: 0000000000000000 - 0000000000001000 (usable) ==> (reserved)
e820 remove range: 00000000000a0000 - 0000000000100000 (usable)
last_pfn = 0x140000 max_arch_pfn = 0x1000000
MTRR default type: uncachable
MTRR fixed ranges enabled:
  00000-9FFFF write-back
  A0000-CFFFF uncachable
  D0000-DFFFF write-protect
  E0000-FFFFF uncachable
MTRR variable ranges enabled:
  0 base 0FFFE0000 mask FFFFE0000 write-protect
  1 base 000000000 mask F80000000 write-back
  2 base 080000000 mask FC0000000 write-back
  3 base 0B8000000 mask FF8000000 uncachable
  4 base 0B7E00000 mask FFFE00000 uncachable
  5 base 0B7D00000 mask FFFF00000 uncachable
  6 base 100000000 mask FC0000000 write-back
  7 disabled
x86 PAT enabled: cpu 0, old 0x7040600070406, new 0x7010600070106
initial memory mapped : 0 - 00e00000
init_memory_mapping: 0000000000000000-00000000375fe000
 0000000000 - 0000200000 page 4k
 0000200000 - 0037400000 page 2M
 0037400000 - 00375fe000 page 4k
kernel direct mapping tables up to 375fe000 @ 7000-f000
RAMDISK: 37ce2000 - 37fef817
Allocated new RAMDISK: 009f5000 - 00d02817
Move RAMDISK from 0000000037ce2000 - 0000000037fef816 to 009f5000 - 00d02816
ACPI: RSDP 000fe020 00024 (v02 TOSINV)
ACPI: XSDT b7cfe120 00064 (v01 TOSINV TOSINV00 00000001      01000013)
ACPI: FACP b7cfd000 000F4 (v04 TOSINV TOSINV00 00000001 MSFT 01000013)
ACPI: DSDT b7cf0000 08FA8 (v01 TOSINV TOSINV00 00000001 MSFT 01000013)
ACPI: FACS b7c93000 00040
ACPI: HPET b7cfc000 00038 (v01 TOSINV TOSINV00 00000001 MSFT 01000013)
ACPI: APIC b7cfb000 0006C (v02 TOSINV TOSINV00 00000001 MSFT 01000013)
ACPI: MCFG b7cfa000 0003C (v01 TOSINV TOSINV00 00000001 MSFT 01000013)
ACPI: ASF! b7cf9000 000A5 (v32 TOSINV TOSINV00 00000001 MSFT 01000013)
ACPI: SLIC b7cef000 00176 (v01 TOSINV TOSINV00 00000001 MSFT 01000013)
ACPI: BOOT b7cee000 00028 (v01 TOSINV TOSINV00 00000001 MSFT 01000013)
ACPI: SSDT b7ced000 00655 (v01  PmRef    CpuPm 00003000 INTL 20051117)
ACPI: Local APIC address 0xfee00000
4234MB HIGHMEM available.
885MB LOWMEM available.
  mapped low ram: 0 - 375fe000
  low ram: 0 - 375fe000
Zone PFN ranges:
  DMA      0x00000001 -> 0x00001000
  Normal   0x00001000 -> 0x000375fe
  HighMem  0x000375fe -> 0x00140000
Movable zone start PFN for each node
early_node_map[6] active PFN ranges
    0: 0x00000001 -> 0x0000009f
    0: 0x00000100 -> 0x000b7b6c
    0: 0x000b7bbf -> 0x000b7c86
    0: 0x000b7cbf -> 0x000b7ced
    0: 0x000b7cff -> 0x000b7d00
    0: 0x00100000 -> 0x00140000
On node 0 totalpages: 1014784
free_area_init_node: node 0, pgdat c089d580, node_mem_map c1001020
  DMA zone: 32 pages used for memmap
  DMA zone: 0 pages reserved
  DMA zone: 3966 pages, LIFO batch:0
  Normal zone: 1740 pages used for memmap
  Normal zone: 220978 pages, LIFO batch:31
  HighMem zone: 8469 pages used for memmap
  HighMem zone: 779599 pages, LIFO batch:31
Using APIC driver default
ACPI: PM-Timer IO Port: 0x408
ACPI: Local APIC address 0xfee00000
ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)
ACPI: LAPIC (acpi_id[0x02] lapic_id[0x01] enabled)
ACPI: LAPIC (acpi_id[0x03] lapic_id[0x00] disabled)
ACPI: LAPIC (acpi_id[0x04] lapic_id[0x00] disabled)
ACPI: IOAPIC (id[0x04] address[0xfec00000] gsi_base[0])
IOAPIC[0]: apic_id 4, version 32, address 0xfec00000, GSI 0-23
ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
ACPI: IRQ0 used by override.
ACPI: IRQ2 used by override.
ACPI: IRQ9 used by override.
Using ACPI (MADT) for SMP configuration information
ACPI: HPET id: 0x8086a201 base: 0xfed00000
SMP: Allowing 4 CPUs, 2 hotplug CPUs
nr_irqs_gsi: 24
early_res array is doubled to 64 at [b000 - b7ff]
PM: Registered nosave memory: 000000000009f000 - 00000000000a0000
PM: Registered nosave memory: 00000000000a0000 - 00000000000e0000
PM: Registered nosave memory: 00000000000e0000 - 0000000000100000
Allocating PCI resources starting at c0000000 (gap: c0000000:38000000)
Booting paravirtualized kernel on bare hardware
setup_percpu: NR_CPUS:32 nr_cpumask_bits:32 nr_cpu_ids:4 nr_node_ids:1
PERCPU: Embedded 15 pages/cpu @c3a00000 s37460 r0 d23980 u524288
pcpu-alloc: s37460 r0 d23980 u524288 alloc=1*2097152
pcpu-alloc: [0] 0 1 2 3 
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 1004543
Kernel command line: ro root=UUID=60fdbf15-a0be-4500-a3b3-3fee3ef7b8b3 rhgb quiet
PID hash table entries: 4096 (order: 2, 16384 bytes)
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Enabling fast FPU save and restore... done.
Enabling unmasked SIMD FPU exception support... done.
Initializing CPU#0
allocated 26214380 bytes of page_cgroup
please try 'cgroup_disable=memory' option if you don't want memory cgroups
Subtract (56 early reservations)
  #1 [0000001000 - 0000002000]   EX TRAMPOLINE
  #2 [0000400000 - 00009ec6ac]   TEXT DATA BSS
  #3 [000009fc00 - 0000100000]   BIOS reserved
  #4 [00009ed000 - 00009f4184]             BRK
  #5 [0000002000 - 0000003000]      TRAMPOLINE
  #6 [0000003000 - 0000007000]     ACPI WAKEUP
  #7 [0000007000 - 000000b000]         PGTABLE
  #8 [00009f5000 - 0000d02817]     NEW RAMDISK
  #9 [0001000000 - 0001001000]         BOOTMEM
  #10 [0001001000 - 0003801000]         BOOTMEM
  #11 [0003801000 - 0003801004]         BOOTMEM
  #12 [0003801040 - 0003801100]         BOOTMEM
  #13 [0003801100 - 00038011a4]         BOOTMEM
  #14 [00038011c0 - 00038041c0]         BOOTMEM
  #15 [00038041c0 - 00038044dc]         BOOTMEM
  #16 [0003804500 - 0003810500]         BOOTMEM
  #17 [0003810500 - 000381052d]         BOOTMEM
  #18 [0003810540 - 000381056f]         BOOTMEM
  #19 [0003810580 - 0003810850]         BOOTMEM
  #20 [0003810880 - 00038108c0]         BOOTMEM
  #21 [00038108c0 - 0003810900]         BOOTMEM
  #22 [0003810900 - 0003810940]         BOOTMEM
  #23 [0003810940 - 0003810980]         BOOTMEM
  #24 [0003810980 - 00038109c0]         BOOTMEM
  #25 [00038109c0 - 0003810a00]         BOOTMEM
  #26 [0003810a00 - 0003810a40]         BOOTMEM
  #27 [0003810a40 - 0003810a80]         BOOTMEM
  #28 [0003810a80 - 0003810ac0]         BOOTMEM
  #29 [0003810ac0 - 0003810b00]         BOOTMEM
  #30 [0003810b00 - 0003810b40]         BOOTMEM
  #31 [0003810b40 - 0003810b80]         BOOTMEM
  #32 [0003810b80 - 0003810bc0]         BOOTMEM
  #33 [0003810bc0 - 0003810c00]         BOOTMEM
  #34 [0003810c00 - 0003810c40]         BOOTMEM
  #35 [0003810c40 - 0003810c80]         BOOTMEM
  #36 [0003810c80 - 0003810cc0]         BOOTMEM
  #37 [0003810cc0 - 0003810d00]         BOOTMEM
  #38 [0003810d00 - 0003810d40]         BOOTMEM
  #39 [0003810d40 - 0003810d50]         BOOTMEM
  #40 [0003810d80 - 0003810dbd]         BOOTMEM
  #41 [0003810dc0 - 0003810dfd]         BOOTMEM
  #42 [0003a00000 - 0003a0f000]         BOOTMEM
  #43 [0003a80000 - 0003a8f000]         BOOTMEM
  #44 [0003b00000 - 0003b0f000]         BOOTMEM
  #45 [0003b80000 - 0003b8f000]         BOOTMEM
  #46 [0003812e00 - 0003812e04]         BOOTMEM
  #47 [0003812e40 - 0003812e44]         BOOTMEM
  #48 [0003812e80 - 0003812e90]         BOOTMEM
  #49 [0003812ec0 - 0003812ed0]         BOOTMEM
  #50 [0003812f00 - 0003812f98]         BOOTMEM
  #51 [0003812fc0 - 0003812ff8]         BOOTMEM
  #52 [0003813000 - 0003817000]         BOOTMEM
  #53 [0003817000 - 0003897000]         BOOTMEM
  #54 [0003897000 - 00038d7000]         BOOTMEM
  #55 [0003b8f000 - 000548efec]         BOOTMEM
 b 20 - 80 9f
 100 100 - 400 400
 d03 d20 - 1000 1000
 3811 - 3812
 38d7 38e0 - 3a00 3a00
 3a0f 3a20 - 3a80 3a80
 3a8f 3aa0 - 3b00 3b00
 3b0f 3b20 - 3b80 3b80
 548f 54a0 - 375e0 375fe
Initializing HighMem for node 0 (000375fe:00140000)
Memory: 3982212k/5242880k available (2881k kernel code, 76924k reserved, 1876k data, 500k init, 3152272k highmem)
virtual kernel memory layout:
    fixmap  : 0xffad6000 - 0xfffff000   (5284 kB)
    pkmap   : 0xff600000 - 0xff800000   (2048 kB)
    vmalloc : 0xf7dfe000 - 0xff5fe000   ( 120 MB)
    lowmem  : 0xc0000000 - 0xf75fe000   ( 885 MB)
      .init : 0xc08a6000 - 0xc0923000   ( 500 kB)
      .data : 0xc06d0657 - 0xc08a5908   (1876 kB)
      .text : 0xc0400000 - 0xc06d0657   (2881 kB)
Checking if this processor honours the WP bit even in supervisor mode...Ok.
SLUB: Genslabs=13, HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
Hierarchical RCU implementation.
NR_IRQS:1280
Console: colour VGA+ 80x25
console [tty0] enabled
hpet clockevent registered
Fast TSC calibration using PIT
Detected 2260.931 MHz processor.
Calibrating delay loop (skipped), value calculated using timer frequency.. 4521.86 BogoMIPS (lpj=2260931)
Mount-cache hash table entries: 512
Initializing cgroup subsys ns
Initializing cgroup subsys cpuacct
Initializing cgroup subsys memory
Initializing cgroup subsys devices
Initializing cgroup subsys freezer
CPU: Physical Processor ID: 0
CPU: Processor Core ID: 0
mce: CPU supports 6 MCE banks
CPU0: Thermal monitoring enabled (TM2)
using mwait in idle threads.
Performance Events: Core2 events, Intel PMU driver.
... version:                2
... bit width:              40
... generic registers:      2
... value mask:             000000ffffffffff
... max period:             000000007fffffff
... fixed-purpose events:   3
... event mask:             0000000700000003
Checking 'hlt' instruction... OK.
ACPI: Core revision 20100121
ftrace: converting mcount calls to 0f 1f 44 00 00
ftrace: allocating 16753 entries in 33 pages
Enabling APIC mode:  Flat.  Using 1 I/O APICs
..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
CPU0: Intel(R) Core(TM)2 Duo CPU     P8400  @ 2.26GHz stepping 06
Booting Node   0, Processors  #1
Initializing CPU#1
Brought up 2 CPUs
Total of 2 processors activated (9044.16 BogoMIPS).
Time: 18:22:59  Date: 03/22/10
NET: Registered protocol family 16
ACPI: bus type pci registered
PCI: MMCONFIG for domain 0000 [bus 00-3f] at [mem 0xf8000000-0xfbffffff] (base 0xf8000000)
PCI: MMCONFIG at [mem 0xf8000000-0xfbffffff] reserved in E820
PCI: Using MMCONFIG for extended config space
PCI: Using configuration type 1 for base access
bio: create slab <bio-0> at 0
ACPI: EC: Look up EC in DSDT
ACPI: Executed 1 blocks of module-level executable AML code
ACPI: BIOS _OSI(Linux) query ignored
ACPI: SSDT b7b77c18 0026B (v01  PmRef  Cpu0Ist 00003000 INTL 20051117)
ACPI: SSDT b7b75598 00537 (v01  PmRef  Cpu0Cst 00003001 INTL 20051117)
ACPI: SSDT b7b76e18 001CF (v01  PmRef    ApIst 00003000 INTL 20051117)
ACPI: SSDT b7b77f18 0008D (v01  PmRef    ApCst 00003000 INTL 20051117)
ACPI: EC: GPE storm detected, transactions will use polling mode
ACPI: Interpreter enabled
ACPI: (supports S0 S3 S4 S5)
ACPI: Using IOAPIC for interrupt routing
ACPI: EC: GPE = 0x16, I/O: command/status = 0x66, data = 0x62
ACPI: Power Resource [FN00] (on)
ACPI: No dock devices found.
PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug
ACPI: PCI Root Bridge [PCI0] (0000:00)
pci_root PNP0A08:00: host bridge window [io  0x0000-0x0cf7]
pci_root PNP0A08:00: host bridge window [io  0x0d00-0xffff]
pci_root PNP0A08:00: host bridge window [mem 0x000a0000-0x000bffff]
pci_root PNP0A08:00: host bridge window [mem 0xc0000000-0xfebfffff]
pci 0000:00:02.0: reg 10: [mem 0xd4400000-0xd47fffff 64bit]
pci 0000:00:02.0: reg 18: [mem 0xc0000000-0xcfffffff 64bit pref]
pci 0000:00:02.0: reg 20: [io  0x6140-0x6147]
pci 0000:00:02.1: reg 10: [mem 0xd7900000-0xd79fffff 64bit]
pci 0000:00:1a.0: reg 20: [io  0x60c0-0x60df]
pci 0000:00:1a.1: reg 20: [io  0x60a0-0x60bf]
pci 0000:00:1a.7: reg 10: [mem 0xdab05400-0xdab057ff]
pci 0000:00:1a.7: PME# supported from D0 D3hot D3cold
pci 0000:00:1a.7: PME# disabled
pci 0000:00:1b.0: reg 10: [mem 0xdab00000-0xdab03fff 64bit]
pci 0000:00:1b.0: PME# supported from D0 D3hot D3cold
pci 0000:00:1b.0: PME# disabled
pci 0000:00:1c.0: PME# supported from D0 D3hot D3cold
pci 0000:00:1c.0: PME# disabled
pci 0000:00:1c.1: PME# supported from D0 D3hot D3cold
pci 0000:00:1c.1: PME# disabled
pci 0000:00:1c.4: PME# supported from D0 D3hot D3cold
pci 0000:00:1c.4: PME# disabled
pci 0000:00:1d.0: reg 20: [io  0x6080-0x609f]
pci 0000:00:1d.1: reg 20: [io  0x6060-0x607f]
pci 0000:00:1d.2: reg 20: [io  0x6040-0x605f]
pci 0000:00:1d.3: reg 20: [io  0x6020-0x603f]
pci 0000:00:1d.7: reg 10: [mem 0xdab05000-0xdab053ff]
pci 0000:00:1d.7: PME# supported from D0 D3hot D3cold
pci 0000:00:1d.7: PME# disabled
pci 0000:00:1f.2: reg 10: [io  0x6138-0x613f]
pci 0000:00:1f.2: reg 14: [io  0x6154-0x6157]
pci 0000:00:1f.2: reg 18: [io  0x6130-0x6137]
pci 0000:00:1f.2: reg 1c: [io  0x6150-0x6153]
pci 0000:00:1f.2: reg 20: [io  0x6110-0x611f]
pci 0000:00:1f.2: reg 24: [io  0x6100-0x610f]
pci 0000:00:1f.3: reg 10: [mem 0xdab05800-0xdab058ff 64bit]
pci 0000:00:1f.3: reg 20: [io  0x6000-0x601f]
pci 0000:00:1f.5: reg 10: [io  0x6128-0x612f]
pci 0000:00:1f.5: reg 14: [io  0x614c-0x614f]
pci 0000:00:1f.5: reg 18: [io  0x6120-0x6127]
pci 0000:00:1f.5: reg 1c: [io  0x6148-0x614b]
pci 0000:00:1f.5: reg 20: [io  0x60f0-0x60ff]
pci 0000:00:1f.5: reg 24: [io  0x60e0-0x60ef]
pci 0000:02:00.0: reg 10: [io  0x4000-0x40ff]
pci 0000:02:00.0: reg 18: [mem 0xd4810000-0xd4810fff 64bit pref]
pci 0000:02:00.0: reg 20: [mem 0xd4800000-0xd480ffff 64bit pref]
pci 0000:02:00.0: unsupported PM cap regs version (7)
pci 0000:00:1c.0: PCI bridge to [bus 02-02]
pci 0000:00:1c.0:   bridge window [io  0x4000-0x5fff]
pci 0000:00:1c.0:   bridge window [mem 0xd9b00000-0xdaafffff]
pci 0000:00:1c.0:   bridge window [mem 0xd4800000-0xd58fffff 64bit pref]
pci 0000:03:00.0: reg 10: [mem 0xd8a00000-0xd8a0ffff 64bit]
pci 0000:03:00.0: supports D1
pci 0000:03:00.0: PME# supported from D0 D1 D3hot
pci 0000:03:00.0: PME# disabled
pci 0000:03:00.0: disabling ASPM on pre-1.1 PCIe device.  You can enable it with 'pcie_aspm=force'
pci 0000:00:1c.1: PCI bridge to [bus 03-03]
pci 0000:00:1c.1:   bridge window [io  0x3000-0x3fff]
pci 0000:00:1c.1:   bridge window [mem 0xd8a00000-0xd9afffff]
pci 0000:00:1c.1:   bridge window [mem 0xd5900000-0xd68fffff 64bit pref]
pci 0000:00:1c.4: PCI bridge to [bus 06-07]
pci 0000:00:1c.4:   bridge window [io  0x2000-0x2fff]
pci 0000:00:1c.4:   bridge window [mem 0xd7a00000-0xd89fffff]
pci 0000:00:1c.4:   bridge window [mem 0xd6900000-0xd78fffff 64bit pref]
pci 0000:04:06.0: reg 10: [mem 0xd4000000-0xd4000fff]
pci 0000:04:06.0: supports D1 D2
pci 0000:04:06.0: PME# supported from D0 D1 D2 D3hot D3cold
pci 0000:04:06.0: PME# disabled
pci 0000:00:1e.0: PCI bridge to [bus 04-05] (subtractive decode)
pci 0000:00:1e.0:   bridge window [io  0x1000-0x1fff]
pci 0000:00:1e.0:   bridge window [mem 0xd2000000-0xd40fffff]
pci 0000:00:1e.0:   bridge window [mem 0xd0000000-0xd1ffffff 64bit pref]
pci 0000:00:1e.0:   bridge window [io  0x0000-0x0cf7] (subtractive decode)
pci 0000:00:1e.0:   bridge window [io  0x0d00-0xffff] (subtractive decode)
pci 0000:00:1e.0:   bridge window [mem 0x000a0000-0x000bffff] (subtractive decode)
pci 0000:00:1e.0:   bridge window [mem 0xc0000000-0xfebfffff] (subtractive decode)
pci_bus 0000:00: on NUMA node 0
ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT]
ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.P32_._PRT]
ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.EXP1._PRT]
ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.EXP2._PRT]
ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.EXP5._PRT]
ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 *5 7 9 10 11 12)
ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 7 9 10 *11 12)
ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 7 9 10 *11 12)
ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 7 9 10 *11 12)
ACPI: PCI Interrupt Link [LNKE] (IRQs 3 4 5 7 9 10 11 12) *0, disabled.
ACPI: PCI Interrupt Link [LNKF] (IRQs 3 4 5 7 9 *10 11 12)
ACPI: PCI Interrupt Link [LNKG] (IRQs 3 4 5 7 9 10 *11 12)
ACPI: PCI Interrupt Link [LNKH] (IRQs 3 4 5 7 9 10 *11 12)
vgaarb: device added: PCI:0000:00:02.0,decodes=io+mem,owns=io+mem,locks=none
vgaarb: loaded
SCSI subsystem initialized
libata version 3.00 loaded.
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
PCI: Using ACPI for IRQ routing
PCI: pci_cache_line_size set to 64 bytes
reserve RAM buffer: 000000000009fc00 - 000000000009ffff 
reserve RAM buffer: 00000000b7b6c000 - 00000000b7ffffff 
reserve RAM buffer: 00000000b7c86000 - 00000000b7ffffff 
reserve RAM buffer: 00000000b7ced000 - 00000000b7ffffff 
reserve RAM buffer: 00000000b7d00000 - 00000000b7ffffff 
HPET: 4 timers in total, 0 timers will be used for per-cpu timer
hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0, 0
hpet0: 4 comparators, 64-bit 14.318180 MHz counter
Switching to clocksource tsc
pnp: PnP ACPI init
ACPI: bus type pnp registered
pnp 00:01: disabling [io  0x164e-0x164f] because it overlaps 0000:00:1e.0 BAR 7 [io  0x1000-0x1fff]
pnp: PnP ACPI: found 8 devices
ACPI: ACPI bus type pnp unregistered
system 00:01: [io  0x0800-0x080f] has been reserved
system 00:01: [io  0x0810-0x0817] has been reserved
system 00:01: [io  0x0820-0x0823] has been reserved
system 00:01: [io  0x0400-0x047f] has been reserved
system 00:01: [io  0x0500-0x057f] has been reserved
system 00:01: [io  0x0580-0x05ff] has been reserved
system 00:01: [io  0x0600-0x0627] has been reserved
system 00:01: [mem 0xf8000000-0xfbffffff] has been reserved
system 00:01: [mem 0xfed1c000-0xfed1ffff] has been reserved
system 00:01: [mem 0xfed10000-0xfed13fff] has been reserved
system 00:01: [mem 0xfed18000-0xfed18fff] has been reserved
system 00:01: [mem 0xfed19000-0xfed19fff] has been reserved
system 00:01: [mem 0xfec00000-0xfec00fff] could not be reserved
system 00:01: [mem 0xfed20000-0xfed8ffff] has been reserved
system 00:01: [mem 0xfee00000-0xfee00fff] has been reserved
system 00:01: [mem 0xff800000-0xffffffff] could not be reserved
PCI: max bus depth: 2 pci_try_num: 3
pci 0000:00:1c.0: PCI bridge to [bus 02-02]
pci 0000:00:1c.0:   bridge window [io  0x4000-0x5fff]
pci 0000:00:1c.0:   bridge window [mem 0xd9b00000-0xdaafffff]
pci 0000:00:1c.0:   bridge window [mem 0xd4800000-0xd58fffff 64bit pref]
pci 0000:00:1c.1: PCI bridge to [bus 03-03]
pci 0000:00:1c.1:   bridge window [io  0x3000-0x3fff]
pci 0000:00:1c.1:   bridge window [mem 0xd8a00000-0xd9afffff]
pci 0000:00:1c.1:   bridge window [mem 0xd5900000-0xd68fffff 64bit pref]
pci 0000:00:1c.4: PCI bridge to [bus 06-07]
pci 0000:00:1c.4:   bridge window [io  0x2000-0x2fff]
pci 0000:00:1c.4:   bridge window [mem 0xd7a00000-0xd89fffff]
pci 0000:00:1c.4:   bridge window [mem 0xd6900000-0xd78fffff 64bit pref]
pci 0000:04:06.0: BAR 9: assigned [mem 0xdc000000-0xdfffffff pref]
pci 0000:04:06.0: BAR 10: assigned [mem 0xe0000000-0xe3ffffff]
pci 0000:04:06.0: BAR 7: assigned [io  0x1000-0x10ff]
pci 0000:04:06.0: BAR 8: assigned [io  0x1400-0x14ff]
pci 0000:04:06.0: CardBus bridge to [bus 05-05]
pci 0000:04:06.0:   bridge window [io  0x1000-0x10ff]
pci 0000:04:06.0:   bridge window [io  0x1400-0x14ff]
pci 0000:04:06.0:   bridge window [mem 0xdc000000-0xdfffffff pref]
pci 0000:04:06.0:   bridge window [mem 0xe0000000-0xe3ffffff]
pci 0000:00:1e.0: PCI bridge to [bus 04-05]
pci 0000:00:1e.0:   bridge window [io  0x1000-0x1fff]
pci 0000:00:1e.0:   bridge window [mem 0xd2000000-0xd40fffff]
pci 0000:00:1e.0:   bridge window [mem 0xd0000000-0xd1ffffff 64bit pref]
pci 0000:00:1c.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
pci 0000:00:1c.0: setting latency timer to 64
pci 0000:00:1c.1: PCI INT B -> GSI 16 (level, low) -> IRQ 16
pci 0000:00:1c.1: setting latency timer to 64
pci 0000:00:1c.4: enabling device (0000 -> 0003)
pci 0000:00:1c.4: PCI INT A -> GSI 17 (level, low) -> IRQ 17
pci 0000:00:1c.4: setting latency timer to 64
pci 0000:00:1e.0: setting latency timer to 64
pci 0000:04:06.0: PCI INT A -> GSI 18 (level, low) -> IRQ 18
pci 0000:04:06.0: setting latency timer to 64
pci_bus 0000:00: resource 4 [io  0x0000-0x0cf7]
pci_bus 0000:00: resource 5 [io  0x0d00-0xffff]
pci_bus 0000:00: resource 6 [mem 0x000a0000-0x000bffff]
pci_bus 0000:00: resource 7 [mem 0xc0000000-0xfebfffff]
pci_bus 0000:02: resource 0 [io  0x4000-0x5fff]
pci_bus 0000:02: resource 1 [mem 0xd9b00000-0xdaafffff]
pci_bus 0000:02: resource 2 [mem 0xd4800000-0xd58fffff 64bit pref]
pci_bus 0000:03: resource 0 [io  0x3000-0x3fff]
pci_bus 0000:03: resource 1 [mem 0xd8a00000-0xd9afffff]
pci_bus 0000:03: resource 2 [mem 0xd5900000-0xd68fffff 64bit pref]
pci_bus 0000:06: resource 0 [io  0x2000-0x2fff]
pci_bus 0000:06: resource 1 [mem 0xd7a00000-0xd89fffff]
pci_bus 0000:06: resource 2 [mem 0xd6900000-0xd78fffff 64bit pref]
pci_bus 0000:04: resource 0 [io  0x1000-0x1fff]
pci_bus 0000:04: resource 1 [mem 0xd2000000-0xd40fffff]
pci_bus 0000:04: resource 2 [mem 0xd0000000-0xd1ffffff 64bit pref]
pci_bus 0000:04: resource 4 [io  0x0000-0x0cf7]
pci_bus 0000:04: resource 5 [io  0x0d00-0xffff]
pci_bus 0000:04: resource 6 [mem 0x000a0000-0x000bffff]
pci_bus 0000:04: resource 7 [mem 0xc0000000-0xfebfffff]
pci_bus 0000:05: resource 0 [io  0x1000-0x10ff]
pci_bus 0000:05: resource 1 [io  0x1400-0x14ff]
pci_bus 0000:05: resource 2 [mem 0xdc000000-0xdfffffff pref]
pci_bus 0000:05: resource 3 [mem 0xe0000000-0xe3ffffff]
NET: Registered protocol family 2
IP route cache hash table entries: 32768 (order: 5, 131072 bytes)
TCP established hash table entries: 131072 (order: 8, 1048576 bytes)
TCP bind hash table entries: 65536 (order: 7, 524288 bytes)
TCP: Hash tables configured (established 131072 bind 65536)
TCP reno registered
UDP hash table entries: 512 (order: 2, 16384 bytes)
UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
NET: Registered protocol family 1
pci 0000:00:02.0: Boot video device
pci 0000:00:1a.7: EHCI: BIOS handoff failed (BIOS bug?) 01010001
pci 0000:00:1d.7: EHCI: BIOS handoff failed (BIOS bug?) 01010001
PCI: CLS 64 bytes, default 64
Trying to unpack rootfs image as initramfs...
Freeing initrd memory: 3126k freed
Simple Boot Flag value 0x5 read from CMOS RAM was invalid
Simple Boot Flag at 0x44 set to 0x1
apm: BIOS not found.
audit: initializing netlink socket (disabled)
type=2000 audit(1269282181.575:1): initialized
highmem bounce pool size: 64 pages
HugeTLB registered 2 MB page size, pre-allocated 0 pages
msgmni has been set to 1627
alg: No test for stdrng (krng)
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
pcieport 0000:00:1c.0: setting latency timer to 64
pcieport 0000:00:1c.0: irq 24 for MSI/MSI-X
pcieport 0000:00:1c.1: setting latency timer to 64
pcieport 0000:00:1c.1: irq 25 for MSI/MSI-X
pcieport 0000:00:1c.4: setting latency timer to 64
pcieport 0000:00:1c.4: irq 26 for MSI/MSI-X
pci-stub: invalid id string ""
ACPI: AC Adapter [ADP0] (on-line)
input: Power Button as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00/input/input0
ACPI: Power Button [PWRB]
input: Lid Switch as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0D:00/input/input1
ACPI: Lid Switch [LID0]
input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input2
ACPI: Power Button [PWRF]
ACPI: Fan [FAN] (on)
Monitor-Mwait will be used to enter C-1 state
Monitor-Mwait will be used to enter C-2 state
Monitor-Mwait will be used to enter C-3 state
Marking TSC unstable due to TSC halts in idle
Switching to clocksource hpet
thermal LNXTHERM:01: registered as thermal_zone0
ACPI: Thermal Zone [THRM] (20 C)
isapnp: Scanning for PnP cards...
ACPI: Battery Slot [BAT0] (battery present)
isapnp: No Plug & Play device found
Linux agpgart interface v0.103
agpgart-intel 0000:00:00.0: Intel GM45 Chipset
agpgart-intel 0000:00:00.0: detected 131068K stolen memory
agpgart-intel 0000:00:00.0: AGP aperture is 256M @ 0xc0000000
Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
brd: module loaded
loop: module loaded
ata_piix 0000:00:1f.2: version 2.13
ata_piix 0000:00:1f.2: PCI INT B -> GSI 19 (level, low) -> IRQ 19
ata_piix 0000:00:1f.2: MAP [ P0 -- P1 -- ]
ata_piix 0000:00:1f.2: setting latency timer to 64
scsi0 : ata_piix
scsi1 : ata_piix
ata1: SATA max UDMA/133 cmd 0x6138 ctl 0x6154 bmdma 0x6110 irq 19
ata2: SATA max UDMA/133 cmd 0x6130 ctl 0x6150 bmdma 0x6118 irq 19
ata_piix 0000:00:1f.5: PCI INT B -> GSI 19 (level, low) -> IRQ 19
ata_piix 0000:00:1f.5: MAP [ P0 -- P1 -- ]
ata_piix 0000:00:1f.5: setting latency timer to 64
scsi2 : ata_piix
scsi3 : ata_piix
ata3: SATA max UDMA/133 cmd 0x6128 ctl 0x614c bmdma 0x60f0 irq 19
ata4: SATA max UDMA/133 cmd 0x6120 ctl 0x6148 bmdma 0x60f8 irq 19
Fixed MDIO Bus: probed
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci_hcd 0000:00:1a.7: PCI INT D -> GSI 19 (level, low) -> IRQ 19
ehci_hcd 0000:00:1a.7: setting latency timer to 64
ehci_hcd 0000:00:1a.7: EHCI Host Controller
ehci_hcd 0000:00:1a.7: new USB bus registered, assigned bus number 1
ehci_hcd 0000:00:1a.7: debug port 1
ehci_hcd 0000:00:1a.7: cache line size of 64 is not supported
ehci_hcd 0000:00:1a.7: irq 19, io mem 0xdab05400
ehci_hcd 0000:00:1a.7: USB 2.0 started, EHCI 1.00
usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: EHCI Host Controller
usb usb1: Manufacturer: Linux 2.6.34-rc2 ehci_hcd
usb usb1: SerialNumber: 0000:00:1a.7
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 4 ports detected
ehci_hcd 0000:00:1d.7: PCI INT A -> GSI 23 (level, low) -> IRQ 23
ehci_hcd 0000:00:1d.7: setting latency timer to 64
ehci_hcd 0000:00:1d.7: EHCI Host Controller
ehci_hcd 0000:00:1d.7: new USB bus registered, assigned bus number 2
ehci_hcd 0000:00:1d.7: debug port 1
ehci_hcd 0000:00:1d.7: cache line size of 64 is not supported
ehci_hcd 0000:00:1d.7: irq 23, io mem 0xdab05000
ehci_hcd 0000:00:1d.7: USB 2.0 started, EHCI 1.00
usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb2: Product: EHCI Host Controller
usb usb2: Manufacturer: Linux 2.6.34-rc2 ehci_hcd
usb usb2: SerialNumber: 0000:00:1d.7
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 8 ports detected
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
uhci_hcd: USB Universal Host Controller Interface driver
uhci_hcd 0000:00:1a.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
uhci_hcd 0000:00:1a.0: setting latency timer to 64
uhci_hcd 0000:00:1a.0: UHCI Host Controller
uhci_hcd 0000:00:1a.0: new USB bus registered, assigned bus number 3
uhci_hcd 0000:00:1a.0: irq 16, io base 0x000060c0
usb usb3: New USB device found, idVendor=1d6b, idProduct=0001
usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb3: Product: UHCI Host Controller
usb usb3: Manufacturer: Linux 2.6.34-rc2 uhci_hcd
usb usb3: SerialNumber: 0000:00:1a.0
hub 3-0:1.0: USB hub found
hub 3-0:1.0: 2 ports detected
uhci_hcd 0000:00:1a.1: PCI INT B -> GSI 21 (level, low) -> IRQ 21
uhci_hcd 0000:00:1a.1: setting latency timer to 64
uhci_hcd 0000:00:1a.1: UHCI Host Controller
uhci_hcd 0000:00:1a.1: new USB bus registered, assigned bus number 4
uhci_hcd 0000:00:1a.1: irq 21, io base 0x000060a0
usb usb4: New USB device found, idVendor=1d6b, idProduct=0001
usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb4: Product: UHCI Host Controller
usb usb4: Manufacturer: Linux 2.6.34-rc2 uhci_hcd
usb usb4: SerialNumber: 0000:00:1a.1
hub 4-0:1.0: USB hub found
hub 4-0:1.0: 2 ports detected
uhci_hcd 0000:00:1d.0: PCI INT A -> GSI 23 (level, low) -> IRQ 23
uhci_hcd 0000:00:1d.0: setting latency timer to 64
uhci_hcd 0000:00:1d.0: UHCI Host Controller
uhci_hcd 0000:00:1d.0: new USB bus registered, assigned bus number 5
uhci_hcd 0000:00:1d.0: irq 23, io base 0x00006080
usb usb5: New USB device found, idVendor=1d6b, idProduct=0001
usb usb5: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb5: Product: UHCI Host Controller
usb usb5: Manufacturer: Linux 2.6.34-rc2 uhci_hcd
usb usb5: SerialNumber: 0000:00:1d.0
hub 5-0:1.0: USB hub found
hub 5-0:1.0: 2 ports detected
uhci_hcd 0000:00:1d.1: PCI INT B -> GSI 19 (level, low) -> IRQ 19
uhci_hcd 0000:00:1d.1: setting latency timer to 64
uhci_hcd 0000:00:1d.1: UHCI Host Controller
uhci_hcd 0000:00:1d.1: new USB bus registered, assigned bus number 6
uhci_hcd 0000:00:1d.1: irq 19, io base 0x00006060
usb usb6: New USB device found, idVendor=1d6b, idProduct=0001
usb usb6: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb6: Product: UHCI Host Controller
usb usb6: Manufacturer: Linux 2.6.34-rc2 uhci_hcd
usb usb6: SerialNumber: 0000:00:1d.1
hub 6-0:1.0: USB hub found
hub 6-0:1.0: 2 ports detected
uhci_hcd 0000:00:1d.2: PCI INT D -> GSI 16 (level, low) -> IRQ 16
uhci_hcd 0000:00:1d.2: setting latency timer to 64
uhci_hcd 0000:00:1d.2: UHCI Host Controller
uhci_hcd 0000:00:1d.2: new USB bus registered, assigned bus number 7
uhci_hcd 0000:00:1d.2: irq 16, io base 0x00006040
usb usb7: New USB device found, idVendor=1d6b, idProduct=0001
usb usb7: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb7: Product: UHCI Host Controller
usb usb7: Manufacturer: Linux 2.6.34-rc2 uhci_hcd
usb usb7: SerialNumber: 0000:00:1d.2
hub 7-0:1.0: USB hub found
hub 7-0:1.0: 2 ports detected
uhci_hcd 0000:00:1d.3: PCI INT C -> GSI 18 (level, low) -> IRQ 18
uhci_hcd 0000:00:1d.3: setting latency timer to 64
uhci_hcd 0000:00:1d.3: UHCI Host Controller
uhci_hcd 0000:00:1d.3: new USB bus registered, assigned bus number 8
uhci_hcd 0000:00:1d.3: irq 18, io base 0x00006020
usb usb8: New USB device found, idVendor=1d6b, idProduct=0001
usb usb8: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb8: Product: UHCI Host Controller
usb usb8: Manufacturer: Linux 2.6.34-rc2 uhci_hcd
usb usb8: SerialNumber: 0000:00:1d.3
hub 8-0:1.0: USB hub found
hub 8-0:1.0: 2 ports detected
PNP: PS/2 Controller [PNP0303:KBC,PNP0f13:MOUE] at 0x60,0x64 irq 1,12
serio: i8042 KBD port at 0x60,0x64 irq 1
serio: i8042 AUX port at 0x60,0x64 irq 12
mice: PS/2 mouse device common for all mice
rtc_cmos 00:03: RTC can wake from S4
rtc_cmos 00:03: rtc core: registered rtc_cmos as rtc0
rtc0: alarms up to one month, 242 bytes nvram, hpet irqs
cpuidle: using governor ladder
cpuidle: using governor menu
usbcore: registered new interface driver hiddev
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
TCP cubic registered
Initializing XFRM netlink socket
NET: Registered protocol family 17
Using IPI No-Shortcut mode
PM: Resume from disk failed.
registered taskstats version 1
  Magic number: 2:367:393
pci_express 0000:00:1c.4:pcie08: hash matches
Initalizing network drop monitor service
input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input3
ata2: SATA link down (SStatus 0 SControl 300)
usb 1-4: new high speed USB device using ehci_hcd and address 2
ata3: SATA link down (SStatus 0 SControl 300)
ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata1.00: ATA-8: TOSHIBA MK2552GSX, LV010M, max UDMA/100
ata1.00: 488397168 sectors, multi 16: LBA48 NCQ (depth 0/32)
ata1.00: configured for UDMA/100
scsi 0:0:0:0: Direct-Access     ATA      TOSHIBA MK2552GS LV01 PQ: 0 ANSI: 5
sd 0:0:0:0: Attached scsi generic sg0 type 0
sd 0:0:0:0: [sda] 488397168 512-byte logical blocks: (250 GB/232 GiB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
 sda:
usb 1-4: New USB device found, idVendor=0bda, idProduct=0158
usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-4: Product: USB2.0-CRW
usb 1-4: Manufacturer: Generic
usb 1-4: SerialNumber: 20071114173400000
 sda1 sda2 sda3 sda4 <
ata4: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
 sda5 >
sd 0:0:0:0: [sda] Attached SCSI disk
ata4.00: ATAPI: HL-DT-ST DVDRAM GSA-T50N, RT04, max UDMA/133
ata4.00: configured for UDMA/133
scsi 3:0:0:0: CD-ROM            HL-DT-ST DVDRAM GSA-T50N  RT04 PQ: 0 ANSI: 5
sr0: scsi3-mmc drive: 24x/24x writer dvd-ram cd/rw xa/form2 cdda tray
Uniform CD-ROM driver Revision: 3.20
sr 3:0:0:0: Attached scsi CD-ROM sr0
sr 3:0:0:0: Attached scsi generic sg1 type 5
Freeing unused kernel memory: 500k freed
Write protecting the kernel text: 2884k
Write protecting the kernel read-only data: 1464k
[drm] Initialized drm 1.1.0 20060810
i915 0000:00:02.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
i915 0000:00:02.0: setting latency timer to 64
i915 0000:00:02.0: irq 27 for MSI/MSI-X
[drm] set up 127M of stolen space
usb 5-1: new low speed USB device using uhci_hcd and address 2
Synaptics Touchpad, model: 1, fw: 7.0, id: 0x1a0b1, caps: 0xd04711/0xa04000
synaptics: Toshiba dynabook EX/63H detected, limiting rate to 40pps.
usb 5-1: New USB device found, idVendor=0d62, idProduct=2050
usb 5-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
input: SynPS/2 Synaptics TouchPad as /devices/platform/i8042/serio1/input/input4
input: HID 0d62:2050 as /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/input/input5
generic-usb 0003:0D62:2050.0001: input,hidraw0: USB HID v1.10 Mouse [HID 0d62:2050] on usb-0000:00:1d.0-1/input0
fbcon: inteldrmfb (fb0) is primary device
Console: switching to colour frame buffer device 160x50
fb0: inteldrmfb frame buffer device
registered panic notifier
acpi device:02: registered as cooling_device3
input: Video Bus as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/LNXVIDEO:00/input/input6
ACPI: Video Device [OVGA] (multi-head: yes  rom: no  post: no)
[drm] Initialized i915 1.6.0 20080730 for 0000:00:02.0 on minor 0
kjournald starting.  Commit interval 5 seconds
EXT3-fs (sda3): mounted filesystem with writeback data mode
udev: starting version 141
yenta_cardbus 0000:04:06.0: CardBus bridge found [1179:ff66]
yenta_cardbus 0000:04:06.0: ISA IRQ mask 0x0ca8, PCI irq 18
yenta_cardbus 0000:04:06.0: Socket status: 30000410
yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge I/O window: 0x1000 - 0x1fff
pcmcia_socket pcmcia_socket0: cs: IO port probe 0x1000-0x1fff: clean.
yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge Memory window: 0xd2000000 - 0xd40fffff
pcmcia_socket pcmcia_socket0: cs: memory probe 0xd2000000-0xd40fffff: excluding 0xd3ef0000-0xd40fffff
yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge Memory window: 0xd0000000 - 0xd1ffffff
pcmcia_socket pcmcia_socket0: cs: memory probe 0xd0000000-0xd1ffffff: excluding 0xd0000000-0xd1ffffff
yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge I/O window: 0x0 - 0xcf7
pcmcia_socket pcmcia_socket0: cs: IO port probe 0x0-0xcf7: clean.
yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge I/O window: 0xd00 - 0xffff
pcmcia_socket pcmcia_socket0: cs: IO port probe 0xd00-0xffff: clean.
yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge Memory window: 0xa0000 - 0xbffff
pcmcia_socket pcmcia_socket0: cs: memory probe 0x0a0000-0x0bffff: excluding 0xa0000-0xbffff
yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge Memory window: 0xc0000000 - 0xfebfffff
pcmcia_socket pcmcia_socket0: cs: memory probe 0xc0000000-0xfebfffff: excluding 0xc0000000-0xd1ffffff 0xd4000000-0xdaffffff 0xdc000000-0xe3ffffff 0xf8000000-0xfbffffff 0xfe800000-0xfeffffff
i801_smbus 0000:00:1f.3: PCI INT C -> GSI 18 (level, low) -> IRQ 18
Initializing USB Mass Storage driver...
scsi4 : usb-storage 1-4:1.0
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
pcmcia_socket pcmcia_socket0: pccard: PCMCIA card inserted into slot 0
pcmcia_socket pcmcia_socket0: cs: memory probe 0xfc000000-0xfe7fffff: excluding 0xfcf00000-0xfd17ffff 0xfde00000-0xfe07ffff
pcmcia 0.0: pcmcia: registering new device pcmcia0.0
pcmcia_socket pcmcia_socket0: cs: IO port probe 0x300-0x3af: clean.
pcmcia_socket pcmcia_socket0: cs: IO port probe 0x3e0-0x4ff: clean.
pcmcia_socket pcmcia_socket0: cs: IO port probe 0x820-0x8ff: clean.
pcmcia_socket pcmcia_socket0: cs: IO port probe 0xc00-0xcf7: clean.
pcmcia_socket pcmcia_socket0: cs: memory probe 0x0c0000-0x0fffff: excluding 0xc0000-0xfffff
pcmcia_socket pcmcia_socket0: cs: memory probe 0xa0000000-0xa0ffffff: excluding 0xa0000000-0xa0ffffff
pcmcia_socket pcmcia_socket0: cs: memory probe 0x60000000-0x60ffffff: excluding 0x60000000-0x60ffffff
pcmcia_socket pcmcia_socket0: cs: IO port probe 0xa00-0xaff: clean.
eth0: C-NET(PC)C, sram 4K TX*2, port 0x1100, irq 3, hw_addr 00:80:4c:xx:xx:xx  => change to xx
udev: renamed network interface eth0 to eth16
scsi 4:0:0:0: Direct-Access     Generic- Multi-Card       1.00 PQ: 0 ANSI: 0 CCS
sd 4:0:0:0: Attached scsi generic sg2 type 0
sd 4:0:0:0: [sdb] Attached SCSI removable disk
EXT3-fs (sda3): using internal journal
Adding 36443416k swap on /dev/sda5.  Priority:-1 extents:1 across:36443416k 
NET: Registered protocol family 10
eth16: no IPv6 routers present

[lspci -vvv]
00:00.0 Host bridge: Intel Corporation Mobile 4 Series Chipset Memory Controller Hub (rev 07)
	Subsystem: Toshiba America Info Systems Device ff66
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort+ >SERR- <PERR- INTx-
	Latency: 0
	Capabilities: <access denied>
	Kernel driver in use: agpgart-intel

00:02.0 VGA compatible controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 07) (prog-if 00 [VGA controller])
	Subsystem: Toshiba America Info Systems Device ff66
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
	Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0
	Interrupt: pin A routed to IRQ 27
	Region 0: Memory at d4400000 (64-bit, non-prefetchable) [size=4M]
	Region 2: Memory at c0000000 (64-bit, prefetchable) [size=256M]
	Region 4: I/O ports at 6140 [size=8]
	Expansion ROM at <unassigned> [disabled]
	Capabilities: <access denied>
	Kernel driver in use: i915
	Kernel modules: i915

00:02.1 Display controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 07)
	Subsystem: Toshiba America Info Systems Device ff66
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0
	Region 0: Memory at d7900000 (64-bit, non-prefetchable) [size=1M]
	Capabilities: <access denied>

00:1a.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #4 (rev 03) (prog-if 00 [UHCI])
	Subsystem: Toshiba America Info Systems Device ff66
	Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0
	Interrupt: pin A routed to IRQ 16
	Region 4: I/O ports at 60c0 [size=32]
	Capabilities: <access denied>
	Kernel driver in use: uhci_hcd

00:1a.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #5 (rev 03) (prog-if 00 [UHCI])
	Subsystem: Toshiba America Info Systems Device ff66
	Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0
	Interrupt: pin B routed to IRQ 21
	Region 4: I/O ports at 60a0 [size=32]
	Capabilities: <access denied>
	Kernel driver in use: uhci_hcd

00:1a.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #2 (rev 03) (prog-if 20 [EHCI])
	Subsystem: Toshiba America Info Systems Device ff66
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0
	Interrupt: pin D routed to IRQ 19
	Region 0: Memory at dab05400 (32-bit, non-prefetchable) [size=1K]
	Capabilities: <access denied>
	Kernel driver in use: ehci_hcd

00:1b.0 Audio device: Intel Corporation 82801I (ICH9 Family) HD Audio Controller (rev 03)
	Subsystem: Toshiba America Info Systems Device ff66
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0, Cache Line Size: 64 bytes
	Interrupt: pin A routed to IRQ 11
	Region 0: Memory at dab00000 (64-bit, non-prefetchable) [size=16K]
	Capabilities: <access denied>

00:1c.0 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 1 (rev 03) (prog-if 00 [Normal decode])
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0
	Bus: primary=00, secondary=02, subordinate=02, sec-latency=0
	I/O behind bridge: 00004000-00005fff
	Memory behind bridge: d9b00000-daafffff
	Prefetchable memory behind bridge: 00000000d4800000-00000000d58fffff
	Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- <SERR- <PERR-
	BridgeCtl: Parity- SERR- NoISA- VGA- MAbort- >Reset- FastB2B-
		PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
	Capabilities: <access denied>
	Kernel driver in use: pcieport

00:1c.1 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 2 (rev 03) (prog-if 00 [Normal decode])
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0
	Bus: primary=00, secondary=03, subordinate=03, sec-latency=0
	I/O behind bridge: 00003000-00003fff
	Memory behind bridge: d8a00000-d9afffff
	Prefetchable memory behind bridge: 00000000d5900000-00000000d68fffff
	Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- <SERR- <PERR-
	BridgeCtl: Parity- SERR- NoISA- VGA- MAbort- >Reset- FastB2B-
		PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
	Capabilities: <access denied>
	Kernel driver in use: pcieport

00:1c.4 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 5 (rev 03) (prog-if 00 [Normal decode])
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0
	Bus: primary=00, secondary=06, subordinate=07, sec-latency=0
	I/O behind bridge: 00002000-00002fff
	Memory behind bridge: d7a00000-d89fffff
	Prefetchable memory behind bridge: 00000000d6900000-00000000d78fffff
	Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- <SERR- <PERR-
	BridgeCtl: Parity- SERR- NoISA- VGA- MAbort- >Reset- FastB2B-
		PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
	Capabilities: <access denied>
	Kernel driver in use: pcieport

00:1d.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #1 (rev 03) (prog-if 00 [UHCI])
	Subsystem: Toshiba America Info Systems Device ff66
	Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0
	Interrupt: pin A routed to IRQ 23
	Region 4: I/O ports at 6080 [size=32]
	Capabilities: <access denied>
	Kernel driver in use: uhci_hcd

00:1d.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #2 (rev 03) (prog-if 00 [UHCI])
	Subsystem: Toshiba America Info Systems Device ff66
	Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0
	Interrupt: pin B routed to IRQ 19
	Region 4: I/O ports at 6060 [size=32]
	Capabilities: <access denied>
	Kernel driver in use: uhci_hcd

00:1d.2 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #3 (rev 03) (prog-if 00 [UHCI])
	Subsystem: Toshiba America Info Systems Device ff66
	Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0
	Interrupt: pin D routed to IRQ 16
	Region 4: I/O ports at 6040 [size=32]
	Capabilities: <access denied>
	Kernel driver in use: uhci_hcd

00:1d.3 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #6 (rev 03) (prog-if 00 [UHCI])
	Subsystem: Toshiba America Info Systems Device ff66
	Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0
	Interrupt: pin C routed to IRQ 18
	Region 4: I/O ports at 6020 [size=32]
	Capabilities: <access denied>
	Kernel driver in use: uhci_hcd

00:1d.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #1 (rev 03) (prog-if 20 [EHCI])
	Subsystem: Toshiba America Info Systems Device ff66
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0
	Interrupt: pin A routed to IRQ 23
	Region 0: Memory at dab05000 (32-bit, non-prefetchable) [size=1K]
	Capabilities: <access denied>
	Kernel driver in use: ehci_hcd

00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 93) (prog-if 01 [Subtractive decode])
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0
	Bus: primary=00, secondary=04, subordinate=05, sec-latency=32
	I/O behind bridge: 00001000-00001fff
	Memory behind bridge: d2000000-d40fffff
	Prefetchable memory behind bridge: 00000000d0000000-00000000d1ffffff
	Secondary status: 66MHz- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort+ <SERR- <PERR-
	BridgeCtl: Parity- SERR- NoISA- VGA- MAbort- >Reset- FastB2B-
		PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
	Capabilities: <access denied>

00:1f.0 ISA bridge: Intel Corporation ICH9M LPC Interface Controller (rev 03)
	Subsystem: Toshiba America Info Systems Device ff66
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0
	Capabilities: <access denied>

00:1f.2 IDE interface: Intel Corporation ICH9M/M-E 2 port SATA IDE Controller (rev 03) (prog-if 8f [Master SecP SecO PriP PriO])
	Subsystem: Toshiba America Info Systems Device ff66
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0
	Interrupt: pin B routed to IRQ 19
	Region 0: I/O ports at 6138 [size=8]
	Region 1: I/O ports at 6154 [size=4]
	Region 2: I/O ports at 6130 [size=8]
	Region 3: I/O ports at 6150 [size=4]
	Region 4: I/O ports at 6110 [size=16]
	Region 5: I/O ports at 6100 [size=16]
	Capabilities: <access denied>
	Kernel driver in use: ata_piix

00:1f.3 SMBus: Intel Corporation 82801I (ICH9 Family) SMBus Controller (rev 03)
	Subsystem: Toshiba America Info Systems Device ff66
	Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Interrupt: pin C routed to IRQ 18
	Region 0: Memory at dab05800 (64-bit, non-prefetchable) [size=256]
	Region 4: I/O ports at 6000 [size=32]
	Kernel driver in use: i801_smbus
	Kernel modules: i2c-i801

00:1f.5 IDE interface: Intel Corporation ICH9M/M-E 2 port SATA IDE Controller (rev 03) (prog-if 85 [Master SecO PriO])
	Subsystem: Toshiba America Info Systems Device ff66
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0
	Interrupt: pin B routed to IRQ 19
	Region 0: I/O ports at 6128 [size=8]
	Region 1: I/O ports at 614c [size=4]
	Region 2: I/O ports at 6120 [size=8]
	Region 3: I/O ports at 6148 [size=4]
	Region 4: I/O ports at 60f0 [size=16]
	Region 5: I/O ports at 60e0 [size=16]
	Capabilities: <access denied>
	Kernel driver in use: ata_piix

02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 02)
	Subsystem: Toshiba America Info Systems Device ff66
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0
	Interrupt: pin A routed to IRQ 5
	Region 0: I/O ports at 4000 [size=256]
	Region 2: Memory at d4810000 (64-bit, prefetchable) [size=4K]
	Region 4: Memory at d4800000 (64-bit, prefetchable) [size=64K]
	Capabilities: <access denied>

03:00.0 Network controller: Atheros Communications Inc. AR928X Wireless Network Adapter (PCI-Express) (rev 01)
	Subsystem: Foxconn International, Inc. Device e009
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0
	Interrupt: pin A routed to IRQ 11
	Region 0: Memory at d8a00000 (64-bit, non-prefetchable) [size=64K]
	Capabilities: <access denied>

04:06.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev b6)
	Subsystem: Toshiba America Info Systems Device ff66
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 168
	Interrupt: pin A routed to IRQ 18
	Region 0: Memory at d4000000 (32-bit, non-prefetchable) [size=4K]
	Bus: primary=04, secondary=05, subordinate=05, sec-latency=176
	Memory window 0: dc000000-dffff000 (prefetchable)
	Memory window 1: e0000000-e3fff000
	I/O window 0: 00001000-000010ff
	I/O window 1: 00001400-000014ff
	BridgeCtl: Parity- SERR- ISA- VGA- MAbort- >Reset- 16bInt+ PostWrite+
	16-bit legacy interface ports at 0001
	Kernel driver in use: yenta_cardbus
	Kernel modules: yenta_socket




From linux at dominikbrodowski.net  Mon Mar 22 08:00:41 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 22 Mar 2010 13:00:41 +0100
Subject: pci_bus_for_each_resource, transparent bridges and rsrc_nonstatic.c
In-Reply-To: <20100322183832.f07b9191.komurojun-mbn@nifty.com>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<1257971899-9274-9-git-send-email-linux@dominikbrodowski.net>
	<20091213212556.03d83e1f.komurojun-mbn@nifty.com>
	<20100228153933.f6fe6f81.komurojun-mbn@nifty.com>
	<20100320063919.f7cd4421.komurojun-mbn@nifty.com>
	<20100321065539.57cb2c96.komurojun-mbn@nifty.com>
	<20100322094022.742e85a9.komurojun-mbn@nifty.com>
	<20100322183832.f07b9191.komurojun-mbn@nifty.com>
Message-ID: <20100322120041.GA5022@comet.dominikbrodowski.net>

Bjorn, Jesse,

Komuro reports the following issue:

lspci -vvv [snippets]:

00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 93) (prog-if 01 [Subtractive decode])
...
	Bus: primary=00, secondary=04, subordinate=05, sec-latency=32
	I/O behind bridge: 00001000-00001fff
	Memory behind bridge: d2000000-d40fffff
	Prefetchable memory behind bridge: 00000000d0000000-00000000d1ffffff

04:06.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev b6)


Iterating over the bus (4) resources used to report just IO 0x1000-0x1ffff,
MEM d2...-d4..., prefetch d0...-d1..., and that's exactly what we need in
drivers/pcmcia/rsrc_nonstatic.c . However, the newly added
pci_bus_for_each_resource() seems to return _also_ additional resources,
which we need to exclude in drivers/pcmcia/rssrc_nonstatic.c . Any ideas on
how to fix this issue?

> yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge I/O window: 0x1000 - 0x1fff
> yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge Memory window: 0xd2000000 - 0xd40fffff
> yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge Memory window: 0xd0000000 - 0xd1ffffff
> yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge I/O window: 0x0 - 0xcf7
> yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge I/O window: 0xd00 - 0xffff
> yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge Memory window: 0xa0000 - 0xbffff
> yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge Memory window: 0xc0000000 - 0xfebfffff

Best,
	Dominik


From stern at rowland.harvard.edu  Mon Mar 22 11:38:44 2010
From: stern at rowland.harvard.edu (Alan Stern)
Date: Mon, 22 Mar 2010 11:38:44 -0400 (EDT)
Subject: runtime PM ops and PCMCIA bus
In-Reply-To: <20100321224546.GA23626@comet.dominikbrodowski.net>
Message-ID: <Pine.LNX.4.44L0.1003221045130.1606-100000@iolanthe.rowland.org>

On Sun, 21 Mar 2010, Dominik Brodowski wrote:

> Hey!
> 
> On the PCMCIA bus, implementing runtime PM "should" be simple.

Ha!  There always are lots of little issues that make it more 
complicated than it seems...

> However, there's a major caveat: the bus must be able to
> force devices to suspend, or force them to resume during
> runtime. Let's discuss this in detail:
> 
> (1) Converting the PCMCIA bus to dev_pm_ops seems easy:
> 
>     pcmcia_dev_suspend() needs to get rid of its second argument,
>     then it's just a 
> 
>     SET_SYSTEM_SLEEP_PM_OPS(pcmcia_dev_suspend, pcmcia_dev_resume)

Yes.

> (2) Whenever two functions local to drivers/pcmcia/ds.c --
>     runtime_suspend() or runtime_resume() -- are called,
>     we need to force a synchronous call to pcmcia_dev_suspend(),
>     or to pcmcia_dev_resume(). Currently, we do this by taking
>     device_lock() and calling the function manually.

That seems like the right thing to do.  (Except that I don't know what 
your device_lock() routine is for.)

> (3) However, it'd be much nicer to be able to use the new runtime
>     PM interface.

I don't understand.  Aren't runtime_suspend() and runtime_resume(), as 
mentioned above, already part of your runtime PM interface?  Or at 
least, intended to be part of your runtime PM interface?

> As the PCMCIA bus can always suspend,

Is that really literally true?  Don't you run into trouble if you try
to suspend while a data transfer is taking place?  And if you've got a 
whole series of transfers going on, does it really make sense to 
suspend after each individual transfer, only to resume immediately when 
the next transfer comes along?

How long should a pcmcia device have to remain idle before suspending 
it will actually end up saving energy?

How does your driver determine when the device becomes idle (and just
as important, stops being idle)?

>     pcmcia_dev_idle() might only contain a call to
> 
> 	pm_schedule_suspend(dev, 0) - or pm_runtime_suspend() ?

pm_schedule_suspend(dev, 0) is exactly the same as
pm_request_suspend(dev).  Either way involves going through a
workqueue, whereas pm_runtime_suspend() invokes the runtime_suspend
method directly.  So there's no reason not to call
pm_runtime_suspend().

>     To enable it, we should add
> 
>        pm_runtime_set_active(&p_dev->dev);
>        pm_runtime_enable(&p_dev->dev);
> 
>     in pcmcia_device_add().

Yes.

> (4) What is then to be done to modify runtime_suspend() / runtime_resume() ?
>     Is it:
> 
> + static int runtime_suspend(struct device *dev)
> + {
> + 	pm_runtime_put_noidle(dev);
> + 	return pm_runtime_suspend(dev);
> + }

This makes no sense at all.  pm_runtime_suspend() calls your 
runtime_suspend() function, not the other way around.

> + static int runtime_resume(struct device *dev)
> + {
> + 	return pm_runtime_get_sync(dev);
> + }

Likewise.

>     or more something like
> 
> 
> +  static int runtime_suspend(struct device *dev)
> + {
> + 	return pm_runtime_put_sync(dev);
> + }
> + 
> + static int runtime_resume(struct device *dev)
> + {
> + 	return pm_runtime_get_sync(dev);
> + }

Ditto.  As far as I can see, those routines don't need to be changed at 
all -- except perhaps to avoid suspending the device while it is being 
used.  Maybe your device_lock() handles that.

>     and modifying pcmcia_dev_idle() to call pm_runtime_suspend() instead of
>     pm_schedule_suspend()?

That's correct assuming you want to suspend right away when 
pcmcia_dev_idle() runs.

> (5) Another problem I'm seeing with the put/get approach: there are three
>     different callpaths where runtime_suspend() / runtime_resume() might
>     be called.[*] However, each one decreases the counter, which might get < 0.

The counter should never become negative; if it does, there's a bug in
your driver.  Every decrement should match a corresponding increment,
just like with refcounts.  And the device should never be
runtime-suspended unless the counter is 0.

>     What to do? Using pm_runtime_suspended seems racy...

What exactly is the problem?  Are you worried about the
pcmcia_store_pm_state() routine?  It's not clear to me that the routine
is needed.  One of the background assumptions behind the runtime PM
framework is that users don't tell the system when to suspend devices.  
Instead, the system automatically suspends devices when it realizes
they aren't being used.

Note that suspending a device is different from turning it off.  When a
device is off, it stays off -- it doesn't get turned on automatically
when a process tries to use it.  But a runtime-suspended device _does_
get resumed automatically as needed.

So if pcmcia_store_pm_state() is meant to turn the device off, then it
shouldn't use the runtime PM framework.  If it is meant only to suspend
the device then it shouldn't exist.

> (6) As pcmcia_dev_resume() is used -- as per UNIVERSAL_DEV_PM_OPS -- what is
>     needed there to set the runtime PM state correctly if we do not wake up
>     the device during system sleep suspend?

Why would you wake up the device during a system sleep suspend?  
Surely you want to _suspend_ the device at that time.

Perhaps you meant to ask about setting the runtime PM state correctly 
during system sleep _resume_?  That is handled for you automatically by 
the UNIVERSAL_DEV_PM_OPS routines -- and it requires you always to wake 
up the device during a resume from system sleep, even if the device had 
been runtime-suspended when the sleep began.

> Pseudo patch -- untested and probably broken [see at least (5) above]
> attached. Any feedback is most welcome.
> 
> Best,
> 	Dominik
> 
> [*] 1) by echoing the state into a device sysfs file.
>     2) by echoing the state into a socket sysfs file.

See above.

>     3) during "resets" of the socket -- we need to suspend devices
>            first, then physically reset the socket, then resume the devices
> 	   on the card.

Temporary resets like these should be done without affecting the 
devices' runtime PM state.  Call your pcmcia_dev_suspend() and 
pcmcia_dev_resume() routines directly without going through the runtime 
PM framework.  At the end of the reset, since the devices have been 
resumed, you should inform the runtime PM core by doing:

	pm_runtime_disable(dev);
	pm_runtime_set_active(dev);
	pm_runtime_enable(dev);

You do have to worry about the possibility that the PM core might issue
a runtime suspend or runtime resume request while the reset is in
progress.  How you deal with that depends on the way your driver and
subsystem are designed.  One possible approach is to call
pm_runtime_get_sync(dev) before starting the reset and
pm_runtime_put_sync(dev) after everything is finished.

> diff --git a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig
> index caca50e..551fcdb 100644
> --- a/drivers/pcmcia/Kconfig
> +++ b/drivers/pcmcia/Kconfig
> @@ -20,6 +20,7 @@ if PCCARD
>  config PCMCIA
>  	tristate "16-bit PCMCIA support"
>  	select CRC32
> +	select PM_RUNTIME

This seems very wrong.  Why do you need it?  Can't the pcmcia subsystem 
work correctly without runtime PM support?  Hasn't it been working 
correctly that way all along?

The other changes involve things discussed above, so there's no need to 
repeat them here.

Alan Stern



From bjorn.helgaas at hp.com  Mon Mar 22 12:34:28 2010
From: bjorn.helgaas at hp.com (Bjorn Helgaas)
Date: Mon, 22 Mar 2010 09:34:28 -0700
Subject: pci_bus_for_each_resource,
	transparent bridges and rsrc_nonstatic.c
In-Reply-To: <20100322120041.GA5022@comet.dominikbrodowski.net>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<20100322183832.f07b9191.komurojun-mbn@nifty.com>
	<20100322120041.GA5022@comet.dominikbrodowski.net>
Message-ID: <201003221034.30205.bjorn.helgaas@hp.com>

On Monday 22 March 2010 06:00:41 am Dominik Brodowski wrote:
> Komuro reports the following issue:
> 
> 00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 93) (prog-if 01 [Subtractive decode])
> ...
> 	Bus: primary=00, secondary=04, subordinate=05, sec-latency=32
> 	I/O behind bridge: 00001000-00001fff
> 	Memory behind bridge: d2000000-d40fffff
> 	Prefetchable memory behind bridge: 00000000d0000000-00000000d1ffffff
> 
> 04:06.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev b6)
> 
> Iterating over the bus (4) resources used to report just IO 0x1000-0x1ffff,
> MEM d2...-d4..., prefetch d0...-d1..., and that's exactly what we need in
> drivers/pcmcia/rsrc_nonstatic.c . However, the newly added
> pci_bus_for_each_resource() seems to return _also_ additional resources,
> which we need to exclude in drivers/pcmcia/rssrc_nonstatic.c . Any ideas on
> how to fix this issue?

This was probably broken by 2fe2abf896c1 or maybe 89a74ecccd1f7, but
I don't see how yet.

Before those changes, we had this:

  #define PCI_BUS_NUM_RESOURCES  16
  static int nonstatic_autoadd_resources(struct pcmcia_socket *s)
      ...
      for (i = 0; i < PCI_BUS_NUM_RESOURCES; i++) {
          struct resource *root = socket->dev->bus->resource[i];

so we used to iterate over all 16 possible bus resources, not just four.

Can you please collect a dmesg log from b16694f70c (just before my
changes) and another from 7bc5e3f2be32 (just after) so we can compare
them?

You can open a kernel bugzilla, assign it to me, and attach the logs
there, if you want.

Bjorn

> > yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge I/O window: 0x1000 - 0x1fff
> > yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge Memory window: 0xd2000000 - 0xd40fffff
> > yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge Memory window: 0xd0000000 - 0xd1ffffff
> > yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge I/O window: 0x0 - 0xcf7
> > yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge I/O window: 0xd00 - 0xffff
> > yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge Memory window: 0xa0000 - 0xbffff
> > yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge Memory window: 0xc0000000 - 0xfebfffff


From linux at dominikbrodowski.net  Mon Mar 22 13:27:10 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 22 Mar 2010 18:27:10 +0100
Subject: pci_bus_for_each_resource,
	transparent bridges and rsrc_nonstatic.c
In-Reply-To: <201003221034.30205.bjorn.helgaas@hp.com>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<20100322183832.f07b9191.komurojun-mbn@nifty.com>
	<20100322120041.GA5022@comet.dominikbrodowski.net>
	<201003221034.30205.bjorn.helgaas@hp.com>
Message-ID: <20100322172710.GA21104@isilmar.linta.de>

Bjorn,

On Mon, Mar 22, 2010 at 09:34:28AM -0700, Bjorn Helgaas wrote:
> On Monday 22 March 2010 06:00:41 am Dominik Brodowski wrote:
> > Komuro reports the following issue:
> > 
> > 00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 93) (prog-if 01 [Subtractive decode])
> > ...
> > 	Bus: primary=00, secondary=04, subordinate=05, sec-latency=32
> > 	I/O behind bridge: 00001000-00001fff
> > 	Memory behind bridge: d2000000-d40fffff
> > 	Prefetchable memory behind bridge: 00000000d0000000-00000000d1ffffff
> > 
> > 04:06.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev b6)
> > 
> > Iterating over the bus (4) resources used to report just IO 0x1000-0x1ffff,
> > MEM d2...-d4..., prefetch d0...-d1..., and that's exactly what we need in
> > drivers/pcmcia/rsrc_nonstatic.c . However, the newly added
> > pci_bus_for_each_resource() seems to return _also_ additional resources,
> > which we need to exclude in drivers/pcmcia/rssrc_nonstatic.c . Any ideas on
> > how to fix this issue?
> 
> This was probably broken by 2fe2abf896c1 or maybe 89a74ecccd1f7, but
> I don't see how yet.
> 
> Before those changes, we had this:
> 
>   #define PCI_BUS_NUM_RESOURCES  16
>   static int nonstatic_autoadd_resources(struct pcmcia_socket *s)
>       ...
>       for (i = 0; i < PCI_BUS_NUM_RESOURCES; i++) {
>           struct resource *root = socket->dev->bus->resource[i];
> 
> so we used to iterate over all 16 possible bus resources, not just four.
> 
> Can you please collect a dmesg log from b16694f70c (just before my
> changes) and another from 7bc5e3f2be32 (just after) so we can compare
> them?
> 
> You can open a kernel bugzilla, assign it to me, and attach the logs
> there, if you want.

Actually, I now think the bug was introduced somewhere else.

We did indeed iterate over all 16 bus resources, so also for the root PCI
bridge resources. However, this used to just skip in the next check:

if (res == &ioport_resource)
	continue;

(or &iomem_resource) as there used to be no specific root I/O / Memory
window resource set. But now, all of the I/O address space is split up into
two, and a (previously non-existing) "PCI Bus 0000:00" appears in
/proc/iomem . Do you know, by chance, which change or patchset specifically
introduced this?

> > > yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge I/O window: 0x0 - 0xcf7
> > > yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge I/O window: 0xd00 - 0xffff

with just a very small hole in between...

So, what should we do? 

(1) The best way seems to be to skip all resources of type 
PCI_SUBTRACTIVE_DECODE, but this flag is only stored in
struct pci_bus_resource, which is hard to access, and nonexistent for the
first four resources. Actually, the "flag" field is unused otherwise. Could
we set res->flags |= PCI_SUBTRACTIVE_DECODE instead? (it probably needs to
be != 0x1 then, but anyways). Then it's trivial in rsrc_nonstatic.c

(2) An alternative would be to 

diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c
index ba3a53e..b0e60a1 100644
--- a/drivers/pcmcia/rsrc_nonstatic.c
+++ b/drivers/pcmcia/rsrc_nonstatic.c
@@ -933,7 +933,8 @@ static int nonstatic_autoadd_resources(struct pcmcia_socket *s)
 		return -EINVAL;
 #endif
 
-	pci_bus_for_each_resource(s->cb_dev->bus, res, i) {
+	for (i = 0; i < PCI_BRIDGE_RESOURCE_NUM; i++) {
+		res = s->cb_dev->bus->resource[i];
 		if (!res)
 			continue;
 


What do you think?

Best,
	Dominik


From cyrille at grinner.fr  Mon Mar 22 15:01:17 2010
From: cyrille at grinner.fr (Cyrille GRINNER)
Date: Mon, 22 Mar 2010 20:01:17 +0100
Subject: Boot options
Message-ID: <1269284477.4ba7be7d31587@imp.free.fr>

Hi!

Here is the dmesg after a boot test with acpi=off pci=usepirqmask:


[    0.000000]  0000000000 - 0000400000 page 4k
[    0.000000]  0000400000 - 001fc00000 page 2M
[    0.000000]  001fc00000 - 001fe70000 page 4k
[    0.000000] kernel direct mapping tables up to 1fe70000 @ 10000-15000
[    0.000000] RAMDISK: 1f715000 - 1fe5fd78
[    0.000000] 0MB HIGHMEM available.
[    0.000000] 510MB LOWMEM available.
[    0.000000]   mapped low ram: 0 - 1fe70000
[    0.000000]   low ram: 0 - 1fe70000
[    0.000000]   node 0 low ram: 00000000 - 1fe70000
[    0.000000]   node 0 bootmap 00011000 - 00014fd0
[    0.000000] (9 early reservations) ==> bootmem [0000000000 - 001fe70000]
[    0.000000]   #0 [0000000000 - 0000001000]   BIOS data page ==> [0000000000 -
0000001000]
[    0.000000]   #1 [0000001000 - 0000002000]    EX TRAMPOLINE ==> [0000001000 -
0000002000]
[    0.000000]   #2 [0000006000 - 0000007000]       TRAMPOLINE ==> [0000006000 -
0000007000]
[    0.000000]   #3 [0000100000 - 00008a80a0]    TEXT DATA BSS ==> [0000100000 -
00008a80a0]
[    0.000000]   #4 [001f715000 - 001fe5fd78]          RAMDISK ==> [001f715000 -
001fe5fd78]
[    0.000000]   #5 [000009f800 - 0000100000]    BIOS reserved ==> [000009f800 -
0000100000]
[    0.000000]   #6 [00008a9000 - 00008ac121]              BRK ==> [00008a9000 -
00008ac121]
[    0.000000]   #7 [0000010000 - 0000011000]          PGTABLE ==> [0000010000 -
0000011000]
[    0.000000]   #8 [0000011000 - 0000015000]          BOOTMAP ==> [0000011000 -
0000015000]
[    0.000000] Zone PFN ranges:
[    0.000000]   DMA      0x00000010 -> 0x00001000
[    0.000000]   Normal   0x00001000 -> 0x0001fe70
[    0.000000]   HighMem  0x0001fe70 -> 0x0001fe70
[    0.000000] Movable zone start PFN for each node
[    0.000000] early_node_map[2] active PFN ranges
[    0.000000]     0: 0x00000010 -> 0x0000009f
[    0.000000]     0: 0x00000100 -> 0x0001fe70
[    0.000000] On node 0 totalpages: 130559
[    0.000000] free_area_init_node: node 0, pgdat c0784940, node_mem_map
c1000200
[    0.000000]   DMA zone: 32 pages used for memmap
[    0.000000]   DMA zone: 0 pages reserved
[    0.000000]   DMA zone: 3951 pages, LIFO batch:0
[    0.000000]   Normal zone: 989 pages used for memmap
[    0.000000]   Normal zone: 125587 pages, LIFO batch:31
[    0.000000] Using APIC driver default
[    0.000000] SMP: Allowing 1 CPUs, 0 hotplug CPUs
[    0.000000] Local APIC disabled by BIOS -- you can enable it with "lapic"
[    0.000000] APIC: disable apic facility
[    0.000000] nr_irqs_gsi: 16
[    0.000000] PM: Registered nosave memory: 000000000009f000 - 00000000000a0000
[    0.000000] PM: Registered nosave memory: 00000000000a0000 - 00000000000e6000
[    0.000000] PM: Registered nosave memory: 00000000000e6000 - 0000000000100000
[    0.000000] Allocating PCI resources starting at 20000000 (gap:
20000000:dff00000)
[    0.000000] NR_CPUS:8 nr_cpumask_bits:8 nr_cpu_ids:1 nr_node_ids:1
[    0.000000] PERCPU: Embedded 14 pages at c1402000, static data 35612 bytes
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total
pages: 129538
[    0.000000] Kernel command line:
root=UUID=549a6bf0-214f-4e92-80c5-22181afee69a acpi=off pci=usepirqmask
[    0.000000] PID hash table entries: 2048 (order: 11, 8192 bytes)
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Enabling fast FPU save and restore... done.
[    0.000000] Enabling unmasked SIMD FPU exception support... done.
[    0.000000] Initializing CPU#0
[    0.000000] allocated 2613120 bytes of page_cgroup
[    0.000000] please try 'cgroup_disable=memory' option if you don't want
memory cgroups
[    0.000000] Initializing HighMem for node 0 (00000000:00000000)
[    0.000000] Memory: 499568k/522688k available (4566k kernel code, 22460k
reserved, 2142k data, 540k init, 0k highmem)
[    0.000000] virtual kernel memory layout:
[    0.000000]     fixmap  : 0xfff1d000 - 0xfffff000   ( 904 kB)
[    0.000000]     pkmap   : 0xff800000 - 0xffc00000   (4096 kB)
[    0.000000]     vmalloc : 0xe0670000 - 0xff7fe000   ( 497 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xdfe70000   ( 510 MB)
[    0.000000]       .init : 0xc078e000 - 0xc0815000   ( 540 kB)
[    0.000000]       .data : 0xc0575b94 - 0xc078d3c8   (2142 kB)
[    0.000000]       .text : 0xc0100000 - 0xc0575b94   (4566 kB)
[    0.000000] Checking if this processor honours the WP bit even in supervisor
mode...Ok.
[    0.000000] SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1,
Nodes=1
[    0.000000] NR_IRQS:2304 nr_irqs:256
[    0.000000] Fast TSC calibration using PIT
[    0.000000] Detected 596.207 MHz processor.
[    0.001970] Console: colour VGA+ 80x25
[    0.001987] console [tty0] enabled
[    0.004026] Calibrating delay loop (skipped), value calculated using timer
frequency.. 1192.41 BogoMIPS (lpj=2384828)
[    0.004247] Security Framework initialized
[    0.004410] AppArmor: AppArmor initialized
[    0.004512] Mount-cache hash table entries: 512
[    0.005128] Initializing cgroup subsys ns
[    0.005223] Initializing cgroup subsys cpuacct
[    0.005301] Initializing cgroup subsys memory
[    0.005395] Initializing cgroup subsys freezer
[    0.005466] Initializing cgroup subsys net_cls
[    0.005582] CPU: L1 I cache: 16K, L1 D cache: 16K
[    0.005689] CPU: L2 cache: 128K
[    0.005763] mce: CPU supports 5 MCE banks
[    0.005872] Performance Counters:
[    0.005924] no APIC, boot with the "lapic" boot parameter to force-enable it.
[    0.006049] no hardware sampling interrupt available.
[    0.006119] p6 PMU driver.
[    0.006222] ... version:                 0
[    0.006290] ... bit width:               32
[    0.006357] ... generic counters:        2
[    0.006425] ... value mask:              00000000ffffffff
[    0.006496] ... max period:              000000007fffffff
[    0.006567] ... fixed-purpose counters:  0
[    0.006634] ... counter mask:            0000000000000003
[    0.006712] Checking 'hlt' instruction... OK.
[    0.021903] SMP alternatives: switching to UP code
[    0.036070] Freeing SMP alternatives: 19k freed
[    0.036494] weird, boot CPU (#0) not listed by the BIOS.
[    0.036579] SMP motherboard not detected.
[    0.036648] Local APIC not detected. Using dummy APIC emulation.
[    0.036718] SMP disabled
[    0.037550] Brought up 1 CPUs
[    0.037645] Total of 1 processors activated (1192.41 BogoMIPS).
[    0.037771] CPU0 attaching NULL sched-domain.
[    0.038944] Booting paravirtualized kernel on bare hardware
[    0.040533] regulator: core version 0.5
[    0.040659] Time: 19:51:28  Date: 03/22/10
[    0.040954] NET: Registered protocol family 16
[    0.041535] EISA bus registered
[    0.049812] PCI: PCI BIOS revision 2.10 entry at 0xfd9b0, last bus=1
[    0.049903] PCI: Using configuration type 1 for base access
[    0.054375] bio: create slab <bio-0> at 0
[    0.054815] ACPI: Interpreter disabled.
[    0.055458] SCSI subsystem initialized
[    0.055812] libata version 3.00 loaded.
[    0.056285] usbcore: registered new interface driver usbfs
[    0.056433] usbcore: registered new interface driver hub
[    0.056662] usbcore: registered new device driver usb
[    0.057308] PCI: Probing PCI hardware
[    0.057388] PCI: Probing PCI hardware (bus 00)
[    0.057631] pci 0000:00:02.0: reg 10 32bit mmio: [0xf8000000-0xfbffffff]
[    0.057650] pci 0000:00:02.0: reg 14 32bit mmio: [0xf4000000-0xf407ffff]
[    0.057897] pci 0000:00:1f.0: quirk: region 1000-107f claimed by ICH4
ACPI/GPIO/TCO
[    0.057998] pci 0000:00:1f.0: quirk: region 1180-11bf claimed by ICH4 GPIO
[    0.058142] pci 0000:00:1f.1: reg 20 io port: [0x1800-0x180f]
[    0.058241] pci 0000:00:1f.2: reg 20 io port: [0x1820-0x183f]
[    0.058346] pci 0000:00:1f.3: reg 20 io port: [0x1810-0x181f]
[    0.058444] pci 0000:00:1f.4: reg 20 io port: [0x2400-0x241f]
[    0.058515] pci 0000:00:1f.5: reg 10 io port: [0x1c00-0x1cff]
[    0.058534] pci 0000:00:1f.5: reg 14 io port: [0x1840-0x187f]
[    0.058624] pci 0000:00:1f.6: reg 10 io port: [0x2000-0x20ff]
[    0.058643] pci 0000:00:1f.6: reg 14 io port: [0x1880-0x18ff]
[    0.058766] pci 0000:01:00.0: reg 10 32bit mmio: [0xf4104000-0xf41047ff]
[    0.058786] pci 0000:01:00.0: reg 14 32bit mmio: [0xf4100000-0xf4103fff]
[    0.058857] pci 0000:01:00.0: supports D2
[    0.058867] pci 0000:01:00.0: PME# supported from D2 D3hot
[    0.058945] pci 0000:01:00.0: PME# disabled
[    0.059069] pci 0000:01:02.0: reg 10 32bit mmio: [0x000000-0x000fff]
[    0.059105] pci 0000:01:02.0: supports D1 D2
[    0.059115] pci 0000:01:02.0: PME# supported from D0 D1 D2 D3hot D3cold
[    0.059193] pci 0000:01:02.0: PME# disabled
[    0.059315] pci 0000:01:02.1: reg 10 32bit mmio: [0x000000-0x000fff]
[    0.059351] pci 0000:01:02.1: supports D1 D2
[    0.059361] pci 0000:01:02.1: PME# supported from D0 D1 D2 D3hot D3cold
[    0.059439] pci 0000:01:02.1: PME# disabled
[    0.059576] pci 0000:00:1e.0: transparent bridge
[    0.059654] pci 0000:00:1e.0: bridge 32bit mmio: [0xf4100000-0xf41fffff]
[    0.061332] pci 0000:00:1f.0: PIIX/ICH IRQ router [8086:244c]
[    0.062061] Bluetooth: Core ver 2.15
[    0.062446] NET: Registered protocol family 31
[    0.062524] Bluetooth: HCI device and connection manager initialized
[    0.062604] Bluetooth: HCI socket layer initialized
[    0.062675] NetLabel: Initializing
[    0.062741] NetLabel:  domain hash size = 128
[    0.062808] NetLabel:  protocols = UNLABELED CIPSOv4
[    0.062930] NetLabel:  unlabeled traffic allowed by default
[    0.071768] pnp: PnP ACPI: disabled
[    0.071872] PnPBIOS: Scanning system for PnP BIOS support...
[    0.072114] PnPBIOS: Found PnP BIOS installation structure at 0xc00f7470
[    0.072202] PnPBIOS: PnP BIOS version 1.0, entry 0xf0000:0xa88d, dseg 0x400
[    0.073970] pnp 00:0a: io resource (0x1000-0x105f) overlaps 0000:00:1f.0 BAR
13 (0x1000-0x107f), disabling
[    0.074087] pnp 00:0a: io resource (0x1060-0x107f) overlaps 0000:00:1f.0 BAR
13 (0x1000-0x107f), disabling
[    0.077232] PnPBIOS: 19 nodes reported by PnP BIOS; 19 recorded by driver
[    0.077366] system 00:00: iomem range 0xfff00000-0xffffffff has been reserved
[    0.077466] system 00:01: iomem range 0x0-0x9ffff could not be reserved
[    0.077547] system 00:01: iomem range 0xe4000-0xfffff could not be reserved
[    0.077626] system 00:01: iomem range 0x100000-0x1fdfffff could not be
reserved
[    0.077773] system 00:0a: ioport range 0x4d0-0x4d1 has been reserved
[    0.077855] system 00:0a: ioport range 0x1100-0x110f has been reserved
[    0.077934] system 00:0a: ioport range 0x1180-0x11bf has been reserved
[    0.078027] system 00:0c: iomem range 0xdc000-0xdffff has been reserved
[    0.078118] system 00:0d: iomem range 0xd8000-0xdbfff has been reserved
[    0.080345] AppArmor: AppArmor Filesystem Enabled
[    0.080570] pci 0000:01:02.0: CardBus bridge, secondary bus 0000:02
[    0.080648] pci 0000:01:02.0:   IO window: 0x003000-0x0030ff
[    0.080726] pci 0000:01:02.0:   IO window: 0x003400-0x0034ff
[    0.080802] pci 0000:01:02.0:   PREFETCH window: 0x20000000-0x23ffffff
[    0.080882] pci 0000:01:02.0:   MEM window: 0x28000000-0x2bffffff
[    0.080959] pci 0000:01:02.1: CardBus bridge, secondary bus 0000:06
[    0.081034] pci 0000:01:02.1:   IO window: 0x003800-0x0038ff
[    0.081110] pci 0000:01:02.1:   IO window: 0x003c00-0x003cff
[    0.081187] pci 0000:01:02.1:   PREFETCH window: 0x24000000-0x27ffffff
[    0.081266] pci 0000:01:02.1:   MEM window: 0x2c000000-0x2fffffff
[    0.081346] pci 0000:00:1e.0: PCI bridge, secondary bus 0000:01
[    0.081421] pci 0000:00:1e.0:   IO window: 0x3000-0x3fff
[    0.081498] pci 0000:00:1e.0:   MEM window: 0xf4100000-0xf41fffff
[    0.081577] pci 0000:00:1e.0:   PREFETCH window: 0x20000000-0x27ffffff
[    0.081678] pci 0000:00:1e.0: setting latency timer to 64
[    0.081703] pci 0000:01:02.0: can't find IRQ for PCI INT A; please try using
pci=biosirq
[    0.081803] pci 0000:01:02.0: setting latency timer to 64
[    0.081825] pci 0000:01:02.1: can't find IRQ for PCI INT B; please try using
pci=biosirq
[    0.081925] pci 0000:01:02.1: setting latency timer to 64
[    0.081946] pci_bus 0000:00: resource 0 io:  [0x00-0xffff]
[    0.081958] pci_bus 0000:00: resource 1 mem: [0x000000-0xffffffff]
[    0.081970] pci_bus 0000:01: resource 0 io:  [0x3000-0x3fff]
[    0.081982] pci_bus 0000:01: resource 1 mem: [0xf4100000-0xf41fffff]
[    0.081994] pci_bus 0000:01: resource 2 pref mem [0x20000000-0x27ffffff]
[    0.082006] pci_bus 0000:01: resource 3 io:  [0x00-0xffff]
[    0.082018] pci_bus 0000:01: resource 4 mem: [0x000000-0xffffffff]
[    0.082030] pci_bus 0000:02: resource 0 io:  [0x3000-0x30ff]
[    0.082042] pci_bus 0000:02: resource 1 io:  [0x3400-0x34ff]
[    0.082053] pci_bus 0000:02: resource 2 pref mem [0x20000000-0x23ffffff]
[    0.082066] pci_bus 0000:02: resource 3 mem: [0x28000000-0x2bffffff]
[    0.082078] pci_bus 0000:06: resource 0 io:  [0x3800-0x38ff]
[    0.082089] pci_bus 0000:06: resource 1 io:  [0x3c00-0x3cff]
[    0.082101] pci_bus 0000:06: resource 2 pref mem [0x24000000-0x27ffffff]
[    0.082113] pci_bus 0000:06: resource 3 mem: [0x2c000000-0x2fffffff]
[    0.082287] NET: Registered protocol family 2
[    0.082808] IP route cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.084300] TCP established hash table entries: 16384 (order: 5, 131072
bytes)
[    0.084847] TCP bind hash table entries: 16384 (order: 5, 131072 bytes)
[    0.085515] TCP: Hash tables configured (established 16384 bind 16384)
[    0.085597] TCP reno registered
[    0.086144] NET: Registered protocol family 1
[    0.086487] Trying to unpack rootfs image as initramfs...
[    1.002645] Freeing initrd memory: 7467k freed
[    1.043581] cpufreq-nforce2: No nForce2 chipset.
[    1.043785] Scanning for low memory corruption every 60 seconds
[    1.044503] audit: initializing netlink socket (disabled)
[    1.044646] type=2000 audit(1269287489.044:1): initialized
[    1.079843] HugeTLB registered 4 MB page size, pre-allocated 0 pages
[    1.087916] VFS: Disk quotas dquot_6.5.2
[    1.088378] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    1.091340] fuse init (API version 7.12)
[    1.091879] msgmni has been set to 990
[    1.093187] alg: No test for stdrng (krng)
[    1.093362] io scheduler noop registered
[    1.093435] io scheduler anticipatory registered
[    1.093504] io scheduler deadline registered
[    1.093919] io scheduler cfq registered (default)
[    1.094046] pci 0000:00:02.0: Boot video device
[    1.094454] pci_hotplug: PCI Hot Plug PCI Core version: 0.5
[    1.094622] pciehp: PCI Express Hot Plug Controller Driver version: 0.4
[    1.095263] isapnp: Scanning for PnP cards...
[    1.449386] isapnp: No Plug & Play device found
[    1.454437] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    1.454893] serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
[    1.456433] 00:12: ttyS1 at I/O 0x2f8 (irq = 4) is a 16550A
[    1.456835] PCI: setting IRQ 5 as level-triggered
[    1.456850] serial 0000:00:1f.6: found PCI INT B -> IRQ 5
[    1.456957] serial 0000:00:1f.6: sharing IRQ 5 with 0000:00:1f.3
[    1.457040] serial 0000:00:1f.6: sharing IRQ 5 with 0000:00:1f.5
[    1.461473] brd: module loaded
[    1.463877] loop: module loaded
[    1.464584] input: Macintosh mouse button emulation as
/devices/virtual/input/input0
[    1.465204] ata_piix 0000:00:1f.1: version 2.13
[    1.465433] ata_piix 0000:00:1f.1: setting latency timer to 64
[    1.465871] scsi0 : ata_piix
[    1.466589] scsi1 : ata_piix
[    1.466841] ata1: PATA max UDMA/100 cmd 0x1f0 ctl 0x3f6 bmdma 0x1800 irq 14
[    1.466924] ata2: PATA max UDMA/100 cmd 0x170 ctl 0x376 bmdma 0x1808 irq 15
[    1.470541] Fixed MDIO Bus: probed
[    1.470769] PPP generic driver version 2.4.2
[    1.471315] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.471504] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    1.471637] uhci_hcd: USB Universal Host Controller Interface driver
[    1.471888] PCI: setting IRQ 9 as level-triggered
[    1.471901] uhci_hcd 0000:00:1f.2: found PCI INT D -> IRQ 9
[    1.472641] uhci_hcd 0000:00:1f.2: setting latency timer to 64
[    1.472657] uhci_hcd 0000:00:1f.2: UHCI Host Controller
[    1.473032] uhci_hcd 0000:00:1f.2: new USB bus registered, assigned bus
number 1
[    1.473190] uhci_hcd 0000:00:1f.2: irq 9, io base 0x00001820
[    1.473639] usb usb1: configuration #1 chosen from 1 choice
[    1.473837] hub 1-0:1.0: USB hub found
[    1.473941] hub 1-0:1.0: 2 ports detected
[    1.474243] PCI: setting IRQ 11 as level-triggered
[    1.474258] uhci_hcd 0000:00:1f.4: found PCI INT C -> IRQ 11
[    1.474408] uhci_hcd 0000:00:1f.4: setting latency timer to 64
[    1.474421] uhci_hcd 0000:00:1f.4: UHCI Host Controller
[    1.474681] uhci_hcd 0000:00:1f.4: new USB bus registered, assigned bus
number 2
[    1.474834] uhci_hcd 0000:00:1f.4: irq 11, io base 0x00002400
[    1.475289] usb usb2: configuration #1 chosen from 1 choice
[    1.475488] hub 2-0:1.0: USB hub found
[    1.475591] hub 2-0:1.0: 2 ports detected
[    1.476181] PNP: PS/2 Controller [PNP0303,PNP0f13] at 0x60,0x64 irq 1,12
[    1.478913] serio: i8042 KBD port at 0x60,0x64 irq 1
[    1.479009] serio: i8042 AUX port at 0x60,0x64 irq 12
[    1.479362] mice: PS/2 mouse device common for all mice
[    1.479864] rtc_cmos 00:05: rtc core: registered rtc_cmos as rtc0
[    1.479991] rtc0: alarms up to one day, 114 bytes nvram
[    1.480623] device-mapper: uevent: version 1.0.3
[    1.481529] device-mapper: ioctl: 4.15.0-ioctl (2009-04-01) initialised:
dm-devel at redhat.com
[    1.482032] device-mapper: multipath: version 1.1.0 loaded
[    1.482117] device-mapper: multipath round-robin: version 1.0.0 loaded
[    1.483033] EISA: Probing bus 0 at eisa.0
[    1.483128] Cannot allocate resource for EISA slot 1
[    1.483201] Cannot allocate resource for EISA slot 2
[    1.483271] Cannot allocate resource for EISA slot 3
[    1.483371] EISA: Detected 0 cards.
[    1.483762] cpuidle: using governor ladder
[    1.483876] cpuidle: using governor menu
[    1.486449] TCP cubic registered
[    1.487302] NET: Registered protocol family 10
[    1.489526] lo: Disabled Privacy Extensions
[    1.491062] NET: Registered protocol family 17
[    1.491240] Bluetooth: L2CAP ver 2.13
[    1.491308] Bluetooth: L2CAP socket layer initialized
[    1.491382] Bluetooth: SCO (Voice Link) ver 0.6
[    1.491450] Bluetooth: SCO socket layer initialized
[    1.491732] Bluetooth: RFCOMM TTY layer initialized
[    1.491813] Bluetooth: RFCOMM socket layer initialized
[    1.491883] Bluetooth: RFCOMM ver 1.11
[    1.491993] Using IPI No-Shortcut mode
[    1.492429] PM: Resume from disk failed.
[    1.492490] registered taskstats version 1
[    1.492964]   Magic number: 2:988:900
[    1.493219] rtc_cmos 00:05: setting system clock to 2010-03-22 19:51:30 UTC
(1269287490)
[    1.493320] BIOS EDD facility v0.16 2004-Jun-25, 0 devices found
[    1.493394] EDD information not available.
[    1.511759] input: AT Translated Set 2 keyboard as
/devices/platform/i8042/serio0/input/input1
[    1.636644] ata2.00: ATAPI: HL-DT-ST DVDRAM GMA-4082N, HJ02, max UDMA/33
[    1.637375] ata1.00: ATA-5: FUJITSU MHM2100AT, 5823, max UDMA/66
[    1.637455] ata1.00: 19640880 sectors, multi 16: LBA
[    1.652473] ata2.00: configured for UDMA/33
[    1.653208] ata1.00: configured for UDMA/66
[    1.653761] scsi 0:0:0:0: Direct-Access     ATA      FUJITSU MHM2100A 5823
PQ: 0 ANSI: 5
[    1.654420] sd 0:0:0:0: Attached scsi generic sg0 type 0
[    1.655095] sd 0:0:0:0: [sda] 19640880 512-byte logical blocks: (10.0 GB/9.36
GiB)
[    1.655458] sd 0:0:0:0: [sda] Write Protect is off
[    1.655537] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[    1.655676] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled,
doesn't support DPO or FUA
[    1.656901]  sda:
[    1.658607] scsi 1:0:0:0: CD-ROM            HL-DT-ST DVDRAM GMA-4082N HJ02
PQ: 0 ANSI: 5
[    1.670613]  sda1 <sr0: scsi3-mmc drive: 24x/24x writer dvd-ram cd/rw
xa/form2 cdda tray
[    1.671033] Uniform CD-ROM driver Revision: 3.20
[    1.671522] sr 1:0:0:0: Attached scsi CD-ROM sr0
[    1.671872] sr 1:0:0:0: Attached scsi generic sg1 type 5
[    1.672062]  sda5 sda6 > sda3
[    1.693279] sd 0:0:0:0: [sda] Attached SCSI disk
[    1.693448] Freeing unused kernel memory: 540k freed
[    1.697230] Write protecting the kernel text: 4568k
[    1.697485] Write protecting the kernel read-only data: 1836k
[    2.533338] Linux agpgart interface v0.103
[    2.867677] agpgart-intel 0000:00:00.0: Intel i815 Chipset
[    2.964212] agpgart-intel 0000:00:00.0: AGP aperture is 64M @ 0xf8000000
[    3.108213] ohci1394 0000:01:00.0: enabling device (0110 -> 0112)
[    3.108314] ohci1394 0000:01:00.0: can't find IRQ for PCI INT A; please try
using pci=biosirq
[    3.164133] ohci1394: Failed to allocate interrupt 0
[    3.164366] ohci1394: probe of 0000:01:00.0 failed with error -16
[    4.241431] PM: Starting manual resume from disk
[    4.241527] PM: Resume from partition 8:6
[    4.241535] PM: Checking hibernation image.
[    4.242139] PM: Resume from disk failed.
[    4.317713] kjournald starting.  Commit interval 5 seconds
[    4.317841] EXT3-fs: mounted filesystem with writeback data mode.
[    5.927132] type=1505 audit(1269287494.930:2): operation="profile_load"
pid=298 name=/usr/share/gdm/guest-session/Xsession
[    6.002918] type=1505 audit(1269287495.006:3): operation="profile_load"
pid=299 name=/sbin/dhclient3
[    6.005115] type=1505 audit(1269287495.010:4): operation="profile_load"
pid=299 name=/usr/lib/NetworkManager/nm-dhcp-client.action
[    6.006305] type=1505 audit(1269287495.010:5): operation="profile_load"
pid=299 name=/usr/lib/connman/scripts/dhclient-script
[    6.115237] type=1505 audit(1269287495.118:6): operation="profile_load"
pid=300 name=/usr/bin/evince
[    6.152045] type=1505 audit(1269287495.154:7): operation="profile_load"
pid=300 name=/usr/bin/evince-previewer
[    6.173327] type=1505 audit(1269287495.178:8): operation="profile_load"
pid=300 name=/usr/bin/evince-thumbnailer
[    6.271430] type=1505 audit(1269287495.274:9): operation="profile_load"
pid=302 name=/usr/lib/cups/backend/cups-pdf
[    6.274105] type=1505 audit(1269287495.278:10): operation="profile_load"
pid=302 name=/usr/sbin/cupsd
[    6.296911] type=1505 audit(1269287495.302:11): operation="profile_load"
pid=303 name=/usr/sbin/tcpdump
[   28.799108] Adding 546168k swap on /dev/sda6.  Priority:-1 extents:1
across:546168k
[   28.877576] udev: starting version 147
[   29.293069] EXT3 FS on sda5, internal journal
[   29.933850] lp: driver loaded but no devices found
[   29.948142] shpchp: Standard Hot Plug PCI Controller Driver version: 0.4
[   29.970488] Intel 82802 RNG detected
[   30.964878] yenta_cardbus 0000:01:02.0: CardBus bridge found [104d:80df]
[   30.964920] yenta_cardbus 0000:01:02.0: no PCI IRQ, CardBus support disabled
for this socket.
[   30.964932] yenta_cardbus 0000:01:02.0: check your BIOS CardBus, BIOS IRQ or
ACPI settings.
[   31.093941] yenta_cardbus 0000:01:02.0: ISA IRQ mask 0x0498, PCI irq 0
[   31.093958] yenta_cardbus 0000:01:02.0: Socket status: 30000820
[   31.093973] pci_bus 0000:01: Raising subordinate bus# of parent bus (#01)
from #01 to #05
[   31.094006] yenta_cardbus 0000:01:02.0: pcmcia: parent PCI bridge I/O window:
0x3000 - 0x3fff
[   31.094022] pcmcia_socket pcmcia_socket0: cs: IO port probe 0x3000-0x3fff:
clean.
[   31.094750] yenta_cardbus 0000:01:02.0: pcmcia: parent PCI bridge Memory
window: 0xf4100000 - 0xf41fffff
[   31.094765] yenta_cardbus 0000:01:02.0: pcmcia: parent PCI bridge Memory
window: 0x20000000 - 0x27ffffff
[   31.095292] yenta_cardbus 0000:01:02.1: CardBus bridge found [104d:80df]
[   31.095332] yenta_cardbus 0000:01:02.1: no PCI IRQ, CardBus support disabled
for this socket.
[   31.095344] yenta_cardbus 0000:01:02.1: check your BIOS CardBus, BIOS IRQ or
ACPI settings.
[   31.170785] input: PS/2 Mouse as /devices/platform/i8042/serio1/input/input2
[   31.238288] input: AlpsPS/2 ALPS GlidePoint as
/devices/platform/i8042/serio1/input/input3
[   31.248941] pcmcia_socket pcmcia_socket0: cs: cardbus cards are not
supported.
[   31.249761] yenta_cardbus 0000:01:02.1: ISA IRQ mask 0x0098, PCI irq 0
[   31.249774] yenta_cardbus 0000:01:02.1: Socket status: 30000006
[   31.249789] pci_bus 0000:01: Raising subordinate bus# of parent bus (#01)
from #05 to #09
[   31.249820] yenta_cardbus 0000:01:02.1: pcmcia: parent PCI bridge I/O window:
0x3000 - 0x3fff
[   31.249836] pcmcia_socket pcmcia_socket1: cs: IO port probe 0x3000-0x3fff:
clean.
[   31.250564] yenta_cardbus 0000:01:02.1: pcmcia: parent PCI bridge Memory
window: 0xf4100000 - 0xf41fffff
[   31.250579] yenta_cardbus 0000:01:02.1: pcmcia: parent PCI bridge Memory
window: 0x20000000 - 0x27ffffff
[   31.561191] ip_tables: (C) 2000-2006 Netfilter Core Team
[   32.075275] pcmcia_socket pcmcia_socket0: cs: IO port probe 0x100-0x3af:
excluding 0x378-0x37f
[   32.077403] pcmcia_socket pcmcia_socket0: cs: IO port probe 0x3e0-0x4ff:
clean.
[   32.078374] pcmcia_socket pcmcia_socket0: cs: IO port probe 0x820-0x8ff:
clean.
[   32.079206] pcmcia_socket pcmcia_socket0: cs: IO port probe 0xc00-0xcf7:
clean.
[   32.080646] pcmcia_socket pcmcia_socket0: cs: IO port probe 0xa00-0xaff:
clean.
[   32.635173] pcmcia_socket pcmcia_socket1: cs: IO port probe 0x100-0x3af:
excluding 0x378-0x37f
[   32.687773] pcmcia_socket pcmcia_socket1: cs: IO port probe 0x3e0-0x4ff:
clean.
[   32.688775] pcmcia_socket pcmcia_socket1: cs: IO port probe 0x820-0x8ff:
clean.
[   32.689756] pcmcia_socket pcmcia_socket1: cs: IO port probe 0xc00-0xcf7:
clean.
[   32.691317] pcmcia_socket pcmcia_socket1: cs: IO port probe 0xa00-0xaff:
clean.
[   33.858041] Intel ICH 0000:00:1f.5: found PCI INT B -> IRQ 5
[   33.858093] Intel ICH 0000:00:1f.5: sharing IRQ 5 with 0000:00:1f.3
[   33.858116] Intel ICH 0000:00:1f.5: sharing IRQ 5 with 0000:00:1f.6
[   33.858196] Intel ICH 0000:00:1f.5: setting latency timer to 64
[   34.126030] type=1505 audit(1269283923.131:12): operation="profile_replace"
pid=760 name=/usr/share/gdm/guest-session/Xsession
[   34.144243] type=1505 audit(1269283923.147:13): operation="profile_replace"
pid=761 name=/sbin/dhclient3
[   34.146394] type=1505 audit(1269283923.151:14): operation="profile_replace"
pid=761 name=/usr/lib/NetworkManager/nm-dhcp-client.action
[   34.147521] type=1505 audit(1269283923.151:15): operation="profile_replace"
pid=761 name=/usr/lib/connman/scripts/dhclient-script
[   34.211388] type=1505 audit(1269283923.215:16): operation="profile_replace"
pid=762 name=/usr/bin/evince
[   34.297197] intel8x0_measure_ac97_clock: measured 57798 usecs (2778 samples)
[   34.297212] intel8x0: clocking to 48000
[   34.305675] type=1505 audit(1269283923.311:17): operation="profile_replace"
pid=762 name=/usr/bin/evince-previewer
[   34.468254] type=1505 audit(1269283923.471:18): operation="profile_replace"
pid=762 name=/usr/bin/evince-thumbnailer
[   34.552934] type=1505 audit(1269283923.555:19): operation="profile_replace"
pid=778 name=/usr/lib/cups/backend/cups-pdf
[   34.578924] type=1505 audit(1269283923.583:20): operation="profile_replace"
pid=778 name=/usr/sbin/cupsd
[   34.608386] type=1505 audit(1269283923.611:21): operation="profile_replace"
pid=780 name=/usr/sbin/tcpdump
[   37.554998] ppdev: user-space parallel port driver
[   37.890620] [drm] Initialized drm 1.1.0 20060810
[   37.909904] PCI: setting IRQ 10 as level-triggered
[   37.909921] pci 0000:00:02.0: found PCI INT A -> IRQ 10
[   37.909988] pci 0000:00:02.0: setting latency timer to 64
[   37.910632] [drm] Initialized i810 1.4.0 20030605 for 0000:00:02.0 on minor 0
[   37.935001] mtrr: base(0xf8000000) is not aligned on a size(0x12c000)
boundary
[   38.194971] [drm] Using v1.4 init.
[   41.605362] [drm:drm_reclaim_locked_buffers] *ERROR* reclaim_buffers_locked()
deadlock. Please rework this
[   41.605375] 	driver to use reclaim_buffers_idlelocked() instead.
[   41.605381] 	I will go on reclaiming the buffers anyway.




From bugzilla-daemon at bugzilla.kernel.org  Mon Mar 22 15:16:01 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Mon, 22 Mar 2010 19:16:01 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@https.bugzilla.kernel.org/>
References: <bug-7304-4463@https.bugzilla.kernel.org/>
Message-ID: <201003221916.o2MJG1Nc032587@demeter.kernel.org>

https://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #79 from Dominik Brodowski <linux at brodo.de>  2010-03-22 19:15:49 ---
Regarding the dmidecode output: do you have CONFIG_DMI and CONFIG_DMIID enabled
in the kernel? Using a dmi-code is the preferred way to specify an override.

Also, could you re-run cbdump, please, with kernel 2.6.34-rc2 and the following
fix-up:

socket->cb_irq = 11;
dev->irq = 11;

first inserted into the working socket #1, then into the non-working socket #0?
Thanks!

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From manuel.lauss at googlemail.com  Mon Mar 22 15:43:23 2010
From: manuel.lauss at googlemail.com (Manuel Lauss)
Date: Mon, 22 Mar 2010 20:43:23 +0100
Subject: [PATCH v2] pcmcia: db1xxx-ss: suspend/resume fix
Message-ID: <1269287003-15523-1-git-send-email-manuel.lauss@gmail.com>

This patch adds more pm method callbacks to the db1xxx-ss socket
driver, which fixes spurious interrupts and dead cards upon resume
from STR.

Tested on DB1200 with CF card (tons of spurious interrupts resulting
in card interrupt being disabled) and a 3c509 card (this one was
just dead after resume).

Signed-off-by: Manuel Lauss <manuel.lauss at gmail.com>
---
v2: remove uneeded .suspend callback (which was identical to
    suspend_noirq).

 drivers/pcmcia/db1xxx_ss.c |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/drivers/pcmcia/db1xxx_ss.c b/drivers/pcmcia/db1xxx_ss.c
index 9254ab0..2191654 100644
--- a/drivers/pcmcia/db1xxx_ss.c
+++ b/drivers/pcmcia/db1xxx_ss.c
@@ -559,21 +559,30 @@ static int __devexit db1x_pcmcia_socket_remove(struct platform_device *pdev)
 }
 
 #ifdef CONFIG_PM
-static int db1x_pcmcia_suspend(struct device *dev)
+static int db1x_pcmcia_suspend_noirq(struct device *dev)
 {
 	return pcmcia_socket_dev_suspend(dev);
 }
 
+static int db1x_pcmcia_resume_noirq(struct device *dev)
+{
+	pcmcia_socket_dev_early_resume(dev);
+	return 0;
+}
+
 static int db1x_pcmcia_resume(struct device *dev)
 {
-	return pcmcia_socket_dev_resume(dev);
+	pcmcia_socket_dev_late_resume(dev);
+	return 0;
 }
 
 static struct dev_pm_ops db1x_pcmcia_pmops = {
 	.resume		= db1x_pcmcia_resume,
-	.suspend	= db1x_pcmcia_suspend,
+	.resume_noirq	= db1x_pcmcia_resume_noirq,
+	.suspend_noirq	= db1x_pcmcia_suspend_noirq,
 	.thaw		= db1x_pcmcia_resume,
-	.freeze		= db1x_pcmcia_suspend,
+	.thaw_noirq	= db1x_pcmcia_resume_noirq,
+	.freeze		= db1x_pcmcia_suspend_noirq,
 };
 
 #define DB1XXX_SS_PMOPS &db1x_pcmcia_pmops
-- 
1.7.0.2



From linux at dominikbrodowski.net  Mon Mar 22 16:03:39 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 22 Mar 2010 21:03:39 +0100
Subject: runtime PM ops and PCMCIA bus
In-Reply-To: <Pine.LNX.4.44L0.1003221045130.1606-100000@iolanthe.rowland.org>
References: <20100321224546.GA23626@comet.dominikbrodowski.net>
	<Pine.LNX.4.44L0.1003221045130.1606-100000@iolanthe.rowland.org>
Message-ID: <20100322200339.GA7673@isilmar.linta.de>

Alan,

many thanks for your extensive feedback!

On Mon, Mar 22, 2010 at 11:38:44AM -0400, Alan Stern wrote:
> On Sun, 21 Mar 2010, Dominik Brodowski wrote:
> > (2) Whenever two functions local to drivers/pcmcia/ds.c --
> >     runtime_suspend() or runtime_resume() -- are called,
> >     we need to force a synchronous call to pcmcia_dev_suspend(),
> >     or to pcmcia_dev_resume(). Currently, we do this by taking
> >     device_lock() and calling the function manually.
> 
> That seems like the right thing to do.  (Except that I don't know what 
> your device_lock() routine is for.)

Actually, that's the generic device_lock(), which replaced down(&dev->sem)
... which is used here to not let a reset or a runtime suspend/resume race
with a system sleep event.

> > (3) However, it'd be much nicer to be able to use the new runtime
> >     PM interface.
> 
> I don't understand.  Aren't runtime_suspend() and runtime_resume(), as 
> mentioned above, already part of your runtime PM interface?  Or at 
> least, intended to be part of your runtime PM interface?

Well, they are part of the PCMCIA-local runtime PM interface -- it is based
around the concept that an user may, whenever she wants, can set a PCMCIA
device (or the whole card) to the "suspend" state.

> > As the PCMCIA bus can always suspend,
> 
> Is that really literally true?  Don't you run into trouble if you try
> to suspend while a data transfer is taking place?  And if you've got a 
> whole series of transfers going on, does it really make sense to 
> suspend after each individual transfer, only to resume immediately when 
> the next transfer comes along?
> 
> How long should a pcmcia device have to remain idle before suspending 
> it will actually end up saving energy?
> 
> How does your driver determine when the device becomes idle (and just
> as important, stops being idle)?

Well, all of this is done by the user. I agree that it might make sense to
take all these issues into consideration -- e.g. by get/put commands used by
the ATA layer etc.

> >     To enable it, we should add
> > 
> >        pm_runtime_set_active(&p_dev->dev);
> >        pm_runtime_enable(&p_dev->dev);
> > 
> >     in pcmcia_device_add().
> 
> Yes.
> 
> > (4) What is then to be done to modify runtime_suspend() / runtime_resume() ?
> >     Is it:
> > 
> > + static int runtime_suspend(struct device *dev)
> > + {
> > + 	pm_runtime_put_noidle(dev);
> > + 	return pm_runtime_suspend(dev);
> > + }
> 
> This makes no sense at all.  pm_runtime_suspend() calls your 
> runtime_suspend() function, not the other way around.

Well, that's not what this "runtime_suspend()" does -- it is the wrapper for
userspace-issued suspend commands.

> > (5) Another problem I'm seeing with the put/get approach: there are three
> >     different callpaths where runtime_suspend() / runtime_resume() might
> >     be called.[*] However, each one decreases the counter, which might get < 0.
> 
> The counter should never become negative; if it does, there's a bug in
> your driver.  Every decrement should match a corresponding increment,
> just like with refcounts.  And the device should never be
> runtime-suspended unless the counter is 0.

what's the initial value, actually? Is it 0 or 1?

> One of the background assumptions behind the runtime PM
> framework is that users don't tell the system when to suspend devices.  

Ah, that's the fundamental issue. I agree that the PCMCIA subsystem does
something unusual here (relating to PCMCIA cards or PCMCIA devices) --
but I would prefer not to break how the system currently works.

> Instead, the system automatically suspends devices when it realizes
> they aren't being used.

That's what we could use for PCMCIA sockets.

> > --- a/drivers/pcmcia/Kconfig
> > +++ b/drivers/pcmcia/Kconfig
> > @@ -20,6 +20,7 @@ if PCCARD
> >  config PCMCIA
> >  	tristate "16-bit PCMCIA support"
> >  	select CRC32
> > +	select PM_RUNTIME
> 
> This seems very wrong.  Why do you need it?  Can't the pcmcia subsystem 
> work correctly without runtime PM support?  Hasn't it been working 
> correctly that way all along?

Oh yes, it did. However, continuing support for the PCMCIA-style "runtime
PM" might need to depend on PM_RUNTIME.

Will do write (and possibly test) some patches first, then get back to you
-- many thanks for your feedback. Really appreciate it!

Best,
	Dominik


From bjorn.helgaas at hp.com  Mon Mar 22 16:08:35 2010
From: bjorn.helgaas at hp.com (Bjorn Helgaas)
Date: Mon, 22 Mar 2010 13:08:35 -0700
Subject: pci_bus_for_each_resource,
	transparent bridges and rsrc_nonstatic.c
In-Reply-To: <20100322172710.GA21104@isilmar.linta.de>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<201003221034.30205.bjorn.helgaas@hp.com>
	<20100322172710.GA21104@isilmar.linta.de>
Message-ID: <201003221408.37858.bjorn.helgaas@hp.com>

On Monday 22 March 2010 11:27:10 am Dominik Brodowski wrote:
> Bjorn,
> 
> On Mon, Mar 22, 2010 at 09:34:28AM -0700, Bjorn Helgaas wrote:
> > On Monday 22 March 2010 06:00:41 am Dominik Brodowski wrote:
> > > Komuro reports the following issue:
> > > 
> > > 00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 93) (prog-if 01 [Subtractive decode])
> > > ...
> > > 	Bus: primary=00, secondary=04, subordinate=05, sec-latency=32
> > > 	I/O behind bridge: 00001000-00001fff
> > > 	Memory behind bridge: d2000000-d40fffff
> > > 	Prefetchable memory behind bridge: 00000000d0000000-00000000d1ffffff
> > > 
> > > 04:06.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev b6)
> > > 
> > > Iterating over the bus (4) resources used to report just IO 0x1000-0x1ffff,
> > > MEM d2...-d4..., prefetch d0...-d1..., and that's exactly what we need in
> > > drivers/pcmcia/rsrc_nonstatic.c . However, the newly added
> > > pci_bus_for_each_resource() seems to return _also_ additional resources,
> > > which we need to exclude in drivers/pcmcia/rssrc_nonstatic.c . Any ideas on
> > > how to fix this issue?
> > ...

> We did indeed iterate over all 16 bus resources, so also for the root PCI
> bridge resources. However, this used to just skip in the next check:
> 
> if (res == &ioport_resource)
> 	continue;
> 
> (or &iomem_resource) as there used to be no specific root I/O / Memory
> window resource set. But now, all of the I/O address space is split up into
> two, and a (previously non-existing) "PCI Bus 0000:00" appears in
> /proc/iomem . Do you know, by chance, which change or patchset specifically
> introduced this?

Yep, I think this is 7bc5e3f2be32a, which makes us pay attention to
the PCI host bridge windows reported by the BIOS instead of assuming
that "all of ioport_resource and iomem_resource are routed to the
single PCI root bus."

You should see the same behavior even before 7bc5e3f2be32a if you
boot with "pci=use_crs".

> > > > yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge I/O window: 0x0 - 0xcf7
> > > > yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge I/O window: 0xd00 - 0xffff
> 
> with just a very small hole in between...

This is pretty typical.  The BIOS is telling us that 0xcf8-0xcff
is consumed directly by the host bridge (it uses that for doing
config space accesses on the PCI bus), and the rest of the area
if forwarded to the downstream PCI bus and is available for PCI
devices to use.

> So, what should we do? 

Let's back up a bit.  I don't know enough about PCMCIA, and I don't
see the problem yet.  We have the 00:1e.0 bridge leading to bus 04,
and 04:06.0 is a CardBus bridge.  These three windows are the ranges
positively decoded and forwarded by the 00:1e.0 bridge:

  yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge I/O window: 0x1000 - 0x1fff
  yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge Memory window: 0xd2000000 - 0xd40fffff
  yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge Memory window: 0xd0000000 - 0xd1ffffff

But the bridge is in subtractive-decode mode, so it *also* forwards
anything it sees that is unclaimed by other devices on bus 00, which
means the 04:06.0 CardBus bridge will also see these ranges:

  yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge I/O window: 0x0 - 0xcf7
  yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge I/O window: 0xd00 - 0xffff
  yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge Memory window: 0xa0000 - 0xbffff
  yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge Memory window: 0xc0000000 - 0xfebfffff

Why do you care whether these additional ranges are excluded?  They
should be just as usable as the first three.  Of course, the first
three ranges (the ones positively decoded by 00:1e.0) can only be
used by devices on bus 04, while the last four (subtractively decoded
by 00:1e.0) can be used by devices on bus 00 or bus 04, so there's
more competition for the last four.

But I don't understand why we care whether the upstream bridge
decoded a region positively or subtractively when deciding whether to
add it to the PCMCIA resource map.

Bjorn


From linux at dominikbrodowski.net  Mon Mar 22 16:21:35 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 22 Mar 2010 21:21:35 +0100
Subject: pci_bus_for_each_resource,
	transparent bridges and rsrc_nonstatic.c
In-Reply-To: <201003221408.37858.bjorn.helgaas@hp.com>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<201003221034.30205.bjorn.helgaas@hp.com>
	<20100322172710.GA21104@isilmar.linta.de>
	<201003221408.37858.bjorn.helgaas@hp.com>
Message-ID: <20100322202135.GB7673@isilmar.linta.de>

Hey,

On Mon, Mar 22, 2010 at 01:08:35PM -0700, Bjorn Helgaas wrote:
> > So, what should we do? 
> 
> Let's back up a bit.  I don't know enough about PCMCIA, and I don't
> see the problem yet.  We have the 00:1e.0 bridge leading to bus 04,
> and 04:06.0 is a CardBus bridge.  These three windows are the ranges
> positively decoded and forwarded by the 00:1e.0 bridge:
> 
>   yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge I/O window: 0x1000 - 0x1fff
>   yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge Memory window: 0xd2000000 - 0xd40fffff
>   yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge Memory window: 0xd0000000 - 0xd1ffffff
> 
> But the bridge is in subtractive-decode mode, so it *also* forwards
> anything it sees that is unclaimed by other devices on bus 00, which
> means the 04:06.0 CardBus bridge will also see these ranges:
> 
>   yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge I/O window: 0x0 - 0xcf7
>   yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge I/O window: 0xd00 - 0xffff
>   yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge Memory window: 0xa0000 - 0xbffff
>   yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge Memory window: 0xc0000000 - 0xfebfffff
> 
> Why do you care whether these additional ranges are excluded?  They
> should be just as usable as the first three.

Quoting rsrc_nonstatic.c:

        /* If this is the root bus, the risk of hitting
         * some strange system devices which aren't protected
         * by either ACPI resource tables or properly requested
         * resources is too big. [...]
         */

Or, as Alan put it -- when it came to I/O resources in the 0x100-0x3ff area:

	"Which crashes older thinkpads, some ATI chipset systems and
	 usually anything containing an NE2000 clone in ISA space."

You can still use subtractive-decoded resources, but then you have to add
them to /etc/pcmcia/config.opts and run pcmcia-startup-bridges (or echo the
resource to a sysfs file).

Now, "usecrs" is only used on 2008-or-newer systems where we _hope_ that all
resource "consumers" are accounted for. So the problem might be mitigated.
However, I wouldn't dare to use ioports 0x0-0xff anyways for they usually
are used for onboard legacy devices...


Best,
	Dominik


From bjorn.helgaas at hp.com  Mon Mar 22 16:36:03 2010
From: bjorn.helgaas at hp.com (Bjorn Helgaas)
Date: Mon, 22 Mar 2010 13:36:03 -0700
Subject: pci_bus_for_each_resource,
	transparent bridges and rsrc_nonstatic.c
In-Reply-To: <20100322202135.GB7673@isilmar.linta.de>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<201003221408.37858.bjorn.helgaas@hp.com>
	<20100322202135.GB7673@isilmar.linta.de>
Message-ID: <201003221436.04689.bjorn.helgaas@hp.com>

On Monday 22 March 2010 02:21:35 pm Dominik Brodowski wrote:
> Hey,
> 
> On Mon, Mar 22, 2010 at 01:08:35PM -0700, Bjorn Helgaas wrote:
> > > So, what should we do? 
> > 
> > Let's back up a bit.  I don't know enough about PCMCIA, and I don't
> > see the problem yet.  We have the 00:1e.0 bridge leading to bus 04,
> > and 04:06.0 is a CardBus bridge.  These three windows are the ranges
> > positively decoded and forwarded by the 00:1e.0 bridge:
> > 
> >   yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge I/O window: 0x1000 - 0x1fff
> >   yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge Memory window: 0xd2000000 - 0xd40fffff
> >   yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge Memory window: 0xd0000000 - 0xd1ffffff
> > 
> > But the bridge is in subtractive-decode mode, so it *also* forwards
> > anything it sees that is unclaimed by other devices on bus 00, which
> > means the 04:06.0 CardBus bridge will also see these ranges:
> > 
> >   yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge I/O window: 0x0 - 0xcf7
> >   yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge I/O window: 0xd00 - 0xffff
> >   yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge Memory window: 0xa0000 - 0xbffff
> >   yenta_cardbus 0000:04:06.0: pcmcia: parent PCI bridge Memory window: 0xc0000000 - 0xfebfffff
> > 
> > Why do you care whether these additional ranges are excluded?  They
> > should be just as usable as the first three.
> 
> Quoting rsrc_nonstatic.c:
> 
>         /* If this is the root bus, the risk of hitting
>          * some strange system devices which aren't protected
>          * by either ACPI resource tables or properly requested
>          * resources is too big. [...]
>          */
> 
> Or, as Alan put it -- when it came to I/O resources in the 0x100-0x3ff area:
> 
> 	"Which crashes older thinkpads, some ATI chipset systems and
> 	 usually anything containing an NE2000 clone in ISA space."
> 
> You can still use subtractive-decoded resources, but then you have to add
> them to /etc/pcmcia/config.opts and run pcmcia-startup-bridges (or echo the
> resource to a sysfs file).

It's too bad we still have such manual configuration.  Is there still
information there that we can't figure out automatically?

> Now, "usecrs" is only used on 2008-or-newer systems where we _hope_ that all
> resource "consumers" are accounted for. So the problem might be mitigated.
> However, I wouldn't dare to use ioports 0x0-0xff anyways for they usually
> are used for onboard legacy devices...

Right.  But PCMCIA is at no greater risk than regular PCI, right?
It looks like both will allocate only above PCIBIOS_MIN_IO (0x1000).

Bjorn


From stern at rowland.harvard.edu  Mon Mar 22 16:37:56 2010
From: stern at rowland.harvard.edu (Alan Stern)
Date: Mon, 22 Mar 2010 16:37:56 -0400 (EDT)
Subject: runtime PM ops and PCMCIA bus
In-Reply-To: <20100322200339.GA7673@isilmar.linta.de>
Message-ID: <Pine.LNX.4.44L0.1003221621000.1606-100000@iolanthe.rowland.org>

On Mon, 22 Mar 2010, Dominik Brodowski wrote:

> Alan,
> 
> many thanks for your extensive feedback!

My pleasure.

> On Mon, Mar 22, 2010 at 11:38:44AM -0400, Alan Stern wrote:
> > On Sun, 21 Mar 2010, Dominik Brodowski wrote:
> > > (2) Whenever two functions local to drivers/pcmcia/ds.c --
> > >     runtime_suspend() or runtime_resume() -- are called,
> > >     we need to force a synchronous call to pcmcia_dev_suspend(),
> > >     or to pcmcia_dev_resume(). Currently, we do this by taking
> > >     device_lock() and calling the function manually.
> > 
> > That seems like the right thing to do.  (Except that I don't know what 
> > your device_lock() routine is for.)
> 
> Actually, that's the generic device_lock(), which replaced down(&dev->sem)

Heh.  Guess I'm not used to seeing it yet...

> ... which is used here to not let a reset or a runtime suspend/resume race
> with a system sleep event.

The PM core is supposed to prevent races between runtime suspend/resume
and system sleep, so you don't need to worry about that.  But you do
need to worry about races with reset (this may or may not be the best
way to handle them).


> > I don't understand.  Aren't runtime_suspend() and runtime_resume(), as 
> > mentioned above, already part of your runtime PM interface?  Or at 
> > least, intended to be part of your runtime PM interface?
> 
> Well, they are part of the PCMCIA-local runtime PM interface -- it is based
> around the concept that an user may, whenever she wants, can set a PCMCIA
> device (or the whole card) to the "suspend" state.

> Well, that's not what this "runtime_suspend()" does -- it is the wrapper for
> userspace-issued suspend commands.

> > One of the background assumptions behind the runtime PM
> > framework is that users don't tell the system when to suspend devices.  
> 
> Ah, that's the fundamental issue. I agree that the PCMCIA subsystem does
> something unusual here (relating to PCMCIA cards or PCMCIA devices) --
> but I would prefer not to break how the system currently works.

All right.  It appears that what you have implemented is really a
"power-down" or "on/off" type of interface rather than a
"runtime-suspend" interface.  You can of course have both types of
interfaces at the same time, but keep in mind that they don't work the
same way.


> > > (5) Another problem I'm seeing with the put/get approach: there are three
> > >     different callpaths where runtime_suspend() / runtime_resume() might
> > >     be called.[*] However, each one decreases the counter, which might get < 0.
> > 
> > The counter should never become negative; if it does, there's a bug in
> > your driver.  Every decrement should match a corresponding increment,
> > just like with refcounts.  And the device should never be
> > runtime-suspended unless the counter is 0.
> 
> what's the initial value, actually? Is it 0 or 1?

It is 0.

> > Instead, the system automatically suspends devices when it realizes
> > they aren't being used.
> 
> That's what we could use for PCMCIA sockets.

Yes, that sounds like an easy application.  If the socket contains no 
card, or if all devices on the card are powered-down, then the socket 
can be runtime-suspended.


> > > --- a/drivers/pcmcia/Kconfig
> > > +++ b/drivers/pcmcia/Kconfig
> > > @@ -20,6 +20,7 @@ if PCCARD
> > >  config PCMCIA
> > >  	tristate "16-bit PCMCIA support"
> > >  	select CRC32
> > > +	select PM_RUNTIME
> > 
> > This seems very wrong.  Why do you need it?  Can't the pcmcia subsystem 
> > work correctly without runtime PM support?  Hasn't it been working 
> > correctly that way all along?
> 
> Oh yes, it did. However, continuing support for the PCMCIA-style "runtime
> PM" might need to depend on PM_RUNTIME.

It shouldn't be that way.  Keep the existing PCMCIA-style interface if
you want, but realize that it is separate and independent from the
runtime PM framework and therefore it shouldn't select PM_RUNTIME.

The alternative is to remove the user's ability to power-down PCMCIA 
devices, and rely on the operating system to suspend them at the right 
times.

Alan Stern




From linux at dominikbrodowski.net  Mon Mar 22 16:51:21 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 22 Mar 2010 21:51:21 +0100
Subject: pci_bus_for_each_resource,
	transparent bridges and rsrc_nonstatic.c
In-Reply-To: <201003221436.04689.bjorn.helgaas@hp.com>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<201003221408.37858.bjorn.helgaas@hp.com>
	<20100322202135.GB7673@isilmar.linta.de>
	<201003221436.04689.bjorn.helgaas@hp.com>
Message-ID: <20100322205121.GA15250@isilmar.linta.de>

On Mon, Mar 22, 2010 at 01:36:03PM -0700, Bjorn Helgaas wrote:
> > You can still use subtractive-decoded resources, but then you have to add
> > them to /etc/pcmcia/config.opts and run pcmcia-startup-bridges (or echo the
> > resource to a sysfs file).
> 
> It's too bad we still have such manual configuration.

Agreed.

> Is there still
> information there that we can't figure out automatically?

That's unknown to me -- are there any ISA-capable systems being sold? If so,
then I suspect the answer may be "yes".

> > Now, "usecrs" is only used on 2008-or-newer systems where we _hope_ that all
> > resource "consumers" are accounted for. So the problem might be mitigated.
> > However, I wouldn't dare to use ioports 0x0-0xff anyways for they usually
> > are used for onboard legacy devices...
> 
> Right.  But PCMCIA is at no greater risk than regular PCI, right?
> It looks like both will allocate only above PCIBIOS_MIN_IO (0x1000).

No, PCMCIA will happily allocate below this limit.

Best,
	Dominik


From linux at dominikbrodowski.net  Mon Mar 22 16:58:14 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 22 Mar 2010 21:58:14 +0100
Subject: [PATCH v2] pcmcia: db1xxx-ss: suspend/resume fix
In-Reply-To: <1269287003-15523-1-git-send-email-manuel.lauss@gmail.com>
References: <1269287003-15523-1-git-send-email-manuel.lauss@gmail.com>
Message-ID: <20100322205814.GB15250@isilmar.linta.de>

Hm, what about using two commits currently in my tree for 2.6.36 instead,
which should fix all socket drivers?

    power: support _noirq actions on device types and classes
    pcmcia: use dev_pm_ops for class pcmcia_socket_class

Manuel: Could you try whether they also solve these issues? If so, I'd
propose pushing both patches already for 2.6.36. Rafael: do you concur?

Best,
	Dominik

On Mon, Mar 22, 2010 at 08:43:23PM +0100, Manuel Lauss wrote:
> This patch adds more pm method callbacks to the db1xxx-ss socket
> driver, which fixes spurious interrupts and dead cards upon resume
> from STR.
> 
> Tested on DB1200 with CF card (tons of spurious interrupts resulting
> in card interrupt being disabled) and a 3c509 card (this one was
> just dead after resume).
> 
> Signed-off-by: Manuel Lauss <manuel.lauss at gmail.com>
> ---
> v2: remove uneeded .suspend callback (which was identical to
>     suspend_noirq).

diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index d477f4d..941fcb8 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -439,8 +439,23 @@ static int device_resume_noirq(struct device *dev, pm_message_t state)
 	if (dev->bus && dev->bus->pm) {
 		pm_dev_dbg(dev, state, "EARLY ");
 		error = pm_noirq_op(dev, dev->bus->pm, state);
+		if (error)
+			goto End;
 	}
 
+	if (dev->type && dev->type->pm) {
+		pm_dev_dbg(dev, state, "EARLY type ");
+		error = pm_noirq_op(dev, dev->type->pm, state);
+		if (error)
+			goto End;
+	}
+
+	if (dev->class && dev->class->pm) {
+		pm_dev_dbg(dev, state, "EARLY class ");
+		error = pm_noirq_op(dev, dev->class->pm, state);
+	}
+
+End:
 	TRACE_RESUME(error);
 	return error;
 }
@@ -735,10 +750,26 @@ static int device_suspend_noirq(struct device *dev, pm_message_t state)
 {
 	int error = 0;
 
+	if (dev->class && dev->class->pm) {
+		pm_dev_dbg(dev, state, "LATE class ");
+		error = pm_noirq_op(dev, dev->class->pm, state);
+		if (error)
+			goto End;
+	}
+
+	if (dev->type && dev->type->pm) {
+		pm_dev_dbg(dev, state, "LATE type ");
+		error = pm_noirq_op(dev, dev->type->pm, state);
+		if (error)
+			goto End;
+	}
+
 	if (dev->bus && dev->bus->pm) {
 		pm_dev_dbg(dev, state, "LATE ");
 		error = pm_noirq_op(dev, dev->bus->pm, state);
 	}
+
+End:
 	return error;
 }
 
diff --git a/drivers/pcmcia/at91_cf.c b/drivers/pcmcia/at91_cf.c
index 5d22807..fb904f4 100644
--- a/drivers/pcmcia/at91_cf.c
+++ b/drivers/pcmcia/at91_cf.c
@@ -361,7 +361,6 @@ static int at91_cf_suspend(struct platform_device *pdev, pm_message_t mesg)
 	struct at91_cf_socket	*cf = platform_get_drvdata(pdev);
 	struct at91_cf_data	*board = cf->board;
 
-	pcmcia_socket_dev_suspend(&pdev->dev);
 	if (device_may_wakeup(&pdev->dev)) {
 		enable_irq_wake(board->det_pin);
 		if (board->irq_pin)
@@ -381,7 +380,6 @@ static int at91_cf_resume(struct platform_device *pdev)
 			disable_irq_wake(board->irq_pin);
 	}
 
-	pcmcia_socket_dev_resume(&pdev->dev);
 	return 0;
 }
 
diff --git a/drivers/pcmcia/au1000_generic.c b/drivers/pcmcia/au1000_generic.c
index 171c8a6..ac4d089 100644
--- a/drivers/pcmcia/au1000_generic.c
+++ b/drivers/pcmcia/au1000_generic.c
@@ -510,17 +510,6 @@ static int au1x00_drv_pcmcia_probe(struct platform_device *dev)
 	return ret;
 }
 
-static int au1x00_drv_pcmcia_suspend(struct platform_device *dev,
-				     pm_message_t state)
-{
-	return pcmcia_socket_dev_suspend(&dev->dev);
-}
-
-static int au1x00_drv_pcmcia_resume(struct platform_device *dev)
-{
-	return pcmcia_socket_dev_resume(&dev->dev);
-}
-
 static struct platform_driver au1x00_pcmcia_driver = {
 	.driver = {
 		.name		= "au1x00-pcmcia",
@@ -528,8 +517,6 @@ static struct platform_driver au1x00_pcmcia_driver = {
 	},
 	.probe		= au1x00_drv_pcmcia_probe,
 	.remove		= au1x00_drv_pcmcia_remove,
-	.suspend 	= au1x00_drv_pcmcia_suspend,
-	.resume 	= au1x00_drv_pcmcia_resume,
 };
 
 
diff --git a/drivers/pcmcia/bfin_cf_pcmcia.c b/drivers/pcmcia/bfin_cf_pcmcia.c
index 1744f38..b16f209 100644
--- a/drivers/pcmcia/bfin_cf_pcmcia.c
+++ b/drivers/pcmcia/bfin_cf_pcmcia.c
@@ -300,16 +300,6 @@ static int __devexit bfin_cf_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static int bfin_cf_suspend(struct platform_device *pdev, pm_message_t mesg)
-{
-	return pcmcia_socket_dev_suspend(&pdev->dev);
-}
-
-static int bfin_cf_resume(struct platform_device *pdev)
-{
-	return pcmcia_socket_dev_resume(&pdev->dev);
-}
-
 static struct platform_driver bfin_cf_driver = {
 	.driver = {
 		   .name = (char *)driver_name,
@@ -317,8 +307,6 @@ static struct platform_driver bfin_cf_driver = {
 		   },
 	.probe = bfin_cf_probe,
 	.remove = __devexit_p(bfin_cf_remove),
-	.suspend = bfin_cf_suspend,
-	.resume = bfin_cf_resume,
 };
 
 static int __init bfin_cf_init(void)
diff --git a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c
index 2295837..4c1bb8a 100644
--- a/drivers/pcmcia/cs.c
+++ b/drivers/pcmcia/cs.c
@@ -76,65 +76,6 @@ DECLARE_RWSEM(pcmcia_socket_list_rwsem);
 EXPORT_SYMBOL(pcmcia_socket_list_rwsem);
 
 
-/*
- * Low-level PCMCIA socket drivers need to register with the PCCard
- * core using pcmcia_register_socket.
- *
- * socket drivers are expected to use the following callbacks in their
- * .drv struct:
- *  - pcmcia_socket_dev_suspend
- *  - pcmcia_socket_dev_resume
- * These functions check for the appropriate struct pcmcia_soket arrays,
- * and pass them to the low-level functions pcmcia_{suspend,resume}_socket
- */
-static int socket_early_resume(struct pcmcia_socket *skt);
-static int socket_late_resume(struct pcmcia_socket *skt);
-static int socket_resume(struct pcmcia_socket *skt);
-static int socket_suspend(struct pcmcia_socket *skt);
-
-static void pcmcia_socket_dev_run(struct device *dev,
-				  int (*cb)(struct pcmcia_socket *))
-{
-	struct pcmcia_socket *socket;
-
-	down_read(&pcmcia_socket_list_rwsem);
-	list_for_each_entry(socket, &pcmcia_socket_list, socket_list) {
-		if (socket->dev.parent != dev)
-			continue;
-		mutex_lock(&socket->skt_mutex);
-		cb(socket);
-		mutex_unlock(&socket->skt_mutex);
-	}
-	up_read(&pcmcia_socket_list_rwsem);
-}
-
-int pcmcia_socket_dev_suspend(struct device *dev)
-{
-	pcmcia_socket_dev_run(dev, socket_suspend);
-	return 0;
-}
-EXPORT_SYMBOL(pcmcia_socket_dev_suspend);
-
-void pcmcia_socket_dev_early_resume(struct device *dev)
-{
-	pcmcia_socket_dev_run(dev, socket_early_resume);
-}
-EXPORT_SYMBOL(pcmcia_socket_dev_early_resume);
-
-void pcmcia_socket_dev_late_resume(struct device *dev)
-{
-	pcmcia_socket_dev_run(dev, socket_late_resume);
-}
-EXPORT_SYMBOL(pcmcia_socket_dev_late_resume);
-
-int pcmcia_socket_dev_resume(struct device *dev)
-{
-	pcmcia_socket_dev_run(dev, socket_resume);
-	return 0;
-}
-EXPORT_SYMBOL(pcmcia_socket_dev_resume);
-
-
 struct pcmcia_socket *pcmcia_get_socket(struct pcmcia_socket *skt)
 {
 	struct device *dev = get_device(&skt->dev);
@@ -577,12 +518,18 @@ static int socket_early_resume(struct pcmcia_socket *skt)
 
 static int socket_late_resume(struct pcmcia_socket *skt)
 {
+	int ret;
+
 	mutex_lock(&skt->ops_mutex);
 	skt->state &= ~SOCKET_SUSPEND;
 	mutex_unlock(&skt->ops_mutex);
 
-	if (!(skt->state & SOCKET_PRESENT))
-		return socket_insert(skt);
+	if (!(skt->state & SOCKET_PRESENT)) {
+		ret = socket_insert(skt);
+		if (ret == -ENODEV)
+			ret = 0;
+		return ret;
+	}
 
 	if (skt->resume_status) {
 		socket_shutdown(skt);
@@ -918,11 +865,66 @@ static void pcmcia_release_socket_class(struct class *data)
 }
 
 
+#ifdef CONFIG_PM
+
+static int __pcmcia_pm_op(struct device *dev,
+			  int (*callback) (struct pcmcia_socket *skt))
+{
+	struct pcmcia_socket *s = container_of(dev, struct pcmcia_socket, dev);
+	int ret;
+
+	mutex_lock(&s->skt_mutex);
+	ret = callback(s);
+	mutex_unlock(&s->skt_mutex);
+
+	return ret;
+}
+
+static int pcmcia_socket_dev_suspend_noirq(struct device *dev)
+{
+	return __pcmcia_pm_op(dev, socket_suspend);
+}
+
+static int pcmcia_socket_dev_resume_noirq(struct device *dev)
+{
+	return __pcmcia_pm_op(dev, socket_early_resume);
+}
+
+static int pcmcia_socket_dev_resume(struct device *dev)
+{
+	return __pcmcia_pm_op(dev, socket_late_resume);
+}
+
+static const struct dev_pm_ops pcmcia_socket_pm_ops = {
+	/* dev_resume may be called with IRQs enabled */
+	SET_SYSTEM_SLEEP_PM_OPS(NULL,
+				pcmcia_socket_dev_resume)
+
+	/* late suspend must be called with IRQs disabled */
+	.suspend_noirq = pcmcia_socket_dev_suspend_noirq,
+	.freeze_noirq = pcmcia_socket_dev_suspend_noirq,
+	.poweroff_noirq = pcmcia_socket_dev_suspend_noirq,
+
+	/* early resume must be called with IRQs disabled */
+	.resume_noirq = pcmcia_socket_dev_resume_noirq,
+	.thaw_noirq = pcmcia_socket_dev_resume_noirq,
+	.restore_noirq = pcmcia_socket_dev_resume_noirq,
+};
+
+#define PCMCIA_SOCKET_CLASS_PM_OPS (&pcmcia_socket_pm_ops)
+
+#else /* CONFIG_PM */
+
+#define PCMCIA_SOCKET_CLASS_PM_OPS NULL
+
+#endif /* CONFIG_PM */
+
 struct class pcmcia_socket_class = {
 	.name = "pcmcia_socket",
 	.dev_uevent = pcmcia_socket_uevent,
 	.dev_release = pcmcia_release_socket,
 	.class_release = pcmcia_release_socket_class,
+	.pm = PCMCIA_SOCKET_CLASS_PM_OPS,
 };
 EXPORT_SYMBOL(pcmcia_socket_class);
 
diff --git a/drivers/pcmcia/db1xxx_ss.c b/drivers/pcmcia/db1xxx_ss.c
index 9254ab0..a520193 100644
--- a/drivers/pcmcia/db1xxx_ss.c
+++ b/drivers/pcmcia/db1xxx_ss.c
@@ -558,37 +558,10 @@ static int __devexit db1x_pcmcia_socket_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM
-static int db1x_pcmcia_suspend(struct device *dev)
-{
-	return pcmcia_socket_dev_suspend(dev);
-}
-
-static int db1x_pcmcia_resume(struct device *dev)
-{
-	return pcmcia_socket_dev_resume(dev);
-}
-
-static struct dev_pm_ops db1x_pcmcia_pmops = {
-	.resume		= db1x_pcmcia_resume,
-	.suspend	= db1x_pcmcia_suspend,
-	.thaw		= db1x_pcmcia_resume,
-	.freeze		= db1x_pcmcia_suspend,
-};
-
-#define DB1XXX_SS_PMOPS &db1x_pcmcia_pmops
-
-#else
-
-#define DB1XXX_SS_PMOPS NULL
-
-#endif
-
 static struct platform_driver db1x_pcmcia_socket_driver = {
 	.driver	= {
 		.name	= "db1xxx_pcmcia",
 		.owner	= THIS_MODULE,
-		.pm	= DB1XXX_SS_PMOPS
 	},
 	.probe		= db1x_pcmcia_socket_probe,
 	.remove		= __devexit_p(db1x_pcmcia_socket_remove),
diff --git a/drivers/pcmcia/i82092.c b/drivers/pcmcia/i82092.c
index f5da626..3003bb3 100644
--- a/drivers/pcmcia/i82092.c
+++ b/drivers/pcmcia/i82092.c
@@ -39,27 +39,11 @@ static struct pci_device_id i82092aa_pci_ids[] = {
 };
 MODULE_DEVICE_TABLE(pci, i82092aa_pci_ids);
 
-#ifdef CONFIG_PM
-static int i82092aa_socket_suspend (struct pci_dev *dev, pm_message_t state)
-{
-	return pcmcia_socket_dev_suspend(&dev->dev);
-}
-
-static int i82092aa_socket_resume (struct pci_dev *dev)
-{
-	return pcmcia_socket_dev_resume(&dev->dev);
-}
-#endif
-
 static struct pci_driver i82092aa_pci_driver = {
 	.name           = "i82092aa",
 	.id_table       = i82092aa_pci_ids,
 	.probe          = i82092aa_pci_probe,
 	.remove         = __devexit_p(i82092aa_pci_remove),
-#ifdef CONFIG_PM
-	.suspend        = i82092aa_socket_suspend,
-	.resume         = i82092aa_socket_resume,
-#endif
 };
 
 
diff --git a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c
index c13fd93..d53d9b5 100644
--- a/drivers/pcmcia/i82365.c
+++ b/drivers/pcmcia/i82365.c
@@ -1223,16 +1223,7 @@ static int pcic_init(struct pcmcia_socket *s)
 	return 0;
 }
 
-static int i82365_drv_pcmcia_suspend(struct platform_device *dev,
-				     pm_message_t state)
-{
-	return pcmcia_socket_dev_suspend(&dev->dev);
-}
 
-static int i82365_drv_pcmcia_resume(struct platform_device *dev)
-{
-	return pcmcia_socket_dev_resume(&dev->dev);
-}
 static struct pccard_operations pcic_operations = {
 	.init			= pcic_init,
 	.get_status		= pcic_get_status,
@@ -1248,8 +1239,6 @@ static struct platform_driver i82365_driver = {
 		.name = "i82365",
 		.owner		= THIS_MODULE,
 	},
-	.suspend 	= i82365_drv_pcmcia_suspend,
-	.resume 	= i82365_drv_pcmcia_resume,
 };
 
 static struct platform_device *i82365_device;
diff --git a/drivers/pcmcia/m32r_cfc.c b/drivers/pcmcia/m32r_cfc.c
index 0ece2cd..ab21264 100644
--- a/drivers/pcmcia/m32r_cfc.c
+++ b/drivers/pcmcia/m32r_cfc.c
@@ -685,16 +685,7 @@ static struct pccard_operations pcc_operations = {
 	.set_mem_map		= pcc_set_mem_map,
 };
 
-static int cfc_drv_pcmcia_suspend(struct platform_device *dev,
-				     pm_message_t state)
-{
-	return pcmcia_socket_dev_suspend(&dev->dev);
-}
 
-static int cfc_drv_pcmcia_resume(struct platform_device *dev)
-{
-	return pcmcia_socket_dev_resume(&dev->dev);
-}
 /*====================================================================*/
 
 static struct platform_driver pcc_driver = {
@@ -702,8 +693,6 @@ static struct platform_driver pcc_driver = {
 		.name		= "cfc",
 		.owner		= THIS_MODULE,
 	},
-	.suspend 	= cfc_drv_pcmcia_suspend,
-	.resume 	= cfc_drv_pcmcia_resume,
 };
 
 static struct platform_device pcc_device = {
diff --git a/drivers/pcmcia/m32r_pcc.c b/drivers/pcmcia/m32r_pcc.c
index 72844c5..0caf3db 100644
--- a/drivers/pcmcia/m32r_pcc.c
+++ b/drivers/pcmcia/m32r_pcc.c
@@ -663,16 +663,6 @@ static struct pccard_operations pcc_operations = {
 	.set_mem_map		= pcc_set_mem_map,
 };
 
-static int pcc_drv_pcmcia_suspend(struct platform_device *dev,
-				     pm_message_t state)
-{
-	return pcmcia_socket_dev_suspend(&dev->dev);
-}
-
-static int pcc_drv_pcmcia_resume(struct platform_device *dev)
-{
-	return pcmcia_socket_dev_resume(&dev->dev);
-}
 /*====================================================================*/
 
 static struct platform_driver pcc_driver = {
@@ -680,8 +670,6 @@ static struct platform_driver pcc_driver = {
 		.name		= "pcc",
 		.owner		= THIS_MODULE,
 	},
-	.suspend 	= pcc_drv_pcmcia_suspend,
-	.resume 	= pcc_drv_pcmcia_resume,
 };
 
 static struct platform_device pcc_device = {
diff --git a/drivers/pcmcia/m8xx_pcmcia.c b/drivers/pcmcia/m8xx_pcmcia.c
index 61c2159..01ef7de 100644
--- a/drivers/pcmcia/m8xx_pcmcia.c
+++ b/drivers/pcmcia/m8xx_pcmcia.c
@@ -1288,21 +1288,6 @@ static int m8xx_remove(struct of_device *ofdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM
-static int m8xx_suspend(struct platform_device *pdev, pm_message_t state)
-{
-	return pcmcia_socket_dev_suspend(&pdev->dev);
-}
-
-static int m8xx_resume(struct platform_device *pdev)
-{
-	return pcmcia_socket_dev_resume(&pdev->dev);
-}
-#else
-#define m8xx_suspend NULL
-#define m8xx_resume NULL
-#endif
-
 static const struct of_device_id m8xx_pcmcia_match[] = {
 	{
 	 .type = "pcmcia",
@@ -1318,8 +1303,6 @@ static struct of_platform_driver m8xx_pcmcia_driver = {
 	.match_table = m8xx_pcmcia_match,
 	.probe = m8xx_probe,
 	.remove = m8xx_remove,
-	.suspend = m8xx_suspend,
-	.resume = m8xx_resume,
 };
 
 static int __init m8xx_init(void)
diff --git a/drivers/pcmcia/omap_cf.c b/drivers/pcmcia/omap_cf.c
index 7d49ba0..eef5f1c 100644
--- a/drivers/pcmcia/omap_cf.c
+++ b/drivers/pcmcia/omap_cf.c
@@ -330,24 +330,12 @@ static int __exit omap_cf_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static int omap_cf_suspend(struct platform_device *pdev, pm_message_t mesg)
-{
-	return pcmcia_socket_dev_suspend(&pdev->dev);
-}
-
-static int omap_cf_resume(struct platform_device *pdev)
-{
-	return pcmcia_socket_dev_resume(&pdev->dev);
-}
-
 static struct platform_driver omap_cf_driver = {
 	.driver = {
 		.name	= (char *) driver_name,
 		.owner	= THIS_MODULE,
 	},
 	.remove		= __exit_p(omap_cf_remove),
-	.suspend	= omap_cf_suspend,
-	.resume		= omap_cf_resume,
 };
 
 static int __init omap_cf_init(void)
diff --git a/drivers/pcmcia/pd6729.c b/drivers/pcmcia/pd6729.c
index 47f342f..4a34268 100644
--- a/drivers/pcmcia/pd6729.c
+++ b/drivers/pcmcia/pd6729.c
@@ -764,18 +764,6 @@ static void __devexit pd6729_pci_remove(struct pci_dev *dev)
 	kfree(socket);
 }
 
-#ifdef CONFIG_PM
-static int pd6729_socket_suspend(struct pci_dev *dev, pm_message_t state)
-{
-	return pcmcia_socket_dev_suspend(&dev->dev);
-}
-
-static int pd6729_socket_resume(struct pci_dev *dev)
-{
-	return pcmcia_socket_dev_resume(&dev->dev);
-}
-#endif
-
 static struct pci_device_id pd6729_pci_ids[] = {
 	{
 		.vendor		= PCI_VENDOR_ID_CIRRUS,
@@ -792,10 +780,6 @@ static struct pci_driver pd6729_pci_driver = {
 	.id_table	= pd6729_pci_ids,
 	.probe		= pd6729_pci_probe,
 	.remove		= __devexit_p(pd6729_pci_remove),
-#ifdef CONFIG_PM
-	.suspend	= pd6729_socket_suspend,
-	.resume		= pd6729_socket_resume,
-#endif
 };
 
 static int pd6729_module_init(void)
diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c
index 76e640b..0a876fa 100644
--- a/drivers/pcmcia/pxa2xx_base.c
+++ b/drivers/pcmcia/pxa2xx_base.c
@@ -325,19 +325,13 @@ static int pxa2xx_drv_pcmcia_remove(struct platform_device *dev)
 	return 0;
 }
 
-static int pxa2xx_drv_pcmcia_suspend(struct device *dev)
-{
-	return pcmcia_socket_dev_suspend(dev);
-}
-
 static int pxa2xx_drv_pcmcia_resume(struct device *dev)
 {
 	pxa2xx_configure_sockets(dev);
-	return pcmcia_socket_dev_resume(dev);
+	return 0;
 }
 
 static const struct dev_pm_ops pxa2xx_drv_pcmcia_pm_ops = {
-	.suspend	= pxa2xx_drv_pcmcia_suspend,
 	.resume		= pxa2xx_drv_pcmcia_resume,
 };
 
diff --git a/drivers/pcmcia/sa1100_generic.c b/drivers/pcmcia/sa1100_generic.c
index 8db86b9..5188962 100644
--- a/drivers/pcmcia/sa1100_generic.c
+++ b/drivers/pcmcia/sa1100_generic.c
@@ -95,17 +95,6 @@ static int sa11x0_drv_pcmcia_remove(struct platform_device *dev)
 	return 0;
 }
 
-static int sa11x0_drv_pcmcia_suspend(struct platform_device *dev,
-				     pm_message_t state)
-{
-	return pcmcia_socket_dev_suspend(&dev->dev);
-}
-
-static int sa11x0_drv_pcmcia_resume(struct platform_device *dev)
-{
-	return pcmcia_socket_dev_resume(&dev->dev);
-}
-
 static struct platform_driver sa11x0_pcmcia_driver = {
 	.driver = {
 		.name		= "sa11x0-pcmcia",
@@ -113,8 +102,6 @@ static struct platform_driver sa11x0_pcmcia_driver = {
 	},
 	.probe		= sa11x0_drv_pcmcia_probe,
 	.remove		= sa11x0_drv_pcmcia_remove,
-	.suspend 	= sa11x0_drv_pcmcia_suspend,
-	.resume 	= sa11x0_drv_pcmcia_resume,
 };
 
 /* sa11x0_pcmcia_init()
diff --git a/drivers/pcmcia/sa1111_generic.c b/drivers/pcmcia/sa1111_generic.c
index db79ca6..799e979 100644
--- a/drivers/pcmcia/sa1111_generic.c
+++ b/drivers/pcmcia/sa1111_generic.c
@@ -213,16 +213,6 @@ static int __devexit pcmcia_remove(struct sa1111_dev *dev)
 	return 0;
 }
 
-static int pcmcia_suspend(struct sa1111_dev *dev, pm_message_t state)
-{
-	return pcmcia_socket_dev_suspend(&dev->dev);
-}
-
-static int pcmcia_resume(struct sa1111_dev *dev)
-{
-	return pcmcia_socket_dev_resume(&dev->dev);
-}
-
 static struct sa1111_driver pcmcia_driver = {
 	.drv = {
 		.name	= "sa1111-pcmcia",
@@ -230,8 +220,6 @@ static struct sa1111_driver pcmcia_driver = {
 	.devid		= SA1111_DEVID_PCMCIA,
 	.probe		= pcmcia_probe,
 	.remove		= __devexit_p(pcmcia_remove),
-	.suspend	= pcmcia_suspend,
-	.resume		= pcmcia_resume,
 };
 
 static int __init sa1111_drv_pcmcia_init(void)
diff --git a/drivers/pcmcia/tcic.c b/drivers/pcmcia/tcic.c
index 12c49ee..bac85f3 100644
--- a/drivers/pcmcia/tcic.c
+++ b/drivers/pcmcia/tcic.c
@@ -348,16 +348,6 @@ static int __init get_tcic_id(void)
     return id;
 }
 
-static int tcic_drv_pcmcia_suspend(struct platform_device *dev,
-				     pm_message_t state)
-{
-	return pcmcia_socket_dev_suspend(&dev->dev);
-}
-
-static int tcic_drv_pcmcia_resume(struct platform_device *dev)
-{
-	return pcmcia_socket_dev_resume(&dev->dev);
-}
 /*====================================================================*/
 
 static struct platform_driver tcic_driver = {
@@ -365,8 +355,6 @@ static struct platform_driver tcic_driver = {
 		.name = "tcic-pcmcia",
 		.owner		= THIS_MODULE,
 	},
-	.suspend 	= tcic_drv_pcmcia_suspend,
-	.resume 	= tcic_drv_pcmcia_resume,
 };
 
 static struct platform_device tcic_device = {
diff --git a/drivers/pcmcia/vrc4171_card.c b/drivers/pcmcia/vrc4171_card.c
index aaccdb9..86e4a1a 100644
--- a/drivers/pcmcia/vrc4171_card.c
+++ b/drivers/pcmcia/vrc4171_card.c
@@ -705,24 +705,11 @@ static int __devinit vrc4171_card_setup(char *options)
 
 __setup("vrc4171_card=", vrc4171_card_setup);
 
-static int vrc4171_card_suspend(struct platform_device *dev,
-				     pm_message_t state)
-{
-	return pcmcia_socket_dev_suspend(&dev->dev);
-}
-
-static int vrc4171_card_resume(struct platform_device *dev)
-{
-	return pcmcia_socket_dev_resume(&dev->dev);
-}
-
 static struct platform_driver vrc4171_card_driver = {
 	.driver = {
 		.name		= vrc4171_card_name,
 		.owner		= THIS_MODULE,
 	},
-	.suspend	= vrc4171_card_suspend,
-	.resume		= vrc4171_card_resume,
 };
 
 static int __devinit vrc4171_card_init(void)
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
index 418988a..f19ad02 100644
--- a/drivers/pcmcia/yenta_socket.c
+++ b/drivers/pcmcia/yenta_socket.c
@@ -1290,12 +1290,9 @@ static int yenta_dev_suspend_noirq(struct device *dev)
 {
 	struct pci_dev *pdev = to_pci_dev(dev);
 	struct yenta_socket *socket = pci_get_drvdata(pdev);
-	int ret;
-
-	ret = pcmcia_socket_dev_suspend(dev);
 
 	if (!socket)
-		return ret;
+		return 0;
 
 	if (socket->type && socket->type->save_state)
 		socket->type->save_state(socket);
@@ -1312,7 +1309,7 @@ static int yenta_dev_suspend_noirq(struct device *dev)
 	 */
 	/* pci_set_power_state(dev, 3); */
 
-	return ret;
+	return 0;
 }
 
 static int yenta_dev_resume_noirq(struct device *dev)
@@ -1336,26 +1333,16 @@ static int yenta_dev_resume_noirq(struct device *dev)
 	if (socket->type && socket->type->restore_state)
 		socket->type->restore_state(socket);
 
-	pcmcia_socket_dev_early_resume(dev);
-	return 0;
-}
-
-static int yenta_dev_resume(struct device *dev)
-{
-	pcmcia_socket_dev_late_resume(dev);
 	return 0;
 }
 
 static const struct dev_pm_ops yenta_pm_ops = {
 	.suspend_noirq = yenta_dev_suspend_noirq,
 	.resume_noirq = yenta_dev_resume_noirq,
-	.resume = yenta_dev_resume,
 	.freeze_noirq = yenta_dev_suspend_noirq,
 	.thaw_noirq = yenta_dev_resume_noirq,
-	.thaw = yenta_dev_resume,
 	.poweroff_noirq = yenta_dev_suspend_noirq,
 	.restore_noirq = yenta_dev_resume_noirq,
-	.restore = yenta_dev_resume,
 };
 
 #define YENTA_PM_OPS	(&yenta_pm_ops)
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h
index 313c912..5a109c8 100644
--- a/include/pcmcia/ss.h
+++ b/include/pcmcia/ss.h
@@ -275,12 +275,6 @@ extern struct pccard_resource_ops pccard_nonstatic_ops;
 #endif
 
 
-/* socket drivers are expected to use these callbacks in their .drv struct */
-extern int pcmcia_socket_dev_suspend(struct device *dev);
-extern void pcmcia_socket_dev_early_resume(struct device *dev);
-extern void pcmcia_socket_dev_late_resume(struct device *dev);
-extern int pcmcia_socket_dev_resume(struct device *dev);
-
 /* socket drivers use this callback in their IRQ handler */
 extern void pcmcia_parse_events(struct pcmcia_socket *socket,
 				unsigned int events);


From linux at dominikbrodowski.net  Mon Mar 22 18:05:50 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 22 Mar 2010 23:05:50 +0100
Subject: Boot options
In-Reply-To: <1269284477.4ba7be7d31587@imp.free.fr>
References: <1269284477.4ba7be7d31587@imp.free.fr>
Message-ID: <20100322220550.GA4666@comet.dominikbrodowski.net>

Hi,

On Mon, Mar 22, 2010 at 08:01:17PM +0100, Cyrille GRINNER wrote:
> Here is the dmesg after a boot test with acpi=off pci=usepirqmask:

last message for today -- what's the "dmesg" ater a boot test with
"acpi=off pci=biosirq"?

Best,
	Dominik


From bjorn.helgaas at hp.com  Mon Mar 22 18:28:55 2010
From: bjorn.helgaas at hp.com (Bjorn Helgaas)
Date: Mon, 22 Mar 2010 15:28:55 -0700
Subject: pci_bus_for_each_resource,
	transparent bridges and rsrc_nonstatic.c
In-Reply-To: <20100322205121.GA15250@isilmar.linta.de>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<201003221436.04689.bjorn.helgaas@hp.com>
	<20100322205121.GA15250@isilmar.linta.de>
Message-ID: <201003221628.56232.bjorn.helgaas@hp.com>

On Monday 22 March 2010 02:51:21 pm Dominik Brodowski wrote:
> On Mon, Mar 22, 2010 at 01:36:03PM -0700, Bjorn Helgaas wrote:
> > > You can still use subtractive-decoded resources, but then you have to add
> > > them to /etc/pcmcia/config.opts and run pcmcia-startup-bridges (or echo the
> > > resource to a sysfs file).
> > 
> > It's too bad we still have such manual configuration.
> 
> Agreed.
> 
> > Is there still
> > information there that we can't figure out automatically?
> 
> That's unknown to me -- are there any ISA-capable systems being sold? If so,
> then I suspect the answer may be "yes".
> 
> > > Now, "usecrs" is only used on 2008-or-newer systems where we _hope_ that all
> > > resource "consumers" are accounted for. So the problem might be mitigated.
> > > However, I wouldn't dare to use ioports 0x0-0xff anyways for they usually
> > > are used for onboard legacy devices...
> > 
> > Right.  But PCMCIA is at no greater risk than regular PCI, right?
> > It looks like both will allocate only above PCIBIOS_MIN_IO (0x1000).
> 
> No, PCMCIA will happily allocate below this limit.

I saw "#define PCIBIOS_MIN_CARDBUS_IO PCIBIOS_MIN_IO" in yenta_socket.c
and assumed it would take care of this, but I didn't look any deeper.

I'm still confused about why PCMCIA is "special" in this regard and
why pci=use_crs breaks it.  Can you make up an example that illustrates
the problem?

Bjorn


From cyrille at grinner.fr  Mon Mar 22 18:37:49 2010
From: cyrille at grinner.fr (Cyrille GRINNER)
Date: Mon, 22 Mar 2010 23:37:49 +0100
Subject: Boot options acpi=off pci=biosirq   dmesg
Message-ID: <1269297469.4ba7f13da7444@imp.free.fr>



rved, 2142k data, 540k init, 0k highmem)
[    0.000000] virtual kernel memory layout:
[    0.000000]     fixmap  : 0xfff1d000 - 0xfffff000   ( 904 kB)
[    0.000000]     pkmap   : 0xff800000 - 0xffc00000   (4096 kB)
[    0.000000]     vmalloc : 0xe0670000 - 0xff7fe000   ( 497 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xdfe70000   ( 510 MB)
[    0.000000]       .init : 0xc078e000 - 0xc0815000   ( 540 kB)
[    0.000000]       .data : 0xc0575b94 - 0xc078d3c8   (2142 kB)
[    0.000000]       .text : 0xc0100000 - 0xc0575b94   (4566 kB)
[    0.000000] Checking if this processor honours the WP bit even in supervisor
mode...Ok.
[    0.000000] SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1,
Nodes=1
[    0.000000] NR_IRQS:2304 nr_irqs:256
[    0.000000] Fast TSC calibration using PIT
[    0.000000] Detected 596.238 MHz processor.
[    0.001968] Console: colour VGA+ 80x25
[    0.001985] console [tty0] enabled
[    0.004000] Calibrating delay loop (skipped), value calculated using timer
frequency.. 1192.47 BogoMIPS (lpj=2384952)
[    0.004000] Security Framework initialized
[    0.004000] AppArmor: AppArmor initialized
[    0.004000] Mount-cache hash table entries: 512
[    0.004000] Initializing cgroup subsys ns
[    0.004000] Initializing cgroup subsys cpuacct
[    0.004000] Initializing cgroup subsys memory
[    0.004000] Initializing cgroup subsys freezer
[    0.004000] Initializing cgroup subsys net_cls
[    0.004000] CPU: L1 I cache: 16K, L1 D cache: 16K
[    0.004000] CPU: L2 cache: 128K
[    0.004000] mce: CPU supports 5 MCE banks
[    0.004000] Performance Counters:
[    0.004000] no APIC, boot with the "lapic" boot parameter to force-enable it.
[    0.004000] no hardware sampling interrupt available.
[    0.004000] p6 PMU driver.
[    0.004000] ... version:                 0
[    0.004000] ... bit width:               32
[    0.004000] ... generic counters:        2
[    0.004000] ... value mask:              00000000ffffffff
[    0.004000] ... max period:              000000007fffffff
[    0.004000] ... fixed-purpose counters:  0
[    0.004000] ... counter mask:            0000000000000003
[    0.004000] Checking 'hlt' instruction... OK.
[    0.017908] SMP alternatives: switching to UP code
[    0.032069] Freeing SMP alternatives: 19k freed
[    0.032493] weird, boot CPU (#0) not listed by the BIOS.
[    0.032577] SMP motherboard not detected.
[    0.032645] Local APIC not detected. Using dummy APIC emulation.
[    0.032716] SMP disabled
[    0.033547] Brought up 1 CPUs
[    0.033641] Total of 1 processors activated (1192.47 BogoMIPS).
[    0.033768] CPU0 attaching NULL sched-domain.
[    0.034941] Booting paravirtualized kernel on bare hardware
[    0.036529] regulator: core version 0.5
[    0.036656] Time: 23:28:02  Date: 03/22/10
[    0.036951] NET: Registered protocol family 16
[    0.037533] EISA bus registered
[    0.045810] PCI: PCI BIOS revision 2.10 entry at 0xfd9b0, last bus=1
[    0.045903] PCI: Using configuration type 1 for base access
[    0.050376] bio: create slab <bio-0> at 0
[    0.050816] ACPI: Interpreter disabled.
[    0.051459] SCSI subsystem initialized
[    0.051811] libata version 3.00 loaded.
[    0.052285] usbcore: registered new interface driver usbfs
[    0.052433] usbcore: registered new interface driver hub
[    0.052665] usbcore: registered new device driver usb
[    0.053308] PCI: Probing PCI hardware
[    0.053387] PCI: Probing PCI hardware (bus 00)
[    0.053628] pci 0000:00:02.0: reg 10 32bit mmio: [0xf8000000-0xfbffffff]
[    0.053648] pci 0000:00:02.0: reg 14 32bit mmio: [0xf4000000-0xf407ffff]
[    0.053894] pci 0000:00:1f.0: quirk: region 1000-107f claimed by ICH4
ACPI/GPIO/TCO
[    0.053995] pci 0000:00:1f.0: quirk: region 1180-11bf claimed by ICH4 GPIO
[    0.054139] pci 0000:00:1f.1: reg 20 io port: [0x1800-0x180f]
[    0.054239] pci 0000:00:1f.2: reg 20 io port: [0x1820-0x183f]
[    0.054344] pci 0000:00:1f.3: reg 20 io port: [0x1810-0x181f]
[    0.054442] pci 0000:00:1f.4: reg 20 io port: [0x1840-0x185f]
[    0.054513] pci 0000:00:1f.5: reg 10 io port: [0x1c00-0x1cff]
[    0.054531] pci 0000:00:1f.5: reg 14 io port: [0x1880-0x18bf]
[    0.054623] pci 0000:00:1f.6: reg 10 io port: [0x2400-0x24ff]
[    0.054642] pci 0000:00:1f.6: reg 14 io port: [0x2000-0x207f]
[    0.054764] pci 0000:01:00.0: reg 10 32bit mmio: [0xf4104000-0xf41047ff]
[    0.054785] pci 0000:01:00.0: reg 14 32bit mmio: [0xf4100000-0xf4103fff]
[    0.054855] pci 0000:01:00.0: supports D2
[    0.054866] pci 0000:01:00.0: PME# supported from D2 D3hot
[    0.054943] pci 0000:01:00.0: PME# disabled
[    0.055067] pci 0000:01:02.0: reg 10 32bit mmio: [0x000000-0x000fff]
[    0.055103] pci 0000:01:02.0: supports D1 D2
[    0.055113] pci 0000:01:02.0: PME# supported from D0 D1 D2 D3hot D3cold
[    0.055192] pci 0000:01:02.0: PME# disabled
[    0.055313] pci 0000:01:02.1: reg 10 32bit mmio: [0x000000-0x000fff]
[    0.055349] pci 0000:01:02.1: supports D1 D2
[    0.055359] pci 0000:01:02.1: PME# supported from D0 D1 D2 D3hot D3cold
[    0.055437] pci 0000:01:02.1: PME# disabled
[    0.055574] pci 0000:00:1e.0: transparent bridge
[    0.055652] pci 0000:00:1e.0: bridge 32bit mmio: [0xf4100000-0xf41fffff]
[    0.057333] pci 0000:00:1f.0: PIIX/ICH IRQ router [8086:244c]
[    0.058058] Bluetooth: Core ver 2.15
[    0.058440] NET: Registered protocol family 31
[    0.058520] Bluetooth: HCI device and connection manager initialized
[    0.058597] Bluetooth: HCI socket layer initialized
[    0.058667] NetLabel: Initializing
[    0.058731] NetLabel:  domain hash size = 128
[    0.058798] NetLabel:  protocols = UNLABELED CIPSOv4
[    0.058923] NetLabel:  unlabeled traffic allowed by default
[    0.067758] pnp: PnP ACPI: disabled
[    0.067861] PnPBIOS: Scanning system for PnP BIOS support...
[    0.068103] PnPBIOS: Found PnP BIOS installation structure at 0xc00f7470
[    0.068190] PnPBIOS: PnP BIOS version 1.0, entry 0xf0000:0xa88d, dseg 0x400
[    0.069972] pnp 00:0a: io resource (0x1000-0x105f) overlaps 0000:00:1f.0 BAR
13 (0x1000-0x107f), disabling
[    0.070089] pnp 00:0a: io resource (0x1060-0x107f) overlaps 0000:00:1f.0 BAR
13 (0x1000-0x107f), disabling
[    0.071798] PnPBIOS: 17 nodes reported by PnP BIOS; 17 recorded by driver
[    0.071921] system 00:00: iomem range 0xfff00000-0xffffffff has been reserved
[    0.072073] system 00:01: iomem range 0x0-0x9ffff could not be reserved
[    0.072154] system 00:01: iomem range 0xe4000-0xfffff could not be reserved
[    0.072234] system 00:01: iomem range 0x100000-0x1fdfffff could not be
reserved
[    0.072355] system 00:0a: ioport range 0x4d0-0x4d1 has been reserved
[    0.072435] system 00:0a: ioport range 0x1100-0x110f has been reserved
[    0.072513] system 00:0a: ioport range 0x1180-0x11bf has been reserved
[    0.072605] system 00:0c: iomem range 0xdc000-0xdffff has been reserved
[    0.072696] system 00:0d: iomem range 0xd8000-0xdbfff has been reserved
[    0.074854] AppArmor: AppArmor Filesystem Enabled
[    0.075077] pci 0000:01:02.0: CardBus bridge, secondary bus 0000:02
[    0.075155] pci 0000:01:02.0:   IO window: 0x003000-0x0030ff
[    0.075232] pci 0000:01:02.0:   IO window: 0x003400-0x0034ff
[    0.075309] pci 0000:01:02.0:   PREFETCH window: 0x20000000-0x23ffffff
[    0.075388] pci 0000:01:02.0:   MEM window: 0x28000000-0x2bffffff
[    0.075466] pci 0000:01:02.1: CardBus bridge, secondary bus 0000:06
[    0.075540] pci 0000:01:02.1:   IO window: 0x003800-0x0038ff
[    0.075617] pci 0000:01:02.1:   IO window: 0x003c00-0x003cff
[    0.075692] pci 0000:01:02.1:   PREFETCH window: 0x24000000-0x27ffffff
[    0.075772] pci 0000:01:02.1:   MEM window: 0x2c000000-0x2fffffff
[    0.075849] pci 0000:00:1e.0: PCI bridge, secondary bus 0000:01
[    0.075925] pci 0000:00:1e.0:   IO window: 0x3000-0x3fff
[    0.076055] pci 0000:00:1e.0:   MEM window: 0xf4100000-0xf41fffff
[    0.076138] pci 0000:00:1e.0:   PREFETCH window: 0x20000000-0x27ffffff
[    0.076238] pci 0000:00:1e.0: setting latency timer to 64
[    0.076263] pci 0000:01:02.0: can't find IRQ for PCI INT A
[    0.076339] pci 0000:01:02.0: setting latency timer to 64
[    0.076360] pci 0000:01:02.1: can't find IRQ for PCI INT B
[    0.076436] pci 0000:01:02.1: setting latency timer to 64
[    0.076457] pci_bus 0000:00: resource 0 io:  [0x00-0xffff]
[    0.076469] pci_bus 0000:00: resource 1 mem: [0x000000-0xffffffff]
[    0.076482] pci_bus 0000:01: resource 0 io:  [0x3000-0x3fff]
[    0.076494] pci_bus 0000:01: resource 1 mem: [0xf4100000-0xf41fffff]
[    0.076506] pci_bus 0000:01: resource 2 pref mem [0x20000000-0x27ffffff]
[    0.076518] pci_bus 0000:01: resource 3 io:  [0x00-0xffff]
[    0.076529] pci_bus 0000:01: resource 4 mem: [0x000000-0xffffffff]
[    0.076542] pci_bus 0000:02: resource 0 io:  [0x3000-0x30ff]
[    0.076553] pci_bus 0000:02: resource 1 io:  [0x3400-0x34ff]
[    0.076565] pci_bus 0000:02: resource 2 pref mem [0x20000000-0x23ffffff]
[    0.076577] pci_bus 0000:02: resource 3 mem: [0x28000000-0x2bffffff]
[    0.076589] pci_bus 0000:06: resource 0 io:  [0x3800-0x38ff]
[    0.076601] pci_bus 0000:06: resource 1 io:  [0x3c00-0x3cff]
[    0.076612] pci_bus 0000:06: resource 2 pref mem [0x24000000-0x27ffffff]
[    0.076625] pci_bus 0000:06: resource 3 mem: [0x2c000000-0x2fffffff]
[    0.076797] NET: Registered protocol family 2
[    0.077321] IP route cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.078739] TCP established hash table entries: 16384 (order: 5, 131072
bytes)
[    0.079384] TCP bind hash table entries: 16384 (order: 5, 131072 bytes)
[    0.080371] TCP: Hash tables configured (established 16384 bind 16384)
[    0.080477] TCP reno registered
[    0.081016] NET: Registered protocol family 1
[    0.081351] Trying to unpack rootfs image as initramfs...
[    0.997327] Freeing initrd memory: 7467k freed
[    1.038171] cpufreq-nforce2: No nForce2 chipset.
[    1.038351] Scanning for low memory corruption every 60 seconds
[    1.038853] audit: initializing netlink socket (disabled)
[    1.038992] type=2000 audit(1269300483.035:1): initialized
[    1.074209] HugeTLB registered 4 MB page size, pre-allocated 0 pages
[    1.081859] VFS: Disk quotas dquot_6.5.2
[    1.082261] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    1.085282] fuse init (API version 7.12)
[    1.085787] msgmni has been set to 990
[    1.086958] alg: No test for stdrng (krng)
[    1.087108] io scheduler noop registered
[    1.087178] io scheduler anticipatory registered
[    1.087247] io scheduler deadline registered
[    1.087612] io scheduler cfq registered (default)
[    1.087727] pci 0000:00:02.0: Boot video device
[    1.088238] pci_hotplug: PCI Hot Plug PCI Core version: 0.5
[    1.088406] pciehp: PCI Express Hot Plug Controller Driver version: 0.4
[    1.089465] isapnp: Scanning for PnP cards...
[    1.443750] isapnp: No Plug & Play device found
[    1.448858] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    1.450499] PCI: setting IRQ 5 as level-triggered
[    1.450515] serial 0000:00:1f.6: found PCI INT B -> IRQ 5
[    1.450626] serial 0000:00:1f.6: sharing IRQ 5 with 0000:00:1f.3
[    1.450709] serial 0000:00:1f.6: sharing IRQ 5 with 0000:00:1f.5
[    1.455012] brd: module loaded
[    1.457481] loop: module loaded
[    1.458072] input: Macintosh mouse button emulation as
/devices/virtual/input/input0
[    1.458691] ata_piix 0000:00:1f.1: version 2.13
[    1.458925] ata_piix 0000:00:1f.1: setting latency timer to 64
[    1.459363] scsi0 : ata_piix
[    1.460107] scsi1 : ata_piix
[    1.460389] ata1: PATA max UDMA/100 cmd 0x1f0 ctl 0x3f6 bmdma 0x1800 irq 14
[    1.460472] ata2: PATA max UDMA/100 cmd 0x170 ctl 0x376 bmdma 0x1808 irq 15
[    1.464765] Fixed MDIO Bus: probed
[    1.464997] PPP generic driver version 2.4.2
[    1.465512] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.465701] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    1.465836] uhci_hcd: USB Universal Host Controller Interface driver
[    1.466084] PCI: setting IRQ 9 as level-triggered
[    1.466097] uhci_hcd 0000:00:1f.2: found PCI INT D -> IRQ 9
[    1.466243] uhci_hcd 0000:00:1f.2: setting latency timer to 64
[    1.466257] uhci_hcd 0000:00:1f.2: UHCI Host Controller
[    1.466566] uhci_hcd 0000:00:1f.2: new USB bus registered, assigned bus
number 1
[    1.466720] uhci_hcd 0000:00:1f.2: irq 9, io base 0x00001820
[    1.467193] usb usb1: configuration #1 chosen from 1 choice
[    1.467398] hub 1-0:1.0: USB hub found
[    1.467500] hub 1-0:1.0: 2 ports detected
[    1.467762] PCI: setting IRQ 11 as level-triggered
[    1.467776] uhci_hcd 0000:00:1f.4: found PCI INT C -> IRQ 11
[    1.467922] uhci_hcd 0000:00:1f.4: setting latency timer to 64
[    1.467935] uhci_hcd 0000:00:1f.4: UHCI Host Controller
[    1.468248] uhci_hcd 0000:00:1f.4: new USB bus registered, assigned bus
number 2
[    1.468401] uhci_hcd 0000:00:1f.4: irq 11, io base 0x00001840
[    1.468887] usb usb2: configuration #1 chosen from 1 choice
[    1.469085] hub 2-0:1.0: USB hub found
[    1.469189] hub 2-0:1.0: 2 ports detected
[    1.469689] PNP: PS/2 Controller [PNP0303,PNP0f13] at 0x60,0x64 irq 1,12
[    1.472139] serio: i8042 KBD port at 0x60,0x64 irq 1
[    1.472240] serio: i8042 AUX port at 0x60,0x64 irq 12
[    1.472597] mice: PS/2 mouse device common for all mice
[    1.473017] rtc_cmos 00:05: rtc core: registered rtc_cmos as rtc0
[    1.473141] rtc0: alarms up to one day, 114 bytes nvram
[    1.473706] device-mapper: uevent: version 1.0.3
[    1.474444] device-mapper: ioctl: 4.15.0-ioctl (2009-04-01) initialised:
dm-devel at redhat.com
[    1.475103] device-mapper: multipath: version 1.1.0 loaded
[    1.475198] device-mapper: multipath round-robin: version 1.0.0 loaded
[    1.476198] EISA: Probing bus 0 at eisa.0
[    1.476293] Cannot allocate resource for EISA slot 1
[    1.476366] Cannot allocate resource for EISA slot 2
[    1.476436] Cannot allocate resource for EISA slot 3
[    1.476536] EISA: Detected 0 cards.
[    1.476940] cpuidle: using governor ladder
[    1.477019] cpuidle: using governor menu
[    1.479696] TCP cubic registered
[    1.480705] NET: Registered protocol family 10
[    1.482797] lo: Disabled Privacy Extensions
[    1.484384] NET: Registered protocol family 17
[    1.484566] Bluetooth: L2CAP ver 2.13
[    1.484635] Bluetooth: L2CAP socket layer initialized
[    1.484709] Bluetooth: SCO (Voice Link) ver 0.6
[    1.484776] Bluetooth: SCO socket layer initialized
[    1.485046] Bluetooth: RFCOMM TTY layer initialized
[    1.485127] Bluetooth: RFCOMM socket layer initialized
[    1.485197] Bluetooth: RFCOMM ver 1.11
[    1.485305] Using IPI No-Shortcut mode
[    1.485696] PM: Resume from disk failed.
[    1.485748] registered taskstats version 1
[    1.486173]   Magic number: 2:3:505
[    1.486251] i8042 i8042: hash matches
[    1.486452] rtc_cmos 00:05: setting system clock to 2010-03-22 23:28:04 UTC
(1269300484)
[    1.486551] BIOS EDD facility v0.16 2004-Jun-25, 0 devices found
[    1.486622] EDD information not available.
[    1.505294] input: AT Translated Set 2 keyboard as
/devices/platform/i8042/serio0/input/input1
[    1.628583] ata2.00: ATAPI: HL-DT-ST DVDRAM GMA-4082N, HJ02, max UDMA/33
[    1.629437] ata1.00: ATA-5: FUJITSU MHM2100AT, 5823, max UDMA/66
[    1.629517] ata1.00: 19640880 sectors, multi 16: LBA
[    1.644400] ata2.00: configured for UDMA/33
[    1.645102] ata1.00: configured for UDMA/66
[    1.645782] scsi 0:0:0:0: Direct-Access     ATA      FUJITSU MHM2100A 5823
PQ: 0 ANSI: 5
[    1.646532] sd 0:0:0:0: Attached scsi generic sg0 type 0
[    1.646925] sd 0:0:0:0: [sda] 19640880 512-byte logical blocks: (10.0 GB/9.36
GiB)
[    1.647278] sd 0:0:0:0: [sda] Write Protect is off
[    1.647357] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[    1.647498] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled,
doesn't support DPO or FUA
[    1.648347]  sda:
[    1.652554] scsi 1:0:0:0: CD-ROM            HL-DT-ST DVDRAM GMA-4082N HJ02
PQ: 0 ANSI: 5
[    1.664574] sr0: scsi3-mmc drive: 24x/24x writer dvd-ram cd/rw xa/form2 cdda
tray
[    1.664685] Uniform CD-ROM driver Revision: 3.20
[    1.665163] sr 1:0:0:0: Attached scsi CD-ROM sr0
[    1.665410] sr 1:0:0:0: Attached scsi generic sg1 type 5
[    1.666182]  sda1 < sda5 sda6 > sda3
[    1.688726] sd 0:0:0:0: [sda] Attached SCSI disk
[    1.688896] Freeing unused kernel memory: 540k freed
[    1.692716] Write protecting the kernel text: 4568k
[    1.692963] Write protecting the kernel read-only data: 1836k
[    1.780085] usb 1-2: new full speed USB device using uhci_hcd and address 2
[    2.107573] usb 1-2: configuration #1 chosen from 1 choice
[    2.562277] Linux agpgart interface v0.103
[    2.875071] agpgart-intel 0000:00:00.0: Intel i815 Chipset
[    3.034636] agpgart-intel 0000:00:00.0: AGP aperture is 64M @ 0xf8000000
[    3.184016] ohci1394: fw-host0: OHCI-1394 1.0 (PCI): IRQ=[10] 
MMIO=[f4104000-f41047ff]  Max Packet=[2048]  IR/IT contexts=[4/8]
[    4.208351] PM: Starting manual resume from disk
[    4.208457] PM: Resume from partition 8:6
[    4.208465] PM: Checking hibernation image.
[    4.209037] PM: Resume from disk failed.
[    4.284788] kjournald starting.  Commit interval 5 seconds
[    4.284917] EXT3-fs: mounted filesystem with writeback data mode.
[    4.468501] ieee1394: Host added: ID:BUS[0-00:1023]  GUID[0800460300a53ece]
[    5.922877] type=1505 audit(1269300488.933:2): operation="profile_load"
pid=299 name=/usr/share/gdm/guest-session/Xsession
[    5.998657] type=1505 audit(1269300489.009:3): operation="profile_load"
pid=300 name=/sbin/dhclient3
[    6.000813] type=1505 audit(1269300489.013:4): operation="profile_load"
pid=300 name=/usr/lib/NetworkManager/nm-dhcp-client.action
[    6.002004] type=1505 audit(1269300489.013:5): operation="profile_load"
pid=300 name=/usr/lib/connman/scripts/dhclient-script
[    6.110572] type=1505 audit(1269300489.121:6): operation="profile_load"
pid=301 name=/usr/bin/evince
[    6.146379] type=1505 audit(1269300489.157:7): operation="profile_load"
pid=301 name=/usr/bin/evince-previewer
[    6.167645] type=1505 audit(1269300489.177:8): operation="profile_load"
pid=301 name=/usr/bin/evince-thumbnailer
[    6.267142] type=1505 audit(1269300489.277:9): operation="profile_load"
pid=303 name=/usr/lib/cups/backend/cups-pdf
[    6.269850] type=1505 audit(1269300489.281:10): operation="profile_load"
pid=303 name=/usr/sbin/cupsd
[    6.292645] type=1505 audit(1269300489.305:11): operation="profile_load"
pid=304 name=/usr/sbin/tcpdump
[   28.509482] Adding 546168k swap on /dev/sda6.  Priority:-1 extents:1
across:546168k
[   28.592025] udev: starting version 147
[   29.286283] lp: driver loaded but no devices found
[   29.356260] shpchp: Standard Hot Plug PCI Controller Driver version: 0.4
[   29.504809] Intel 82802 RNG detected
[   30.287821] cfg80211: Calling CRDA to update world regulatory domain
[   30.482601] cfg80211: World regulatory domain updated:
[   30.482626] 	(start_freq - end_freq @ bandwidth), (max_antenna_gain,
max_eirp)
[   30.482641] 	(2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   30.482653] 	(2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[   30.482666] 	(2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[   30.482678] 	(5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   30.482691] 	(5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   31.027208] yenta_cardbus 0000:01:02.0: CardBus bridge found [104d:80df]
[   31.027251] yenta_cardbus 0000:01:02.0: no PCI IRQ, CardBus support disabled
for this socket.
[   31.027263] yenta_cardbus 0000:01:02.0: check your BIOS CardBus, BIOS IRQ or
ACPI settings.
[   31.179027] ip_tables: (C) 2000-2006 Netfilter Core Team
[   31.960283] irq 10: nobody cared (try booting with the "irqpoll" option)
[   31.960388] Pid: 447, comm: modprobe Not tainted 2.6.31-16-generic #52-Ubuntu
[   31.960400] Call Trace:
[   31.960425]  [<c056ea5c>] ? printk+0x18/0x1c
[   31.960459]  [<c0190ee7>] __report_bad_irq+0x27/0x90
[   31.960475]  [<c018f8fc>] ? handle_IRQ_event+0x4c/0x140
[   31.960491]  [<c01910a0>] note_interrupt+0x150/0x190
[   31.960518]  [<c0106c62>] ? mask_and_ack_8259A+0x52/0xf0
[   31.960534]  [<c0191a0c>] handle_level_irq+0xbc/0xe0
[   31.960547]  [<c01919f6>] ? handle_level_irq+0xa6/0xe0
[   31.960562]  [<c0105a38>] handle_irq+0x18/0x30
[   31.960575]  [<c0104f07>] do_IRQ+0x47/0xc0
[   31.960588]  [<c0104f10>] ? do_IRQ+0x50/0xc0
[   31.960613]  [<c0127c38>] ? default_spin_lock_flags+0x8/0x10
[   31.960633]  [<c0570e1a>] ? _spin_lock_irqsave+0x2a/0x40
[   31.960648]  [<c01039b0>] common_interrupt+0x30/0x40
[   31.960675]  [<c014b365>] ? __do_softirq+0x45/0x1a0
[   31.960690]  [<c0127c38>] ? default_spin_lock_flags+0x8/0x10
[   31.960704]  [<c0570e1a>] ? _spin_lock_irqsave+0x2a/0x40
[   31.960719]  [<c0106b92>] ? enable_8259A_irq+0x42/0x60
[   31.960733]  [<c01919f6>] ? handle_level_irq+0xa6/0xe0
[   31.960748]  [<c014b4fd>] do_softirq+0x3d/0x40
[   31.960762]  [<c014b63d>] irq_exit+0x5d/0x70
[   31.960775]  [<c0104f10>] do_IRQ+0x50/0xc0
[   31.960788]  [<c056f6c1>] ? schedule_timeout+0x131/0x200
[   31.960803]  [<c01039b0>] common_interrupt+0x30/0x40
[   31.960820]  [<c03187b1>] ? delay_tsc+0x41/0x70
[   31.960833]  [<c0318739>] __delay+0x9/0x10
[   31.960846]  [<c031876b>] __const_udelay+0x2b/0x30
[   31.960885]  [<e0b1d2a2>] yenta_get_socket_capabilities+0xf2/0x150
[yenta_socket]
[   31.960908]  [<e0b1f1ce>] yenta_probe+0x2ea/0x396 [yenta_socket]
[   31.960942]  [<c032853e>] local_pci_probe+0xe/0x10
[   31.960957]  [<c03292c0>] pci_device_probe+0x60/0x80
[   31.960989]  [<c03a2e70>] really_probe+0x50/0x140
[   31.961003]  [<c0570e1a>] ? _spin_lock_irqsave+0x2a/0x40
[   31.961019]  [<c03a2f79>] driver_probe_device+0x19/0x20
[   31.961034]  [<c03a2ff9>] __driver_attach+0x79/0x80
[   31.961049]  [<c03a24c8>] bus_for_each_dev+0x48/0x70
[   31.961064]  [<c03a2d39>] driver_attach+0x19/0x20
[   31.961078]  [<c03a2f80>] ? __driver_attach+0x0/0x80
[   31.961092]  [<c03a271f>] bus_add_driver+0xbf/0x2a0
[   31.961107]  [<c0329200>] ? pci_device_remove+0x0/0x40
[   31.961122]  [<c03a3285>] driver_register+0x65/0x120
[   31.961137]  [<c03294e0>] __pci_register_driver+0x40/0xb0
[   31.961157]  [<e0b24017>] yenta_socket_init+0x17/0x19 [yenta_socket]
[   31.961171]  [<c010112c>] do_one_initcall+0x2c/0x190
[   31.961191]  [<e0b24000>] ? yenta_socket_init+0x0/0x19 [yenta_socket]
[   31.961219]  [<c0173751>] sys_init_module+0xb1/0x1f0
[   31.961233]  [<c010336c>] syscall_call+0x7/0xb
[   31.961244] handlers:
[   31.961311] [<e06f0220>] (ohci_irq_handler+0x0/0x780 [ohci1394])
[   31.961488] Disabling IRQ #10
[   31.962159] yenta_cardbus 0000:01:02.0: ISA IRQ mask 0x0098, PCI irq 0
[   31.962173] yenta_cardbus 0000:01:02.0: Socket status: 30000820
[   31.962187] pci_bus 0000:01: Raising subordinate bus# of parent bus (#01)
from #01 to #05
[   32.199826] phy0: Selected rate control algorithm 'minstrel'
[   32.203014] Registered led device: rt73usb-phy0::radio
[   32.203122] Registered led device: rt73usb-phy0::assoc
[   32.203199] Registered led device: rt73usb-phy0::quality
[   32.221304] usbcore: registered new interface driver rt73usb
[   32.752815] input: PS/2 Mouse as /devices/platform/i8042/serio1/input/input2
[   32.794549] input: AlpsPS/2 ALPS GlidePoint as
/devices/platform/i8042/serio1/input/input3
[   32.848741] Intel ICH 0000:00:1f.5: found PCI INT B -> IRQ 5
[   32.848795] Intel ICH 0000:00:1f.5: sharing IRQ 5 with 0000:00:1f.3
[   32.848820] Intel ICH 0000:00:1f.5: sharing IRQ 5 with 0000:00:1f.6
[   32.848894] Intel ICH 0000:00:1f.5: setting latency timer to 64
[   32.893203] yenta_cardbus 0000:01:02.0: pcmcia: parent PCI bridge I/O window:
0x3000 - 0x3fff
[   32.893226] pcmcia_socket pcmcia_socket0: cs: IO port probe 0x3000-0x3fff:
clean.
[   32.893948] yenta_cardbus 0000:01:02.0: pcmcia: parent PCI bridge Memory
window: 0xf4100000 - 0xf41fffff
[   32.893963] yenta_cardbus 0000:01:02.0: pcmcia: parent PCI bridge Memory
window: 0x20000000 - 0x27ffffff
[   32.894512] yenta_cardbus 0000:01:02.1: CardBus bridge found [104d:80df]
[   32.894555] yenta_cardbus 0000:01:02.1: no PCI IRQ, CardBus support disabled
for this socket.
[   32.894567] yenta_cardbus 0000:01:02.1: check your BIOS CardBus, BIOS IRQ or
ACPI settings.
[   33.019994] yenta_cardbus 0000:01:02.1: ISA IRQ mask 0x0098, PCI irq 0
[   33.020013] yenta_cardbus 0000:01:02.1: Socket status: 30000006
[   33.020029] pci_bus 0000:01: Raising subordinate bus# of parent bus (#01)
from #05 to #09
[   33.020065] yenta_cardbus 0000:01:02.1: pcmcia: parent PCI bridge I/O window:
0x3000 - 0x3fff
[   33.020082] pcmcia_socket pcmcia_socket1: cs: IO port probe 0x3000-0x3fff:
clean.
[   33.020809] yenta_cardbus 0000:01:02.1: pcmcia: parent PCI bridge Memory
window: 0xf4100000 - 0xf41fffff
[   33.020823] yenta_cardbus 0000:01:02.1: pcmcia: parent PCI bridge Memory
window: 0x20000000 - 0x27ffffff
[   33.025225] pcmcia_socket pcmcia_socket0: cs: cardbus cards are not
supported.
[   33.167811] pcmcia_socket pcmcia_socket1: cs: IO port probe 0x100-0x3af:
clean.
[   33.169937] pcmcia_socket pcmcia_socket1: cs: IO port probe 0x3e0-0x4ff:
clean.
[   33.170904] pcmcia_socket pcmcia_socket1: cs: IO port probe 0x820-0x8ff:
clean.
[   33.172068] pcmcia_socket pcmcia_socket1: cs: IO port probe 0xc00-0xcf7:
clean.
[   33.173523] pcmcia_socket pcmcia_socket1: cs: IO port probe 0xa00-0xaff:
clean.
[   33.267406] intel8x0_measure_ac97_clock: measured 54178 usecs (2604 samples)
[   33.267423] intel8x0: clocking to 48000
[   33.632689] pcmcia_socket pcmcia_socket0: cs: IO port probe 0x100-0x3af:
clean.
[   33.634795] pcmcia_socket pcmcia_socket0: cs: IO port probe 0x3e0-0x4ff:
clean.
[   33.635871] pcmcia_socket pcmcia_socket0: cs: IO port probe 0x820-0x8ff:
clean.
[   33.636710] pcmcia_socket pcmcia_socket0: cs: IO port probe 0xc00-0xcf7:
clean.
[   33.638309] pcmcia_socket pcmcia_socket0: cs: IO port probe 0xa00-0xaff:
clean.
[  170.810772] EXT3 FS on sda5, internal journal
[  172.095921] rt73usb 1-2:1.0: firmware: requesting rt73.bin
[  173.277175] type=1505 audit(1269297056.290:12): operation="profile_replace"
pid=803 name=/usr/share/gdm/guest-session/Xsession
[  173.301159] type=1505 audit(1269297056.314:13): operation="profile_replace"
pid=804 name=/sbin/dhclient3
[  173.303361] type=1505 audit(1269297056.314:14): operation="profile_replace"
pid=804 name=/usr/lib/NetworkManager/nm-dhcp-client.action
[  173.304567] type=1505 audit(1269297056.314:15): operation="profile_replace"
pid=804 name=/usr/lib/connman/scripts/dhclient-script
[  173.370780] type=1505 audit(1269297056.382:16): operation="profile_replace"
pid=805 name=/usr/bin/evince
[  173.451922] type=1505 audit(1269297056.462:17): operation="profile_replace"
pid=805 name=/usr/bin/evince-previewer
[  173.502602] type=1505 audit(1269297056.514:18): operation="profile_replace"
pid=805 name=/usr/bin/evince-thumbnailer
[  173.556343] type=1505 audit(1269297056.566:19): operation="profile_replace"
pid=807 name=/usr/lib/cups/backend/cups-pdf
[  173.569107] ADDRCONF(NETDEV_UP): wlan0: link is not ready
[  173.588674] type=1505 audit(1269297056.598:20): operation="profile_replace"
pid=807 name=/usr/sbin/cupsd
[  173.599327] type=1505 audit(1269297056.610:21): operation="profile_replace"
pid=809 name=/usr/sbin/tcpdump
[  176.043555] ppdev: user-space parallel port driver
[  177.070262] [drm] Initialized drm 1.1.0 20060810
[  177.097039] PCI: setting IRQ 10 as level-triggered
[  177.097056] pci 0000:00:02.0: found PCI INT A -> IRQ 10
[  177.097123] pci 0000:00:02.0: setting latency timer to 64
[  177.097796] [drm] Initialized i810 1.4.0 20030605 for 0000:00:02.0 on minor 0
[  177.118307] mtrr: base(0xf8000000) is not aligned on a size(0x12c000)
boundary
[  177.343725] [drm] Using v1.4 init.
[  180.660581] [drm:drm_reclaim_locked_buffers] *ERROR* reclaim_buffers_locked()
deadlock. Please rework this
[  180.660596] 	driver to use reclaim_buffers_idlelocked() instead.
[  180.660602] 	I will go on reclaiming the buffers anyway.
[  235.482645] wlan0: authenticate with AP ce:3d:6a:0b:95:f8
[  235.485484] wlan0: authenticated
[  235.485507] wlan0: associate with AP ce:3d:6a:0b:95:f8
[  235.499946] wlan0: RX AssocResp from ce:3d:6a:0b:95:f8 (capab=0x411 status=0
aid=1)
[  235.499963] wlan0: associated
[  235.566495] ADDRCONF(NETDEV_CHANGE): wlan0: link becomes read



From linux at dominikbrodowski.net  Mon Mar 22 18:52:35 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 22 Mar 2010 23:52:35 +0100
Subject: pci_bus_for_each_resource,
	transparent bridges and rsrc_nonstatic.c
In-Reply-To: <201003221628.56232.bjorn.helgaas@hp.com>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<201003221436.04689.bjorn.helgaas@hp.com>
	<20100322205121.GA15250@isilmar.linta.de>
	<201003221628.56232.bjorn.helgaas@hp.com>
Message-ID: <20100322225235.GA29522@isilmar.linta.de>

Hey,

On Mon, Mar 22, 2010 at 03:28:55PM -0700, Bjorn Helgaas wrote:
> On Monday 22 March 2010 02:51:21 pm Dominik Brodowski wrote:
> > On Mon, Mar 22, 2010 at 01:36:03PM -0700, Bjorn Helgaas wrote:
> > > > You can still use subtractive-decoded resources, but then you have to add
> > > > them to /etc/pcmcia/config.opts and run pcmcia-startup-bridges (or echo the
> > > > resource to a sysfs file).
> > > 
> > > It's too bad we still have such manual configuration.
> > 
> > Agreed.
> > 
> > > Is there still
> > > information there that we can't figure out automatically?
> > 
> > That's unknown to me -- are there any ISA-capable systems being sold? If so,
> > then I suspect the answer may be "yes".
> > 
> > > > Now, "usecrs" is only used on 2008-or-newer systems where we _hope_ that all
> > > > resource "consumers" are accounted for. So the problem might be mitigated.
> > > > However, I wouldn't dare to use ioports 0x0-0xff anyways for they usually
> > > > are used for onboard legacy devices...
> > > 
> > > Right.  But PCMCIA is at no greater risk than regular PCI, right?
> > > It looks like both will allocate only above PCIBIOS_MIN_IO (0x1000).
> > 
> > No, PCMCIA will happily allocate below this limit.
> 
> I saw "#define PCIBIOS_MIN_CARDBUS_IO PCIBIOS_MIN_IO" in yenta_socket.c
> and assumed it would take care of this, but I didn't look any deeper.
> 
> I'm still confused about why PCMCIA is "special" in this regard and
> why pci=use_crs breaks it.  Can you make up an example that illustrates
> the problem?

Consider the following case:

(1) The root PCI bus has _CRS I/O 0000-0cf7; 0d00-ffff "produced";

    the (transparent) PCI-PCI bridge offers, as bus resources, to
    downstream users 0x4000-0x4fff plus everything else because of
    subtractive decoding;

    there is a yenta-style PCI-CardBus/PCMCIA bridge below this
    PCI-PCI bridge.

(2) There are some I/O ports which react rather unfriendly to being read or
    written. Let's assume they're at 0x100-0x10f; and let's also assume that
    the BIOS writers forgot to mention them at all in the ACPI _CRS
    settings; no other part of the kernel knows about it.

0000-0cf7 : PCI Bus 0000:00
...
  00f0-00ff : fpu
  0170-0177 : 0000:00:1f.2


(3) A PCMCIA card is inserted. It needs an I/O port resource of size 8. The
    PCMCIA subsystem looks in its own resource database which I/O ports it
    may use; there, it finds not only 0x4000-0x4fff but (with a small
    exception) 0x0000-0xffff; as 0x0000-0x00ff are already assigned, it
    happily assigns the first free area -- 0x100-0x108 -- to the PCMCIA
    card.

0000-0cf7 : PCI Bus 0000:00
...
  00f0-00ff : fpu
  0100-0108 : pcmcia0.0
  0170-0177 : 0000:00:1f.2

(4) The PCMCIA card and the PCMCIA driver are set up to work with an IO
    resource at 0x100-0x108. As soon as they attempt to use this resource,
    bad things happen (lockups, etc.) because of the reasons spelled out at
    (2).

=> It is only an issue if the ACPI resource descriptions are incomplete. It
is worse for PCMCIA because it happily assigns resources below 0x1000, where
such system/platform devices usually listen to. And usecrs worsens the
situation also in another regard: on my own laptop (a pre-2008 model),
pci=use_crs makes the PCI-PCI bridge to be marked as "transparent", while
pci=nocrs means the PCI-PCI bridge is assumed to be "non-transparent".

Best,
	Dominik


From linux at dominikbrodowski.net  Mon Mar 22 19:03:07 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Tue, 23 Mar 2010 00:03:07 +0100
Subject: Boot options acpi=off pci=biosirq   dmesg
In-Reply-To: <1269297469.4ba7f13da7444@imp.free.fr>
References: <1269297469.4ba7f13da7444@imp.free.fr>
Message-ID: <20100322230307.GB29522@isilmar.linta.de>

Ah, we're getting closer! The CardBus bridge should be using IRQ 10, but the
BIOS does not report this.

What happens if you use

	acpi=off pci=biosirq irqfixup

or even

	acpi=off pci=biosirq irqpoll

as kernel options? Please try out inserting the USB card into _both_ sockets
(if there are two), and send the resulting "dmesg" if it fails.

Thanks and best,
	Dominik


From bjorn.helgaas at hp.com  Mon Mar 22 19:11:33 2010
From: bjorn.helgaas at hp.com (Bjorn Helgaas)
Date: Mon, 22 Mar 2010 16:11:33 -0700
Subject: pci_bus_for_each_resource,
	transparent bridges and rsrc_nonstatic.c
In-Reply-To: <20100322225235.GA29522@isilmar.linta.de>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<201003221628.56232.bjorn.helgaas@hp.com>
	<20100322225235.GA29522@isilmar.linta.de>
Message-ID: <201003221711.34997.bjorn.helgaas@hp.com>

On Monday 22 March 2010 04:52:35 pm Dominik Brodowski wrote:
> Hey,
> 
> On Mon, Mar 22, 2010 at 03:28:55PM -0700, Bjorn Helgaas wrote:
> > On Monday 22 March 2010 02:51:21 pm Dominik Brodowski wrote:
> > > On Mon, Mar 22, 2010 at 01:36:03PM -0700, Bjorn Helgaas wrote:
> > > > > You can still use subtractive-decoded resources, but then you have to add
> > > > > them to /etc/pcmcia/config.opts and run pcmcia-startup-bridges (or echo the
> > > > > resource to a sysfs file).
> > > > 
> > > > It's too bad we still have such manual configuration.
> > > 
> > > Agreed.
> > > 
> > > > Is there still
> > > > information there that we can't figure out automatically?
> > > 
> > > That's unknown to me -- are there any ISA-capable systems being sold? If so,
> > > then I suspect the answer may be "yes".
> > > 
> > > > > Now, "usecrs" is only used on 2008-or-newer systems where we _hope_ that all
> > > > > resource "consumers" are accounted for. So the problem might be mitigated.
> > > > > However, I wouldn't dare to use ioports 0x0-0xff anyways for they usually
> > > > > are used for onboard legacy devices...
> > > > 
> > > > Right.  But PCMCIA is at no greater risk than regular PCI, right?
> > > > It looks like both will allocate only above PCIBIOS_MIN_IO (0x1000).
> > > 
> > > No, PCMCIA will happily allocate below this limit.
> > 
> > I saw "#define PCIBIOS_MIN_CARDBUS_IO PCIBIOS_MIN_IO" in yenta_socket.c
> > and assumed it would take care of this, but I didn't look any deeper.
> > 
> > I'm still confused about why PCMCIA is "special" in this regard and
> > why pci=use_crs breaks it.  Can you make up an example that illustrates
> > the problem?
> 
> Consider the following case:

Thanks!  Sorry to be so dense here ...

> (1) The root PCI bus has _CRS I/O 0000-0cf7; 0d00-ffff "produced";
> 
>     the (transparent) PCI-PCI bridge offers, as bus resources, to
>     downstream users 0x4000-0x4fff plus everything else because of
>     subtractive decoding;
> 
>     there is a yenta-style PCI-CardBus/PCMCIA bridge below this
>     PCI-PCI bridge.
> 
> (2) There are some I/O ports which react rather unfriendly to being read or
>     written. Let's assume they're at 0x100-0x10f; and let's also assume that
>     the BIOS writers forgot to mention them at all in the ACPI _CRS
>     settings; no other part of the kernel knows about it.
> 
> 0000-0cf7 : PCI Bus 0000:00
> ...
>   00f0-00ff : fpu
>   0170-0177 : 0000:00:1f.2
> 
> 
> (3) A PCMCIA card is inserted. It needs an I/O port resource of size 8. The
>     PCMCIA subsystem looks in its own resource database which I/O ports it
>     may use; there, it finds not only 0x4000-0x4fff but (with a small
>     exception) 0x0000-0xffff; as 0x0000-0x00ff are already assigned, it
>     happily assigns the first free area -- 0x100-0x108 -- to the PCMCIA
>     card.
> 
> 0000-0cf7 : PCI Bus 0000:00
> ...
>   00f0-00ff : fpu
>   0100-0108 : pcmcia0.0
>   0170-0177 : 0000:00:1f.2
> 
> (4) The PCMCIA card and the PCMCIA driver are set up to work with an IO
>     resource at 0x100-0x108. As soon as they attempt to use this resource,
>     bad things happen (lockups, etc.) because of the reasons spelled out at
>     (2).

We'd have exactly the same situation if we assigned I/O port 0x100
to a PCI device.  Why can't we use the same strategy PCI uses to
avoid it?

> => It is only an issue if the ACPI resource descriptions are incomplete. It
> is worse for PCMCIA because it happily assigns resources below 0x1000, where
> such system/platform devices usually listen to. And usecrs worsens the
> situation also in another regard: on my own laptop (a pre-2008 model),
> pci=use_crs makes the PCI-PCI bridge to be marked as "transparent", while
> pci=nocrs means the PCI-PCI bridge is assumed to be "non-transparent".

Sorry to be slow again...  The pci=use_crs and pci=nocrs options only
affect the PCI host bridge; they don't affect PCI-PCI bridges at all,
except that they change the set of resources available for subtractive-
decode PCI-PCI bridges to forward.  (Strictly speaking, they don't
affect the *behavior* of the PCI-PCI bridges, they only affect our
*idea* of what they're doing.)

I'm thinking of the code in pci_setup_device() where we set dev->transparent
based on the bridge's class code.  Obviously, you must be thinking
of something else.

My intention was that on pre-2008 systems like your laptop, my patches
would not change any behavior at all, unless you boot with "pci=use_crs".
Are you seeing an unexpected change on your system?

Bjorn


From linux at dominikbrodowski.net  Mon Mar 22 19:28:00 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Tue, 23 Mar 2010 00:28:00 +0100
Subject: pci_bus_for_each_resource,
	transparent bridges and rsrc_nonstatic.c
In-Reply-To: <201003221711.34997.bjorn.helgaas@hp.com>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<201003221628.56232.bjorn.helgaas@hp.com>
	<20100322225235.GA29522@isilmar.linta.de>
	<201003221711.34997.bjorn.helgaas@hp.com>
Message-ID: <20100322232800.GA532@isilmar.linta.de>

On Mon, Mar 22, 2010 at 04:11:33PM -0700, Bjorn Helgaas wrote:
> > (1) The root PCI bus has _CRS I/O 0000-0cf7; 0d00-ffff "produced";
> > 
> >     the (transparent) PCI-PCI bridge offers, as bus resources, to
> >     downstream users 0x4000-0x4fff plus everything else because of
> >     subtractive decoding;
> > 
> >     there is a yenta-style PCI-CardBus/PCMCIA bridge below this
> >     PCI-PCI bridge.
> > 
> > (2) There are some I/O ports which react rather unfriendly to being read or
> >     written. Let's assume they're at 0x100-0x10f; and let's also assume that
> >     the BIOS writers forgot to mention them at all in the ACPI _CRS
> >     settings; no other part of the kernel knows about it.
> > 
> > 0000-0cf7 : PCI Bus 0000:00
> > ...
> >   00f0-00ff : fpu
> >   0170-0177 : 0000:00:1f.2
> > 
> > 
> > (3) A PCMCIA card is inserted. It needs an I/O port resource of size 8. The
> >     PCMCIA subsystem looks in its own resource database which I/O ports it
> >     may use; there, it finds not only 0x4000-0x4fff but (with a small
> >     exception) 0x0000-0xffff; as 0x0000-0x00ff are already assigned, it
> >     happily assigns the first free area -- 0x100-0x108 -- to the PCMCIA
> >     card.
> > 
> > 0000-0cf7 : PCI Bus 0000:00
> > ...
> >   00f0-00ff : fpu
> >   0100-0108 : pcmcia0.0
> >   0170-0177 : 0000:00:1f.2
> > 
> > (4) The PCMCIA card and the PCMCIA driver are set up to work with an IO
> >     resource at 0x100-0x108. As soon as they attempt to use this resource,
> >     bad things happen (lockups, etc.) because of the reasons spelled out at
> >     (2).
> 
> We'd have exactly the same situation if we assigned I/O port 0x100
> to a PCI device.  Why can't we use the same strategy PCI uses to
> avoid it?

Well, PCI devices have three advantages:

- they can more easily be "enumerated" (and their resource needs reflected)
  by ACPI or the BIOS.

- they usually don't conflict with ISA-style hardware(?)

- they usually work happily with any (even high) I/O ports.

> > => It is only an issue if the ACPI resource descriptions are incomplete. It
> > is worse for PCMCIA because it happily assigns resources below 0x1000, where
> > such system/platform devices usually listen to. And usecrs worsens the
> > situation also in another regard: on my own laptop (a pre-2008 model),
> > pci=use_crs makes the PCI-PCI bridge to be marked as "transparent", while
> > pci=nocrs means the PCI-PCI bridge is assumed to be "non-transparent".
> 
> Sorry to be slow again...  The pci=use_crs and pci=nocrs options only
> affect the PCI host bridge; they don't affect PCI-PCI bridges at all,
> except that they change the set of resources available for subtractive-
> decode PCI-PCI bridges to forward.  (Strictly speaking, they don't
> affect the *behavior* of the PCI-PCI bridges, they only affect our
> *idea* of what they're doing.)
> 
> I'm thinking of the code in pci_setup_device() where we set dev->transparent
> based on the bridge's class code.  Obviously, you must be thinking
> of something else.
> 
> My intention was that on pre-2008 systems like your laptop, my patches
> would not change any behavior at all, unless you boot with "pci=use_crs".
> Are you seeing an unexpected change on your system?

No, that's excactly what I'm seeing here. On pre-2008 system, the behavior
is still the same; no unexpected change; all fine unless I boot with
"pci=use_crs".

In contrast, on post-2008 systems like Komuros system, we now trust to
ACPI report _all_ resource users. If ACPI gets this right, I don't see a
real problem (but I might add a safety check to avoid any I/O ports < 0x0100
anyway). The remaining question: can we safely trust BIOS authors to get it
right?

	Dominik


From raraks at gmail.com  Mon Mar 22 19:40:33 2010
From: raraks at gmail.com (raraks)
Date: Mon, 22 Mar 2010 16:40:33 -0700
Subject: Card Memory windows in client driver  - how to access ?
Message-ID: <74717750AF19415282F82F43C2286064@spyrus.com>

I have a 16 bit PCMCIA card driver I am working on which requires memory 
windows to read and write both attribute and common memory. Card needs only 
memory windows to work (no IO or irq).

I use the foll. method to get access to the card memory windows after 
setting up  the window attributes appropriately

 link->conf.ConfigBase = parse.config.base;
 link->conf.Present = parse.config.rmask[0];
 link->conf.IntType = INT_MEMORY;

dev->request_attr_memory.Attributes = ( WIN_DATA_WIDTH_8 | 
WIN_MEMORY_TYPE_AM | WIN_ENABLE );
 dev->request_attr_memory.Base = 0;
 dev->request_attr_memory.Size = 0x1000;
 dev->request_attr_memory.AccessSpeed = 200;

 ret = pcmcia_request_window(&link, &dev->request_attr_memory, 
&dev->handle_attr_memory);

 if (ret != 0) {
  cs_error(link, RequestWindow, ret);
}

 memreq_attr_memory.CardOffset = 0;
 memreq_attr_memory.Page = 0;

 ret = pcmcia_map_mem_page(dev->handle_attr_memory, &memreq_attr_memory);

 if (ret != 0) {
  cs_error(link, MapMemPage, ret);}

 dev->attr_memory = ioremap( dev->request_attr_memory.Base, 
dev->request_attr_memory.Size);

All the above succeed and then I call pcmcia_request_configuration


Now if I try to dump say the first 512 bytes of memory at the address 
returned by ioremap - the bytes there dont look anything like what I am 
supposed to see in the CIS.  In fact they are all 0's. Same with common 
memory window that I request and create like the above except for the size 
and attribute being differnet

So I am obviously not doing something right here ....

Any pointers on what I am/could be doing wrong will be much appreciated.

Thanks




From komurojun-mbn at nifty.com  Tue Mar 23 09:29:56 2010
From: komurojun-mbn at nifty.com (Komuro)
Date: Tue, 23 Mar 2010 22:29:56 +0900
Subject: [BUG? kernel 2.6.34-rc1-git8] cs: IO port probe 0x0-0xcf7: clean.
In-Reply-To: <20100322183832.f07b9191.komurojun-mbn@nifty.com>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<1257971899-9274-9-git-send-email-linux@dominikbrodowski.net>
	<20091213212556.03d83e1f.komurojun-mbn@nifty.com>
	<20100228153933.f6fe6f81.komurojun-mbn@nifty.com>
	<20100320063919.f7cd4421.komurojun-mbn@nifty.com>
	<20100321065539.57cb2c96.komurojun-mbn@nifty.com>
	<20100322094022.742e85a9.komurojun-mbn@nifty.com>
	<20100322183832.f07b9191.komurojun-mbn@nifty.com>
Message-ID: <20100323222956.f7f83e83.komurojun-mbn@nifty.com>

Hi,

Some pcmcia device works only with lower ioport ( ioport < 0x300 )
and does not work with higher ioport ( ioport > 0x400 ).

Actually, it is difficult to find unused ioport in this lower area.

One solution is to use PNP BIOS to get used ioport.
but pre-1995 system does not have PNP BIOS.
I'm not sure the recent system have PNP BIOS.


Another solution is to use ACPI BIOS.
but pre-1998 system does not have ACPI BIOS.
 

ISA slot card is no longer sold in the PC store,
but on-board legacy devices still use this lower ioport.



Best Regards
Komuro



From linux at dominikbrodowski.net  Tue Mar 23 11:30:02 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Tue, 23 Mar 2010 16:30:02 +0100
Subject: Card Memory windows in client driver  - how to access ?
In-Reply-To: <74717750AF19415282F82F43C2286064@spyrus.com>
References: <74717750AF19415282F82F43C2286064@spyrus.com>
Message-ID: <20100323153002.GA10380@comet.dominikbrodowski.net>

Hey,


On Mon, Mar 22, 2010 at 04:40:33PM -0700, raraks wrote:
> I have a 16 bit PCMCIA card driver I am working on which requires
> memory windows to read and write both attribute and common memory.
> Card needs only memory windows to work (no IO or irq).
> 
> I use the foll. method to get access to the card memory windows
> after setting up  the window attributes appropriately
> 
> link->conf.ConfigBase = parse.config.base;
> link->conf.Present = parse.config.rmask[0];

That's already available in
	p_dev->conf.ConfigBase
	p_dev->conf.Present
no need to overwrite it here. Unless, of course, you're using an oooold
kernel.

> link->conf.IntType = INT_MEMORY;

What happens if you set this to INT_MEMORY_AND_IO ?

> dev->request_attr_memory.Attributes = ( WIN_DATA_WIDTH_8 |
> WIN_MEMORY_TYPE_AM | WIN_ENABLE );
> dev->request_attr_memory.Base = 0;
> dev->request_attr_memory.Size = 0x1000;
> dev->request_attr_memory.AccessSpeed = 200;

Have you tried different accessspeed settings, or keeping it at 0?
> 
> ret = pcmcia_request_window(&link, &dev->request_attr_memory,
> &dev->handle_attr_memory);
> 
> if (ret != 0) {
>  cs_error(link, RequestWindow, ret);
> }

Using cs_error is deprecated.

> memreq_attr_memory.CardOffset = 0;

0?

> memreq_attr_memory.Page = 0;
> 
> ret = pcmcia_map_mem_page(dev->handle_attr_memory, &memreq_attr_memory);
> 
> if (ret != 0) {
>  cs_error(link, MapMemPage, ret);}
> 
> dev->attr_memory = ioremap( dev->request_attr_memory.Base,
> dev->request_attr_memory.Size);
> 
> All the above succeed and then I call pcmcia_request_configuration

Is this ordering correct? IIRC you shouldn't even have to call
pcmcia_request_configuration... 

Best,
	Dominik


From linux at dominikbrodowski.net  Tue Mar 23 11:13:01 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Tue, 23 Mar 2010 16:13:01 +0100
Subject: pci_bus_for_each_resource, transparent bridges and
	rsrc_nonstatic.c
In-Reply-To: <20100322232800.GA532@isilmar.linta.de>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<201003221628.56232.bjorn.helgaas@hp.com>
	<20100322225235.GA29522@isilmar.linta.de>
	<201003221711.34997.bjorn.helgaas@hp.com>
	<20100322232800.GA532@isilmar.linta.de>
Message-ID: <20100323151301.GA10452@comet.dominikbrodowski.net>

On Tue, Mar 23, 2010 at 12:28:00AM +0100, Dominik Brodowski wrote:
> On Mon, Mar 22, 2010 at 04:11:33PM -0700, Bjorn Helgaas wrote:
> > > (1) The root PCI bus has _CRS I/O 0000-0cf7; 0d00-ffff "produced";
> > > 
> > >     the (transparent) PCI-PCI bridge offers, as bus resources, to
> > >     downstream users 0x4000-0x4fff plus everything else because of
> > >     subtractive decoding;
> > > 
> > >     there is a yenta-style PCI-CardBus/PCMCIA bridge below this
> > >     PCI-PCI bridge.
> > > 
> > > (2) There are some I/O ports which react rather unfriendly to being read or
> > >     written. Let's assume they're at 0x100-0x10f; and let's also assume that
> > >     the BIOS writers forgot to mention them at all in the ACPI _CRS
> > >     settings; no other part of the kernel knows about it.
> > > 
> > > 0000-0cf7 : PCI Bus 0000:00
> > > ...
> > >   00f0-00ff : fpu
> > >   0170-0177 : 0000:00:1f.2
> > > 
> > > 
> > > (3) A PCMCIA card is inserted. It needs an I/O port resource of size 8. The
> > >     PCMCIA subsystem looks in its own resource database which I/O ports it
> > >     may use; there, it finds not only 0x4000-0x4fff but (with a small
> > >     exception) 0x0000-0xffff; as 0x0000-0x00ff are already assigned, it
> > >     happily assigns the first free area -- 0x100-0x108 -- to the PCMCIA
> > >     card.
> > > 
> > > 0000-0cf7 : PCI Bus 0000:00
> > > ...
> > >   00f0-00ff : fpu
> > >   0100-0108 : pcmcia0.0
> > >   0170-0177 : 0000:00:1f.2
> > > 
> > > (4) The PCMCIA card and the PCMCIA driver are set up to work with an IO
> > >     resource at 0x100-0x108. As soon as they attempt to use this resource,
> > >     bad things happen (lockups, etc.) because of the reasons spelled out at
> > >     (2).
> > 
> > We'd have exactly the same situation if we assigned I/O port 0x100
> > to a PCI device.  Why can't we use the same strategy PCI uses to
> > avoid it?
> 
> Well, PCI devices have three advantages:
> 
> - they can more easily be "enumerated" (and their resource needs reflected)
>   by ACPI or the BIOS.
> 
> - they usually don't conflict with ISA-style hardware(?)
> 
> - they usually work happily with any (even high) I/O ports.
> 
> > > => It is only an issue if the ACPI resource descriptions are incomplete. It
> > > is worse for PCMCIA because it happily assigns resources below 0x1000, where
> > > such system/platform devices usually listen to. And usecrs worsens the
> > > situation also in another regard: on my own laptop (a pre-2008 model),
> > > pci=use_crs makes the PCI-PCI bridge to be marked as "transparent", while
> > > pci=nocrs means the PCI-PCI bridge is assumed to be "non-transparent".
> > 
> > Sorry to be slow again...  The pci=use_crs and pci=nocrs options only
> > affect the PCI host bridge; they don't affect PCI-PCI bridges at all,
> > except that they change the set of resources available for subtractive-
> > decode PCI-PCI bridges to forward.  (Strictly speaking, they don't
> > affect the *behavior* of the PCI-PCI bridges, they only affect our
> > *idea* of what they're doing.)
> > 
> > I'm thinking of the code in pci_setup_device() where we set dev->transparent
> > based on the bridge's class code.  Obviously, you must be thinking
> > of something else.
> > 
> > My intention was that on pre-2008 systems like your laptop, my patches
> > would not change any behavior at all, unless you boot with "pci=use_crs".
> > Are you seeing an unexpected change on your system?
> 
> No, that's excactly what I'm seeing here. On pre-2008 system, the behavior
> is still the same; no unexpected change; all fine unless I boot with
> "pci=use_crs".
> 
> In contrast, on post-2008 systems like Komuros system, we now trust to
> ACPI report _all_ resource users. If ACPI gets this right, I don't see a
> real problem (but I might add a safety check to avoid any I/O ports < 0x0100
> anyway). The remaining question: can we safely trust BIOS authors to get it
> right?

From: Dominik Brodowski <linux at dominikbrodowski.net>
Date: Tue, 23 Mar 2010 16:05:00 +0100
Subject: [PATCH] pcmcia: do not use ioports < 0x100 on x86

On x86 systems using ACPI _CRS information -- now the default for
post-2008 systems -- the PCI root bus no longer pretends to be
offering the root ioport_resource. To avoid accidentally hitting
some platform / system device, use only I/O ports >= 0x100 for
PCMCIA devices on x86.

Also, use %pR, while we're there.

Reported-by: Komuro <komurojun-mbn at nifty.com>
CC: Bjorn Helgaas <bjorn.helgaas at hp.com>
Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>

diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c
index 4663b3f..7ae5b0f 100644
--- a/drivers/pcmcia/rsrc_nonstatic.c
+++ b/drivers/pcmcia/rsrc_nonstatic.c
@@ -864,13 +864,21 @@ static int nonstatic_autoadd_resources(struct pcmcia_socket *s)
 			continue;
 
 		if (res->flags & IORESOURCE_IO) {
+
+#if defined(CONFIG_X86)
+			/* on x86, avoid anything < 0x100 for it is often
+			 * used for legacy platform devices
+			 */
+			if (res->start < 0x100)
+				res->start = 0x100;
+			if (res->start >= res->end)
+				continue;
+#endif
+
 			if (res == &ioport_resource)
 				continue;
-			dev_printk(KERN_INFO, &s->cb_dev->dev,
-				   "pcmcia: parent PCI bridge I/O "
-				   "window: 0x%llx - 0x%llx\n",
-				   (unsigned long long)res->start,
-				   (unsigned long long)res->end);
+			dev_info(&s->cb_dev->dev, "pcmcia: parent PCI bridge "
+				"window: %pR\n", res);
 			if (!adjust_io(s, ADD_MANAGED_RESOURCE, res->start, res->end))
 				done |= IORESOURCE_IO;
 
@@ -879,11 +887,8 @@ static int nonstatic_autoadd_resources(struct pcmcia_socket *s)
 		if (res->flags & IORESOURCE_MEM) {
 			if (res == &iomem_resource)
 				continue;
-			dev_printk(KERN_INFO, &s->cb_dev->dev,
-				   "pcmcia: parent PCI bridge Memory "
-				   "window: 0x%llx - 0x%llx\n",
-				   (unsigned long long)res->start,
-				   (unsigned long long)res->end);
+			dev_info(&s->cb_dev->dev, "pcmcia: parent PCI bridge "
+				"window: %pR\n", res);
 			if (!adjust_memory(s, ADD_MANAGED_RESOURCE, res->start, res->end))
 				done |= IORESOURCE_MEM;
 		}


From raraks at gmail.com  Tue Mar 23 12:13:27 2010
From: raraks at gmail.com (raraks)
Date: Tue, 23 Mar 2010 09:13:27 -0700
Subject: Card Memory windows in client driver  - how to access ?
References: <74717750AF19415282F82F43C2286064@spyrus.com>
	<20100323153002.GA10380@comet.dominikbrodowski.net>
Message-ID: <47648B2473F74B40ACDB694281AEB0E0@spyrus.com>


- I am using 2.6.31-17
- I would think that pDev->conf.ConfigBase and pDev->conf.Present  will only 
be valid after a pcmcia_request_configuration. Is it valid in the probe 
routine ?
- pDev->conf.ConfigBase is a pointer to attribute memory or common memory 
window ? ...and how do I get the other window mapped for access ? (cistpl 
config has default flag set and uses device size as common memory size. 
Based on our last interchange I assume all attrib memory is sized 4K).

- I havent tried using INT_MEMORY_AND_IO but have tried using access speed 
0. I know the card normally works at 200ns

- I believe CardOffset = 0 ... if not I dont know what value to set here .. 
where do I get this info ? ( I have an older 2.4 card services version 
driver that does the same thing when requesting mappings for both memory 
windows ).

Thanks
-R-



----- Original Message ----- 
From: "Dominik Brodowski" <linux at dominikbrodowski.net>
To: "raraks" <raraks at gmail.com>
Cc: <linux-pcmcia at lists.infradead.org>
Sent: Tuesday, March 23, 2010 8:30 AM
Subject: Re: Card Memory windows in client driver - how to access ?


> Hey,
>
>
> On Mon, Mar 22, 2010 at 04:40:33PM -0700, raraks wrote:
>> I have a 16 bit PCMCIA card driver I am working on which requires
>> memory windows to read and write both attribute and common memory.
>> Card needs only memory windows to work (no IO or irq).
>>
>> I use the foll. method to get access to the card memory windows
>> after setting up  the window attributes appropriately
>>
>> link->conf.ConfigBase = parse.config.base;
>> link->conf.Present = parse.config.rmask[0];
>
> That's already available in
> p_dev->conf.ConfigBase
> p_dev->conf.Present
> no need to overwrite it here. Unless, of course, you're using an oooold
> kernel.
>
>> link->conf.IntType = INT_MEMORY;
>
> What happens if you set this to INT_MEMORY_AND_IO ?
>
>> dev->request_attr_memory.Attributes = ( WIN_DATA_WIDTH_8 |
>> WIN_MEMORY_TYPE_AM | WIN_ENABLE );
>> dev->request_attr_memory.Base = 0;
>> dev->request_attr_memory.Size = 0x1000;
>> dev->request_attr_memory.AccessSpeed = 200;
>
> Have you tried different accessspeed settings, or keeping it at 0?
>>
>> ret = pcmcia_request_window(&link, &dev->request_attr_memory,
>> &dev->handle_attr_memory);
>>
>> if (ret != 0) {
>>  cs_error(link, RequestWindow, ret);
>> }
>
> Using cs_error is deprecated.
>
>> memreq_attr_memory.CardOffset = 0;
>
> 0?
>
>> memreq_attr_memory.Page = 0;
>>
>> ret = pcmcia_map_mem_page(dev->handle_attr_memory, &memreq_attr_memory);
>>
>> if (ret != 0) {
>>  cs_error(link, MapMemPage, ret);}
>>
>> dev->attr_memory = ioremap( dev->request_attr_memory.Base,
>> dev->request_attr_memory.Size);
>>
>> All the above succeed and then I call pcmcia_request_configuration
>
> Is this ordering correct? IIRC you shouldn't even have to call
> pcmcia_request_configuration...
>
> Best,
> Dominik 



From linux at dominikbrodowski.net  Tue Mar 23 12:14:04 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Tue, 23 Mar 2010 17:14:04 +0100
Subject: Card Memory windows in client driver  - how to access ?
In-Reply-To: <47648B2473F74B40ACDB694281AEB0E0@spyrus.com>
References: <74717750AF19415282F82F43C2286064@spyrus.com>
	<20100323153002.GA10380@comet.dominikbrodowski.net>
	<47648B2473F74B40ACDB694281AEB0E0@spyrus.com>
Message-ID: <20100323161404.GA29560@isilmar.linta.de>

On Tue, Mar 23, 2010 at 09:13:27AM -0700, raraks wrote:
> - I would think that pDev->conf.ConfigBase and pDev->conf.Present  will 
> only be valid after a pcmcia_request_configuration. Is it valid in the 
> probe routine ?

It's set up before ->probe() is being called:


        ret = pccard_read_tuple(p_dev->socket, p_dev->func, CISTPL_CONFIG,
                                &cis_config);
        if (!ret) {
                p_dev->conf.ConfigBase = cis_config.base;
                p_dev->conf.Present = cis_config.rmask[0];
        } ...
	ret = p_drv->probe(p_dev);

> - I havent tried using INT_MEMORY_AND_IO but have tried using access speed 
> 0. I know the card normally works at 200ns

Could you try it out (_AND_IO)?

Best,
	Dominik


From raraks at gmail.com  Tue Mar 23 12:41:50 2010
From: raraks at gmail.com (raraks)
Date: Tue, 23 Mar 2010 09:41:50 -0700
Subject: Card Memory windows in client driver  - how to access ?
References: <74717750AF19415282F82F43C2286064@spyrus.com>
	<20100323153002.GA10380@comet.dominikbrodowski.net>
	<47648B2473F74B40ACDB694281AEB0E0@spyrus.com>
	<20100323161404.GA29560@isilmar.linta.de>
Message-ID: <21A726D3623F4E85BA638596B3ACF26A@spyrus.com>

Using INT_MEMORY_AND_IO didnt help either

This is what I got when I dumped the contents of pDev->conf in my config 
routine

conf.Attributes = 0
conf.ConfigBase = 1024
conf.Vpp = 0
conf.IntType = 0
conf.Status = 0
conf.Pin = 0
conf.Copy = 0
conf.ExStatus = 0
conf.ConfigIndex = 0
conf.Present = 37

Is conf.Vpp = 0 the problem here ?

-R-


----- Original Message ----- 
From: "Dominik Brodowski" <linux at dominikbrodowski.net>
To: "raraks" <raraks at gmail.com>
Cc: <linux-pcmcia at lists.infradead.org>
Sent: Tuesday, March 23, 2010 9:14 AM
Subject: Re: Card Memory windows in client driver - how to access ?


> On Tue, Mar 23, 2010 at 09:13:27AM -0700, raraks wrote:
>> - I would think that pDev->conf.ConfigBase and pDev->conf.Present  will
>> only be valid after a pcmcia_request_configuration. Is it valid in the
>> probe routine ?
>
> It's set up before ->probe() is being called:
>
>
>        ret = pccard_read_tuple(p_dev->socket, p_dev->func, CISTPL_CONFIG,
>                                &cis_config);
>        if (!ret) {
>                p_dev->conf.ConfigBase = cis_config.base;
>                p_dev->conf.Present = cis_config.rmask[0];
>        } ...
> ret = p_drv->probe(p_dev);
>
>> - I havent tried using INT_MEMORY_AND_IO but have tried using access 
>> speed
>> 0. I know the card normally works at 200ns
>
> Could you try it out (_AND_IO)?
>
> Best,
> Dominik 



From manuel.lauss at googlemail.com  Tue Mar 23 13:15:36 2010
From: manuel.lauss at googlemail.com (Manuel Lauss)
Date: Tue, 23 Mar 2010 18:15:36 +0100
Subject: [PATCH v2] pcmcia: db1xxx-ss: suspend/resume fix
In-Reply-To: <20100322205814.GB15250@isilmar.linta.de>
References: <1269287003-15523-1-git-send-email-manuel.lauss@gmail.com>
	<20100322205814.GB15250@isilmar.linta.de>
Message-ID: <f861ec6f1003231015j73d6de9dp7a3a4e087aabda0a@mail.gmail.com>

Howdy,

On Mon, Mar 22, 2010 at 9:58 PM, Dominik Brodowski
<linux at dominikbrodowski.net> wrote:
> Hm, what about using two commits currently in my tree for 2.6.36 instead,
> which should fix all socket drivers?
>
> ? ?power: support _noirq actions on device types and classes
> ? ?pcmcia: use dev_pm_ops for class pcmcia_socket_class
>
> Manuel: Could you try whether they also solve these issues? If so, I'd

Yes it does, works on my MIPS test systems.


> propose pushing both patches already for 2.6.36. Rafael: do you concur?

I hope you meant 2.6.34


Thanks!
     Manuel Lauss


From bjorn.helgaas at hp.com  Tue Mar 23 13:30:47 2010
From: bjorn.helgaas at hp.com (Bjorn Helgaas)
Date: Tue, 23 Mar 2010 11:30:47 -0600
Subject: pci_bus_for_each_resource,
	transparent bridges and rsrc_nonstatic.c
In-Reply-To: <20100323151301.GA10452@comet.dominikbrodowski.net>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<20100322232800.GA532@isilmar.linta.de>
	<20100323151301.GA10452@comet.dominikbrodowski.net>
Message-ID: <201003231130.47869.bjorn.helgaas@hp.com>

On Tuesday 23 March 2010 09:13:01 am Dominik Brodowski wrote:
> From: Dominik Brodowski <linux at dominikbrodowski.net>
> Date: Tue, 23 Mar 2010 16:05:00 +0100
> Subject: [PATCH] pcmcia: do not use ioports < 0x100 on x86
> 
> On x86 systems using ACPI _CRS information -- now the default for
> post-2008 systems -- the PCI root bus no longer pretends to be
> offering the root ioport_resource. To avoid accidentally hitting
> some platform / system device, use only I/O ports >= 0x100 for
> PCMCIA devices on x86.
> 
> Also, use %pR, while we're there.
> 
> Reported-by: Komuro <komurojun-mbn at nifty.com>
> CC: Bjorn Helgaas <bjorn.helgaas at hp.com>
> Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
> 
> diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c
> index 4663b3f..7ae5b0f 100644
> --- a/drivers/pcmcia/rsrc_nonstatic.c
> +++ b/drivers/pcmcia/rsrc_nonstatic.c
> @@ -864,13 +864,21 @@ static int nonstatic_autoadd_resources(struct pcmcia_socket *s)
>  			continue;
>  
>  		if (res->flags & IORESOURCE_IO) {
> +
> +#if defined(CONFIG_X86)
> +			/* on x86, avoid anything < 0x100 for it is often
> +			 * used for legacy platform devices
> +			 */
> +			if (res->start < 0x100)
> +				res->start = 0x100;
> +			if (res->start >= res->end)
> +				continue;
> +#endif

I'm concerned that this changes a resource that PCMCIA doesn't own,
i.e., this struct resource actually lives in the pci_dev of an upstream
bridge or in the host bridge data.

Doesn't PCMCIA maintain its own resource_map structures, and if so,
wouldn't it be cleaner to modify *those* instead, or change the
allocator to avoid these low ports?

> +
>  			if (res == &ioport_resource)
>  				continue;

If you make PCMCIA smart enough to avoid these low ports, do we still
need these &ioport_resource and &iomem_resource checks?  Having two
mechanisms will lead to more complicated behavior and more special
cases.

> -			dev_printk(KERN_INFO, &s->cb_dev->dev,
> -				   "pcmcia: parent PCI bridge I/O "
> -				   "window: 0x%llx - 0x%llx\n",
> -				   (unsigned long long)res->start,
> -				   (unsigned long long)res->end);
> +			dev_info(&s->cb_dev->dev, "pcmcia: parent PCI bridge "
> +				"window: %pR\n", res);

Jesse applied a patch from me to make this %pR change just a few days ago.

Bjorn

>  			if (!adjust_io(s, ADD_MANAGED_RESOURCE, res->start, res->end))
>  				done |= IORESOURCE_IO;
>  
> @@ -879,11 +887,8 @@ static int nonstatic_autoadd_resources(struct pcmcia_socket *s)
>  		if (res->flags & IORESOURCE_MEM) {
>  			if (res == &iomem_resource)
>  				continue;
> -			dev_printk(KERN_INFO, &s->cb_dev->dev,
> -				   "pcmcia: parent PCI bridge Memory "
> -				   "window: 0x%llx - 0x%llx\n",
> -				   (unsigned long long)res->start,
> -				   (unsigned long long)res->end);
> +			dev_info(&s->cb_dev->dev, "pcmcia: parent PCI bridge "
> +				"window: %pR\n", res);
>  			if (!adjust_memory(s, ADD_MANAGED_RESOURCE, res->start, res->end))
>  				done |= IORESOURCE_MEM;
>  		}
> 




From linux at dominikbrodowski.net  Tue Mar 23 14:02:37 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Tue, 23 Mar 2010 19:02:37 +0100
Subject: pci_bus_for_each_resource, transparent bridges and
	rsrc_nonstatic.c
In-Reply-To: <201003231130.47869.bjorn.helgaas@hp.com>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<20100322232800.GA532@isilmar.linta.de>
	<20100323151301.GA10452@comet.dominikbrodowski.net>
	<201003231130.47869.bjorn.helgaas@hp.com>
Message-ID: <20100323180237.GA28365@comet.dominikbrodowski.net>

> I'm concerned that this changes a resource that PCMCIA doesn't own,
> i.e., this struct resource actually lives in the pci_dev of an upstream
> bridge or in the host bridge data.

Oh yes, you're right -- my patch was badly broken. Brown paper-bag style.

> > +
> >  			if (res == &ioport_resource)
> >  				continue;
> 
> If you make PCMCIA smart enough to avoid these low ports, do we still
> need these &ioport_resource and &iomem_resource checks?  Having two
> mechanisms will lead to more complicated behavior and more special
> cases.

Well, it aren't only the low ports (<0x100) I'm concerned about, it's also
(and especially on pre-2008 systems) ports in higher areas
(0x100 < x < 0xffff). If we don't use _CRS, we need to be more careful to
avoid accidentally hitting wrong I/O-ports.

> > -			dev_printk(KERN_INFO, &s->cb_dev->dev,
> > -				   "pcmcia: parent PCI bridge I/O "
> > -				   "window: 0x%llx - 0x%llx\n",
> > -				   (unsigned long long)res->start,
> > -				   (unsigned long long)res->end);
> > +			dev_info(&s->cb_dev->dev, "pcmcia: parent PCI bridge "
> > +				"window: %pR\n", res);
> 
> Jesse applied a patch from me to make this %pR change just a few days ago.

Okay, I'll leave that alone then.

Thanks,
	Dominik

From: Dominik Brodowski <linux at dominikbrodowski.net>
Date: Tue, 23 Mar 2010 16:05:00 +0100
Subject: [PATCH] pcmcia: do not use ioports < 0x100 on x86

On x86 systems using ACPI _CRS information -- now the default for
post-2008 systems -- the PCI root bus no longer pretends to be
offering the root ioport_resource. To avoid accidentally hitting
some platform / system device, use only I/O ports >= 0x100 for
PCMCIA devices on x86.

Reported-by: Komuro <komurojun-mbn at nifty.com>
CC: Bjorn Helgaas <bjorn.helgaas at hp.com>
Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>

diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c
index 4663b3f..dcc6021 100644
--- a/drivers/pcmcia/rsrc_nonstatic.c
+++ b/drivers/pcmcia/rsrc_nonstatic.c
@@ -810,6 +810,13 @@ static int adjust_io(struct pcmcia_socket *s, unsigned int action, unsigned long
 	unsigned long size = end - start + 1;
 	int ret = 0;
 
+#if defined(CONFIG_X86)
+	/* on x86, avoid anything < 0x100 for it is often used for
+	 * legacy platform devices */
+	if (start < 0x100)
+		start = 0x100;
+#endif
+
 	if (end < start)
 		return -EINVAL;
 


From cyrille at grinner.fr  Tue Mar 23 15:22:57 2010
From: cyrille at grinner.fr (Cyrille Grinner)
Date: Tue, 23 Mar 2010 20:22:57 +0100
Subject: Boot options acpi=off pci=biosirq   dmesg
In-Reply-To: <20100322230307.GB29522@isilmar.linta.de>
References: <1269297469.4ba7f13da7444@imp.free.fr>
	<20100322230307.GB29522@isilmar.linta.de>
Message-ID: <4BA91511.4040100@grinner.fr>

Hi Dominik!

I checked under Windows! IRQ9 is being used for the pcmcia card! I'm 
going to try right now the

	acpi=off pci=biosirq irqfixup

	acpi=off pci=biosirq irqpoll

I'll let you know in a few minutes ;-)

Cyrille



From cyrille at grinner.fr  Tue Mar 23 15:37:04 2010
From: cyrille at grinner.fr (Cyrille Grinner)
Date: Tue, 23 Mar 2010 20:37:04 +0100
Subject: dmesg acpi=off pci=biosirq irqfixup SLOT 1
Message-ID: <4BA91860.3050807@grinner.fr>

/form2 cdda tray
[    1.674584] Uniform CD-ROM driver Revision: 3.20
[    1.675073] sr 1:0:0:0: Attached scsi CD-ROM sr0
[    1.675324] sr 1:0:0:0: Attached scsi generic sg1 type 5
[    1.691147]  sda6 > sda3
[    1.692880] sd 0:0:0:0: [sda] Attached SCSI disk
[    1.693045] Freeing unused kernel memory: 540k freed
[    1.696836] Write protecting the kernel text: 4568k
[    1.697085] Write protecting the kernel read-only data: 1836k
[    1.788070] usb 1-2: new full speed USB device using uhci_hcd and address 2
[    2.116950] usb 1-2: configuration #1 chosen from 1 choice
[    2.685078] Linux agpgart interface v0.103
[    2.954305] agpgart-intel 0000:00:00.0: Intel i815 Chipset
[    3.053012] agpgart-intel 0000:00:00.0: AGP aperture is 64M @ 0xf8000000
[    3.176085] ohci1394: fw-host0: OHCI-1394 1.0 (PCI): IRQ=[10]  MMIO=[f4104000-f41047ff]  Max Packet=[2048]  IR/IT contexts=[4/8]
[    4.326137] PM: Starting manual resume from disk
[    4.326240] PM: Resume from partition 8:6
[    4.326248] PM: Checking hibernation image.
[    4.326871] PM: Resume from disk failed.
[    4.402938] kjournald starting.  Commit interval 5 seconds
[    4.403067] EXT3-fs: mounted filesystem with writeback data mode.
[    4.456652] ieee1394: Host added: ID:BUS[0-00:1023]  GUID[0800460300a53ece]
[    6.040851] type=1505 audit(1269375678.048:2): operation="profile_load" pid=300 name=/usr/share/gdm/guest-session/Xsession
[    6.116705] type=1505 audit(1269375678.124:3): operation="profile_load" pid=301 name=/sbin/dhclient3
[    6.118825] type=1505 audit(1269375678.124:4): operation="profile_load" pid=301 name=/usr/lib/NetworkManager/nm-dhcp-client.action
[    6.120077] type=1505 audit(1269375678.128:5): operation="profile_load" pid=301 name=/usr/lib/connman/scripts/dhclient-script
[    6.228355] type=1505 audit(1269375678.236:6): operation="profile_load" pid=302 name=/usr/bin/evince
[    6.264150] type=1505 audit(1269375678.272:7): operation="profile_load" pid=302 name=/usr/bin/evince-previewer
[    6.286745] type=1505 audit(1269375678.292:8): operation="profile_load" pid=302 name=/usr/bin/evince-thumbnailer
[    6.370902] type=1505 audit(1269375678.376:9): operation="profile_load" pid=304 name=/usr/lib/cups/backend/cups-pdf
[    6.373676] type=1505 audit(1269375678.380:10): operation="profile_load" pid=304 name=/usr/sbin/cupsd
[    6.396483] type=1505 audit(1269375678.404:11): operation="profile_load" pid=305 name=/usr/sbin/tcpdump
[   28.697992] Adding 546168k swap on /dev/sda6.  Priority:-1 extents:1 across:546168k
[   28.780353] udev: starting version 147
[   29.178320] EXT3 FS on sda5, internal journal
[   29.968308] lp: driver loaded but no devices found
[   29.976693] shpchp: Standard Hot Plug PCI Controller Driver version: 0.4
[   30.055212] Intel 82802 RNG detected
[   30.429891] cfg80211: Calling CRDA to update world regulatory domain
[   30.620322] cfg80211: World regulatory domain updated:
[   30.620343]  (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[   30.620357]  (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   30.620370]  (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[   30.620383]  (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[   30.620395]  (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   30.620407]  (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   31.214992] yenta_cardbus 0000:01:02.0: CardBus bridge found [104d:80df]
[   31.215035] yenta_cardbus 0000:01:02.0: no PCI IRQ, CardBus support disabled for this socket.
[   31.215048] yenta_cardbus 0000:01:02.0: check your BIOS CardBus, BIOS IRQ or ACPI settings.
[   33.517548] irq 10: nobody cared (try booting with the "irqpoll" option)
[   33.517652] Pid: 475, comm: modprobe Not tainted 2.6.31-16-generic #52-Ubuntu
[   33.517664] Call Trace:
[   33.517698]  [<c056ea5c>] ? printk+0x18/0x1c
[   33.517740]  [<c0190ee7>] __report_bad_irq+0x27/0x90
[   33.517756]  [<c01910a0>] note_interrupt+0x150/0x190
[   33.517786]  [<c0106c62>] ? mask_and_ack_8259A+0x52/0xf0
[   33.517801]  [<c0191a0c>] handle_level_irq+0xbc/0xe0
[   33.517816]  [<c0105a38>] handle_irq+0x18/0x30
[   33.517829]  [<c0104f07>] do_IRQ+0x47/0xc0
[   33.517855]  [<c03e0512>] ? ata_sff_host_intr+0xa2/0x160
[   33.517870]  [<c01039b0>] common_interrupt+0x30/0x40
[   33.517887]  [<c057007b>] ? schedule_hrtimeout_range+0xbb/0x150
[   33.517903]  [<c01900e0>] ? can_request_irq+0x10/0x40
[   33.517930]  [<c014b365>] ? __do_softirq+0x45/0x1a0
[   33.517957]  [<c0127c38>] ? default_spin_lock_flags+0x8/0x10
[   33.517976]  [<c0570e1a>] ? _spin_lock_irqsave+0x2a/0x40
[   33.517991]  [<c0106b92>] ? enable_8259A_irq+0x42/0x60
[   33.518005]  [<c01919f6>] ? handle_level_irq+0xa6/0xe0
[   33.518020]  [<c014b4fd>] do_softirq+0x3d/0x40
[   33.518035]  [<c014b63d>] irq_exit+0x5d/0x70
[   33.518048]  [<c0104f10>] do_IRQ+0x50/0xc0
[   33.518061]  [<c056f6c1>] ? schedule_timeout+0x131/0x200
[   33.518076]  [<c01039b0>] common_interrupt+0x30/0x40
[   33.518092]  [<c0318798>] ? delay_tsc+0x28/0x70
[   33.518105]  [<c0318739>] __delay+0x9/0x10
[   33.518118]  [<c031876b>] __const_udelay+0x2b/0x30
[   33.518157]  [<e0b092a2>] yenta_get_socket_capabilities+0xf2/0x150 [yenta_socket]
[   33.518180]  [<e0b0b1ce>] yenta_probe+0x2ea/0x396 [yenta_socket]
[   33.518217]  [<c032853e>] local_pci_probe+0xe/0x10
[   33.518232]  [<c03292c0>] pci_device_probe+0x60/0x80
[   33.518265]  [<c03a2e70>] really_probe+0x50/0x140
[   33.518280]  [<c0570e1a>] ? _spin_lock_irqsave+0x2a/0x40
[   33.518295]  [<c03a2f79>] driver_probe_device+0x19/0x20
[   33.518310]  [<c03a2ff9>] __driver_attach+0x79/0x80
[   33.518325]  [<c03a24c8>] bus_for_each_dev+0x48/0x70
[   33.518340]  [<c03a2d39>] driver_attach+0x19/0x20
[   33.518354]  [<c03a2f80>] ? __driver_attach+0x0/0x80
[   33.518368]  [<c03a271f>] bus_add_driver+0xbf/0x2a0
[   33.518383]  [<c0329200>] ? pci_device_remove+0x0/0x40
[   33.518398]  [<c03a3285>] driver_register+0x65/0x120
[   33.518413]  [<c03294e0>] __pci_register_driver+0x40/0xb0
[   33.518432]  [<e0b10017>] yenta_socket_init+0x17/0x19 [yenta_socket]
[   33.518447]  [<c010112c>] do_one_initcall+0x2c/0x190
[   33.518466]  [<e0b10000>] ? yenta_socket_init+0x0/0x19 [yenta_socket]
[   33.518495]  [<c0173751>] sys_init_module+0xb1/0x1f0
[   33.518510]  [<c010336c>] syscall_call+0x7/0xb
[   33.518520] handlers:
[   33.518586] [<e06f0220>] (ohci_irq_handler+0x0/0x780 [ohci1394])
[   33.518758] Disabling IRQ #10
[   33.519711] yenta_cardbus 0000:01:02.0: ISA IRQ mask 0x0098, PCI irq 0
[   33.519725] yenta_cardbus 0000:01:02.0: Socket status: 30000820
[   33.519792] pci_bus 0000:01: Raising subordinate bus# of parent bus (#01) from #01 to #05
[   33.600207] input: PS/2 Mouse as /devices/platform/i8042/serio1/input/input2
[   33.644549] input: AlpsPS/2 ALPS GlidePoint as /devices/platform/i8042/serio1/input/input3
[   34.286591] ip_tables: (C) 2000-2006 Netfilter Core Team
[   35.738394] phy0: Selected rate control algorithm 'minstrel'
[   35.741654] Registered led device: rt73usb-phy0::radio
[   35.741732] Registered led device: rt73usb-phy0::assoc
[   35.741808] Registered led device: rt73usb-phy0::quality
[   35.746294] usbcore: registered new interface driver rt73usb
[   36.516670] type=1505 audit(1269372108.523:12): operation="profile_replace" pid=778 name=/usr/share/gdm/guest-session/Xsession
[   36.558289] type=1505 audit(1269372108.563:13): operation="profile_replace" pid=779 name=/sbin/dhclient3
[   36.561250] type=1505 audit(1269372108.567:14): operation="profile_replace" pid=779 name=/usr/lib/NetworkManager/nm-dhcp-client.action
[   36.562362] type=1505 audit(1269372108.567:15): operation="profile_replace" pid=779 name=/usr/lib/connman/scripts/dhclient-script
[   36.692059] type=1505 audit(1269372108.699:16): operation="profile_replace" pid=780 name=/usr/bin/evince
[   36.798385] type=1505 audit(1269372108.803:17): operation="profile_replace" pid=780 name=/usr/bin/evince-previewer
[   36.801174] Intel ICH 0000:00:1f.5: found PCI INT B -> IRQ 5
[   36.801226] Intel ICH 0000:00:1f.5: sharing IRQ 5 with 0000:00:1f.3
[   36.801250] Intel ICH 0000:00:1f.5: sharing IRQ 5 with 0000:00:1f.6
[   36.801331] Intel ICH 0000:00:1f.5: setting latency timer to 64
[   36.851365] type=1505 audit(1269372108.855:18): operation="profile_replace" pid=780 name=/usr/bin/evince-thumbnailer
[   36.917610] type=1505 audit(1269372108.923:19): operation="profile_replace" pid=782 name=/usr/lib/cups/backend/cups-pdf
[   36.920488] type=1505 audit(1269372108.927:20): operation="profile_replace" pid=782 name=/usr/sbin/cupsd
[   36.948774] type=1505 audit(1269372108.955:21): operation="profile_replace" pid=783 name=/usr/sbin/tcpdump
[   37.239848] intel8x0_measure_ac97_clock: measured 58354 usecs (2804 samples)
[   37.239864] intel8x0: clocking to 48000
[   37.492317] rt73usb 1-2:1.0: firmware: requesting rt73.bin
[   38.112121] yenta_cardbus 0000:01:02.0: pcmcia: parent PCI bridge I/O window: 0x3000 - 0x3fff
[   38.112143] pcmcia_socket pcmcia_socket0: cs: IO port probe 0x3000-0x3fff: clean.
[   38.112865] yenta_cardbus 0000:01:02.0: pcmcia: parent PCI bridge Memory window: 0xf4100000 - 0xf41fffff
[   38.112879] yenta_cardbus 0000:01:02.0: pcmcia: parent PCI bridge Memory window: 0x20000000 - 0x27ffffff
[   38.113530] yenta_cardbus 0000:01:02.1: CardBus bridge found [104d:80df]
[   38.113577] yenta_cardbus 0000:01:02.1: no PCI IRQ, CardBus support disabled for this socket.
[   38.113589] yenta_cardbus 0000:01:02.1: check your BIOS CardBus, BIOS IRQ or ACPI settings.
[   38.240193] yenta_cardbus 0000:01:02.1: ISA IRQ mask 0x0098, PCI irq 0
[   38.240237] yenta_cardbus 0000:01:02.1: Socket status: 30000006
[   38.240252] pci_bus 0000:01: Raising subordinate bus# of parent bus (#01) from #05 to #09
[   38.240283] yenta_cardbus 0000:01:02.1: pcmcia: parent PCI bridge I/O window: 0x3000 - 0x3fff
[   38.240299] pcmcia_socket pcmcia_socket1: cs: IO port probe 0x3000-0x3fff: clean.
[   38.241021] yenta_cardbus 0000:01:02.1: pcmcia: parent PCI bridge Memory window: 0xf4100000 - 0xf41fffff
[   38.241036] yenta_cardbus 0000:01:02.1: pcmcia: parent PCI bridge Memory window: 0x20000000 - 0x27ffffff
[   38.245260] pcmcia_socket pcmcia_socket0: cs: cardbus cards are not supported.
[   38.385146] pcmcia_socket pcmcia_socket0: cs: IO port probe 0x100-0x3af: clean.
[   38.387445] pcmcia_socket pcmcia_socket0: cs: IO port probe 0x3e0-0x4ff: clean.
[   38.390531] pcmcia_socket pcmcia_socket0: cs: IO port probe 0x820-0x8ff: clean.
[   38.391406] pcmcia_socket pcmcia_socket0: cs: IO port probe 0xc00-0xcf7: clean.
[   38.392949] pcmcia_socket pcmcia_socket0: cs: IO port probe 0xa00-0xaff: clean.
[   38.415518] ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   38.862456] pcmcia_socket pcmcia_socket1: cs: IO port probe 0x100-0x3af: clean.
[   38.864801] pcmcia_socket pcmcia_socket1: cs: IO port probe 0x3e0-0x4ff: clean.
[   38.865804] pcmcia_socket pcmcia_socket1: cs: IO port probe 0x820-0x8ff: clean.
[   38.866660] pcmcia_socket pcmcia_socket1: cs: IO port probe 0xc00-0xcf7: clean.
[   38.876975] pcmcia_socket pcmcia_socket1: cs: IO port probe 0xa00-0xaff: clean.
[   40.672295] ppdev: user-space parallel port driver
[   41.916693] [drm] Initialized drm 1.1.0 20060810
[   41.962096] PCI: setting IRQ 10 as level-triggered
[   41.962114] pci 0000:00:02.0: found PCI INT A -> IRQ 10
[   41.962181] pci 0000:00:02.0: setting latency timer to 64
[   41.962848] [drm] Initialized i810 1.4.0 20030605 for 0000:00:02.0 on minor 0
[   41.977668] mtrr: base(0xf8000000) is not aligned on a size(0x12c000) boundary
[   42.293170] [drm] Using v1.4 init.
[   45.771664] [drm:drm_reclaim_locked_buffers] *ERROR* reclaim_buffers_locked() deadlock. Please rework this
[   45.771677]  driver to use reclaim_buffers_idlelocked() instead.
[   45.771683]  I will go on reclaiming the buffers anyway.
[  107.838168] wlan0: authenticate with AP ce:3d:6a:0b:95:f8
[  107.840414] wlan0: authenticated
[  107.840436] wlan0: associate with AP ce:3d:6a:0b:95:f8
[  107.843321] wlan0: RX AssocResp from ce:3d:6a:0b:95:f8 (capab=0x411 status=0 aid=1)
[  107.843339] wlan0: associated
[  108.082500] ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready





From cyrille at grinner.fr  Tue Mar 23 15:52:47 2010
From: cyrille at grinner.fr (Cyrille Grinner)
Date: Tue, 23 Mar 2010 20:52:47 +0100
Subject: acpi=off pci=biosirq irqfixup SLOT2
Message-ID: <4BA91C0F.2080408@grinner.fr>

[    1.478062] device-mapper: uevent: version 1.0.3
[    1.478808] device-mapper: ioctl: 4.15.0-ioctl (2009-04-01) initialised:

dm-devel at redhat.com
[    1.479474] device-mapper: multipath: version 1.1.0 loaded
[    1.479570] device-mapper: multipath round-robin: version 1.0.0 loaded
[    1.480568] EISA: Probing bus 0 at eisa.0
[    1.480665] Cannot allocate resource for EISA slot 1
[    1.480738] Cannot allocate resource for EISA slot 2
[    1.480809] Cannot allocate resource for EISA slot 3
[    1.480908] EISA: Detected 0 cards.
[    1.481311] cpuidle: using governor ladder
[    1.481391] cpuidle: using governor menu
[    1.484101] TCP cubic registered
[    1.484967] NET: Registered protocol family 10
[    1.487047] lo: Disabled Privacy Extensions
[    1.488655] NET: Registered protocol family 17
[    1.488841] Bluetooth: L2CAP ver 2.13
[    1.488909] Bluetooth: L2CAP socket layer initialized
[    1.488983] Bluetooth: SCO (Voice Link) ver 0.6
[    1.489051] Bluetooth: SCO socket layer initialized
[    1.489313] Bluetooth: RFCOMM TTY layer initialized
[    1.489394] Bluetooth: RFCOMM socket layer initialized
[    1.489465] Bluetooth: RFCOMM ver 1.11
[    1.489573] Using IPI No-Shortcut mode
[    1.489995] PM: Resume from disk failed.
[    1.490049] registered taskstats version 1
[    1.490475]   Magic number: 2:413:650
[    1.490689] rtc_cmos 00:05: setting system clock to 2010-03-23 20:37:46

UTC (1269376666)
[    1.490788] BIOS EDD facility v0.16 2004-Jun-25, 0 devices found
[    1.490859] EDD information not available.
[    1.507744] input: AT Translated Set 2 keyboard as

/devices/platform/i8042/serio0/input/input1
[    1.632575] ata2.00: ATAPI: HL-DT-ST DVDRAM GMA-4082N, HJ02,

max UDMA/33
[    1.633437] ata1.00: ATA-5: FUJITSU MHM2100AT, 5823, max

UDMA/66
[    1.633521] ata1.00: 19640880 sectors, multi 16: LBA
[    1.648396] ata2.00: configured for UDMA/33
[    1.649098] ata1.00: configured for UDMA/66
[    1.649787] scsi 0:0:0:0: Direct-Access     ATA      FUJITSU MHM2100A

5823 PQ: 0 ANSI: 5
[    1.650593] sd 0:0:0:0: Attached scsi generic sg0 type 0
[    1.650909] sd 0:0:0:0: [sda] 19640880 512-byte logical blocks: (10.0

GB/9.36 GiB)
[    1.651261] sd 0:0:0:0: [sda] Write Protect is off
[    1.651340] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[    1.651481] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled,

doesn't support DPO or FUA
[    1.652307]  sda:
[    1.656515] scsi 1:0:0:0: CD-ROM            HL-DT-ST DVDRAM GMA-4082N

HJ02 PQ: 0 ANSI: 5
[    1.668523] sr0: scsi3-mmc drive: 24x/24x writer dvd-ram cd/rw

xa/form2 cdda tray
[    1.668633] Uniform CD-ROM driver Revision: 3.20
[    1.669110] sr 1:0:0:0: Attached scsi CD-ROM sr0
[    1.669358] sr 1:0:0:0: Attached scsi generic sg1 type 5
[    1.670834]  sda1 < sda5 sda6 > sda3
[    1.693480] sd 0:0:0:0: [sda] Attached SCSI disk
[    1.693644] Freeing unused kernel memory: 540k freed
[    1.697428] Write protecting the kernel text: 4568k
[    1.697676] Write protecting the kernel read-only data: 1836k
[    1.784051] usb 1-2: new full speed USB device using uhci_hcd and 
address

2
[    2.110574] usb 1-2: configuration #1 chosen from 1 choice
[    2.572160] Linux agpgart interface v0.103
[    2.905010] agpgart-intel 0000:00:00.0: Intel i815 Chipset
[    3.070808] agpgart-intel 0000:00:00.0: AGP aperture is 64M @

0xf8000000
[    3.176764] ohci1394: fw-host0: OHCI-1394 1.0 (PCI): IRQ=[10]  

MMIO=[f4104000-f41047ff]  Max Packet=[2048]  IR/IT contexts=[4/8]
[    4.270299] PM: Starting manual resume from disk
[    4.270397] PM: Resume from partition 8:6
[    4.270405] PM: Checking hibernation image.
[    4.270934] PM: Resume from disk failed.
[    4.346555] kjournald starting.  Commit interval 5 seconds
[    4.346700] EXT3-fs: mounted filesystem with writeback data mode.
[    4.452392] ieee1394: Host added: ID:BUS[0-00:1023]  

GUID[0800460300a53ece]
[    5.955923] type=1505 audit(1269376670.965:2):

operation="profile_load" pid=298

name=/usr/share/gdm/guest-session/Xsession
[    6.031994] type=1505 audit(1269376671.041:3): operation="profile_load"

pid=299 name=/sbin/dhclient3
[    6.034135] type=1505 audit(1269376671.041:4): operation="profile_load"

pid=299 name=/usr/lib/NetworkManager/nm-dhcp-client.action
[    6.035318] type=1505 audit(1269376671.041:5): operation="profile_load"

pid=299 name=/usr/lib/connman/scripts/dhclient-script
[    6.143674] type=1505 audit(1269376671.149:6): operation="profile_load"

pid=300 name=/usr/bin/evince
[    6.178958] type=1505 audit(1269376671.185:7): operation="profile_load"

pid=300 name=/usr/bin/evince-previewer
[    6.202090] type=1505 audit(1269376671.209:8):

operation="profile_load" pid=300 name=/usr/bin/evince-thumbnailer
[    6.285969] type=1505 audit(1269376671.293:9):

operation="profile_load" pid=302 name=/usr/lib/cups/backend/cups-pdf
[    6.288713] type=1505 audit(1269376671.297:10):

operation="profile_load" pid=302 name=/usr/sbin/cupsd
[    6.311426] type=1505 audit(1269376671.317:11): operation="profile_load"

pid=303 name=/usr/sbin/tcpdump
[    8.593422] Adding 546168k swap on /dev/sda6.  Priority:-1 extents:1

across:546168k
[    9.472767] EXT3 FS on sda5, internal journal
[   12.417836] udev: starting version 147
[   15.131750] cfg80211: Calling CRDA to update world regulatory domain
[   15.676077] shpchp: Standard Hot Plug PCI Controller Driver version: 0.4
[   16.225996] Intel 82802 RNG detected
[   16.818671] lp: driver loaded but no devices found
[   17.128084] input: PS/2 Mouse as

/devices/platform/i8042/serio1/input/input2
[   17.164891] input: AlpsPS/2 ALPS GlidePoint as

/devices/platform/i8042/serio1/input/input3
[   18.153465] yenta_cardbus 0000:01:02.0: CardBus bridge found

[104d:80df]
[   18.153507] yenta_cardbus 0000:01:02.0: no PCI IRQ, CardBus support

disabled for this socket.
[   18.153520] yenta_cardbus 0000:01:02.0: check your BIOS CardBus,

BIOS IRQ or ACPI settings.
[   18.280324] yenta_cardbus 0000:01:02.0: ISA IRQ mask 0x0098, PCI irq

0
[   18.280341] yenta_cardbus 0000:01:02.0: Socket status: 30000826
[   18.280355] pci_bus 0000:01: Raising subordinate bus# of parent bus

(#01) from #01 to #05
[   18.280386] yenta_cardbus 0000:01:02.0: pcmcia: parent PCI bridge I/O

window: 0x3000 - 0x3fff
[   18.280403] pcmcia_socket pcmcia_socket0: cs: IO port probe

0x3000-0x3fff: clean.
[   18.281125] yenta_cardbus 0000:01:02.0: pcmcia: parent PCI bridge

Memory window: 0xf4100000 - 0xf41fffff
[   18.281139] yenta_cardbus 0000:01:02.0: pcmcia: parent PCI bridge

Memory window: 0x20000000 - 0x27ffffff
[   18.281677] yenta_cardbus 0000:01:02.1: CardBus bridge found

[104d:80df]
[   18.281716] yenta_cardbus 0000:01:02.1: no PCI IRQ, CardBus support

disabled for this socket.
[   18.281728] yenta_cardbus 0000:01:02.1: check your BIOS CardBus, BIOS

IRQ or ACPI settings.
[   18.420102] yenta_cardbus 0000:01:02.1: ISA IRQ mask 0x00b8, PCI irq

0
[   18.420120] yenta_cardbus 0000:01:02.1: Socket status: 30000820
[   18.420136] pci_bus 0000:01: Raising subordinate bus# of parent bus

(#01) from #05 to #09
[   18.420168] yenta_cardbus 0000:01:02.1: pcmcia: parent PCI bridge I/O

window: 0x3000 - 0x3fff
[   18.420184] pcmcia_socket pcmcia_socket1: cs: IO port probe

0x3000-0x3fff: clean.
[   18.420907] yenta_cardbus 0000:01:02.1: pcmcia: parent PCI bridge

Memory window: 0xf4100000 - 0xf41fffff
[   18.420924] yenta_cardbus 0000:01:02.1: pcmcia: parent PCI bridge

Memory window: 0x20000000 - 0x27ffffff
[   18.571588] pcmcia_socket pcmcia_socket1: cs: cardbus cards are not

supported.
[   19.180326] cfg80211: World regulatory domain updated:
[   19.180344]  (start_freq - end_freq @ bandwidth), (max_antenna_gain,

max_eirp)
[   19.180359]  (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi,

2000 mBm)
[   19.180372]  (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi,

2000 mBm)
[   19.180384]  (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi,

2000 mBm)
[   19.180397]  (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi,

2000 mBm)
[   19.180409]  (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi,

2000 mBm)
[   19.540142] pcmcia_socket pcmcia_socket0: cs: IO port probe

0x100-0x3af: clean.
[   19.542300] pcmcia_socket pcmcia_socket0: cs: IO port probe

0x3e0-0x4ff: clean.
[   19.543310] pcmcia_socket pcmcia_socket0: cs: IO port probe

0x820-0x8ff: clean.
[   19.546687] pcmcia_socket pcmcia_socket0: cs: IO port probe

0xc00-0xcf7: clean.
[   19.548313] pcmcia_socket pcmcia_socket0: cs: IO port probe

0xa00-0xaff: clean.
[   19.732830] ip_tables: (C) 2000-2006 Netfilter Core Team
[   19.813279] pcmcia_socket pcmcia_socket1: cs: IO port probe

0x100-0x3af: clean.
[   19.815374] pcmcia_socket pcmcia_socket1: cs: IO port probe

0x3e0-0x4ff: clean.
[   19.816515] pcmcia_socket pcmcia_socket1: cs: IO port probe

0x820-0x8ff: clean.
[   19.817359] pcmcia_socket pcmcia_socket1: cs: IO port probe

0xc00-0xcf7: clean.
[   19.818850] pcmcia_socket pcmcia_socket1: cs: IO port probe

0xa00-0xaff: clean.
[   21.739095] type=1505 audit(1269373086.744:12):

operation="profile_replace" pid=633

name=/usr/share/gdm/guest-session/Xsession
[   21.751395] type=1505 audit(1269373086.756:13):

operation="profile_replace" pid=634 name=/sbin/dhclient3
[   21.755070] type=1505 audit(1269373086.760:14):

operation="profile_replace" pid=634

name=/usr/lib/NetworkManager/nm-dhcp-client.action
[   21.756378] type=1505 audit(1269373086.764:15):

operation="profile_replace" pid=634

name=/usr/lib/connman/scripts/dhclient-script
[   21.790542] type=1505 audit(1269373086.796:16):

operation="profile_replace" pid=635 name=/usr/bin/evince
[   21.852864] type=1505 audit(1269373086.860:17):

operation="profile_replace" pid=635 name=/usr/bin/evince-previewer
[   21.889159] type=1505 audit(1269373086.896:18):

operation="profile_replace" pid=635 name=/usr/bin/evince-thumbnailer
[   21.922727] type=1505 audit(1269373086.928:19):

operation="profile_replace" pid=647

name=/usr/lib/cups/backend/cups-pdf
[   21.927570] type=1505 audit(1269373086.932:20):

operation="profile_replace" pid=647 name=/usr/sbin/cupsd
[   21.937971] type=1505 audit(1269373086.944:21):

operation="profile_replace" pid=648 name=/usr/sbin/tcpdump
[   22.099068] phy0: Selected rate control algorithm 'minstrel'
[   22.102200] Registered led device: rt73usb-phy0::radio
[   22.102286] Registered led device: rt73usb-phy0::assoc
[   22.102361] Registered led device: rt73usb-phy0::quality
[   22.106494] usbcore: registered new interface driver rt73usb
[   24.520216] Intel ICH 0000:00:1f.5: found PCI INT B -> IRQ 5
[   24.520268] Intel ICH 0000:00:1f.5: sharing IRQ 5 with 0000:00:1f.3
[   24.520292] Intel ICH 0000:00:1f.5: sharing IRQ 5 with 0000:00:1f.6
[   24.520374] Intel ICH 0000:00:1f.5: setting latency timer to 64
[   24.943502] intel8x0_measure_ac97_clock: measured 58907 usecs (2832

samples)
[   24.943518] intel8x0: clocking to 48000
[   33.073874] rt73usb 1-2:1.0: firmware: requesting rt73.bin
[   33.862442] ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   39.007540] [drm] Initialized drm 1.1.0 20060810
[   39.082874] PCI: setting IRQ 10 as level-triggered
[   39.082895] pci 0000:00:02.0: found PCI INT A -> IRQ 10
[   39.082965] pci 0000:00:02.0: setting latency timer to 64
[   39.089314] [drm] Initialized i810 1.4.0 20030605 for 0000:00:02.0 on

minor 0
[   39.101105] mtrr: base(0xf8000000) is not aligned on a size(0x12c000)

boundary
[   39.343197] [drm] Using v1.4 init.
[   39.485208] ppdev: user-space parallel port driver
[   42.993991] [drm:drm_reclaim_locked_buffers] *ERROR*

reclaim_buffers_locked() deadlock. Please rework this
[   42.994006]  driver to use reclaim_buffers_idlelocked() instead.
[   42.994012]  I will go on reclaiming the buffers anyway.
[  222.971995] wlan0: authenticate with AP ce:3d:6a:0b:95:f8
[  222.974350] wlan0: authenticated
[  222.974418] wlan0: associate with AP ce:3d:6a:0b:95:f8
[  222.982407] wlan0: RX AssocResp from ce:3d:6a:0b:95:f8 (capab=0x411

status=0 aid=1)
[  222.982426] wlan0: associated
[  223.187360] ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready



From rjw at sisk.pl  Tue Mar 23 18:02:49 2010
From: rjw at sisk.pl (Rafael J. Wysocki)
Date: Tue, 23 Mar 2010 23:02:49 +0100
Subject: [PATCH v2] pcmcia: db1xxx-ss: suspend/resume fix
In-Reply-To: <f861ec6f1003231015j73d6de9dp7a3a4e087aabda0a@mail.gmail.com>
References: <1269287003-15523-1-git-send-email-manuel.lauss@gmail.com>
	<20100322205814.GB15250@isilmar.linta.de>
	<f861ec6f1003231015j73d6de9dp7a3a4e087aabda0a@mail.gmail.com>
Message-ID: <201003232302.49415.rjw@sisk.pl>

On Tuesday 23 March 2010, Manuel Lauss wrote:
> Howdy,
> 
> On Mon, Mar 22, 2010 at 9:58 PM, Dominik Brodowski
> <linux at dominikbrodowski.net> wrote:
> > Hm, what about using two commits currently in my tree for 2.6.36 instead,
> > which should fix all socket drivers?
> >
> >    power: support _noirq actions on device types and classes
> >    pcmcia: use dev_pm_ops for class pcmcia_socket_class
> >
> > Manuel: Could you try whether they also solve these issues? If so, I'd
> 
> Yes it does, works on my MIPS test systems.

I don't seem to have received the original message, so sorry for the lack of
response.
 
> > propose pushing both patches already for 2.6.36. Rafael: do you concur?

I do.  The patches look good and if they fix things for people right now,
that's a good reason to push them for .34.

> I hope you meant 2.6.34

I think Dominik meant .35 actually.

Rafael


From bugzilla-daemon at bugzilla.kernel.org  Wed Mar 24 06:07:52 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Wed, 24 Mar 2010 10:07:52 GMT
Subject: [Bug 15621] New: BUG: unable to handle kernel paging request  -
	comm: pccardd
Message-ID: <bug-15621-4463@https.bugzilla.kernel.org/>

https://bugzilla.kernel.org/show_bug.cgi?id=15621

           Summary: BUG: unable to handle kernel paging request  - comm:
                    pccardd
           Product: Drivers
           Version: 2.5
    Kernel Version: 2.6.34-rc2 ae6be51ed01d6c4aaf249a207b4434bc7785853b
          Platform: All
        OS/Version: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: PCMCIA
        AssignedTo: linux-pcmcia at lists.infradead.org
        ReportedBy: ozgur.yuksel at oracle.com
        Regression: Yes


After building ae6be51ed01d6c4aaf249a207b4434bc7785853b, bootup gives out:
[   75.245698] BUG: unable to handle kernel paging request at 746f7274
[   75.249007] IP: [<c014ded0>] iomem_map_sanity_check+0x70/0x170
[   75.249007] *pdpt = 000000002371c001 *pde = 0000000000000000
[   75.249007] Oops: 0000 [#1] SMP
[   75.249007] last sysfs file: /sys/devices/pnp0/00:0e/id
[   75.272054] Modules linked in: sbp2 ip_tables snd yenta_socket ppdev psmouse
soundcort
[   75.272054]
[   75.272054] Pid: 998, comm: pccardd Not tainted 2.6.34-rc2 #1
0KU184/Latitude D630
[   75.306331] EIP: 0060:[<c014ded0>] EFLAGS: 00010202 CPU: 1
[   75.306331] EIP is at iomem_map_sanity_check+0x70/0x170
[   75.306331] EAX: 746f7270 EBX: 000f4800 ECX: 01100018 EDX: 746f7270
[   75.306331] ESI: 00000000 EDI: 00001000 EBP: e4701d34 ESP: e4701cd0
[   75.306331]  DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
[   75.306331] Process pccardd (pid: 998, ti=e4700000 task=e36f3fc0
task.ti=e4700000)
[   75.306331] Stack:
[   75.359751]  c04a0f5c 00000004 00000000 00000002 00000000 28172cf5 e47d4390
00000013
[   75.359751] <0> 00000000 e4701d04 f4800fff 00000000 000f4800 00000000
000f4800 0000000
[   75.359751] <0> f4800000 00000000 f4800fff 00000000 f4801000 00000000
f4800000 0000000
[   75.359751] Call Trace:
[   75.359751]  [<c04a0f5c>] ? raw_pci_write+0x7c/0x80
[   75.359751]  [<c012a02e>] ? __ioremap_caller+0xae/0x3f0
[   75.359751]  [<c01f001b>] ? kmem_cache_alloc_notrace+0x6b/0xb0
[   75.421337]  [<c014eb6e>] ? __request_region+0x1e/0x210
[   75.421337]  [<c043963b>] ? usb_hcd_pci_probe+0x17b/0x3f0
[   75.436059]  [<c012a43a>] ? ioremap_nocache+0x1a/0x20
[   75.436059]  [<c043963b>] ? usb_hcd_pci_probe+0x17b/0x3f0
[   75.436059]  [<c043963b>] ? usb_hcd_pci_probe+0x17b/0x3f0
[   75.436059]  [<c024de78>] ? sysfs_add_one+0x18/0x100
[   75.436059]  [<c024d477>] ? sysfs_new_dirent+0x67/0x100
[   75.436059]  [<c033c0be>] ? local_pci_probe+0xe/0x10
[   75.436059]  [<c033ce40>] ? pci_device_probe+0x60/0x80
[   75.436059]  [<c03bba69>] ? driver_probe_device+0x69/0x150
[   75.436059]  [<c03bbb91>] ? __device_attach+0x41/0x50
[   75.436059]  [<c03badd8>] ? bus_for_each_drv+0x48/0x70
[   75.436059]  [<c03bbd8d>] ? device_attach+0x6d/0x80
[   75.436059]  [<c03bbb50>] ? __device_attach+0x0/0x50
[   75.436059]  [<c03bac2d>] ? bus_probe_device+0x1d/0x40
[   75.436059]  [<c03b997a>] ? device_add+0x48a/0x560
[   75.436059]  [<c033a43e>] ? pci_set_cacheline_size+0x8e/0xe0
[   75.436059]  [<c03374a7>] ? pci_bus_add_device+0x17/0x40
[   75.436059]  [<c0337510>] ? pci_bus_add_devices+0x40/0x120
[   75.436059]  [<f8b3e9ba>] ? cb_alloc+0xca/0xe0 [pcmcia_core]
[   75.436059]  [<f8b3de29>] ? socket_insert+0xd9/0x100 [pcmcia_core]
[   75.436059]  [<f8b3e289>] ? pccardd+0x309/0x400 [pcmcia_core]
[   75.436059]  [<f8b3df80>] ? pccardd+0x0/0x400 [pcmcia_core]
[   75.436059]  [<c0161e5c>] ? kthread+0x6c/0x80
[   75.436059]  [<c0161df0>] ? kthread+0x0/0x80
[   75.436059]  [<c01035c6>] ? kernel_thread_helper+0x6/0x10
[   75.436059] Code: 55 ec 89 4d d8 8b 4d f0 89 5d dc 89 75 e0 83 c2 ff 83 d1
ff 89 55 c
[   75.436059] EIP: [<c014ded0>] iomem_map_sanity_check+0x70/0x170 SS:ESP
0068:e4701cd0
[   75.436059] CR2: 00000000746f7274
[   75.439957] ---[ end trace c9fcf1971e726fcf ]---

But kernel continues to boot .. But unfortunately fails with below later on:

[  141.736006] BUG: soft lockup - CPU#0 stuck for 61s! [modprobe:573]
[  141.736006] Modules linked in: auth_rpcgss iwl3945(+) snd_timer uinput
snd_seq_devicet
[  141.736006] Modules linked in: auth_rpcgss iwl3945(+) snd_timer uinput
snd_seq_devicet
[  141.736006]
[  141.736006] Pid: 573, comm: modprobe Tainted: G      D 2.6.34-rc2 #1
0KU184/Latitu
[  141.736006] EIP: 0060:[<c058ff4c>] EFLAGS: 00000287 CPU: 0
[  141.736006] EIP is at __write_lock_failed+0xc/0x20
[  141.736006] EAX: c077e2e4 EBX: fe8fffff ECX: e4713240 EDX: e4713240
[  141.736006] ESI: 00000000 EDI: c077e2c0 EBP: e454bd70 ESP: e454bd70
[  141.736006]  DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
[  141.736006] Process modprobe (pid: 573, ti=e454a000 task=e3425940
task.ti=e454a000)
[  141.736006] Stack:
[  141.736006]  e454bd78 c0590151 e454bda8 c014ebc9 00000000 0000000d e4713240
c04a0f5c
[  141.736006] <0> 0000000d 00000040 e4713240 00000000 00001000 00000000
e454bdf0 c0339c8
[  141.736006] <0> 00001000 00000000 f87b3d33 00000000 00000000 fe8fffff
00000000 0000100
[  141.736006] Call Trace:
[  141.736006]  [<c0590151>] ? _raw_write_lock+0x11/0x20
[  141.736006]  [<c014ebc9>] ? __request_region+0x79/0x210
[  141.736006]  [<c04a0f5c>] ? raw_pci_write+0x7c/0x80
[  141.736006]  [<c0339cd8>] ? __pci_request_region+0x158/0x1c0
[  141.736006]  [<c0339f07>] ? __pci_request_selected_regions+0x37/0x70
[  141.736006]  [<c0339f92>] ? pci_request_selected_regions+0x12/0x20
[  141.736006]  [<c0339faf>] ? pci_request_regions+0xf/0x20
[  141.736006]  [<f87a8602>] ? iwl3945_pci_probe+0x112/0x9d0 [iwl3945]
[  141.736006]  [<c058ed34>] ? mutex_lock+0x14/0x40
[  141.736006]  [<c033c0be>] ? local_pci_probe+0xe/0x10
[  141.736006]  [<c033ce40>] ? pci_device_probe+0x60/0x80
[  141.736006]  [<c03bba69>] ? driver_probe_device+0x69/0x150
[  141.736006]  [<c03bbe19>] ? __driver_attach+0x79/0x80
[  141.736006]  [<c03baed8>] ? bus_for_each_dev+0x48/0x70
[  141.736006]  [<c03bb919>] ? driver_attach+0x19/0x20
[  141.736006]  [<c03bbda0>] ? __driver_attach+0x0/0x80
[  141.736006]  [<c03bb21f>] ? bus_add_driver+0xbf/0x2a0
[  141.736006]  [<c033cd80>] ? pci_device_remove+0x0/0x40
[  141.736006]  [<c03bbf35>] ? driver_register+0x65/0x120
[  141.736006]  [<f87cc2e8>] ? ieee80211_rate_control_register+0xc8/0x120
[mac80211]
[  141.736006]  [<c033d060>] ? __pci_register_driver+0x40/0xb0
[  141.736006]  [<f86da050>] ? iwl3945_init+0x50/0x6e [iwl3945]
[  141.736006]  [<c010112c>] ? do_one_initcall+0x2c/0x190
[  141.736006]  [<f86da000>] ? iwl3945_init+0x0/0x6e [iwl3945]
[  141.736006]  [<c017c011>] ? sys_init_module+0xb1/0x220
[  141.736006]  [<c0102fe3>] ? sysenter_do_call+0x12/0x28
[  141.736006] Code: c7 45 f8 01 00 00 00 e8 03 fe ff ff 89 d8 83 c4 10 5b 5d
c3 90 90 9

And the bootup starts to loop around dumps with similar / same stack ..

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From bugzilla-daemon at bugzilla.kernel.org  Wed Mar 24 06:09:13 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Wed, 24 Mar 2010 10:09:13 GMT
Subject: [Bug 15621] BUG: unable to handle kernel paging request  - comm:
	pccardd
In-Reply-To: <bug-15621-4463@https.bugzilla.kernel.org/>
References: <bug-15621-4463@https.bugzilla.kernel.org/>
Message-ID: <201003241009.o2OA9Dec019271@demeter.kernel.org>

https://bugzilla.kernel.org/show_bug.cgi?id=15621





--- Comment #1 from Ozgur Yuksel <ozgur.yuksel at oracle.com>  2010-03-24 10:09:07 ---
Created an attachment (id=25680)
 --> (https://bugzilla.kernel.org/attachment.cgi?id=25680)
Dump for first failure

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From bugzilla-daemon at bugzilla.kernel.org  Wed Mar 24 06:09:44 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Wed, 24 Mar 2010 10:09:44 GMT
Subject: [Bug 15621] BUG: unable to handle kernel paging request  - comm:
	pccardd
In-Reply-To: <bug-15621-4463@https.bugzilla.kernel.org/>
References: <bug-15621-4463@https.bugzilla.kernel.org/>
Message-ID: <201003241009.o2OA9iSc019386@demeter.kernel.org>

https://bugzilla.kernel.org/show_bug.cgi?id=15621





--- Comment #2 from Ozgur Yuksel <ozgur.yuksel at oracle.com>  2010-03-24 10:09:43 ---
Created an attachment (id=25681)
 --> (https://bugzilla.kernel.org/attachment.cgi?id=25681)
Recurring failures that follow

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From bugzilla-daemon at bugzilla.kernel.org  Wed Mar 24 10:16:55 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Wed, 24 Mar 2010 14:16:55 GMT
Subject: [Bug 15621] BUG: unable to handle kernel paging request  - comm:
	pccardd
In-Reply-To: <bug-15621-4463@https.bugzilla.kernel.org/>
References: <bug-15621-4463@https.bugzilla.kernel.org/>
Message-ID: <201003241416.o2OEGt2x017545@demeter.kernel.org>

https://bugzilla.kernel.org/show_bug.cgi?id=15621





--- Comment #3 from Andrew Morton <akpm at linux-foundation.org>  2010-03-24 14:14:17 ---
(switched to email.  Please respond via emailed reply-to-all, not via the
bugzilla web interface).

On Wed, 24 Mar 2010 10:07:54 GMT bugzilla-daemon at bugzilla.kernel.org wrote:

> https://bugzilla.kernel.org/show_bug.cgi?id=15621
> 
>            Summary: BUG: unable to handle kernel paging request  - comm:
>                     pccardd
>            Product: Drivers
>            Version: 2.5
>     Kernel Version: 2.6.34-rc2 ae6be51ed01d6c4aaf249a207b4434bc7785853b
>           Platform: All
>         OS/Version: Linux
>               Tree: Mainline
>             Status: NEW
>           Severity: normal
>           Priority: P1
>          Component: PCMCIA
>         AssignedTo: linux-pcmcia at lists.infradead.org
>         ReportedBy: ozgur.yuksel at oracle.com
>         Regression: Yes

It looks like the iomem_resource tree got wrecked.  Has anyone been
changing anything in there lately?

> 
> After building ae6be51ed01d6c4aaf249a207b4434bc7785853b, bootup gives out:
> [   75.245698] BUG: unable to handle kernel paging request at 746f7274
> [   75.249007] IP: [<c014ded0>] iomem_map_sanity_check+0x70/0x170
> [   75.249007] *pdpt = 000000002371c001 *pde = 0000000000000000
> [   75.249007] Oops: 0000 [#1] SMP
> [   75.249007] last sysfs file: /sys/devices/pnp0/00:0e/id
> [   75.272054] Modules linked in: sbp2 ip_tables snd yenta_socket ppdev psmouse
> soundcort
> [   75.272054]
> [   75.272054] Pid: 998, comm: pccardd Not tainted 2.6.34-rc2 #1
> 0KU184/Latitude D630
> [   75.306331] EIP: 0060:[<c014ded0>] EFLAGS: 00010202 CPU: 1
> [   75.306331] EIP is at iomem_map_sanity_check+0x70/0x170
> [   75.306331] EAX: 746f7270 EBX: 000f4800 ECX: 01100018 EDX: 746f7270
> [   75.306331] ESI: 00000000 EDI: 00001000 EBP: e4701d34 ESP: e4701cd0
> [   75.306331]  DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
> [   75.306331] Process pccardd (pid: 998, ti=e4700000 task=e36f3fc0
> task.ti=e4700000)
> [   75.306331] Stack:
> [   75.359751]  c04a0f5c 00000004 00000000 00000002 00000000 28172cf5 e47d4390
> 00000013
> [   75.359751] <0> 00000000 e4701d04 f4800fff 00000000 000f4800 00000000
> 000f4800 0000000
> [   75.359751] <0> f4800000 00000000 f4800fff 00000000 f4801000 00000000
> f4800000 0000000
> [   75.359751] Call Trace:
> [   75.359751]  [<c04a0f5c>] ? raw_pci_write+0x7c/0x80
> [   75.359751]  [<c012a02e>] ? __ioremap_caller+0xae/0x3f0
> [   75.359751]  [<c01f001b>] ? kmem_cache_alloc_notrace+0x6b/0xb0
> [   75.421337]  [<c014eb6e>] ? __request_region+0x1e/0x210
> [   75.421337]  [<c043963b>] ? usb_hcd_pci_probe+0x17b/0x3f0
> [   75.436059]  [<c012a43a>] ? ioremap_nocache+0x1a/0x20
> [   75.436059]  [<c043963b>] ? usb_hcd_pci_probe+0x17b/0x3f0
> [   75.436059]  [<c043963b>] ? usb_hcd_pci_probe+0x17b/0x3f0
> [   75.436059]  [<c024de78>] ? sysfs_add_one+0x18/0x100
> [   75.436059]  [<c024d477>] ? sysfs_new_dirent+0x67/0x100
> [   75.436059]  [<c033c0be>] ? local_pci_probe+0xe/0x10
> [   75.436059]  [<c033ce40>] ? pci_device_probe+0x60/0x80
> [   75.436059]  [<c03bba69>] ? driver_probe_device+0x69/0x150
> [   75.436059]  [<c03bbb91>] ? __device_attach+0x41/0x50
> [   75.436059]  [<c03badd8>] ? bus_for_each_drv+0x48/0x70
> [   75.436059]  [<c03bbd8d>] ? device_attach+0x6d/0x80
> [   75.436059]  [<c03bbb50>] ? __device_attach+0x0/0x50
> [   75.436059]  [<c03bac2d>] ? bus_probe_device+0x1d/0x40
> [   75.436059]  [<c03b997a>] ? device_add+0x48a/0x560
> [   75.436059]  [<c033a43e>] ? pci_set_cacheline_size+0x8e/0xe0
> [   75.436059]  [<c03374a7>] ? pci_bus_add_device+0x17/0x40
> [   75.436059]  [<c0337510>] ? pci_bus_add_devices+0x40/0x120
> [   75.436059]  [<f8b3e9ba>] ? cb_alloc+0xca/0xe0 [pcmcia_core]
> [   75.436059]  [<f8b3de29>] ? socket_insert+0xd9/0x100 [pcmcia_core]
> [   75.436059]  [<f8b3e289>] ? pccardd+0x309/0x400 [pcmcia_core]
> [   75.436059]  [<f8b3df80>] ? pccardd+0x0/0x400 [pcmcia_core]
> [   75.436059]  [<c0161e5c>] ? kthread+0x6c/0x80
> [   75.436059]  [<c0161df0>] ? kthread+0x0/0x80
> [   75.436059]  [<c01035c6>] ? kernel_thread_helper+0x6/0x10
> [   75.436059] Code: 55 ec 89 4d d8 8b 4d f0 89 5d dc 89 75 e0 83 c2 ff 83 d1
> ff 89 55 c
> [   75.436059] EIP: [<c014ded0>] iomem_map_sanity_check+0x70/0x170 SS:ESP
> 0068:e4701cd0
> [   75.436059] CR2: 00000000746f7274
> [   75.439957] ---[ end trace c9fcf1971e726fcf ]---
> 
> But kernel continues to boot .. But unfortunately fails with below later on:
> 
> [  141.736006] BUG: soft lockup - CPU#0 stuck for 61s! [modprobe:573]
> [  141.736006] Modules linked in: auth_rpcgss iwl3945(+) snd_timer uinput
> snd_seq_devicet
> [  141.736006] Modules linked in: auth_rpcgss iwl3945(+) snd_timer uinput
> snd_seq_devicet
> [  141.736006]
> [  141.736006] Pid: 573, comm: modprobe Tainted: G      D 2.6.34-rc2 #1
> 0KU184/Latitu
> [  141.736006] EIP: 0060:[<c058ff4c>] EFLAGS: 00000287 CPU: 0
> [  141.736006] EIP is at __write_lock_failed+0xc/0x20
> [  141.736006] EAX: c077e2e4 EBX: fe8fffff ECX: e4713240 EDX: e4713240
> [  141.736006] ESI: 00000000 EDI: c077e2c0 EBP: e454bd70 ESP: e454bd70
> [  141.736006]  DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
> [  141.736006] Process modprobe (pid: 573, ti=e454a000 task=e3425940
> task.ti=e454a000)
> [  141.736006] Stack:
> [  141.736006]  e454bd78 c0590151 e454bda8 c014ebc9 00000000 0000000d e4713240
> c04a0f5c
> [  141.736006] <0> 0000000d 00000040 e4713240 00000000 00001000 00000000
> e454bdf0 c0339c8
> [  141.736006] <0> 00001000 00000000 f87b3d33 00000000 00000000 fe8fffff
> 00000000 0000100
> [  141.736006] Call Trace:
> [  141.736006]  [<c0590151>] ? _raw_write_lock+0x11/0x20
> [  141.736006]  [<c014ebc9>] ? __request_region+0x79/0x210
> [  141.736006]  [<c04a0f5c>] ? raw_pci_write+0x7c/0x80
> [  141.736006]  [<c0339cd8>] ? __pci_request_region+0x158/0x1c0
> [  141.736006]  [<c0339f07>] ? __pci_request_selected_regions+0x37/0x70
> [  141.736006]  [<c0339f92>] ? pci_request_selected_regions+0x12/0x20
> [  141.736006]  [<c0339faf>] ? pci_request_regions+0xf/0x20
> [  141.736006]  [<f87a8602>] ? iwl3945_pci_probe+0x112/0x9d0 [iwl3945]
> [  141.736006]  [<c058ed34>] ? mutex_lock+0x14/0x40
> [  141.736006]  [<c033c0be>] ? local_pci_probe+0xe/0x10
> [  141.736006]  [<c033ce40>] ? pci_device_probe+0x60/0x80
> [  141.736006]  [<c03bba69>] ? driver_probe_device+0x69/0x150
> [  141.736006]  [<c03bbe19>] ? __driver_attach+0x79/0x80
> [  141.736006]  [<c03baed8>] ? bus_for_each_dev+0x48/0x70
> [  141.736006]  [<c03bb919>] ? driver_attach+0x19/0x20
> [  141.736006]  [<c03bbda0>] ? __driver_attach+0x0/0x80
> [  141.736006]  [<c03bb21f>] ? bus_add_driver+0xbf/0x2a0
> [  141.736006]  [<c033cd80>] ? pci_device_remove+0x0/0x40
> [  141.736006]  [<c03bbf35>] ? driver_register+0x65/0x120
> [  141.736006]  [<f87cc2e8>] ? ieee80211_rate_control_register+0xc8/0x120
> [mac80211]
> [  141.736006]  [<c033d060>] ? __pci_register_driver+0x40/0xb0
> [  141.736006]  [<f86da050>] ? iwl3945_init+0x50/0x6e [iwl3945]
> [  141.736006]  [<c010112c>] ? do_one_initcall+0x2c/0x190
> [  141.736006]  [<f86da000>] ? iwl3945_init+0x0/0x6e [iwl3945]
> [  141.736006]  [<c017c011>] ? sys_init_module+0xb1/0x220
> [  141.736006]  [<c0102fe3>] ? sysenter_do_call+0x12/0x28
> [  141.736006] Code: c7 45 f8 01 00 00 00 e8 03 fe ff ff 89 d8 83 c4 10 5b 5d
> c3 90 90 9
> 
> And the bootup starts to loop around dumps with similar / same stack ..
>

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From manuel.lauss at googlemail.com  Wed Mar 24 13:04:50 2010
From: manuel.lauss at googlemail.com (Manuel Lauss)
Date: Wed, 24 Mar 2010 18:04:50 +0100
Subject: [PATCH v2] pcmcia: db1xxx-ss: suspend/resume fix
In-Reply-To: <201003232302.49415.rjw@sisk.pl>
References: <1269287003-15523-1-git-send-email-manuel.lauss@gmail.com>
	<20100322205814.GB15250@isilmar.linta.de>
	<f861ec6f1003231015j73d6de9dp7a3a4e087aabda0a@mail.gmail.com>
	<201003232302.49415.rjw@sisk.pl>
Message-ID: <f861ec6f1003241004r629f0b35webd9d1925fe5f0d9@mail.gmail.com>

Dominik,

On Tue, Mar 23, 2010 at 11:02 PM, Rafael J. Wysocki <rjw at sisk.pl> wrote:
> On Tuesday 23 March 2010, Manuel Lauss wrote:
>> Howdy,
>>
>> On Mon, Mar 22, 2010 at 9:58 PM, Dominik Brodowski
>> <linux at dominikbrodowski.net> wrote:
>> > Hm, what about using two commits currently in my tree for 2.6.36 instead,
>> > which should fix all socket drivers?
>> >
>> > ? ?power: support _noirq actions on device types and classes
>> > ? ?pcmcia: use dev_pm_ops for class pcmcia_socket_class
>> >
>> > Manuel: Could you try whether they also solve these issues? If so, I'd
>>
>> Yes it does, works on my MIPS test systems.
>
> I don't seem to have received the original message, so sorry for the lack of
> response.
>
>> > propose pushing both patches already for 2.6.36. Rafael: do you concur?
>
> I do. ?The patches look good and if they fix things for people right now,
> that's a good reason to push them for .34.
>
>> I hope you meant 2.6.34
>
> I think Dominik meant .35 actually.

Okay, can we apply my v2 patch to 2.6.34?  I'd like to have PM working when
it gets out.

Manuel


From bjorn.helgaas at hp.com  Wed Mar 24 13:23:16 2010
From: bjorn.helgaas at hp.com (Bjorn Helgaas)
Date: Wed, 24 Mar 2010 11:23:16 -0600
Subject: pci_bus_for_each_resource, transparent bridges and
	rsrc_nonstatic.c
In-Reply-To: <20100323180237.GA28365@comet.dominikbrodowski.net>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<20100322232800.GA532@isilmar.linta.de>
	<20100323151301.GA10452@comet.dominikbrodowski.net>
	<201003231130.47869.bjorn.helgaas@hp.com>
	<20100323180237.GA28365@comet.dominikbrodowski.net>
Message-ID: <1269451396.31485.23.camel@dc7800.home>

On Tue, 2010-03-23 at 19:02 +0100, Dominik Brodowski wrote:
> > If you make PCMCIA smart enough to avoid these low ports, do we still
> > need these &ioport_resource and &iomem_resource checks?  Having two
> > mechanisms will lead to more complicated behavior and more special
> > cases.
> 
> Well, it aren't only the low ports (<0x100) I'm concerned about, it's also
> (and especially on pre-2008 systems) ports in higher areas
> (0x100 < x < 0xffff). If we don't use _CRS, we need to be more careful to
> avoid accidentally hitting wrong I/O-ports.

> From: Dominik Brodowski <linux at dominikbrodowski.net>
> Date: Tue, 23 Mar 2010 16:05:00 +0100
> Subject: [PATCH] pcmcia: do not use ioports < 0x100 on x86
> 
> On x86 systems using ACPI _CRS information -- now the default for
> post-2008 systems -- the PCI root bus no longer pretends to be
> offering the root ioport_resource. To avoid accidentally hitting
> some platform / system device, use only I/O ports >= 0x100 for
> PCMCIA devices on x86.
> 
> Reported-by: Komuro <komurojun-mbn at nifty.com>
> CC: Bjorn Helgaas <bjorn.helgaas at hp.com>
> Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
> 
> diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c
> index 4663b3f..dcc6021 100644
> --- a/drivers/pcmcia/rsrc_nonstatic.c
> +++ b/drivers/pcmcia/rsrc_nonstatic.c
> @@ -810,6 +810,13 @@ static int adjust_io(struct pcmcia_socket *s, unsigned int action, unsigned long
>  	unsigned long size = end - start + 1;
>  	int ret = 0;
>  
> +#if defined(CONFIG_X86)
> +	/* on x86, avoid anything < 0x100 for it is often used for
> +	 * legacy platform devices */
> +	if (start < 0x100)
> +		start = 0x100;
> +#endif

This looks OK to me (but we've already established that I don't know
anything about PCMCIA :)).  I do wonder whether we should have a generic
mechanism to define areas we should avoid, along the lines of
PCIBIOS_MIN_IO and PCIBIOS_MIN_CARDBUS_IO.  PNP should probably avoid
the same areas.

Which reminds me, what little I gleaned from the MindShare PCMCIA book
suggests that PCMCIA devices are similar to PNPBIOS devices in some ways
-- you get a list of possible resource assignments from CIS, sometimes
those assignments are fixed, other times they're programmable, and then
you pick something that works.  I wonder if there'd be any point in
integrating PNP and PCMCIA somehow.

Bjorn

>  	if (end < start)
>  		return -EINVAL;
>  



From linux at dominikbrodowski.net  Wed Mar 24 15:18:44 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Wed, 24 Mar 2010 20:18:44 +0100
Subject: [linux-pm] [PATCH v2] pcmcia: db1xxx-ss: suspend/resume fix
In-Reply-To: <f861ec6f1003241004r629f0b35webd9d1925fe5f0d9@mail.gmail.com>
References: <1269287003-15523-1-git-send-email-manuel.lauss@gmail.com>
	<20100322205814.GB15250@isilmar.linta.de>
	<f861ec6f1003231015j73d6de9dp7a3a4e087aabda0a@mail.gmail.com>
	<201003232302.49415.rjw@sisk.pl>
	<f861ec6f1003241004r629f0b35webd9d1925fe5f0d9@mail.gmail.com>
Message-ID: <20100324191844.GA22767@isilmar.linta.de>

Hey,

On Wed, Mar 24, 2010 at 06:04:50PM +0100, Manuel Lauss wrote:
> Dominik,
> 
> On Tue, Mar 23, 2010 at 11:02 PM, Rafael J. Wysocki <rjw at sisk.pl> wrote:
> > On Tuesday 23 March 2010, Manuel Lauss wrote:
> >> Howdy,
> >>
> >> On Mon, Mar 22, 2010 at 9:58 PM, Dominik Brodowski
> >> <linux at dominikbrodowski.net> wrote:
> >> > Hm, what about using two commits currently in my tree for 2.6.36 instead,
> >> > which should fix all socket drivers?
> >> >
> >> > ? ?power: support _noirq actions on device types and classes
> >> > ? ?pcmcia: use dev_pm_ops for class pcmcia_socket_class
> >> >
> >> > Manuel: Could you try whether they also solve these issues? If so, I'd
> >>
> >> Yes it does, works on my MIPS test systems.
> >
> > I don't seem to have received the original message, so sorry for the lack of
> > response.
> >
> >> > propose pushing both patches already for 2.6.36. Rafael: do you concur?
> >
> > I do. ?The patches look good and if they fix things for people right now,
> > that's a good reason to push them for .34.
> >
> >> I hope you meant 2.6.34
> >
> > I think Dominik meant .35 actually.
> 
> Okay, can we apply my v2 patch to 2.6.34?  I'd like to have PM working when
> it gets out.

Actually I meant .34. I'll push out my patch in the next days, if you
concur.

Best,
	Dominik


From manuel.lauss at googlemail.com  Wed Mar 24 15:23:09 2010
From: manuel.lauss at googlemail.com (Manuel Lauss)
Date: Wed, 24 Mar 2010 20:23:09 +0100
Subject: [linux-pm] [PATCH v2] pcmcia: db1xxx-ss: suspend/resume fix
In-Reply-To: <20100324191844.GA22767@isilmar.linta.de>
References: <1269287003-15523-1-git-send-email-manuel.lauss@gmail.com>
	<20100322205814.GB15250@isilmar.linta.de>
	<f861ec6f1003231015j73d6de9dp7a3a4e087aabda0a@mail.gmail.com>
	<201003232302.49415.rjw@sisk.pl>
	<f861ec6f1003241004r629f0b35webd9d1925fe5f0d9@mail.gmail.com>
	<20100324191844.GA22767@isilmar.linta.de>
Message-ID: <f861ec6f1003241223v11e3eaf3sf4e2c0a7594a38df@mail.gmail.com>

On Wed, Mar 24, 2010 at 8:18 PM, Dominik Brodowski
<linux at dominikbrodowski.net> wrote:
> Hey,
>
> On Wed, Mar 24, 2010 at 06:04:50PM +0100, Manuel Lauss wrote:
>> Dominik,
>>
>> On Tue, Mar 23, 2010 at 11:02 PM, Rafael J. Wysocki <rjw at sisk.pl> wrote:
>> > On Tuesday 23 March 2010, Manuel Lauss wrote:
>> >> Howdy,
>> >>
>> >> On Mon, Mar 22, 2010 at 9:58 PM, Dominik Brodowski
>> >> <linux at dominikbrodowski.net> wrote:
>> >> > Hm, what about using two commits currently in my tree for 2.6.36 instead,
>> >> > which should fix all socket drivers?
>> >> >
>> >> > ? ?power: support _noirq actions on device types and classes
>> >> > ? ?pcmcia: use dev_pm_ops for class pcmcia_socket_class
>> >> >
>> >> > Manuel: Could you try whether they also solve these issues? If so, I'd
>> >>
>> >> Yes it does, works on my MIPS test systems.
>> >
>> > I don't seem to have received the original message, so sorry for the lack of
>> > response.
>> >
>> >> > propose pushing both patches already for 2.6.36. Rafael: do you concur?
>> >
>> > I do. ?The patches look good and if they fix things for people right now,
>> > that's a good reason to push them for .34.
>> >
>> >> I hope you meant 2.6.34
>> >
>> > I think Dominik meant .35 actually.
>>
>> Okay, can we apply my v2 patch to 2.6.34? ?I'd like to have PM working when
>> it gets out.
>
> Actually I meant .34. I'll push out my patch in the next days, if you
> concur.

Great, I'm all for upstreaming your patch.

Thanks!
      Manuel Lauss


From bugzilla-daemon at bugzilla.kernel.org  Wed Mar 24 15:48:41 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Wed, 24 Mar 2010 19:48:41 GMT
Subject: [Bug 15621] BUG: unable to handle kernel paging request  - comm:
	pccardd
In-Reply-To: <bug-15621-4463@https.bugzilla.kernel.org/>
References: <bug-15621-4463@https.bugzilla.kernel.org/>
Message-ID: <201003241948.o2OJmfke009455@demeter.kernel.org>

https://bugzilla.kernel.org/show_bug.cgi?id=15621


Rafael J. Wysocki <rjw at sisk.pl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rjw at sisk.pl
             Blocks|                            |15310




-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From rjw at sisk.pl  Wed Mar 24 16:03:21 2010
From: rjw at sisk.pl (Rafael J. Wysocki)
Date: Wed, 24 Mar 2010 21:03:21 +0100
Subject: [linux-pm] [PATCH v2] pcmcia: db1xxx-ss: suspend/resume fix
In-Reply-To: <f861ec6f1003241223v11e3eaf3sf4e2c0a7594a38df@mail.gmail.com>
References: <1269287003-15523-1-git-send-email-manuel.lauss@gmail.com>
	<20100324191844.GA22767@isilmar.linta.de>
	<f861ec6f1003241223v11e3eaf3sf4e2c0a7594a38df@mail.gmail.com>
Message-ID: <201003242103.21659.rjw@sisk.pl>

On Wednesday 24 March 2010, Manuel Lauss wrote:
> On Wed, Mar 24, 2010 at 8:18 PM, Dominik Brodowski
> <linux at dominikbrodowski.net> wrote:
> > Hey,
> >
> > On Wed, Mar 24, 2010 at 06:04:50PM +0100, Manuel Lauss wrote:
> >> Dominik,
> >>
> >> On Tue, Mar 23, 2010 at 11:02 PM, Rafael J. Wysocki <rjw at sisk.pl> wrote:
> >> > On Tuesday 23 March 2010, Manuel Lauss wrote:
> >> >> Howdy,
> >> >>
> >> >> On Mon, Mar 22, 2010 at 9:58 PM, Dominik Brodowski
> >> >> <linux at dominikbrodowski.net> wrote:
> >> >> > Hm, what about using two commits currently in my tree for 2.6.36 instead,
> >> >> > which should fix all socket drivers?
> >> >> >
> >> >> >    power: support _noirq actions on device types and classes
> >> >> >    pcmcia: use dev_pm_ops for class pcmcia_socket_class
> >> >> >
> >> >> > Manuel: Could you try whether they also solve these issues? If so, I'd
> >> >>
> >> >> Yes it does, works on my MIPS test systems.
> >> >
> >> > I don't seem to have received the original message, so sorry for the lack of
> >> > response.
> >> >
> >> >> > propose pushing both patches already for 2.6.36. Rafael: do you concur?
> >> >
> >> > I do.  The patches look good and if they fix things for people right now,
> >> > that's a good reason to push them for .34.
> >> >
> >> >> I hope you meant 2.6.34
> >> >
> >> > I think Dominik meant .35 actually.
> >>
> >> Okay, can we apply my v2 patch to 2.6.34?  I'd like to have PM working when
> >> it gets out.
> >
> > Actually I meant .34. I'll push out my patch in the next days, if you
> > concur.
> 
> Great, I'm all for upstreaming your patch.

Agreed.

Rafael


From bugzilla-daemon at bugzilla.kernel.org  Wed Mar 24 16:09:16 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Wed, 24 Mar 2010 20:09:16 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@https.bugzilla.kernel.org/>
References: <bug-7304-4463@https.bugzilla.kernel.org/>
Message-ID: <201003242009.o2OK9G0F017295@demeter.kernel.org>

https://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #80 from Thomas Nemeth <nemeth.thomas at gmail.com>  2010-03-24 20:08:56 ---
Created an attachment (id=25689)
 --> (https://bugzilla.kernel.org/attachment.cgi?id=25689)
Boot messages for 2.6.34-rc2 with IRQ forced to 11.

As you requested I compiled a 2.6.34-rc2 kernel with the irqs forced to 11.
The configuration file displays:
$ grep CONFIG_DMI linux-2.6.34-rc2/.config
CONFIG_DMI=y
CONFIG_DMIID=y

It was the same with the 2.6.33 :(
I booted and configuered the eth card in the working slot, tested it (ok) and
then put it in the other (non-working) slot. It could get an IP address through
DHCP but ping didn't work.

dmidecode gave the same results as previouly.

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From bugzilla-daemon at bugzilla.kernel.org  Wed Mar 24 16:16:45 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Wed, 24 Mar 2010 20:16:45 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@https.bugzilla.kernel.org/>
References: <bug-7304-4463@https.bugzilla.kernel.org/>
Message-ID: <201003242016.o2OKGjP0020295@demeter.kernel.org>

https://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #81 from Thomas Nemeth <nemeth.thomas at gmail.com>  2010-03-24 20:16:34 ---
Ooops wrong.
I didn't get an IP address through DHCP on the non-working slot. I just
forgot to ifconfig down the interface before switching slots. The non-working
slot still doesn't work.

Regarding the dmidecode output, could it be that my computer is too old ?

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From mroberto at cpti.cetuc.puc-rio.br  Wed Mar 24 19:04:57 2010
From: mroberto at cpti.cetuc.puc-rio.br (Marcelo Roberto Jimenez)
Date: Wed, 24 Mar 2010 20:04:57 -0300
Subject: [PATCH 1/2] ARM: pcmcia: Fix for building DEBUG with sa11xx_base.c as
	a module.
Message-ID: <1269471898-26301-1-git-send-email-mroberto@cpti.cetuc.puc-rio.br>

This patch fixes a compilation issue when compiling PCMCIA SA1100
support as a module with PCMCIA_DEBUG enabled. The symbol
soc_pcmcia_debug was not beeing exported.

Signed-off-by: Marcelo Roberto Jimenez <mroberto at cpti.cetuc.puc-rio.br>
---
 drivers/pcmcia/soc_common.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c
index 6f1a86b..fd4c25a 100644
--- a/drivers/pcmcia/soc_common.c
+++ b/drivers/pcmcia/soc_common.c
@@ -65,6 +65,7 @@ void soc_pcmcia_debug(struct soc_pcmcia_socket *skt, const char *func,
 		va_end(args);
 	}
 }
+EXPORT_SYMBOL(soc_pcmcia_debug);
 
 #endif
 
-- 
1.7.0.3



From mroberto at cpti.cetuc.puc-rio.br  Wed Mar 24 19:04:58 2010
From: mroberto at cpti.cetuc.puc-rio.br (Marcelo Roberto Jimenez)
Date: Wed, 24 Mar 2010 20:04:58 -0300
Subject: [PATCH 2/2] ARM: pcmcia: fix checkpatch.pl issues in soc_common.c
In-Reply-To: <1269471898-26301-1-git-send-email-mroberto@cpti.cetuc.puc-rio.br>
References: <1269471898-26301-1-git-send-email-mroberto@cpti.cetuc.puc-rio.br>
Message-ID: <1269471898-26301-2-git-send-email-mroberto@cpti.cetuc.puc-rio.br>

This patch fixes checkpatch.pl issues in soc_common.c.

Signed-off-by: Marcelo Roberto Jimenez <mroberto at cpti.cetuc.puc-rio.br>
---
 drivers/pcmcia/soc_common.c |  129 +++++++++++++++++++++++--------------------
 1 files changed, 69 insertions(+), 60 deletions(-)

diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c
index fd4c25a..22af8d2 100644
--- a/drivers/pcmcia/soc_common.c
+++ b/drivers/pcmcia/soc_common.c
@@ -31,20 +31,20 @@
 ======================================================================*/
 
 
-#include <linux/module.h>
-#include <linux/moduleparam.h>
+#include <linux/cpufreq.h>
 #include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/io.h>
+#include <linux/irq.h>
 #include <linux/kernel.h>
-#include <linux/timer.h>
 #include <linux/mm.h>
+#include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/mutex.h>
-#include <linux/interrupt.h>
-#include <linux/irq.h>
 #include <linux/spinlock.h>
-#include <linux/cpufreq.h>
+#include <linux/timer.h>
 
 #include <mach/hardware.h>
-#include <asm/io.h>
 #include <asm/system.h>
 
 #include "soc_common.h"
@@ -69,7 +69,8 @@ EXPORT_SYMBOL(soc_pcmcia_debug);
 
 #endif
 
-#define to_soc_pcmcia_socket(x)	container_of(x, struct soc_pcmcia_socket, socket)
+#define to_soc_pcmcia_socket(x)	\
+	container_of(x, struct soc_pcmcia_socket, socket)
 
 static unsigned short
 calc_speed(unsigned short *spds, int num, unsigned short dflt)
@@ -86,11 +87,15 @@ calc_speed(unsigned short *spds, int num, unsigned short dflt)
 	return speed;
 }
 
-void soc_common_pcmcia_get_timing(struct soc_pcmcia_socket *skt, struct soc_pcmcia_timing *timing)
+void soc_common_pcmcia_get_timing(struct soc_pcmcia_socket *skt,
+	struct soc_pcmcia_timing *timing)
 {
-	timing->io = calc_speed(skt->spd_io, MAX_IO_WIN, SOC_PCMCIA_IO_ACCESS);
-	timing->mem = calc_speed(skt->spd_mem, MAX_WIN, SOC_PCMCIA_3V_MEM_ACCESS);
-	timing->attr = calc_speed(skt->spd_attr, MAX_WIN, SOC_PCMCIA_3V_MEM_ACCESS);
+	timing->io =
+		calc_speed(skt->spd_io, MAX_IO_WIN, SOC_PCMCIA_IO_ACCESS);
+	timing->mem =
+		calc_speed(skt->spd_mem, MAX_WIN, SOC_PCMCIA_3V_MEM_ACCESS);
+	timing->attr =
+		calc_speed(skt->spd_attr, MAX_WIN, SOC_PCMCIA_3V_MEM_ACCESS);
 }
 EXPORT_SYMBOL(soc_common_pcmcia_get_timing);
 
@@ -132,8 +137,8 @@ static unsigned int soc_common_pcmcia_skt_state(struct soc_pcmcia_socket *skt)
  *
  * Convert PCMCIA socket state to our socket configure structure.
  */
-static int
-soc_common_pcmcia_config_skt(struct soc_pcmcia_socket *skt, socket_state_t *state)
+static int soc_common_pcmcia_config_skt(
+	struct soc_pcmcia_socket *skt, socket_state_t *state)
 {
 	int ret;
 
@@ -145,7 +150,8 @@ soc_common_pcmcia_config_skt(struct soc_pcmcia_socket *skt, socket_state_t *stat
 		 */
 		if (skt->irq_state != 1 && state->io_irq) {
 			skt->irq_state = 1;
-			set_irq_type(skt->socket.pci_irq, IRQ_TYPE_EDGE_FALLING);
+			set_irq_type(skt->socket.pci_irq,
+				IRQ_TYPE_EDGE_FALLING);
 		} else if (skt->irq_state == 1 && state->io_irq == 0) {
 			skt->irq_state = 0;
 			set_irq_type(skt->socket.pci_irq, IRQ_TYPE_NONE);
@@ -299,24 +305,25 @@ soc_common_pcmcia_get_status(struct pcmcia_socket *sock, unsigned int *status)
  * of power configuration, reset, &c. We also record the value of
  * `state' in order to regurgitate it to the PCMCIA core later.
  */
-static int
-soc_common_pcmcia_set_socket(struct pcmcia_socket *sock, socket_state_t *state)
+static int soc_common_pcmcia_set_socket(
+	struct pcmcia_socket *sock, socket_state_t *state)
 {
 	struct soc_pcmcia_socket *skt = to_soc_pcmcia_socket(sock);
 
-	debug(skt, 2, "mask: %s%s%s%s%s%sflags: %s%s%s%s%s%sVcc %d Vpp %d irq %d\n",
-			(state->csc_mask==0)?"<NONE> ":"",
-			(state->csc_mask&SS_DETECT)?"DETECT ":"",
-			(state->csc_mask&SS_READY)?"READY ":"",
-			(state->csc_mask&SS_BATDEAD)?"BATDEAD ":"",
-			(state->csc_mask&SS_BATWARN)?"BATWARN ":"",
-			(state->csc_mask&SS_STSCHG)?"STSCHG ":"",
-			(state->flags==0)?"<NONE> ":"",
-			(state->flags&SS_PWR_AUTO)?"PWR_AUTO ":"",
-			(state->flags&SS_IOCARD)?"IOCARD ":"",
-			(state->flags&SS_RESET)?"RESET ":"",
-			(state->flags&SS_SPKR_ENA)?"SPKR_ENA ":"",
-			(state->flags&SS_OUTPUT_ENA)?"OUTPUT_ENA ":"",
+	debug(skt, 2,	"mask: %s%s%s%s%s%s "
+			"flags: %s%s%s%s%s%s Vcc %d Vpp %d irq %d\n",
+			(state->csc_mask == 0)		? "<NONE> " :	"",
+			(state->csc_mask & SS_DETECT)	? "DETECT " :	"",
+			(state->csc_mask & SS_READY)	? "READY " :	"",
+			(state->csc_mask & SS_BATDEAD)	? "BATDEAD " :	"",
+			(state->csc_mask & SS_BATWARN)	? "BATWARN " :	"",
+			(state->csc_mask & SS_STSCHG)	? "STSCHG " :	"",
+			(state->flags == 0)		? "<NONE> " :	"",
+			(state->flags & SS_PWR_AUTO)	? "PWR_AUTO " :	"",
+			(state->flags & SS_IOCARD)	? "IOCARD " :	"",
+			(state->flags & SS_RESET)	? "RESET " :	"",
+			(state->flags & SS_SPKR_ENA)	? "SPKR_ENA " :	"",
+			(state->flags & SS_OUTPUT_ENA)	? "OUTPUT_ENA " : "",
 			state->Vcc, state->Vpp, state->io_irq);
 
 	return soc_common_pcmcia_config_skt(skt, state);
@@ -331,8 +338,8 @@ soc_common_pcmcia_set_socket(struct pcmcia_socket *sock, socket_state_t *state)
  *
  * Returns: 0 on success, -1 on error
  */
-static int
-soc_common_pcmcia_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *map)
+static int soc_common_pcmcia_set_io_map(
+	struct pcmcia_socket *sock, struct pccard_io_map *map)
 {
 	struct soc_pcmcia_socket *skt = to_soc_pcmcia_socket(sock);
 	unsigned short speed = map->speed;
@@ -341,14 +348,14 @@ soc_common_pcmcia_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *m
 		map->map, map->speed, (unsigned long long)map->start,
 		(unsigned long long)map->stop);
 	debug(skt, 2, "flags: %s%s%s%s%s%s%s%s\n",
-		(map->flags==0)?"<NONE>":"",
-		(map->flags&MAP_ACTIVE)?"ACTIVE ":"",
-		(map->flags&MAP_16BIT)?"16BIT ":"",
-		(map->flags&MAP_AUTOSZ)?"AUTOSZ ":"",
-		(map->flags&MAP_0WS)?"0WS ":"",
-		(map->flags&MAP_WRPROT)?"WRPROT ":"",
-		(map->flags&MAP_USE_WAIT)?"USE_WAIT ":"",
-		(map->flags&MAP_PREFETCH)?"PREFETCH ":"");
+		(map->flags == 0)		? "<NONE>"	: "",
+		(map->flags & MAP_ACTIVE)	? "ACTIVE "	: "",
+		(map->flags & MAP_16BIT)	? "16BIT "	: "",
+		(map->flags & MAP_AUTOSZ)	? "AUTOSZ "	: "",
+		(map->flags & MAP_0WS)		? "0WS "	: "",
+		(map->flags & MAP_WRPROT)	? "WRPROT "	: "",
+		(map->flags & MAP_USE_WAIT)	? "USE_WAIT "	: "",
+		(map->flags & MAP_PREFETCH)	? "PREFETCH "	: "");
 
 	if (map->map >= MAX_IO_WIN) {
 		printk(KERN_ERR "%s(): map (%d) out of range\n", __func__,
@@ -385,8 +392,8 @@ soc_common_pcmcia_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *m
  *
  * Returns: 0 on success, -ERRNO on error
  */
-static int
-soc_common_pcmcia_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map *map)
+static int soc_common_pcmcia_set_mem_map(
+	struct pcmcia_socket *sock, struct pccard_mem_map *map)
 {
 	struct soc_pcmcia_socket *skt = to_soc_pcmcia_socket(sock);
 	struct resource *res;
@@ -395,14 +402,14 @@ soc_common_pcmcia_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map
 	debug(skt, 2, "map %u speed %u card_start %08x\n",
 		map->map, map->speed, map->card_start);
 	debug(skt, 2, "flags: %s%s%s%s%s%s%s%s\n",
-		(map->flags==0)?"<NONE>":"",
-		(map->flags&MAP_ACTIVE)?"ACTIVE ":"",
-		(map->flags&MAP_16BIT)?"16BIT ":"",
-		(map->flags&MAP_AUTOSZ)?"AUTOSZ ":"",
-		(map->flags&MAP_0WS)?"0WS ":"",
-		(map->flags&MAP_WRPROT)?"WRPROT ":"",
-		(map->flags&MAP_ATTRIB)?"ATTRIB ":"",
-		(map->flags&MAP_USE_WAIT)?"USE_WAIT ":"");
+		(map->flags == 0)		? "<NONE>"	: "",
+		(map->flags & MAP_ACTIVE)	? "ACTIVE "	: "",
+		(map->flags & MAP_16BIT)	? "16BIT "	: "",
+		(map->flags & MAP_AUTOSZ)	? "AUTOSZ "	: "",
+		(map->flags & MAP_0WS)		? "0WS "	: "",
+		(map->flags & MAP_WRPROT)	? "WRPROT "	: "",
+		(map->flags & MAP_ATTRIB)	? "ATTRIB "	: "",
+		(map->flags & MAP_USE_WAIT)	? "USE_WAIT "	: "");
 
 	if (map->map >= MAX_WIN)
 		return -EINVAL;
@@ -457,8 +464,8 @@ static struct bittbl conf_bits[] = {
 	{ SS_OUTPUT_ENA,	"SS_OUTPUT_ENA"	},
 };
 
-static void
-dump_bits(char **p, const char *prefix, unsigned int val, struct bittbl *bits, int sz)
+static void dump_bits(char **p, const char *prefix,
+	unsigned int val, struct bittbl *bits, int sz)
 {
 	char *b = *p;
 	int i;
@@ -476,13 +483,14 @@ dump_bits(char **p, const char *prefix, unsigned int val, struct bittbl *bits, i
  *
  * Returns: the number of characters added to the buffer
  */
-static ssize_t show_status(struct device *dev, struct device_attribute *attr, char *buf)
+static ssize_t show_status(
+	struct device *dev, struct device_attribute *attr, char *buf)
 {
 	struct soc_pcmcia_socket *skt =
 		container_of(dev, struct soc_pcmcia_socket, socket.dev);
 	char *p = buf;
 
-	p+=sprintf(p, "slot     : %d\n", skt->nr);
+	p += sprintf(p, "slot     : %d\n", skt->nr);
 
 	dump_bits(&p, "status", skt->status,
 		  status_bits, ARRAY_SIZE(status_bits));
@@ -491,12 +499,12 @@ static ssize_t show_status(struct device *dev, struct device_attribute *attr, ch
 	dump_bits(&p, "cs_flags", skt->cs_state.flags,
 		  conf_bits, ARRAY_SIZE(conf_bits));
 
-	p+=sprintf(p, "Vcc      : %d\n", skt->cs_state.Vcc);
-	p+=sprintf(p, "Vpp      : %d\n", skt->cs_state.Vpp);
-	p+=sprintf(p, "IRQ      : %d (%d)\n", skt->cs_state.io_irq,
+	p += sprintf(p, "Vcc      : %d\n", skt->cs_state.Vcc);
+	p += sprintf(p, "Vpp      : %d\n", skt->cs_state.Vpp);
+	p += sprintf(p, "IRQ      : %d (%d)\n", skt->cs_state.io_irq,
 		skt->socket.pci_irq);
 	if (skt->ops->show_timing)
-		p+=skt->ops->show_timing(skt, p);
+		p += skt->ops->show_timing(skt, p);
 
 	return p-buf;
 }
@@ -589,7 +597,7 @@ soc_pcmcia_notifier(struct notifier_block *nb, unsigned long val, void *data)
 
 	mutex_lock(&soc_pcmcia_sockets_lock);
 	list_for_each_entry(skt, &soc_pcmcia_sockets, node)
-		if ( skt->ops->frequency_change )
+		if (skt->ops->frequency_change)
 			ret += skt->ops->frequency_change(skt, val, freqs);
 	mutex_unlock(&soc_pcmcia_sockets_lock);
 
@@ -615,7 +623,8 @@ fs_initcall(soc_pcmcia_cpufreq_register);
 
 static void soc_pcmcia_cpufreq_unregister(void)
 {
-	cpufreq_unregister_notifier(&soc_pcmcia_notifier_block, CPUFREQ_TRANSITION_NOTIFIER);
+	cpufreq_unregister_notifier(&soc_pcmcia_notifier_block,
+		CPUFREQ_TRANSITION_NOTIFIER);
 }
 module_exit(soc_pcmcia_cpufreq_unregister);
 
-- 
1.7.0.3



From linux at arm.linux.org.uk  Wed Mar 24 19:07:29 2010
From: linux at arm.linux.org.uk (Russell King - ARM Linux)
Date: Wed, 24 Mar 2010 23:07:29 +0000
Subject: [PATCH 2/2] ARM: pcmcia: fix checkpatch.pl issues in soc_common.c
In-Reply-To: <1269471898-26301-2-git-send-email-mroberto@cpti.cetuc.puc-rio.br>
References: <1269471898-26301-1-git-send-email-mroberto@cpti.cetuc.puc-rio.br>
	<1269471898-26301-2-git-send-email-mroberto@cpti.cetuc.puc-rio.br>
Message-ID: <20100324230729.GA21359@n2100.arm.linux.org.uk>

On Wed, Mar 24, 2010 at 08:04:58PM -0300, Marcelo Roberto Jimenez wrote:
> -	debug(skt, 2, "mask: %s%s%s%s%s%sflags: %s%s%s%s%s%sVcc %d Vpp %d irq %d\n",
> -			(state->csc_mask==0)?"<NONE> ":"",
> -			(state->csc_mask&SS_DETECT)?"DETECT ":"",
> -			(state->csc_mask&SS_READY)?"READY ":"",
> -			(state->csc_mask&SS_BATDEAD)?"BATDEAD ":"",
> -			(state->csc_mask&SS_BATWARN)?"BATWARN ":"",
> -			(state->csc_mask&SS_STSCHG)?"STSCHG ":"",
> -			(state->flags==0)?"<NONE> ":"",
> -			(state->flags&SS_PWR_AUTO)?"PWR_AUTO ":"",
> -			(state->flags&SS_IOCARD)?"IOCARD ":"",
> -			(state->flags&SS_RESET)?"RESET ":"",
> -			(state->flags&SS_SPKR_ENA)?"SPKR_ENA ":"",
> -			(state->flags&SS_OUTPUT_ENA)?"OUTPUT_ENA ":"",
> +	debug(skt, 2,	"mask: %s%s%s%s%s%s "
> +			"flags: %s%s%s%s%s%s Vcc %d Vpp %d irq %d\n",

NAK.  Breaking kernel messages across multiple lines makes them impossible
to grep for.  checkpatch.pl is wrong on this one.


From mroberto at cpti.cetuc.puc-rio.br  Wed Mar 24 19:20:19 2010
From: mroberto at cpti.cetuc.puc-rio.br (Marcelo Jimenez)
Date: Wed, 24 Mar 2010 20:20:19 -0300
Subject: [PATCH 2/2] ARM: pcmcia: fix checkpatch.pl issues in soc_common.c
In-Reply-To: <20100324230729.GA21359@n2100.arm.linux.org.uk>
References: <1269471898-26301-1-git-send-email-mroberto@cpti.cetuc.puc-rio.br>
	<1269471898-26301-2-git-send-email-mroberto@cpti.cetuc.puc-rio.br> 
	<20100324230729.GA21359@n2100.arm.linux.org.uk>
Message-ID: <cecb6d8f1003241620v55fb960ds14818bf3a03fa334@mail.gmail.com>

On Wed, Mar 24, 2010 at 20:07, Russell King - ARM Linux
<linux at arm.linux.org.uk> wrote:
> On Wed, Mar 24, 2010 at 08:04:58PM -0300, Marcelo Roberto Jimenez wrote:
>> - ? ? debug(skt, 2, "mask: %s%s%s%s%s%sflags: %s%s%s%s%s%sVcc %d Vpp %d irq %d\n",
>> - ? ? ? ? ? ? ? ? ? ? (state->csc_mask==0)?"<NONE> ":"",
>> - ? ? ? ? ? ? ? ? ? ? (state->csc_mask&SS_DETECT)?"DETECT ":"",
>> - ? ? ? ? ? ? ? ? ? ? (state->csc_mask&SS_READY)?"READY ":"",
>> - ? ? ? ? ? ? ? ? ? ? (state->csc_mask&SS_BATDEAD)?"BATDEAD ":"",
>> - ? ? ? ? ? ? ? ? ? ? (state->csc_mask&SS_BATWARN)?"BATWARN ":"",
>> - ? ? ? ? ? ? ? ? ? ? (state->csc_mask&SS_STSCHG)?"STSCHG ":"",
>> - ? ? ? ? ? ? ? ? ? ? (state->flags==0)?"<NONE> ":"",
>> - ? ? ? ? ? ? ? ? ? ? (state->flags&SS_PWR_AUTO)?"PWR_AUTO ":"",
>> - ? ? ? ? ? ? ? ? ? ? (state->flags&SS_IOCARD)?"IOCARD ":"",
>> - ? ? ? ? ? ? ? ? ? ? (state->flags&SS_RESET)?"RESET ":"",
>> - ? ? ? ? ? ? ? ? ? ? (state->flags&SS_SPKR_ENA)?"SPKR_ENA ":"",
>> - ? ? ? ? ? ? ? ? ? ? (state->flags&SS_OUTPUT_ENA)?"OUTPUT_ENA ":"",
>> + ? ? debug(skt, 2, ? "mask: %s%s%s%s%s%s "
>> + ? ? ? ? ? ? ? ? ? ? "flags: %s%s%s%s%s%s Vcc %d Vpp %d irq %d\n",
>
> NAK. ?Breaking kernel messages across multiple lines makes them impossible
> to grep for. ?checkpatch.pl is wrong on this one.

I will redo it, no problem. But just for my information, in that
particular case, is it usefull to grep using format specifiers?


From mroberto at cpti.cetuc.puc-rio.br  Wed Mar 24 19:45:10 2010
From: mroberto at cpti.cetuc.puc-rio.br (Marcelo Roberto Jimenez)
Date: Wed, 24 Mar 2010 20:45:10 -0300
Subject: [PATCH 2/2] ARM: pcmcia: fix checkpatch.pl issues in soc_common.c
In-Reply-To: <1269471898-26301-2-git-send-email-mroberto@cpti.cetuc.puc-rio.br>
References: <1269471898-26301-2-git-send-email-mroberto@cpti.cetuc.puc-rio.br>
Message-ID: <1269474310-13970-1-git-send-email-mroberto@cpti.cetuc.puc-rio.br>

This patch fixes checkpatch.pl issues in soc_common.c.

Signed-off-by: Marcelo Roberto Jimenez <mroberto at cpti.cetuc.puc-rio.br>
---
 drivers/pcmcia/soc_common.c |  128 +++++++++++++++++++++++--------------------
 1 files changed, 68 insertions(+), 60 deletions(-)

diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c
index fd4c25a..25c5b50 100644
--- a/drivers/pcmcia/soc_common.c
+++ b/drivers/pcmcia/soc_common.c
@@ -31,20 +31,20 @@
 ======================================================================*/
 
 
-#include <linux/module.h>
-#include <linux/moduleparam.h>
+#include <linux/cpufreq.h>
 #include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/io.h>
+#include <linux/irq.h>
 #include <linux/kernel.h>
-#include <linux/timer.h>
 #include <linux/mm.h>
+#include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/mutex.h>
-#include <linux/interrupt.h>
-#include <linux/irq.h>
 #include <linux/spinlock.h>
-#include <linux/cpufreq.h>
+#include <linux/timer.h>
 
 #include <mach/hardware.h>
-#include <asm/io.h>
 #include <asm/system.h>
 
 #include "soc_common.h"
@@ -69,7 +69,8 @@ EXPORT_SYMBOL(soc_pcmcia_debug);
 
 #endif
 
-#define to_soc_pcmcia_socket(x)	container_of(x, struct soc_pcmcia_socket, socket)
+#define to_soc_pcmcia_socket(x)	\
+	container_of(x, struct soc_pcmcia_socket, socket)
 
 static unsigned short
 calc_speed(unsigned short *spds, int num, unsigned short dflt)
@@ -86,11 +87,15 @@ calc_speed(unsigned short *spds, int num, unsigned short dflt)
 	return speed;
 }
 
-void soc_common_pcmcia_get_timing(struct soc_pcmcia_socket *skt, struct soc_pcmcia_timing *timing)
+void soc_common_pcmcia_get_timing(struct soc_pcmcia_socket *skt,
+	struct soc_pcmcia_timing *timing)
 {
-	timing->io = calc_speed(skt->spd_io, MAX_IO_WIN, SOC_PCMCIA_IO_ACCESS);
-	timing->mem = calc_speed(skt->spd_mem, MAX_WIN, SOC_PCMCIA_3V_MEM_ACCESS);
-	timing->attr = calc_speed(skt->spd_attr, MAX_WIN, SOC_PCMCIA_3V_MEM_ACCESS);
+	timing->io =
+		calc_speed(skt->spd_io, MAX_IO_WIN, SOC_PCMCIA_IO_ACCESS);
+	timing->mem =
+		calc_speed(skt->spd_mem, MAX_WIN, SOC_PCMCIA_3V_MEM_ACCESS);
+	timing->attr =
+		calc_speed(skt->spd_attr, MAX_WIN, SOC_PCMCIA_3V_MEM_ACCESS);
 }
 EXPORT_SYMBOL(soc_common_pcmcia_get_timing);
 
@@ -132,8 +137,8 @@ static unsigned int soc_common_pcmcia_skt_state(struct soc_pcmcia_socket *skt)
  *
  * Convert PCMCIA socket state to our socket configure structure.
  */
-static int
-soc_common_pcmcia_config_skt(struct soc_pcmcia_socket *skt, socket_state_t *state)
+static int soc_common_pcmcia_config_skt(
+	struct soc_pcmcia_socket *skt, socket_state_t *state)
 {
 	int ret;
 
@@ -145,7 +150,8 @@ soc_common_pcmcia_config_skt(struct soc_pcmcia_socket *skt, socket_state_t *stat
 		 */
 		if (skt->irq_state != 1 && state->io_irq) {
 			skt->irq_state = 1;
-			set_irq_type(skt->socket.pci_irq, IRQ_TYPE_EDGE_FALLING);
+			set_irq_type(skt->socket.pci_irq,
+				IRQ_TYPE_EDGE_FALLING);
 		} else if (skt->irq_state == 1 && state->io_irq == 0) {
 			skt->irq_state = 0;
 			set_irq_type(skt->socket.pci_irq, IRQ_TYPE_NONE);
@@ -299,24 +305,24 @@ soc_common_pcmcia_get_status(struct pcmcia_socket *sock, unsigned int *status)
  * of power configuration, reset, &c. We also record the value of
  * `state' in order to regurgitate it to the PCMCIA core later.
  */
-static int
-soc_common_pcmcia_set_socket(struct pcmcia_socket *sock, socket_state_t *state)
+static int soc_common_pcmcia_set_socket(
+	struct pcmcia_socket *sock, socket_state_t *state)
 {
 	struct soc_pcmcia_socket *skt = to_soc_pcmcia_socket(sock);
 
-	debug(skt, 2, "mask: %s%s%s%s%s%sflags: %s%s%s%s%s%sVcc %d Vpp %d irq %d\n",
-			(state->csc_mask==0)?"<NONE> ":"",
-			(state->csc_mask&SS_DETECT)?"DETECT ":"",
-			(state->csc_mask&SS_READY)?"READY ":"",
-			(state->csc_mask&SS_BATDEAD)?"BATDEAD ":"",
-			(state->csc_mask&SS_BATWARN)?"BATWARN ":"",
-			(state->csc_mask&SS_STSCHG)?"STSCHG ":"",
-			(state->flags==0)?"<NONE> ":"",
-			(state->flags&SS_PWR_AUTO)?"PWR_AUTO ":"",
-			(state->flags&SS_IOCARD)?"IOCARD ":"",
-			(state->flags&SS_RESET)?"RESET ":"",
-			(state->flags&SS_SPKR_ENA)?"SPKR_ENA ":"",
-			(state->flags&SS_OUTPUT_ENA)?"OUTPUT_ENA ":"",
+	debug(skt, 2, "mask: %s%s%s%s%s%s flags: %s%s%s%s%s%s Vcc %d Vpp %d irq %d\n",
+			(state->csc_mask == 0)		? "<NONE> " :	"",
+			(state->csc_mask & SS_DETECT)	? "DETECT " :	"",
+			(state->csc_mask & SS_READY)	? "READY " :	"",
+			(state->csc_mask & SS_BATDEAD)	? "BATDEAD " :	"",
+			(state->csc_mask & SS_BATWARN)	? "BATWARN " :	"",
+			(state->csc_mask & SS_STSCHG)	? "STSCHG " :	"",
+			(state->flags == 0)		? "<NONE> " :	"",
+			(state->flags & SS_PWR_AUTO)	? "PWR_AUTO " :	"",
+			(state->flags & SS_IOCARD)	? "IOCARD " :	"",
+			(state->flags & SS_RESET)	? "RESET " :	"",
+			(state->flags & SS_SPKR_ENA)	? "SPKR_ENA " :	"",
+			(state->flags & SS_OUTPUT_ENA)	? "OUTPUT_ENA " : "",
 			state->Vcc, state->Vpp, state->io_irq);
 
 	return soc_common_pcmcia_config_skt(skt, state);
@@ -331,8 +337,8 @@ soc_common_pcmcia_set_socket(struct pcmcia_socket *sock, socket_state_t *state)
  *
  * Returns: 0 on success, -1 on error
  */
-static int
-soc_common_pcmcia_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *map)
+static int soc_common_pcmcia_set_io_map(
+	struct pcmcia_socket *sock, struct pccard_io_map *map)
 {
 	struct soc_pcmcia_socket *skt = to_soc_pcmcia_socket(sock);
 	unsigned short speed = map->speed;
@@ -341,14 +347,14 @@ soc_common_pcmcia_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *m
 		map->map, map->speed, (unsigned long long)map->start,
 		(unsigned long long)map->stop);
 	debug(skt, 2, "flags: %s%s%s%s%s%s%s%s\n",
-		(map->flags==0)?"<NONE>":"",
-		(map->flags&MAP_ACTIVE)?"ACTIVE ":"",
-		(map->flags&MAP_16BIT)?"16BIT ":"",
-		(map->flags&MAP_AUTOSZ)?"AUTOSZ ":"",
-		(map->flags&MAP_0WS)?"0WS ":"",
-		(map->flags&MAP_WRPROT)?"WRPROT ":"",
-		(map->flags&MAP_USE_WAIT)?"USE_WAIT ":"",
-		(map->flags&MAP_PREFETCH)?"PREFETCH ":"");
+		(map->flags == 0)		? "<NONE>"	: "",
+		(map->flags & MAP_ACTIVE)	? "ACTIVE "	: "",
+		(map->flags & MAP_16BIT)	? "16BIT "	: "",
+		(map->flags & MAP_AUTOSZ)	? "AUTOSZ "	: "",
+		(map->flags & MAP_0WS)		? "0WS "	: "",
+		(map->flags & MAP_WRPROT)	? "WRPROT "	: "",
+		(map->flags & MAP_USE_WAIT)	? "USE_WAIT "	: "",
+		(map->flags & MAP_PREFETCH)	? "PREFETCH "	: "");
 
 	if (map->map >= MAX_IO_WIN) {
 		printk(KERN_ERR "%s(): map (%d) out of range\n", __func__,
@@ -385,8 +391,8 @@ soc_common_pcmcia_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *m
  *
  * Returns: 0 on success, -ERRNO on error
  */
-static int
-soc_common_pcmcia_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map *map)
+static int soc_common_pcmcia_set_mem_map(
+	struct pcmcia_socket *sock, struct pccard_mem_map *map)
 {
 	struct soc_pcmcia_socket *skt = to_soc_pcmcia_socket(sock);
 	struct resource *res;
@@ -395,14 +401,14 @@ soc_common_pcmcia_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map
 	debug(skt, 2, "map %u speed %u card_start %08x\n",
 		map->map, map->speed, map->card_start);
 	debug(skt, 2, "flags: %s%s%s%s%s%s%s%s\n",
-		(map->flags==0)?"<NONE>":"",
-		(map->flags&MAP_ACTIVE)?"ACTIVE ":"",
-		(map->flags&MAP_16BIT)?"16BIT ":"",
-		(map->flags&MAP_AUTOSZ)?"AUTOSZ ":"",
-		(map->flags&MAP_0WS)?"0WS ":"",
-		(map->flags&MAP_WRPROT)?"WRPROT ":"",
-		(map->flags&MAP_ATTRIB)?"ATTRIB ":"",
-		(map->flags&MAP_USE_WAIT)?"USE_WAIT ":"");
+		(map->flags == 0)		? "<NONE>"	: "",
+		(map->flags & MAP_ACTIVE)	? "ACTIVE "	: "",
+		(map->flags & MAP_16BIT)	? "16BIT "	: "",
+		(map->flags & MAP_AUTOSZ)	? "AUTOSZ "	: "",
+		(map->flags & MAP_0WS)		? "0WS "	: "",
+		(map->flags & MAP_WRPROT)	? "WRPROT "	: "",
+		(map->flags & MAP_ATTRIB)	? "ATTRIB "	: "",
+		(map->flags & MAP_USE_WAIT)	? "USE_WAIT "	: "");
 
 	if (map->map >= MAX_WIN)
 		return -EINVAL;
@@ -457,8 +463,8 @@ static struct bittbl conf_bits[] = {
 	{ SS_OUTPUT_ENA,	"SS_OUTPUT_ENA"	},
 };
 
-static void
-dump_bits(char **p, const char *prefix, unsigned int val, struct bittbl *bits, int sz)
+static void dump_bits(char **p, const char *prefix,
+	unsigned int val, struct bittbl *bits, int sz)
 {
 	char *b = *p;
 	int i;
@@ -476,13 +482,14 @@ dump_bits(char **p, const char *prefix, unsigned int val, struct bittbl *bits, i
  *
  * Returns: the number of characters added to the buffer
  */
-static ssize_t show_status(struct device *dev, struct device_attribute *attr, char *buf)
+static ssize_t show_status(
+	struct device *dev, struct device_attribute *attr, char *buf)
 {
 	struct soc_pcmcia_socket *skt =
 		container_of(dev, struct soc_pcmcia_socket, socket.dev);
 	char *p = buf;
 
-	p+=sprintf(p, "slot     : %d\n", skt->nr);
+	p += sprintf(p, "slot     : %d\n", skt->nr);
 
 	dump_bits(&p, "status", skt->status,
 		  status_bits, ARRAY_SIZE(status_bits));
@@ -491,12 +498,12 @@ static ssize_t show_status(struct device *dev, struct device_attribute *attr, ch
 	dump_bits(&p, "cs_flags", skt->cs_state.flags,
 		  conf_bits, ARRAY_SIZE(conf_bits));
 
-	p+=sprintf(p, "Vcc      : %d\n", skt->cs_state.Vcc);
-	p+=sprintf(p, "Vpp      : %d\n", skt->cs_state.Vpp);
-	p+=sprintf(p, "IRQ      : %d (%d)\n", skt->cs_state.io_irq,
+	p += sprintf(p, "Vcc      : %d\n", skt->cs_state.Vcc);
+	p += sprintf(p, "Vpp      : %d\n", skt->cs_state.Vpp);
+	p += sprintf(p, "IRQ      : %d (%d)\n", skt->cs_state.io_irq,
 		skt->socket.pci_irq);
 	if (skt->ops->show_timing)
-		p+=skt->ops->show_timing(skt, p);
+		p += skt->ops->show_timing(skt, p);
 
 	return p-buf;
 }
@@ -589,7 +596,7 @@ soc_pcmcia_notifier(struct notifier_block *nb, unsigned long val, void *data)
 
 	mutex_lock(&soc_pcmcia_sockets_lock);
 	list_for_each_entry(skt, &soc_pcmcia_sockets, node)
-		if ( skt->ops->frequency_change )
+		if (skt->ops->frequency_change)
 			ret += skt->ops->frequency_change(skt, val, freqs);
 	mutex_unlock(&soc_pcmcia_sockets_lock);
 
@@ -615,7 +622,8 @@ fs_initcall(soc_pcmcia_cpufreq_register);
 
 static void soc_pcmcia_cpufreq_unregister(void)
 {
-	cpufreq_unregister_notifier(&soc_pcmcia_notifier_block, CPUFREQ_TRANSITION_NOTIFIER);
+	cpufreq_unregister_notifier(&soc_pcmcia_notifier_block,
+		CPUFREQ_TRANSITION_NOTIFIER);
 }
 module_exit(soc_pcmcia_cpufreq_unregister);
 
-- 
1.7.0.3



From sshtylyov at mvista.com  Thu Mar 25 06:19:29 2010
From: sshtylyov at mvista.com (Sergei Shtylyov)
Date: Thu, 25 Mar 2010 13:19:29 +0300
Subject: [PATCH 2/2] ARM: pcmcia: fix checkpatch.pl issues in soc_common.c
In-Reply-To: <20100324230729.GA21359@n2100.arm.linux.org.uk>
References: <1269471898-26301-1-git-send-email-mroberto@cpti.cetuc.puc-rio.br>	<1269471898-26301-2-git-send-email-mroberto@cpti.cetuc.puc-rio.br>
	<20100324230729.GA21359@n2100.arm.linux.org.uk>
Message-ID: <4BAB38B1.8080404@ru.mvista.com>

Hello.

Russell King - ARM Linux wrote:

>> -	debug(skt, 2, "mask: %s%s%s%s%s%sflags: %s%s%s%s%s%sVcc %d Vpp %d irq %d\n",
>> -			(state->csc_mask==0)?"<NONE> ":"",
>> -			(state->csc_mask&SS_DETECT)?"DETECT ":"",
>> -			(state->csc_mask&SS_READY)?"READY ":"",
>> -			(state->csc_mask&SS_BATDEAD)?"BATDEAD ":"",
>> -			(state->csc_mask&SS_BATWARN)?"BATWARN ":"",
>> -			(state->csc_mask&SS_STSCHG)?"STSCHG ":"",
>> -			(state->flags==0)?"<NONE> ":"",
>> -			(state->flags&SS_PWR_AUTO)?"PWR_AUTO ":"",
>> -			(state->flags&SS_IOCARD)?"IOCARD ":"",
>> -			(state->flags&SS_RESET)?"RESET ":"",
>> -			(state->flags&SS_SPKR_ENA)?"SPKR_ENA ":"",
>> -			(state->flags&SS_OUTPUT_ENA)?"OUTPUT_ENA ":"",
>> +	debug(skt, 2,	"mask: %s%s%s%s%s%s "
>> +			"flags: %s%s%s%s%s%s Vcc %d Vpp %d irq %d\n",
>>     
>
> NAK.  Breaking kernel messages across multiple lines makes them impossible
> to grep for.  checkpatch.pl is wrong on this one.
>   

   I'd disagree in this case. Anybody will hardly grep for "mask: 
%s%s%s%s%s%sflags: %s%s%s%s%s%s".

WBR, Sergei



From bugzilla-daemon at bugzilla.kernel.org  Thu Mar 25 12:53:27 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Thu, 25 Mar 2010 16:53:27 GMT
Subject: [Bug 15621] BUG: unable to handle kernel paging request  - comm:
	pccardd
In-Reply-To: <bug-15621-4463@https.bugzilla.kernel.org/>
References: <bug-15621-4463@https.bugzilla.kernel.org/>
Message-ID: <201003251653.o2PGrR42002099@demeter.kernel.org>

https://bugzilla.kernel.org/show_bug.cgi?id=15621





--- Comment #4 from Bjorn Helgaas <bjorn.helgaas at hp.com>  2010-03-25 16:53:12 ---
> It looks like the iomem_resource tree got wrecked.  Has anyone been
> changing anything in there lately?

My pci=use_crs patches change the contents of the iomem_resource tree,
and it's possible they broke some assumptions PCMCIA was making, so
you might see if "pci=nocrs" makes any difference.  If it does, please
attach an acpidump and the entire dmesg logs with and without that option.

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From linux at dominikbrodowski.net  Thu Mar 25 13:04:40 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Thu, 25 Mar 2010 18:04:40 +0100
Subject: [PATCH 2/2] ARM: pcmcia: fix checkpatch.pl issues in soc_common.c
In-Reply-To: <1269474310-13970-1-git-send-email-mroberto@cpti.cetuc.puc-rio.br>
References: <1269471898-26301-2-git-send-email-mroberto@cpti.cetuc.puc-rio.br>
	<1269474310-13970-1-git-send-email-mroberto@cpti.cetuc.puc-rio.br>
Message-ID: <20100325170440.GC5424@comet.dominikbrodowski.net>

Russell,

do you prefer me pushing these patches upstream (possibly even for -rc3), or
do you wish to take these patches?

Best,
	Dominik

On Wed, Mar 24, 2010 at 08:45:10PM -0300, Marcelo Roberto Jimenez wrote:
> This patch fixes checkpatch.pl issues in soc_common.c.
> 
> Signed-off-by: Marcelo Roberto Jimenez <mroberto at cpti.cetuc.puc-rio.br>
> ---
>  drivers/pcmcia/soc_common.c |  128 +++++++++++++++++++++++--------------------
>  1 files changed, 68 insertions(+), 60 deletions(-)
> 
> diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c
> index fd4c25a..25c5b50 100644
> --- a/drivers/pcmcia/soc_common.c
> +++ b/drivers/pcmcia/soc_common.c
> @@ -31,20 +31,20 @@
>  ======================================================================*/
>  
>  
> -#include <linux/module.h>
> -#include <linux/moduleparam.h>
> +#include <linux/cpufreq.h>
>  #include <linux/init.h>
> +#include <linux/interrupt.h>
> +#include <linux/io.h>
> +#include <linux/irq.h>
>  #include <linux/kernel.h>
> -#include <linux/timer.h>
>  #include <linux/mm.h>
> +#include <linux/module.h>
> +#include <linux/moduleparam.h>
>  #include <linux/mutex.h>
> -#include <linux/interrupt.h>
> -#include <linux/irq.h>
>  #include <linux/spinlock.h>
> -#include <linux/cpufreq.h>
> +#include <linux/timer.h>
>  
>  #include <mach/hardware.h>
> -#include <asm/io.h>
>  #include <asm/system.h>
>  
>  #include "soc_common.h"
> @@ -69,7 +69,8 @@ EXPORT_SYMBOL(soc_pcmcia_debug);
>  
>  #endif
>  
> -#define to_soc_pcmcia_socket(x)	container_of(x, struct soc_pcmcia_socket, socket)
> +#define to_soc_pcmcia_socket(x)	\
> +	container_of(x, struct soc_pcmcia_socket, socket)
>  
>  static unsigned short
>  calc_speed(unsigned short *spds, int num, unsigned short dflt)
> @@ -86,11 +87,15 @@ calc_speed(unsigned short *spds, int num, unsigned short dflt)
>  	return speed;
>  }
>  
> -void soc_common_pcmcia_get_timing(struct soc_pcmcia_socket *skt, struct soc_pcmcia_timing *timing)
> +void soc_common_pcmcia_get_timing(struct soc_pcmcia_socket *skt,
> +	struct soc_pcmcia_timing *timing)
>  {
> -	timing->io = calc_speed(skt->spd_io, MAX_IO_WIN, SOC_PCMCIA_IO_ACCESS);
> -	timing->mem = calc_speed(skt->spd_mem, MAX_WIN, SOC_PCMCIA_3V_MEM_ACCESS);
> -	timing->attr = calc_speed(skt->spd_attr, MAX_WIN, SOC_PCMCIA_3V_MEM_ACCESS);
> +	timing->io =
> +		calc_speed(skt->spd_io, MAX_IO_WIN, SOC_PCMCIA_IO_ACCESS);
> +	timing->mem =
> +		calc_speed(skt->spd_mem, MAX_WIN, SOC_PCMCIA_3V_MEM_ACCESS);
> +	timing->attr =
> +		calc_speed(skt->spd_attr, MAX_WIN, SOC_PCMCIA_3V_MEM_ACCESS);
>  }
>  EXPORT_SYMBOL(soc_common_pcmcia_get_timing);
>  
> @@ -132,8 +137,8 @@ static unsigned int soc_common_pcmcia_skt_state(struct soc_pcmcia_socket *skt)
>   *
>   * Convert PCMCIA socket state to our socket configure structure.
>   */
> -static int
> -soc_common_pcmcia_config_skt(struct soc_pcmcia_socket *skt, socket_state_t *state)
> +static int soc_common_pcmcia_config_skt(
> +	struct soc_pcmcia_socket *skt, socket_state_t *state)
>  {
>  	int ret;
>  
> @@ -145,7 +150,8 @@ soc_common_pcmcia_config_skt(struct soc_pcmcia_socket *skt, socket_state_t *stat
>  		 */
>  		if (skt->irq_state != 1 && state->io_irq) {
>  			skt->irq_state = 1;
> -			set_irq_type(skt->socket.pci_irq, IRQ_TYPE_EDGE_FALLING);
> +			set_irq_type(skt->socket.pci_irq,
> +				IRQ_TYPE_EDGE_FALLING);
>  		} else if (skt->irq_state == 1 && state->io_irq == 0) {
>  			skt->irq_state = 0;
>  			set_irq_type(skt->socket.pci_irq, IRQ_TYPE_NONE);
> @@ -299,24 +305,24 @@ soc_common_pcmcia_get_status(struct pcmcia_socket *sock, unsigned int *status)
>   * of power configuration, reset, &c. We also record the value of
>   * `state' in order to regurgitate it to the PCMCIA core later.
>   */
> -static int
> -soc_common_pcmcia_set_socket(struct pcmcia_socket *sock, socket_state_t *state)
> +static int soc_common_pcmcia_set_socket(
> +	struct pcmcia_socket *sock, socket_state_t *state)
>  {
>  	struct soc_pcmcia_socket *skt = to_soc_pcmcia_socket(sock);
>  
> -	debug(skt, 2, "mask: %s%s%s%s%s%sflags: %s%s%s%s%s%sVcc %d Vpp %d irq %d\n",
> -			(state->csc_mask==0)?"<NONE> ":"",
> -			(state->csc_mask&SS_DETECT)?"DETECT ":"",
> -			(state->csc_mask&SS_READY)?"READY ":"",
> -			(state->csc_mask&SS_BATDEAD)?"BATDEAD ":"",
> -			(state->csc_mask&SS_BATWARN)?"BATWARN ":"",
> -			(state->csc_mask&SS_STSCHG)?"STSCHG ":"",
> -			(state->flags==0)?"<NONE> ":"",
> -			(state->flags&SS_PWR_AUTO)?"PWR_AUTO ":"",
> -			(state->flags&SS_IOCARD)?"IOCARD ":"",
> -			(state->flags&SS_RESET)?"RESET ":"",
> -			(state->flags&SS_SPKR_ENA)?"SPKR_ENA ":"",
> -			(state->flags&SS_OUTPUT_ENA)?"OUTPUT_ENA ":"",
> +	debug(skt, 2, "mask: %s%s%s%s%s%s flags: %s%s%s%s%s%s Vcc %d Vpp %d irq %d\n",
> +			(state->csc_mask == 0)		? "<NONE> " :	"",
> +			(state->csc_mask & SS_DETECT)	? "DETECT " :	"",
> +			(state->csc_mask & SS_READY)	? "READY " :	"",
> +			(state->csc_mask & SS_BATDEAD)	? "BATDEAD " :	"",
> +			(state->csc_mask & SS_BATWARN)	? "BATWARN " :	"",
> +			(state->csc_mask & SS_STSCHG)	? "STSCHG " :	"",
> +			(state->flags == 0)		? "<NONE> " :	"",
> +			(state->flags & SS_PWR_AUTO)	? "PWR_AUTO " :	"",
> +			(state->flags & SS_IOCARD)	? "IOCARD " :	"",
> +			(state->flags & SS_RESET)	? "RESET " :	"",
> +			(state->flags & SS_SPKR_ENA)	? "SPKR_ENA " :	"",
> +			(state->flags & SS_OUTPUT_ENA)	? "OUTPUT_ENA " : "",
>  			state->Vcc, state->Vpp, state->io_irq);
>  
>  	return soc_common_pcmcia_config_skt(skt, state);
> @@ -331,8 +337,8 @@ soc_common_pcmcia_set_socket(struct pcmcia_socket *sock, socket_state_t *state)
>   *
>   * Returns: 0 on success, -1 on error
>   */
> -static int
> -soc_common_pcmcia_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *map)
> +static int soc_common_pcmcia_set_io_map(
> +	struct pcmcia_socket *sock, struct pccard_io_map *map)
>  {
>  	struct soc_pcmcia_socket *skt = to_soc_pcmcia_socket(sock);
>  	unsigned short speed = map->speed;
> @@ -341,14 +347,14 @@ soc_common_pcmcia_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *m
>  		map->map, map->speed, (unsigned long long)map->start,
>  		(unsigned long long)map->stop);
>  	debug(skt, 2, "flags: %s%s%s%s%s%s%s%s\n",
> -		(map->flags==0)?"<NONE>":"",
> -		(map->flags&MAP_ACTIVE)?"ACTIVE ":"",
> -		(map->flags&MAP_16BIT)?"16BIT ":"",
> -		(map->flags&MAP_AUTOSZ)?"AUTOSZ ":"",
> -		(map->flags&MAP_0WS)?"0WS ":"",
> -		(map->flags&MAP_WRPROT)?"WRPROT ":"",
> -		(map->flags&MAP_USE_WAIT)?"USE_WAIT ":"",
> -		(map->flags&MAP_PREFETCH)?"PREFETCH ":"");
> +		(map->flags == 0)		? "<NONE>"	: "",
> +		(map->flags & MAP_ACTIVE)	? "ACTIVE "	: "",
> +		(map->flags & MAP_16BIT)	? "16BIT "	: "",
> +		(map->flags & MAP_AUTOSZ)	? "AUTOSZ "	: "",
> +		(map->flags & MAP_0WS)		? "0WS "	: "",
> +		(map->flags & MAP_WRPROT)	? "WRPROT "	: "",
> +		(map->flags & MAP_USE_WAIT)	? "USE_WAIT "	: "",
> +		(map->flags & MAP_PREFETCH)	? "PREFETCH "	: "");
>  
>  	if (map->map >= MAX_IO_WIN) {
>  		printk(KERN_ERR "%s(): map (%d) out of range\n", __func__,
> @@ -385,8 +391,8 @@ soc_common_pcmcia_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *m
>   *
>   * Returns: 0 on success, -ERRNO on error
>   */
> -static int
> -soc_common_pcmcia_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map *map)
> +static int soc_common_pcmcia_set_mem_map(
> +	struct pcmcia_socket *sock, struct pccard_mem_map *map)
>  {
>  	struct soc_pcmcia_socket *skt = to_soc_pcmcia_socket(sock);
>  	struct resource *res;
> @@ -395,14 +401,14 @@ soc_common_pcmcia_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map
>  	debug(skt, 2, "map %u speed %u card_start %08x\n",
>  		map->map, map->speed, map->card_start);
>  	debug(skt, 2, "flags: %s%s%s%s%s%s%s%s\n",
> -		(map->flags==0)?"<NONE>":"",
> -		(map->flags&MAP_ACTIVE)?"ACTIVE ":"",
> -		(map->flags&MAP_16BIT)?"16BIT ":"",
> -		(map->flags&MAP_AUTOSZ)?"AUTOSZ ":"",
> -		(map->flags&MAP_0WS)?"0WS ":"",
> -		(map->flags&MAP_WRPROT)?"WRPROT ":"",
> -		(map->flags&MAP_ATTRIB)?"ATTRIB ":"",
> -		(map->flags&MAP_USE_WAIT)?"USE_WAIT ":"");
> +		(map->flags == 0)		? "<NONE>"	: "",
> +		(map->flags & MAP_ACTIVE)	? "ACTIVE "	: "",
> +		(map->flags & MAP_16BIT)	? "16BIT "	: "",
> +		(map->flags & MAP_AUTOSZ)	? "AUTOSZ "	: "",
> +		(map->flags & MAP_0WS)		? "0WS "	: "",
> +		(map->flags & MAP_WRPROT)	? "WRPROT "	: "",
> +		(map->flags & MAP_ATTRIB)	? "ATTRIB "	: "",
> +		(map->flags & MAP_USE_WAIT)	? "USE_WAIT "	: "");
>  
>  	if (map->map >= MAX_WIN)
>  		return -EINVAL;
> @@ -457,8 +463,8 @@ static struct bittbl conf_bits[] = {
>  	{ SS_OUTPUT_ENA,	"SS_OUTPUT_ENA"	},
>  };
>  
> -static void
> -dump_bits(char **p, const char *prefix, unsigned int val, struct bittbl *bits, int sz)
> +static void dump_bits(char **p, const char *prefix,
> +	unsigned int val, struct bittbl *bits, int sz)
>  {
>  	char *b = *p;
>  	int i;
> @@ -476,13 +482,14 @@ dump_bits(char **p, const char *prefix, unsigned int val, struct bittbl *bits, i
>   *
>   * Returns: the number of characters added to the buffer
>   */
> -static ssize_t show_status(struct device *dev, struct device_attribute *attr, char *buf)
> +static ssize_t show_status(
> +	struct device *dev, struct device_attribute *attr, char *buf)
>  {
>  	struct soc_pcmcia_socket *skt =
>  		container_of(dev, struct soc_pcmcia_socket, socket.dev);
>  	char *p = buf;
>  
> -	p+=sprintf(p, "slot     : %d\n", skt->nr);
> +	p += sprintf(p, "slot     : %d\n", skt->nr);
>  
>  	dump_bits(&p, "status", skt->status,
>  		  status_bits, ARRAY_SIZE(status_bits));
> @@ -491,12 +498,12 @@ static ssize_t show_status(struct device *dev, struct device_attribute *attr, ch
>  	dump_bits(&p, "cs_flags", skt->cs_state.flags,
>  		  conf_bits, ARRAY_SIZE(conf_bits));
>  
> -	p+=sprintf(p, "Vcc      : %d\n", skt->cs_state.Vcc);
> -	p+=sprintf(p, "Vpp      : %d\n", skt->cs_state.Vpp);
> -	p+=sprintf(p, "IRQ      : %d (%d)\n", skt->cs_state.io_irq,
> +	p += sprintf(p, "Vcc      : %d\n", skt->cs_state.Vcc);
> +	p += sprintf(p, "Vpp      : %d\n", skt->cs_state.Vpp);
> +	p += sprintf(p, "IRQ      : %d (%d)\n", skt->cs_state.io_irq,
>  		skt->socket.pci_irq);
>  	if (skt->ops->show_timing)
> -		p+=skt->ops->show_timing(skt, p);
> +		p += skt->ops->show_timing(skt, p);
>  
>  	return p-buf;
>  }
> @@ -589,7 +596,7 @@ soc_pcmcia_notifier(struct notifier_block *nb, unsigned long val, void *data)
>  
>  	mutex_lock(&soc_pcmcia_sockets_lock);
>  	list_for_each_entry(skt, &soc_pcmcia_sockets, node)
> -		if ( skt->ops->frequency_change )
> +		if (skt->ops->frequency_change)
>  			ret += skt->ops->frequency_change(skt, val, freqs);
>  	mutex_unlock(&soc_pcmcia_sockets_lock);
>  
> @@ -615,7 +622,8 @@ fs_initcall(soc_pcmcia_cpufreq_register);
>  
>  static void soc_pcmcia_cpufreq_unregister(void)
>  {
> -	cpufreq_unregister_notifier(&soc_pcmcia_notifier_block, CPUFREQ_TRANSITION_NOTIFIER);
> +	cpufreq_unregister_notifier(&soc_pcmcia_notifier_block,
> +		CPUFREQ_TRANSITION_NOTIFIER);
>  }
>  module_exit(soc_pcmcia_cpufreq_unregister);
>  
> -- 
> 1.7.0.3
> 


From mroberto at cpti.cetuc.puc-rio.br  Thu Mar 25 13:47:50 2010
From: mroberto at cpti.cetuc.puc-rio.br (Marcelo Jimenez)
Date: Thu, 25 Mar 2010 14:47:50 -0300
Subject: [PATCH 2/2] ARM: pcmcia: fix checkpatch.pl issues in soc_common.c
In-Reply-To: <20100325170440.GC5424@comet.dominikbrodowski.net>
References: <1269471898-26301-2-git-send-email-mroberto@cpti.cetuc.puc-rio.br>
	<1269474310-13970-1-git-send-email-mroberto@cpti.cetuc.puc-rio.br> 
	<20100325170440.GC5424@comet.dominikbrodowski.net>
Message-ID: <cecb6d8f1003251047p34620f8fhc11884cdcb8a399f@mail.gmail.com>

On Thu, Mar 25, 2010 at 14:04, Dominik Brodowski
<linux at dominikbrodowski.net> wrote:
> Russell,
>
> do you prefer me pushing these patches upstream (possibly even for -rc3), or
> do you wish to take these patches?

If possible, please take a look at my other ARM patches, I have
submitted a total of nine, but got feedback in only two of them (this
beeing the second).

> Best,
> ? ? ? ?Dominik

Regards,
Marcelo.


From bugzilla-daemon at bugzilla.kernel.org  Thu Mar 25 14:15:21 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Thu, 25 Mar 2010 18:15:21 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@https.bugzilla.kernel.org/>
References: <bug-7304-4463@https.bugzilla.kernel.org/>
Message-ID: <201003251815.o2PIFLwI004714@demeter.kernel.org>

https://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #82 from Dominik Brodowski <linux at brodo.de>  2010-03-25 18:15:13 ---
This is with both
socket->cb_irq = 11;
dev->irq = 11;
?

What's the cbdump output of each socket, with the card inserted? (I'm asking as
one bit which should be set to 0 is set to 1 in the last cbdump output, and
that confuses me)

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From bugzilla-daemon at bugzilla.kernel.org  Thu Mar 25 14:20:37 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Thu, 25 Mar 2010 18:20:37 GMT
Subject: [Bug 15621] BUG: unable to handle kernel paging request  - comm:
	pccardd
In-Reply-To: <bug-15621-4463@https.bugzilla.kernel.org/>
References: <bug-15621-4463@https.bugzilla.kernel.org/>
Message-ID: <201003251820.o2PIKbDn007878@demeter.kernel.org>

https://bugzilla.kernel.org/show_bug.cgi?id=15621





--- Comment #5 from Anonymous Emailer <anonymous at kernel-bugs.osdl.org>  2010-03-25 18:20:33 ---
Reply-To: linux at dominikbrodowski.net

On Thu, Mar 25, 2010 at 10:51:39AM -0600, Bjorn Helgaas wrote:
> > It looks like the iomem_resource tree got wrecked.  Has anyone been
> > changing anything in there lately?
> 
> My pci=use_crs patches change the contents of the iomem_resource tree,
> and it's possible they broke some assumptions PCMCIA was making, so
> you might see if "pci=nocrs" makes any difference.  If it does, please
> attach an acpidump and the entire dmesg logs with and without that option.

... and /proc/iomem as well as /proc/ioports , please.

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From bugzilla-daemon at bugzilla.kernel.org  Thu Mar 25 14:20:43 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Thu, 25 Mar 2010 18:20:43 GMT
Subject: [Bug 15621] BUG: unable to handle kernel paging request  - comm:
	pccardd
In-Reply-To: <bug-15621-4463@https.bugzilla.kernel.org/>
References: <bug-15621-4463@https.bugzilla.kernel.org/>
Message-ID: <201003251820.o2PIKhj9007951@demeter.kernel.org>

https://bugzilla.kernel.org/show_bug.cgi?id=15621





--- Comment #6 from Anonymous Emailer <anonymous at kernel-bugs.osdl.org>  2010-03-25 18:20:41 ---
Reply-To: linux at dominikbrodowski.net

On Thu, Mar 25, 2010 at 10:51:39AM -0600, Bjorn Helgaas wrote:
> > It looks like the iomem_resource tree got wrecked.  Has anyone been
> > changing anything in there lately?
> 
> My pci=use_crs patches change the contents of the iomem_resource tree,
> and it's possible they broke some assumptions PCMCIA was making, so
> you might see if "pci=nocrs" makes any difference.  If it does, please
> attach an acpidump and the entire dmesg logs with and without that option.

... and /proc/iomem as well as /proc/ioports , please.

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From Valdis.Kletnieks at vt.edu  Thu Mar 25 14:26:01 2010
From: Valdis.Kletnieks at vt.edu (Valdis.Kletnieks at vt.edu)
Date: Thu, 25 Mar 2010 14:26:01 -0400
Subject: [PATCH 2/2] ARM: pcmcia: fix checkpatch.pl issues in soc_common.c
In-Reply-To: Your message of "Thu, 25 Mar 2010 13:19:29 +0300."
	<4BAB38B1.8080404@ru.mvista.com>
References: <1269471898-26301-1-git-send-email-mroberto@cpti.cetuc.puc-rio.br>
	<1269471898-26301-2-git-send-email-mroberto@cpti.cetuc.puc-rio.br>
	<20100324230729.GA21359@n2100.arm.linux.org.uk>
	<4BAB38B1.8080404@ru.mvista.com>
Message-ID: <9610.1269541561@localhost>

On Thu, 25 Mar 2010 13:19:29 +0300, Sergei Shtylyov said:

>    I'd disagree in this case. Anybody will hardly grep for "mask: 
> %s%s%s%s%s%sflags: %s%s%s%s%s%s".

However,  egrep 'mask: .*flags: ' is quite plausible.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 227 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-pcmcia/attachments/20100325/d84a7233/attachment.sig>

From Valdis.Kletnieks at vt.edu  Fri Mar 26 11:56:34 2010
From: Valdis.Kletnieks at vt.edu (Valdis.Kletnieks at vt.edu)
Date: Fri, 26 Mar 2010 11:56:34 -0400
Subject: [PATCH 2/2] ARM: pcmcia: fix checkpatch.pl issues in soc_common.c
In-Reply-To: Your message of "Wed, 24 Mar 2010 20:20:19 -0300."
	<cecb6d8f1003241620v55fb960ds14818bf3a03fa334@mail.gmail.com>
References: <1269471898-26301-1-git-send-email-mroberto@cpti.cetuc.puc-rio.br>
	<1269471898-26301-2-git-send-email-mroberto@cpti.cetuc.puc-rio.br>
	<20100324230729.GA21359@n2100.arm.linux.org.uk>
	<cecb6d8f1003241620v55fb960ds14818bf3a03fa334@mail.gmail.com>
Message-ID: <10080.1269618994@localhost>

On Wed, 24 Mar 2010 20:20:19 -0300, Marcelo Jimenez said:

>> - ? ? debug(skt, 2, "mask: %s%s%s%s%s%sflags: %s%s%s%s%s%sVcc %d Vpp %d irq %d\n",

> I will redo it, no problem. But just for my information, in that
> particular case, is it usefull to grep using format specifiers?

Until you find the format string, you really don't know for sure if
it's a %d or a %u or a %alt-ctl-cokebottle so you end up grepping like this:

egrep 'mask: .*flags: .*Vcc .* Vpp .* irq'

basically wildcarding your way across whatever %foo might be there.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 227 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-pcmcia/attachments/20100326/ac330af8/attachment.sig>

From linux at dominikbrodowski.net  Fri Mar 26 12:25:27 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Fri, 26 Mar 2010 17:25:27 +0100
Subject: [git pull] PCMCIA bugfixes for 2.6.34-rc3
Message-ID: <20100326162527.GA5192@comet.dominikbrodowski.net>

Linus,

some PCMCIA bugfixes for 2.6.34-rc3 are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git urgent

Please pull from that location. The diffstat and list of changes follows.
The PM-related change is ACKed by Rafael and needed for the PCMCIA bugfix.

Thanks,
	Dominik

----

Dominik Brodowski (4):
      pcmcia: do not use ioports < 0x100 on x86
      pcmcia: allow for four multifunction subdevices (again)
      power: support _noirq actions on device types and classes
      pcmcia: use dev_pm_ops for class pcmcia_socket_class

Komuro (1):
      pd6729: Coding Style fixes

 drivers/base/power/main.c       |   31 ++++++++++
 drivers/pcmcia/at91_cf.c        |    2 -
 drivers/pcmcia/au1000_generic.c |   13 ----
 drivers/pcmcia/bfin_cf_pcmcia.c |   12 ----
 drivers/pcmcia/cs.c             |  124 ++++++++++++++++++++-------------------
 drivers/pcmcia/db1xxx_ss.c      |   27 ---------
 drivers/pcmcia/ds.c             |    8 ++-
 drivers/pcmcia/i82092.c         |   16 -----
 drivers/pcmcia/i82365.c         |   11 ----
 drivers/pcmcia/m32r_cfc.c       |   11 ----
 drivers/pcmcia/m32r_pcc.c       |   12 ----
 drivers/pcmcia/m8xx_pcmcia.c    |   17 -----
 drivers/pcmcia/omap_cf.c        |   12 ----
 drivers/pcmcia/pd6729.c         |   80 ++++++++++++-------------
 drivers/pcmcia/pxa2xx_base.c    |    8 +--
 drivers/pcmcia/rsrc_nonstatic.c |    7 ++
 drivers/pcmcia/sa1100_generic.c |   13 ----
 drivers/pcmcia/sa1111_generic.c |   12 ----
 drivers/pcmcia/tcic.c           |   12 ----
 drivers/pcmcia/vrc4171_card.c   |   13 ----
 drivers/pcmcia/yenta_socket.c   |   17 +-----
 include/pcmcia/ss.h             |    6 --
 22 files changed, 149 insertions(+), 315 deletions(-)


From linux at arm.linux.org.uk  Fri Mar 26 14:18:00 2010
From: linux at arm.linux.org.uk (Russell King - ARM Linux)
Date: Fri, 26 Mar 2010 18:18:00 +0000
Subject: [PATCH 2/2] ARM: pcmcia: fix checkpatch.pl issues in soc_common.c
In-Reply-To: <4BAB38B1.8080404@ru.mvista.com>
References: <1269471898-26301-1-git-send-email-mroberto@cpti.cetuc.puc-rio.br>
	<1269471898-26301-2-git-send-email-mroberto@cpti.cetuc.puc-rio.br>
	<20100324230729.GA21359@n2100.arm.linux.org.uk>
	<4BAB38B1.8080404@ru.mvista.com>
Message-ID: <20100326181800.GB21682@n2100.arm.linux.org.uk>

On Thu, Mar 25, 2010 at 01:19:29PM +0300, Sergei Shtylyov wrote:
> Hello.
>
> Russell King - ARM Linux wrote:
>
>>> -	debug(skt, 2, "mask: %s%s%s%s%s%sflags: %s%s%s%s%s%sVcc %d Vpp %d irq %d\n",
>>> -			(state->csc_mask==0)?"<NONE> ":"",
>>> -			(state->csc_mask&SS_DETECT)?"DETECT ":"",
>>> -			(state->csc_mask&SS_READY)?"READY ":"",
>>> -			(state->csc_mask&SS_BATDEAD)?"BATDEAD ":"",
>>> -			(state->csc_mask&SS_BATWARN)?"BATWARN ":"",
>>> -			(state->csc_mask&SS_STSCHG)?"STSCHG ":"",
>>> -			(state->flags==0)?"<NONE> ":"",
>>> -			(state->flags&SS_PWR_AUTO)?"PWR_AUTO ":"",
>>> -			(state->flags&SS_IOCARD)?"IOCARD ":"",
>>> -			(state->flags&SS_RESET)?"RESET ":"",
>>> -			(state->flags&SS_SPKR_ENA)?"SPKR_ENA ":"",
>>> -			(state->flags&SS_OUTPUT_ENA)?"OUTPUT_ENA ":"",
>>> +	debug(skt, 2,	"mask: %s%s%s%s%s%s "
>>> +			"flags: %s%s%s%s%s%s Vcc %d Vpp %d irq %d\n",
>>>     
>>
>> NAK.  Breaking kernel messages across multiple lines makes them impossible
>> to grep for.  checkpatch.pl is wrong on this one.
>>   
>
>   I'd disagree in this case. Anybody will hardly grep for "mask:  
> %s%s%s%s%s%sflags: %s%s%s%s%s%s".

Well, I disagree on a matter of principle with you.  If you want to avoid
the line going over 80 columns, move the entire string onto the next line.
Then we can have the entire string intact _and_ we can have it fitting
within 80 columns.


From bugzilla-daemon at bugzilla.kernel.org  Fri Mar 26 17:18:49 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Fri, 26 Mar 2010 21:18:49 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@https.bugzilla.kernel.org/>
References: <bug-7304-4463@https.bugzilla.kernel.org/>
Message-ID: <201003262118.o2QLInwK029575@demeter.kernel.org>

https://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #83 from Thomas Nemeth <nemeth.thomas at gmail.com>  2010-03-26 21:18:34 ---
Created an attachment (id=25724)
 --> (https://bugzilla.kernel.org/attachment.cgi?id=25724)
Output of cbdump on 2.6.34-rc2 with the eth card in the non-working slot

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From bugzilla-daemon at bugzilla.kernel.org  Fri Mar 26 17:20:07 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Fri, 26 Mar 2010 21:20:07 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@https.bugzilla.kernel.org/>
References: <bug-7304-4463@https.bugzilla.kernel.org/>
Message-ID: <201003262120.o2QLK7T5030031@demeter.kernel.org>

https://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #84 from Thomas Nemeth <nemeth.thomas at gmail.com>  2010-03-26 21:20:02 ---
Created an attachment (id=25725)
 --> (https://bugzilla.kernel.org/attachment.cgi?id=25725)
Output of cbdump on 2.6.34-rc2 with the eth card in the working slot

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From bugzilla-daemon at bugzilla.kernel.org  Fri Mar 26 17:23:45 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Fri, 26 Mar 2010 21:23:45 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@https.bugzilla.kernel.org/>
References: <bug-7304-4463@https.bugzilla.kernel.org/>
Message-ID: <201003262123.o2QLNj0X030960@demeter.kernel.org>

https://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #85 from Thomas Nemeth <nemeth.thomas at gmail.com>  2010-03-26 21:23:40 ---
(In reply to comment #82)
> This is with both
> socket->cb_irq = 11;
> dev->irq = 11;
> ?

    Yes.

thomas at cixi:exether$ grep "= 11;"
linux-2.6.34-rc2/drivers/pcmcia/yenta_socket.c
        socket->cb_irq = 11;
        dev->irq = 11;


> What's the cbdump output of each socket, with the card inserted? (I'm asking
> as one bit which should be set to 0 is set to 1 in the last cbdump output,
> and that confuses me)

    Here is the diff between the two dumps (hope this helps):

thomas at cixi:~$ diff cbdump-2.6.34-rc2-slitaz-nonworkingslot
cbdump-2.6.34-rc2-slitaz-workingslot
--- cbdump-2.6.34-rc2-slitaz-nonworkingslot     2010-03-26 22:15:39.000000000
+0100
+++ cbdump-2.6.34-rc2-slitaz-workingslot        2010-03-26 22:15:40.000000000
+0100
@@ -12,20 +12,20 @@
   IO Limit 0                     [30] : 0x000018fc
   IO Base 1                      [34] : 0x00001c00
   IO Limit 1                     [38] : 0x00001cfc
-  Bridge control                 [3e] : 0x0500
+  Bridge control                 [3e] : 0x0580
   Subsystem vendor ID            [40] : 0x1179
   Subsystem device ID            [42] : 0x0001
   Legacy mode base               [44] : 0x0001
   -- cardbus registers
   CB_SOCKET_EVENT                [00] : 0x00000000
   CB_SOCKET_MASK                 [04] : 0x00000006
-  CB_SOCKET_STATE                [08] : 0x30000828
+  CB_SOCKET_STATE                [08] : 0x30000007
   CB_SOCKET_FORCE                [0c] : 0x00000000
-  CB_SOCKET_CONTROL              [10] : 0x00000033
+  CB_SOCKET_CONTROL              [10] : 0x00000000
   CB_SOCKET_POWER                [20] : 0x00000000
   -- exca registers
   I365_IDENT                     [00] : 0x83
-  I365_STATUS                    [01] : 0x8e
+  I365_STATUS                    [01] : 0xb2
   I365_POWER                     [02] : 0x40
   I365_INTCTL                    [03] : 0x40
   I365_CSC                       [04] : 0x00
@@ -73,20 +73,20 @@
   IO Limit 0                     [30] : 0x000010fc
   IO Base 1                      [34] : 0x00001400
   IO Limit 1                     [38] : 0x000014fc
-  Bridge control                 [3e] : 0x0580
+  Bridge control                 [3e] : 0x0500
   Subsystem vendor ID            [40] : 0x1179
   Subsystem device ID            [42] : 0x0001
   Legacy mode base               [44] : 0x0001
   -- cardbus registers
   CB_SOCKET_EVENT                [00] : 0x00000000
   CB_SOCKET_MASK                 [04] : 0x00000006
-  CB_SOCKET_STATE                [08] : 0x30000087
+  CB_SOCKET_STATE                [08] : 0x30000828
   CB_SOCKET_FORCE                [0c] : 0x00000000
-  CB_SOCKET_CONTROL              [10] : 0x00000000
+  CB_SOCKET_CONTROL              [10] : 0x00000033
   CB_SOCKET_POWER                [20] : 0x00000000
   -- exca registers
   I365_IDENT                     [00] : 0x83
-  I365_STATUS                    [01] : 0xb2
+  I365_STATUS                    [01] : 0x8e
   I365_POWER                     [02] : 0x40
   I365_INTCTL                    [03] : 0x40
   I365_CSC                       [04] : 0x00
thomas at cixi:~$

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From mroberto at cpti.cetuc.puc-rio.br  Fri Mar 26 17:57:07 2010
From: mroberto at cpti.cetuc.puc-rio.br (Marcelo Jimenez)
Date: Fri, 26 Mar 2010 18:57:07 -0300
Subject: [PATCH 2/2] ARM: pcmcia: fix checkpatch.pl issues in soc_common.c
In-Reply-To: <20100326181800.GB21682@n2100.arm.linux.org.uk>
References: <1269471898-26301-1-git-send-email-mroberto@cpti.cetuc.puc-rio.br>
	<1269471898-26301-2-git-send-email-mroberto@cpti.cetuc.puc-rio.br> 
	<20100324230729.GA21359@n2100.arm.linux.org.uk>
	<4BAB38B1.8080404@ru.mvista.com> 
	<20100326181800.GB21682@n2100.arm.linux.org.uk>
Message-ID: <cecb6d8f1003261457x69c319c1w884ade1746f81e8b@mail.gmail.com>

On Fri, Mar 26, 2010 at 15:18, Russell King - ARM Linux
<linux at arm.linux.org.uk> wrote:
> On Thu, Mar 25, 2010 at 01:19:29PM +0300, Sergei Shtylyov wrote:
>>
>> ? I'd disagree in this case. Anybody will hardly grep for "mask:
>> %s%s%s%s%s%sflags: %s%s%s%s%s%s".
>
> Well, I disagree on a matter of principle with you. ?If you want to avoid
> the line going over 80 columns, move the entire string onto the next line.
> Then we can have the entire string intact _and_ we can have it fitting
> within 80 columns.

This is no big deal. Also, I have already submitted the new patch and
Valdis had a good point for egrep.

Regards,
Marcelo.


From linux at arm.linux.org.uk  Fri Mar 26 19:06:18 2010
From: linux at arm.linux.org.uk (Russell King - ARM Linux)
Date: Fri, 26 Mar 2010 23:06:18 +0000
Subject: [PATCH 2/2] ARM: pcmcia: fix checkpatch.pl issues in soc_common.c
In-Reply-To: <cecb6d8f1003261457x69c319c1w884ade1746f81e8b@mail.gmail.com>
References: <1269471898-26301-1-git-send-email-mroberto@cpti.cetuc.puc-rio.br>
	<1269471898-26301-2-git-send-email-mroberto@cpti.cetuc.puc-rio.br>
	<20100324230729.GA21359@n2100.arm.linux.org.uk>
	<4BAB38B1.8080404@ru.mvista.com>
	<20100326181800.GB21682@n2100.arm.linux.org.uk>
	<cecb6d8f1003261457x69c319c1w884ade1746f81e8b@mail.gmail.com>
Message-ID: <20100326230618.GD29179@n2100.arm.linux.org.uk>

On Fri, Mar 26, 2010 at 06:57:07PM -0300, Marcelo Jimenez wrote:
> On Fri, Mar 26, 2010 at 15:18, Russell King - ARM Linux
> <linux at arm.linux.org.uk> wrote:
> > On Thu, Mar 25, 2010 at 01:19:29PM +0300, Sergei Shtylyov wrote:
> >>
> >> ? I'd disagree in this case. Anybody will hardly grep for "mask:
> >> %s%s%s%s%s%sflags: %s%s%s%s%s%s".
> >
> > Well, I disagree on a matter of principle with you. ?If you want to avoid
> > the line going over 80 columns, move the entire string onto the next line.
> > Then we can have the entire string intact _and_ we can have it fitting
> > within 80 columns.
> 
> This is no big deal. Also, I have already submitted the new patch and
> Valdis had a good point for egrep.

Sorry, I'm having stability issues with my MTA which inexplicably died
about 12 hours ago, presumably due to the level of crap flying around
the 'net nowadays.  This appears to be becoming a regular occurance in
the last week. ;(


From komurojun-mbn at nifty.com  Sat Mar 27 02:35:25 2010
From: komurojun-mbn at nifty.com (Komuro)
Date: Sat, 27 Mar 2010 15:35:25 +0900
Subject: [kernel 2.6.34-rc2] cs: IO port probe 0x100-0x3af: excluding
	0x378-0x37f
In-Reply-To: <20100323222956.f7f83e83.komurojun-mbn@nifty.com>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<1257971899-9274-9-git-send-email-linux@dominikbrodowski.net>
	<20091213212556.03d83e1f.komurojun-mbn@nifty.com>
	<20100228153933.f6fe6f81.komurojun-mbn@nifty.com>
	<20100320063919.f7cd4421.komurojun-mbn@nifty.com>
	<20100321065539.57cb2c96.komurojun-mbn@nifty.com>
	<20100322094022.742e85a9.komurojun-mbn@nifty.com>
	<20100322183832.f07b9191.komurojun-mbn@nifty.com>
	<20100323222956.f7f83e83.komurojun-mbn@nifty.com>
Message-ID: <20100327153525.f8ec12d2.komurojun-mbn@nifty.com>

Hi,

At kernel 2.6.34-rc2, io_port 0x378-0x37f is not excluded automatically
in my system.

io_probe is not safe for some device (for example, ATI Radeon?)
Is it better not to do io_probe?


[kernel 2.6.33]
pcmcia_socket pcmcia_socket0: cs: IO port probe 0x100-0x3af: excluding 0x378-0x37f
pcmcia_socket pcmcia_socket0: cs: IO port probe 0x3e0-0x4ff: clean.
pcmcia_socket pcmcia_socket0: cs: IO port probe 0x820-0x8ff: clean.
pcmcia_socket pcmcia_socket0: cs: IO port probe 0xc00-0xcf7: clean.

[kernel 2.6.34-rc2]
pcmcia_socket pcmcia_socket1: cs: IO port probe 0xa00-0xaff: clean.
pcmcia_socket pcmcia_socket0: cs: IO port probe 0x100-0x3af: clean.
pcmcia_socket pcmcia_socket0: cs: IO port probe 0x3e0-0x4ff: clean.
pcmcia_socket pcmcia_socket0: cs: IO port probe 0x820-0x8ff: clean.
pcmcia_socket pcmcia_socket0: cs: IO port probe 0xc00-0xcf7: clean.


Best Regards
Komuro


From bugzilla-daemon at bugzilla.kernel.org  Sat Mar 27 10:00:19 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Sat, 27 Mar 2010 14:00:19 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@https.bugzilla.kernel.org/>
References: <bug-7304-4463@https.bugzilla.kernel.org/>
Message-ID: <201003271400.o2RE0JOQ026226@demeter.kernel.org>

https://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #86 from Dominik Brodowski <linux at brodo.de>  2010-03-27 14:00:09 ---
Created an attachment (id=25735)
 --> (https://bugzilla.kernel.org/attachment.cgi?id=25735)
test patch to use ISA IRQs also for CardBus

That's bad news -- both sockets are configured the same way. So they _should_
behave the same way, and work... Well, could you remove the IRQ=11 forced
setting, try out the attached patch (both sockets), and send the dmesg (even if
it works)? cbdump or other is not needed.

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From linux at dominikbrodowski.net  Sat Mar 27 09:12:07 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Sat, 27 Mar 2010 14:12:07 +0100
Subject: [kernel 2.6.34-rc2] cs: IO port probe 0x100-0x3af: excluding
	0x378-0x37f
In-Reply-To: <20100327153525.f8ec12d2.komurojun-mbn@nifty.com>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<1257971899-9274-9-git-send-email-linux@dominikbrodowski.net>
	<20091213212556.03d83e1f.komurojun-mbn@nifty.com>
	<20100228153933.f6fe6f81.komurojun-mbn@nifty.com>
	<20100320063919.f7cd4421.komurojun-mbn@nifty.com>
	<20100321065539.57cb2c96.komurojun-mbn@nifty.com>
	<20100322094022.742e85a9.komurojun-mbn@nifty.com>
	<20100322183832.f07b9191.komurojun-mbn@nifty.com>
	<20100323222956.f7f83e83.komurojun-mbn@nifty.com>
	<20100327153525.f8ec12d2.komurojun-mbn@nifty.com>
Message-ID: <20100327131207.GA21948@comet.dominikbrodowski.net>

Hey,

Can't see how this is a real PCMCIA issue here...

What kind of device is at 0x378? Was it reliably detected by io_probe
before? Why is this device not reported by _CRS / ACPI / whatever?

Best,
	Dominik

On Sat, Mar 27, 2010 at 03:35:25PM +0900, Komuro wrote:
> Hi,
> 
> At kernel 2.6.34-rc2, io_port 0x378-0x37f is not excluded automatically
> in my system.
> 
> io_probe is not safe for some device (for example, ATI Radeon?)
> Is it better not to do io_probe?
> 
> 
> [kernel 2.6.33]
> pcmcia_socket pcmcia_socket0: cs: IO port probe 0x100-0x3af: excluding 0x378-0x37f
> pcmcia_socket pcmcia_socket0: cs: IO port probe 0x3e0-0x4ff: clean.
> pcmcia_socket pcmcia_socket0: cs: IO port probe 0x820-0x8ff: clean.
> pcmcia_socket pcmcia_socket0: cs: IO port probe 0xc00-0xcf7: clean.
> 
> [kernel 2.6.34-rc2]
> pcmcia_socket pcmcia_socket1: cs: IO port probe 0xa00-0xaff: clean.
> pcmcia_socket pcmcia_socket0: cs: IO port probe 0x100-0x3af: clean.
> pcmcia_socket pcmcia_socket0: cs: IO port probe 0x3e0-0x4ff: clean.
> pcmcia_socket pcmcia_socket0: cs: IO port probe 0x820-0x8ff: clean.
> pcmcia_socket pcmcia_socket0: cs: IO port probe 0xc00-0xcf7: clean.
> 
> 
> Best Regards
> Komuro
> 
> _______________________________________________
> Linux PCMCIA reimplementation list
> http://lists.infradead.org/mailman/listinfo/linux-pcmcia


From peter at stuge.se  Sat Mar 27 15:03:40 2010
From: peter at stuge.se (Peter Stuge)
Date: Sat, 27 Mar 2010 20:03:40 +0100
Subject: pci_bus_for_each_resource, transparent bridges and
	rsrc_nonstatic.c
In-Reply-To: <20100322232800.GA532@isilmar.linta.de>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<201003221628.56232.bjorn.helgaas@hp.com>
	<20100322225235.GA29522@isilmar.linta.de>
	<201003221711.34997.bjorn.helgaas@hp.com>
	<20100322232800.GA532@isilmar.linta.de>
Message-ID: <20100327190340.27310.qmail@stuge.se>

Dominik Brodowski wrote:
> can we safely trust BIOS authors to get it right?

As a long time member of the coreboot project I can assure you that
the answer to that is "No!!"


//Peter


From komurojun-mbn at nifty.com  Sat Mar 27 20:08:59 2010
From: komurojun-mbn at nifty.com (Komuro)
Date: Sun, 28 Mar 2010 09:08:59 +0900
Subject: [kernel 2.6.34-rc2] cs: IO port probe 0x100-0x3af: excluding
	0x378-0x37f
In-Reply-To: <20100327153525.f8ec12d2.komurojun-mbn@nifty.com>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<1257971899-9274-9-git-send-email-linux@dominikbrodowski.net>
	<20091213212556.03d83e1f.komurojun-mbn@nifty.com>
	<20100228153933.f6fe6f81.komurojun-mbn@nifty.com>
	<20100320063919.f7cd4421.komurojun-mbn@nifty.com>
	<20100321065539.57cb2c96.komurojun-mbn@nifty.com>
	<20100322094022.742e85a9.komurojun-mbn@nifty.com>
	<20100322183832.f07b9191.komurojun-mbn@nifty.com>
	<20100323222956.f7f83e83.komurojun-mbn@nifty.com>
	<20100327153525.f8ec12d2.komurojun-mbn@nifty.com>
Message-ID: <20100328090859.ffc1e335.komurojun-mbn@nifty.com>

Hi,

>What kind of device is at 0x378? Was it reliably detected by io_probe
>before? Why is this device not reported by _CRS / ACPI / whatever?

0x378 is printer-port.

Here is the dmesg of 2.6.34-rc2.


Linux version 2.6.34-rc2 (root at localhost.localdomain) (gcc version 4.1.2 20070502 (Red Hat 4.1.2-12)) #1 SMP Mon Mar 22 21:22:37 JST 2010
BIOS-provided physical RAM map:
 BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
 BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
 BIOS-e820: 00000000000e4000 - 0000000000100000 (reserved)
 BIOS-e820: 0000000000100000 - 000000003ffb0000 (usable)
 BIOS-e820: 000000003ffb0000 - 000000003ffc0000 (ACPI data)
 BIOS-e820: 000000003ffc0000 - 000000003fff0000 (ACPI NVS)
 BIOS-e820: 000000003fff0000 - 0000000040000000 (reserved)
 BIOS-e820: 00000000ff780000 - 0000000100000000 (reserved)
Notice: NX (Execute Disable) protection cannot be enabled: non-PAE kernel!
DMI 2.3 present.
AMI BIOS detected: BIOS may corrupt low RAM, working around it.
e820 update range: 0000000000000000 - 0000000000010000 (usable) ==> (reserved)
e820 update range: 0000000000000000 - 0000000000001000 (usable) ==> (reserved)
e820 remove range: 00000000000a0000 - 0000000000100000 (usable)
last_pfn = 0x3ffb0 max_arch_pfn = 0x100000
MTRR default type: uncachable
MTRR fixed ranges enabled:
  00000-9FFFF write-back
  A0000-EFFFF uncachable
  F0000-FFFFF write-protect
MTRR variable ranges enabled:
  0 base 0000000000 mask FFC0000000 write-back
  1 base 00DC000000 mask FFFC000000 write-combining
  2 disabled
  3 disabled
  4 disabled
  5 disabled
  6 disabled
  7 disabled
x86 PAT enabled: cpu 0, old 0x7040600070406, new 0x7010600070106
initial memory mapped : 0 - 00c00000
found SMP MP-table at [c00ff780] ff780
init_memory_mapping: 0000000000000000-00000000377fe000
 0000000000 - 0000400000 page 4k
 0000400000 - 0037400000 page 2M
 0037400000 - 00377fe000 page 4k
kernel direct mapping tables up to 377fe000 @ 15000-1a000
RAMDISK: 37d33000 - 37fef92c
Allocated new RAMDISK: 00100000 - 003bc92c
Move RAMDISK from 0000000037d33000 - 0000000037fef92b to 00100000 - 003bc92b
ACPI: RSDP 000fa850 00021 (v02 ACPIAM)
ACPI: XSDT 3ffb0100 0003C (v01 A M I  OEMXSDT  03000615 MSFT 00000097)
ACPI: FACP 3ffb0290 000F4 (v03 A M I  OEMFACP  03000615 MSFT 00000097)
ACPI: DSDT 3ffb03f0 0391B (v01  A0277 A0277001 00000001 MSFT 0100000D)
ACPI: FACS 3ffc0000 00040
ACPI: APIC 3ffb0390 00052 (v01 A M I  OEMAPIC  03000615 MSFT 00000097)
ACPI: OEMB 3ffc0040 0003F (v01 A M I  OEMBIOS  03000615 MSFT 00000097)
ACPI: Local APIC address 0xfee00000
135MB HIGHMEM available.
887MB LOWMEM available.
  mapped low ram: 0 - 377fe000
  low ram: 0 - 377fe000
Zone PFN ranges:
  DMA      0x00000010 -> 0x00001000
  Normal   0x00001000 -> 0x000377fe
  HighMem  0x000377fe -> 0x0003ffb0
Movable zone start PFN for each node
early_node_map[2] active PFN ranges
    0: 0x00000010 -> 0x0000009f
    0: 0x00000100 -> 0x0003ffb0
On node 0 totalpages: 261951
free_area_init_node: node 0, pgdat c0782700, node_mem_map c1001200
  DMA zone: 32 pages used for memmap
  DMA zone: 0 pages reserved
  DMA zone: 3951 pages, LIFO batch:0
  Normal zone: 1744 pages used for memmap
  Normal zone: 221486 pages, LIFO batch:31
  HighMem zone: 272 pages used for memmap
  HighMem zone: 34466 pages, LIFO batch:7
Using APIC driver default
Detected use of extended apic ids on hypertransport bus
ACPI: PM-Timer IO Port: 0x808
ACPI: Local APIC address 0xfee00000
ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)
ACPI: LAPIC (acpi_id[0x02] lapic_id[0x01] enabled)
ACPI: IOAPIC (id[0x02] address[0xfec00000] gsi_base[0])
IOAPIC[0]: apic_id 2, version 3, address 0xfec00000, GSI 0-23
ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
ACPI: IRQ0 used by override.
ACPI: IRQ2 used by override.
ACPI: IRQ9 used by override.
Using ACPI (MADT) for SMP configuration information
SMP: Allowing 2 CPUs, 0 hotplug CPUs
nr_irqs_gsi: 24
early_res array is doubled to 64 at [16000 - 167ff]
Allocating PCI resources starting at 40000000 (gap: 40000000:bf780000)
setup_percpu: NR_CPUS:8 nr_cpumask_bits:8 nr_cpu_ids:2 nr_node_ids:1
PERCPU: Embedded 16 pages/cpu @c1c00000 s41236 r0 d24300 u2097152
pcpu-alloc: s41236 r0 d24300 u2097152 alloc=1*4194304
pcpu-alloc: [0] 0 1 
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 259903
Kernel command line: ro root=LABEL=/1 rhgb quiet
PID hash table entries: 4096 (order: 2, 16384 bytes)
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Enabling fast FPU save and restore... done.
Enabling unmasked SIMD FPU exception support... done.
Initializing CPU#0
Subtract (44 early reservations)
  #1 [0000001000 - 0000002000]   EX TRAMPOLINE
  #2 [0000400000 - 000086da94]   TEXT DATA BSS
  #3 [000086e000 - 000087121c]             BRK
  #4 [00000ff790 - 0000100000]   BIOS reserved
  #5 [00000ff780 - 00000ff790]    MP-table mpf
  #6 [000009fc00 - 00000e0250]   BIOS reserved
  #7 [00000e03b4 - 00000ff780]   BIOS reserved
  #8 [00000e0250 - 00000e03b4]    MP-table mpc
  #9 [0000010000 - 0000011000]      TRAMPOLINE
  #10 [0000011000 - 0000015000]     ACPI WAKEUP
  #11 [0000015000 - 0000016000]         PGTABLE
  #12 [0000100000 - 00003bc92c]     NEW RAMDISK
  #13 [0001000000 - 0001001000]         BOOTMEM
  #14 [0001001000 - 0001801000]         BOOTMEM
  #15 [0001801000 - 0001801004]         BOOTMEM
  #16 [0001801040 - 0001801100]         BOOTMEM
  #17 [0001801100 - 0001801154]         BOOTMEM
  #18 [0001801180 - 0001804180]         BOOTMEM
  #19 [0001804180 - 0001804190]         BOOTMEM
  #20 [00018041c0 - 0001804dc0]         BOOTMEM
  #21 [0001804dc0 - 0001804de7]         BOOTMEM
  #22 [0001804e00 - 0001804efc]         BOOTMEM
  #23 [0001804f00 - 0001804f40]         BOOTMEM
  #24 [0001804f40 - 0001804f80]         BOOTMEM
  #25 [0001804f80 - 0001804fc0]         BOOTMEM
  #26 [0001804fc0 - 0001805000]         BOOTMEM
  #27 [0001805000 - 0001805040]         BOOTMEM
  #28 [0001805040 - 0001805080]         BOOTMEM
  #29 [0001805080 - 00018050c0]         BOOTMEM
  #30 [00018050c0 - 0001805100]         BOOTMEM
  #31 [0001805100 - 000180511c]         BOOTMEM
  #32 [0001805140 - 000180515c]         BOOTMEM
  #33 [0001c00000 - 0001c10000]         BOOTMEM
  #34 [0001e00000 - 0001e10000]         BOOTMEM
  #35 [0001807180 - 0001807184]         BOOTMEM
  #36 [00018071c0 - 00018071c4]         BOOTMEM
  #37 [0001807200 - 0001807208]         BOOTMEM
  #38 [0001807240 - 0001807248]         BOOTMEM
  #39 [0001807280 - 0001807328]         BOOTMEM
  #40 [0001807340 - 00018073a8]         BOOTMEM
  #41 [00018073c0 - 000180b3c0]         BOOTMEM
  #42 [000180b3c0 - 000188b3c0]         BOOTMEM
  #43 [000188b3c0 - 00018cb3c0]         BOOTMEM
 16 20 - 80 9f
 3bd 3c0 - 400 400
 872 880 - 1000 1000
 1806 - 1807
 18cc 18e0 - 1c00 1c00
 1c10 1c20 - 1e00 1e00
 1e10 1e20 - 377e0 377fe
Initializing HighMem for node 0 (000377fe:0003ffb0)
Memory: 1031292k/1048256k available (2184k kernel code, 16512k reserved, 1441k data, 352k init, 138952k highmem)
virtual kernel memory layout:
    fixmap  : 0xffe7f000 - 0xfffff000   (1536 kB)
    pkmap   : 0xff800000 - 0xffc00000   (4096 kB)
    vmalloc : 0xf7ffe000 - 0xff7fe000   ( 120 MB)
    lowmem  : 0xc0000000 - 0xf77fe000   ( 887 MB)
      .init : 0xc078b000 - 0xc07e3000   ( 352 kB)
      .data : 0xc062235a - 0xc078aaa4   (1441 kB)
      .text : 0xc0400000 - 0xc062235a   (2184 kB)
Checking if this processor honours the WP bit even in supervisor mode...Ok.
Hierarchical RCU implementation.
NR_IRQS:512
CPU 0 irqstacks, hard=c1c00000 soft=c1c01000
Extended CMOS year: 2000
Console: colour VGA+ 80x25
console [tty0] enabled
Fast TSC calibration using PIT
Detected 2202.650 MHz processor.
Calibrating delay loop (skipped), value calculated using timer frequency.. 4405.30 BogoMIPS (lpj=2202650)
Mount-cache hash table entries: 512
CPU: Physical Processor ID: 0
CPU: Processor Core ID: 0
mce: CPU supports 5 MCE banks
Performance Events: AMD PMU driver.
... version:                0
... bit width:              48
... generic registers:      4
... value mask:             0000ffffffffffff
... max period:             00007fffffffffff
... fixed-purpose events:   0
... event mask:             000000000000000f
Checking 'hlt' instruction... OK.
ACPI: Core revision 20100121
Enabling APIC mode:  Flat.  Using 1 I/O APICs
..TIMER: vector=0x30 apic1=0 pin1=2 apic2=0 pin2=0
CPU0: AMD Athlon(tm) 64 X2 Dual Core Processor 4200+ stepping 02
CPU 1 irqstacks, hard=c1e00000 soft=c1e01000
Booting Node   0, Processors  #1 Ok.
Initializing CPU#1
Brought up 2 CPUs
Total of 2 processors activated (8810.29 BogoMIPS).
khelper used greatest stack depth: 3504 bytes left
NET: Registered protocol family 16
khelper used greatest stack depth: 3444 bytes left
node 0 link 0: io port [1000, ffffff]
TOM: 0000000040000000 aka 1024M
node 0 link 0: mmio [a0000, bffff]
node 0 link 0: mmio [40000000, ffffffff]
bus: [00, ff] on node 0 link 0
bus: 00 index 0 [io  0x0000-0xffff]
bus: 00 index 1 [mem 0x000a0000-0x000bffff]
bus: 00 index 2 [mem 0x40000000-0xffffffff]
ACPI: bus type pci registered
PCI: PCI BIOS revision 2.10 entry at 0xf0031, last bus=3
PCI: Using configuration type 1 for base access
khelper used greatest stack depth: 3256 bytes left
bio: create slab <bio-0> at 0
ACPI: EC: Look up EC in DSDT
ACPI: Executed 1 blocks of module-level executable AML code
ACPI: Interpreter enabled
ACPI: (supports S0 S1 S3 S5)
ACPI: Using IOAPIC for interrupt routing
ACPI Warning: Incorrect checksum in table [OEMB] - F4, should be E7 (20100121/tbutils-314)
ACPI: No dock devices found.
PCI: Ignoring host bridge windows from ACPI; if necessary, use "pci=use_crs" and report a bug
ACPI: PCI Root Bridge [PCI0] (0000:00)
pci_root PNP0A03:00: host bridge window [io  0x0000-0x0cf7] (ignored)
pci_root PNP0A03:00: host bridge window [io  0x0d00-0xffff] (ignored)
pci_root PNP0A03:00: host bridge window [mem 0x000a0000-0x000bffff] (ignored)
pci_root PNP0A03:00: host bridge window [mem 0x40000000-0xffffffff] (ignored)
pci 0000:00:00.0: reg 10: [mem 0xdc000000-0xdfffffff pref]
pci 0000:00:01.0: supports D1
pci 0000:00:0a.0: reg 10: [mem 0xf9c00000-0xf9c03fff]
pci 0000:00:0a.0: reg 14: [io  0xb000-0xb0ff]
pci 0000:00:0a.0: reg 30: [mem 0xf9b00000-0xf9b1ffff pref]
pci 0000:00:0a.0: supports D1 D2
pci 0000:00:0a.0: PME# supported from D0 D1 D2 D3hot D3cold
pci 0000:00:0a.0: PME# disabled
pci 0000:00:0c.0: reg 10: [mem 0x00000000-0x00000fff]
pci 0000:00:0c.0: supports D1 D2
pci 0000:00:0c.0: PME# supported from D0 D1 D2 D3hot
pci 0000:00:0c.0: PME# disabled
pci 0000:00:0c.1: reg 10: [mem 0x00000000-0x00000fff]
pci 0000:00:0c.1: supports D1 D2
pci 0000:00:0c.1: PME# supported from D0 D1 D2 D3hot
pci 0000:00:0c.1: PME# disabled
pci 0000:00:0f.0: reg 10: [io  0xd000-0xd007]
pci 0000:00:0f.0: reg 14: [io  0xc800-0xc803]
pci 0000:00:0f.0: reg 18: [io  0xc400-0xc407]
pci 0000:00:0f.0: reg 1c: [io  0xc000-0xc003]
pci 0000:00:0f.0: reg 20: [io  0xb800-0xb80f]
pci 0000:00:0f.0: reg 24: [io  0xb400-0xb4ff]
pci 0000:00:0f.1: reg 20: [io  0xfc00-0xfc0f]
pci 0000:00:10.0: reg 20: [io  0xd400-0xd41f]
pci 0000:00:10.0: supports D1 D2
pci 0000:00:10.0: PME# supported from D0 D1 D2 D3hot D3cold
pci 0000:00:10.0: PME# disabled
pci 0000:00:10.1: reg 20: [io  0xd800-0xd81f]
pci 0000:00:10.1: supports D1 D2
pci 0000:00:10.1: PME# supported from D0 D1 D2 D3hot D3cold
pci 0000:00:10.1: PME# disabled
pci 0000:00:10.2: reg 20: [io  0xe000-0xe01f]
pci 0000:00:10.2: supports D1 D2
pci 0000:00:10.2: PME# supported from D0 D1 D2 D3hot D3cold
pci 0000:00:10.2: PME# disabled
pci 0000:00:10.3: reg 20: [io  0xe400-0xe41f]
pci 0000:00:10.3: supports D1 D2
pci 0000:00:10.3: PME# supported from D0 D1 D2 D3hot D3cold
pci 0000:00:10.3: PME# disabled
pci 0000:00:10.4: reg 10: [mem 0xf9e00000-0xf9e000ff]
pci 0000:00:10.4: supports D1 D2
pci 0000:00:10.4: PME# supported from D0 D1 D2 D3hot D3cold
pci 0000:00:10.4: PME# disabled
HPET not enabled in BIOS. You might try hpet=force boot option
pci 0000:00:11.0: Enabled onboard AC97/MC97 devices
pci 0000:00:11.5: reg 10: [io  0xe800-0xe8ff]
pci 0000:00:11.5: supports D1 D2
pci 0000:00:11.6: reg 10: [io  0x0000-0x00ff]
PCI: peer root bus 00 res updated from pci conf
pci 0000:03:00.0: reg 10: [mem 0xfb000000-0xfbffffff]
pci 0000:03:00.0: reg 14: [mem 0xe0000000-0xefffffff pref]
pci 0000:03:00.0: reg 18: [mem 0xfa000000-0xfaffffff]
pci 0000:03:00.0: reg 30: [mem 0xf9f00000-0xf9f1ffff pref]
pci 0000:00:01.0: PCI bridge to [bus 03-03]
pci 0000:00:01.0:   bridge window [io  f000 - 0000] reg reading
pci 0000:00:01.0:   bridge window [mem 0xf9f00000-0xfbffffff]
pci 0000:00:01.0:   bridge window [mem 0xe0000000-0xf8ffffff pref]
pci_bus 0000:00: on NUMA node 0
ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT]
ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 7 10 *11 14 15)
ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 7 *10 11 14 15)
ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 *5 7 10 11 14 15)
ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 7 10 11 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LNKE] (IRQs 3 4 5 7 10 11 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LNKF] (IRQs 3 4 5 7 10 11 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LNKG] (IRQs 3 4 5 7 10 11 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LNKH] (IRQs 3 4 5 7 10 11 14 15) *0, disabled.
vgaarb: device added: PCI:0000:03:00.0,decodes=io+mem,owns=io+mem,locks=none
vgaarb: loaded
PCI: Using ACPI for IRQ routing
PCI: pci_cache_line_size set to 64 bytes
reserve RAM buffer: 000000000009fc00 - 000000000009ffff 
reserve RAM buffer: 000000003ffb0000 - 000000003fffffff 
pnp: PnP ACPI init
ACPI: bus type pnp registered
pnp 00:0a: disabling [io  0x0010-0x001f] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x0022-0x003f] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x0044-0x005f] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x0062-0x0063] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x0065-0x006f] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x0072-0x007f] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x0080] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x0084-0x0086] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x0088] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x008c-0x008e] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x0090-0x009f] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x00a2-0x00bf] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp 00:0a: disabling [io  0x00e0-0x00ef] because it overlaps 0000:00:11.6 BAR 0 [io  0x0000-0x00ff]
pnp: PnP ACPI: found 14 devices
ACPI: ACPI bus type pnp unregistered
system 00:09: [io  0x0680-0x06ff] has been reserved
system 00:09: [io  0x0290-0x0297] has been reserved
system 00:0a: [io  0x03e1-0x03e7] has been reserved
system 00:0a: [io  0x04d0-0x04d1] has been reserved
system 00:0a: [io  0x0800-0x087f] has been reserved
system 00:0a: [io  0x0400-0x041f] has been reserved
system 00:0b: [mem 0xfec00000-0xfec00fff] could not be reserved
system 00:0b: [mem 0xfee00000-0xfee00fff] has been reserved
system 00:0b: [mem 0xfff80000-0xffffffff] has been reserved
system 00:0d: [mem 0x00000000-0x0009ffff] could not be reserved
system 00:0d: [mem 0x000c0000-0x000dffff] could not be reserved
system 00:0d: [mem 0x000e0000-0x000fffff] could not be reserved
system 00:0d: [mem 0x00100000-0x3ffeffff] could not be reserved
Switching to clocksource acpi_pm
PCI: max bus depth: 1 pci_try_num: 2
pci 0000:00:0c.0: BAR 9: assigned [mem 0x40000000-0x43ffffff pref]
pci 0000:00:0c.0: BAR 10: assigned [mem 0x44000000-0x47ffffff]
pci 0000:00:0c.1: BAR 9: assigned [mem 0x48000000-0x4bffffff pref]
pci 0000:00:0c.1: BAR 10: assigned [mem 0x4c000000-0x4fffffff]
pci 0000:00:0c.0: BAR 0: assigned [mem 0x50000000-0x50000fff]
pci 0000:00:0c.0: BAR 0: set to [mem 0x50000000-0x50000fff] (PCI address [0x50000000-0x50000fff]
pci 0000:00:0c.1: BAR 0: assigned [mem 0x50001000-0x50001fff]
pci 0000:00:0c.1: BAR 0: set to [mem 0x50001000-0x50001fff] (PCI address [0x50001000-0x50001fff]
pci 0000:00:0c.0: BAR 7: assigned [io  0x1000-0x10ff]
pci 0000:00:0c.0: BAR 8: assigned [io  0x1400-0x14ff]
pci 0000:00:0c.1: BAR 7: assigned [io  0x1800-0x18ff]
pci 0000:00:0c.1: BAR 8: assigned [io  0x1c00-0x1cff]
pci 0000:00:11.6: BAR 0: assigned [io  0x2000-0x20ff]
pci 0000:00:11.6: BAR 0: set to [io  0x2000-0x20ff] (PCI address [0x2000-0x20ff]
pci 0000:00:01.0: PCI bridge to [bus 03-03]
pci 0000:00:01.0:   bridge window [io  disabled]
pci 0000:00:01.0:   bridge window [mem 0xf9f00000-0xfbffffff]
pci 0000:00:01.0:   bridge window [mem 0xe0000000-0xf8ffffff pref]
pci 0000:00:0c.0: CardBus bridge to [bus 04-07]
pci 0000:00:0c.0:   bridge window [io  0x1000-0x10ff]
pci 0000:00:0c.0:   bridge window [io  0x1400-0x14ff]
pci 0000:00:0c.0:   bridge window [mem 0x40000000-0x43ffffff pref]
pci 0000:00:0c.0:   bridge window [mem 0x44000000-0x47ffffff]
pci 0000:00:0c.1: CardBus bridge to [bus 08-0b]
pci 0000:00:0c.1:   bridge window [io  0x1800-0x18ff]
pci 0000:00:0c.1:   bridge window [io  0x1c00-0x1cff]
pci 0000:00:0c.1:   bridge window [mem 0x48000000-0x4bffffff pref]
pci 0000:00:0c.1:   bridge window [mem 0x4c000000-0x4fffffff]
pci 0000:00:01.0: setting latency timer to 64
pci 0000:00:0c.0: enabling device (0140 -> 0143)
pci 0000:00:0c.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
pci 0000:00:0c.1: enabling device (0140 -> 0143)
pci 0000:00:0c.1: PCI INT B -> GSI 18 (level, low) -> IRQ 18
pci_bus 0000:00: resource 4 [io  0x0000-0xffff]
pci_bus 0000:00: resource 5 [mem 0x000a0000-0x000bffff]
pci_bus 0000:00: resource 6 [mem 0x40000000-0xffffffff]
pci_bus 0000:03: resource 1 [mem 0xf9f00000-0xfbffffff]
pci_bus 0000:03: resource 2 [mem 0xe0000000-0xf8ffffff pref]
pci_bus 0000:04: resource 0 [io  0x1000-0x10ff]
pci_bus 0000:04: resource 1 [io  0x1400-0x14ff]
pci_bus 0000:04: resource 2 [mem 0x40000000-0x43ffffff pref]
pci_bus 0000:04: resource 3 [mem 0x44000000-0x47ffffff]
pci_bus 0000:08: resource 0 [io  0x1800-0x18ff]
pci_bus 0000:08: resource 1 [io  0x1c00-0x1cff]
pci_bus 0000:08: resource 2 [mem 0x48000000-0x4bffffff pref]
pci_bus 0000:08: resource 3 [mem 0x4c000000-0x4fffffff]
NET: Registered protocol family 2
IP route cache hash table entries: 32768 (order: 5, 131072 bytes)
TCP established hash table entries: 131072 (order: 8, 1048576 bytes)
TCP bind hash table entries: 65536 (order: 7, 524288 bytes)
TCP: Hash tables configured (established 131072 bind 65536)
TCP reno registered
UDP hash table entries: 512 (order: 2, 16384 bytes)
UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
NET: Registered protocol family 1
pci 0000:00:01.0: disabling DAC on VIA PCI bridge
pci 0000:03:00.0: Boot video device
PCI: CLS 64 bytes, default 64
Trying to unpack rootfs image as initramfs...
Freeing initrd memory: 2802k freed
khelper used greatest stack depth: 3232 bytes left
audit: initializing netlink socket (disabled)
type=2000 audit(1269703391.265:1): initialized
highmem bounce pool size: 64 pages
HugeTLB registered 4 MB page size, pre-allocated 0 pages
msgmni has been set to 1748
cryptomgr_test used greatest stack depth: 2972 bytes left
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
isapnp: Scanning for PnP cards...
isapnp: No Plug & Play device found
Non-volatile memory driver v1.3
Linux agpgart interface v0.103
Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
00:0c: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
brd: module loaded
loop: module loaded
PNP: PS/2 Controller [PNP0303:PS2K,PNP0f03:PS2M] at 0x60,0x64 irq 1,12
serio: i8042 KBD port at 0x60,0x64 irq 1
serio: i8042 AUX port at 0x60,0x64 irq 12
mice: PS/2 mouse device common for all mice
input: PC Speaker as /class/input/input0
cpuidle: using governor ladder
cpuidle: using governor menu
TCP cubic registered
Initializing XFRM netlink socket
NET: Registered protocol family 10
NET: Registered protocol family 17
Using IPI No-Shortcut mode
registered taskstats version 1
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
Freeing unused kernel memory: 352k freed
Write protecting the kernel text: 2188k
Write protecting the kernel read-only data: 1184k
input: AT Translated Set 2 keyboard as /class/input/input1
SCSI subsystem initialized
libata version 3.00 loaded.
pata_via 0000:00:0f.1: version 0.3.4
pata_via 0000:00:0f.1: PCI INT A -> GSI 20 (level, low) -> IRQ 20
scsi0 : pata_via
scsi1 : pata_via
ata1: PATA max UDMA/133 cmd 0x1f0 ctl 0x3f6 bmdma 0xfc00 irq 14
ata2: PATA max UDMA/133 cmd 0x170 ctl 0x376 bmdma 0xfc08 irq 15
ata1.00: ATA-7: ST3120814A, 3.AAD, max UDMA/100
ata1.00: 234441648 sectors, multi 16: LBA48 
ata1.01: ATAPI: _NEC DVD_RW ND-3550A, 1.20, max UDMA/33
ata1.00: configured for UDMA/100
ata1.01: configured for UDMA/33
scsi 0:0:0:0: Direct-Access     ATA      ST3120814A       3.AA PQ: 0 ANSI: 5
sd 0:0:0:0: [sda] 234441648 512-byte logical blocks: (120 GB/111 GiB)
scsi 0:0:1:0: CD-ROM            _NEC     DVD_RW ND-3550A  1.20 PQ: 0 ANSI: 5
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
 sda:
input: ImPS/2 Generic Wheel Mouse as /class/input/input2
 sda1 sda2 sda3
sd 0:0:0:0: [sda] Attached SCSI disk
insmod used greatest stack depth: 2692 bytes left
sata_via 0000:00:0f.0: version 2.6
sata_via 0000:00:0f.0: PCI INT B -> GSI 20 (level, low) -> IRQ 20
sata_via 0000:00:0f.0: routed to hard irq line 10
scsi2 : sata_via
scsi3 : sata_via
ata3: SATA max UDMA/133 cmd 0xd000 ctl 0xc800 bmdma 0xb800 irq 20
ata4: SATA max UDMA/133 cmd 0xc400 ctl 0xc000 bmdma 0xb808 irq 20
ata3: SATA link down 1.5 Gbps (SStatus 0 SControl 300)
ata4: SATA link down 1.5 Gbps (SStatus 0 SControl 300)
kjournald starting.  Commit interval 5 seconds
EXT3-fs (sda2): mounted filesystem with writeback data mode
modprobe used greatest stack depth: 2224 bytes left
sd 0:0:0:0: Attached scsi generic sg0 type 0
scsi 0:0:1:0: Attached scsi generic sg1 type 5
Floppy drive(s): fd0 is 1.44M
FDC 0 is a post-1991 82077
input: Power Button as /class/input/input3
ACPI: Power Button [PWRB]
input: Sleep Button as /class/input/input4
ACPI: Sleep Button [SLPB]
input: Power Button as /class/input/input5
ACPI: Power Button [PWRF]
yenta_cardbus 0000:00:0c.0: CardBus bridge found [1195:02a2]
yenta_cardbus 0000:00:0c.0: Enabling burst memory read transactions
yenta_cardbus 0000:00:0c.0: Using CSCINT to route CSC interrupts to PCI
yenta_cardbus 0000:00:0c.0: Routing CardBus interrupts to PCI
yenta_cardbus 0000:00:0c.0: TI: mfunc 0x0cb91522, devctl 0x66
sr0: scsi3-mmc drive: 48x/48x writer cd/rw xa/form2 cdda tray
Uniform CD-ROM driver Revision: 3.20
sr 0:0:1:0: Attached scsi CD-ROM sr0
yenta_cardbus 0000:00:0c.0: ISA IRQ mask 0x0000, PCI irq 17
yenta_cardbus 0000:00:0c.0: Socket status: 30000006
yenta_cardbus 0000:00:0c.1: CardBus bridge found [1195:02a2]
yenta_cardbus 0000:00:0c.1: Using CSCINT to route CSC interrupts to PCI
yenta_cardbus 0000:00:0c.1: Routing CardBus interrupts to PCI
yenta_cardbus 0000:00:0c.1: TI: mfunc 0x0cb91522, devctl 0x66
yenta_cardbus 0000:00:0c.1: ISA IRQ mask 0x0000, PCI irq 18
yenta_cardbus 0000:00:0c.1: Socket status: 30000006
pcmcia_socket pcmcia_socket1: cs: IO port probe 0x100-0x3af: clean.
pcmcia_socket pcmcia_socket1: cs: IO port probe 0x3e0-0x4ff: clean.
pcmcia_socket pcmcia_socket1: cs: IO port probe 0x820-0x8ff: clean.
pcmcia_socket pcmcia_socket1: cs: IO port probe 0xc00-0xcf7: clean.
pcmcia_socket pcmcia_socket1: cs: memory probe 0x0c0000-0x0fffff: excluding 0xc0000-0xfffff
pcmcia_socket pcmcia_socket1: cs: memory probe 0xa0000000-0xa0ffffff: clean.
pcmcia_socket pcmcia_socket1: cs: memory probe 0x60000000-0x60ffffff: clean.
pcmcia_socket pcmcia_socket1: cs: IO port probe 0xa00-0xaff: clean.
pcmcia_socket pcmcia_socket0: cs: IO port probe 0x100-0x3af: clean.
pcmcia_socket pcmcia_socket0: cs: IO port probe 0x3e0-0x4ff: clean.
pcmcia_socket pcmcia_socket0: cs: IO port probe 0x820-0x8ff: clean.
pcmcia_socket pcmcia_socket0: cs: IO port probe 0xc00-0xcf7: clean.
pcmcia_socket pcmcia_socket0: cs: memory probe 0x0c0000-0x0fffff: excluding 0xc0000-0xfffff
pcmcia_socket pcmcia_socket0: cs: memory probe 0xa0000000-0xa0ffffff: clean.
pcmcia_socket pcmcia_socket0: cs: memory probe 0x60000000-0x60ffffff: clean.
pcmcia_socket pcmcia_socket0: cs: IO port probe 0xa00-0xaff: clean.
EXT3-fs (sda2): using internal journal
Adding 4578520k swap on /dev/sda3.  Priority:-1 extents:1 across:4578520k 
rc.sysinit used greatest stack depth: 2036 bytes left


From komurojun-mbn at nifty.com  Sat Mar 27 20:49:33 2010
From: komurojun-mbn at nifty.com (Komuro)
Date: Sun, 28 Mar 2010 09:49:33 +0900
Subject: [kernel 2.6.34-rc2] cs: IO port probe 0x100-0x3af: excluding
	0x378-0x37f
In-Reply-To: <20100328090859.ffc1e335.komurojun-mbn@nifty.com>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<1257971899-9274-9-git-send-email-linux@dominikbrodowski.net>
	<20091213212556.03d83e1f.komurojun-mbn@nifty.com>
	<20100228153933.f6fe6f81.komurojun-mbn@nifty.com>
	<20100320063919.f7cd4421.komurojun-mbn@nifty.com>
	<20100321065539.57cb2c96.komurojun-mbn@nifty.com>
	<20100322094022.742e85a9.komurojun-mbn@nifty.com>
	<20100322183832.f07b9191.komurojun-mbn@nifty.com>
	<20100323222956.f7f83e83.komurojun-mbn@nifty.com>
	<20100327153525.f8ec12d2.komurojun-mbn@nifty.com>
	<20100328090859.ffc1e335.komurojun-mbn@nifty.com>
Message-ID: <20100328094933.7a8b9271.komurojun-mbn@nifty.com>


Hi,

>Can't see how this is a real PCMCIA issue here...

You are right.
do_io_probe (in rsrc_nonstatic.c) is not changed between 2.6.33 and 2.6.34-rc2...



From linux at arm.linux.org.uk  Sun Mar 28 05:44:08 2010
From: linux at arm.linux.org.uk (Russell King - ARM Linux)
Date: Sun, 28 Mar 2010 10:44:08 +0100
Subject: [PATCH 2/2] ARM: pcmcia: fix checkpatch.pl issues in soc_common.c
In-Reply-To: <20100325170440.GC5424@comet.dominikbrodowski.net>
References: <1269471898-26301-2-git-send-email-mroberto@cpti.cetuc.puc-rio.br>
	<1269474310-13970-1-git-send-email-mroberto@cpti.cetuc.puc-rio.br>
	<20100325170440.GC5424@comet.dominikbrodowski.net>
Message-ID: <20100328094408.GA23048@n2100.arm.linux.org.uk>

On Thu, Mar 25, 2010 at 06:04:40PM +0100, Dominik Brodowski wrote:
> do you prefer me pushing these patches upstream (possibly even for -rc3), or
> do you wish to take these patches?

I'll take them through the patch system, but as they're not bug fixes
I'd queue them for the next merge window.


From linux at dominikbrodowski.net  Sun Mar 28 05:46:50 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Sun, 28 Mar 2010 11:46:50 +0200
Subject: [PATCH 2/2] ARM: pcmcia: fix checkpatch.pl issues in soc_common.c
In-Reply-To: <20100328094408.GA23048@n2100.arm.linux.org.uk>
References: <1269471898-26301-2-git-send-email-mroberto@cpti.cetuc.puc-rio.br>
	<1269474310-13970-1-git-send-email-mroberto@cpti.cetuc.puc-rio.br>
	<20100325170440.GC5424@comet.dominikbrodowski.net>
	<20100328094408.GA23048@n2100.arm.linux.org.uk>
Message-ID: <20100328094650.GA24007@isilmar.linta.de>

On Sun, Mar 28, 2010 at 10:44:08AM +0100, Russell King - ARM Linux wrote:
> On Thu, Mar 25, 2010 at 06:04:40PM +0100, Dominik Brodowski wrote:
> > do you prefer me pushing these patches upstream (possibly even for -rc3), or
> > do you wish to take these patches?
> 
> I'll take them through the patch system, but as they're not bug fixes
> I'd queue them for the next merge window.

Excellent, thanks a lot.

Best,
	Dominik


From bugzilla-daemon at bugzilla.kernel.org  Sun Mar 28 05:58:44 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Sun, 28 Mar 2010 09:58:44 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@https.bugzilla.kernel.org/>
References: <bug-7304-4463@https.bugzilla.kernel.org/>
Message-ID: <201003280958.o2S9wid6003714@demeter.kernel.org>

https://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #87 from Thomas Nemeth <nemeth.thomas at gmail.com>  2010-03-28 09:58:35 ---
Created an attachment (id=25738)
 --> (https://bugzilla.kernel.org/attachment.cgi?id=25738)
Boot messages for 2.6.34-rc2 with applied patch

No slot worked :(

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From bugzilla-daemon at bugzilla.kernel.org  Sun Mar 28 07:54:29 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Sun, 28 Mar 2010 11:54:29 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@https.bugzilla.kernel.org/>
References: <bug-7304-4463@https.bugzilla.kernel.org/>
Message-ID: <201003281154.o2SBsTVd004359@demeter.kernel.org>

https://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #88 from Dominik Brodowski <linux at brodo.de>  2010-03-28 11:54:21 ---
Thanks. Both sockets look properly configured (for PCI IRQ = 11); the
workaround (trying to use ISA IRQs for PCI) does not work as expected -- at
least from what I determine out of the ToPIC97 datasheet found at the pcmcia-cs
homepage. :(

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From linux at dominikbrodowski.net  Sun Mar 28 07:45:59 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Sun, 28 Mar 2010 13:45:59 +0200
Subject: pci_bus_for_each_resource, transparent bridges and
	rsrc_nonstatic.c
In-Reply-To: <20100327190340.27310.qmail@stuge.se>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<201003221628.56232.bjorn.helgaas@hp.com>
	<20100322225235.GA29522@isilmar.linta.de>
	<201003221711.34997.bjorn.helgaas@hp.com>
	<20100322232800.GA532@isilmar.linta.de>
	<20100327190340.27310.qmail@stuge.se>
Message-ID: <20100328114559.GA2504@comet.dominikbrodowski.net>


On Sat, Mar 27, 2010 at 08:03:40PM +0100, Peter Stuge wrote:
> Dominik Brodowski wrote:
> > can we safely trust BIOS authors to get it right?
> 
> As a long time member of the coreboot project I can assure you that
> the answer to that is "No!!"

Thanks. Jesse, Bjorn: recalling my mesage of 22 March 2010, what's your
opinion on the two options spelled out there:

| (1) The best way seems to be to skip all resources of type
| PCI_SUBTRACTIVE_DECODE, but this flag is only stored in
| struct pci_bus_resource, which is hard to access, and nonexistent for the
| first four resources. Actually, the "flag" field is unused otherwise. Could
| we set res->flags |= PCI_SUBTRACTIVE_DECODE instead? (it probably needs to
| be != 0x1 then, but anyways). Then it's trivial in rsrc_nonstatic.c
| 
| (2) An alternative would be to
|
| diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c
| index ba3a53e..b0e60a1 100644
| --- a/drivers/pcmcia/rsrc_nonstatic.c
| +++ b/drivers/pcmcia/rsrc_nonstatic.c
| @@ -933,7 +933,8 @@ static int nonstatic_autoadd_resources(struct pcmcia_socket *s)
|                 return -EINVAL;
|  #endif
| 
| -       pci_bus_for_each_resource(s->cb_dev->bus, res, i) {
| +       for (i = 0; i < PCI_BRIDGE_RESOURCE_NUM; i++) {
| +               res = s->cb_dev->bus->resource[i];
|                 if (!res)
|                         continue;

Best,
	Dominik


From cjwatson at debian.org  Sun Mar 28 20:59:59 2010
From: cjwatson at debian.org (Colin Watson)
Date: Mon, 29 Mar 2010 01:59:59 +0100
Subject: [PATCH] Don't link pcmcia-check-broken-cis against libsysfs
Message-ID: <20100329005959.GA22333@riva.ucam.org>

It uses the SYSFS_PATH_MAX macro from <sysfs/libsysfs.h>, but nothing
that requires run-time linkage.

Signed-off-by: Colin Watson <cjwatson at debian.org>
---
 Makefile |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 26f3e4b..a265873 100644
--- a/Makefile
+++ b/Makefile
@@ -150,10 +150,12 @@ CFLAGS +=	-I$(PWD)/src
 CFLAGS += $(WARNINGS) -I$(GCCINCDIR)
 
 LIB_OBJS = -lc -lsysfs
+LIB_PLAIN_OBJS = -lc
 LIB_PCI_OBJS = -lc -lpci
 
 ifeq ($(strip $(STATIC)),true)
 	LIB_OBJS = -lsysfs
+	LIB_PLAIN_OBJS =
 	LIB_PCI_OBJS = -lpci
 	LDFLAGS += -static
 else
@@ -230,7 +232,7 @@ $(PCCARDCTL): $(LIBC) src/$(PCCARDCTL).o src/$(PCCARDCTL).c $(OBJS) $(HEADERS)
 	$(QUIET) $(STRIPCMD) $@
 
 $(PCMCIA_CHECK_BROKEN_CIS): $(LIBC) src/$(PCMCIA_CHECK_BROKEN_CIS).o src/read-cis.o $(OBJS) $(HEADERS)
-	$(QUIET) $(LD) $(LDFLAGS) -o $@ $(CRT0) src/$(PCMCIA_CHECK_BROKEN_CIS).o src/read-cis.o $(LIB_OBJS) $(ARCH_LIB_OBJS)
+	$(QUIET) $(LD) $(LDFLAGS) -o $@ $(CRT0) src/$(PCMCIA_CHECK_BROKEN_CIS).o src/read-cis.o $(LIB_PLAIN_OBJS) $(ARCH_LIB_OBJS)
 	$(QUIET) $(STRIPCMD) $@
 
 $(PCMCIA_SOCKET_STARTUP): $(LIBC) src/startup.o src/yacc_config.o src/lex_config.o $(OBJS) $(HEADERS)
-- 
1.7.0.2


From scott.thomson at motec.com.au  Mon Mar 29 01:16:14 2010
From: scott.thomson at motec.com.au (Scott Thomson)
Date: Mon, 29 Mar 2010 16:16:14 +1100
Subject: exca_readw returning wrong type
Message-ID: <4BB0379E.7090600@motec.com.au>

I have been developing in 2.4.25 and found that exca_readw returns u8 
instead of u16. Looks like this is still a bug. This seems pretty 
obvious so am I missing something?
Thanks



From scott.thomson at motec.com.au  Mon Mar 29 01:29:13 2010
From: scott.thomson at motec.com.au (Scott Thomson)
Date: Mon, 29 Mar 2010 16:29:13 +1100
Subject: exca_readw returning wrong type
In-Reply-To: <4BB0379E.7090600@motec.com.au>
References: <4BB0379E.7090600@motec.com.au>
Message-ID: <4BB03AA9.7050003@motec.com.au>

Never mind. Looks like it isn't even used anymore.

Scott Thomson wrote:
> I have been developing in 2.4.25 and found that exca_readw returns u8 
> instead of u16. Looks like this is still a bug. This seems pretty 
> obvious so am I missing something?
> Thanks
>
>
> _______________________________________________
> Linux PCMCIA reimplementation list
> http://lists.infradead.org/mailman/listinfo/linux-pcmcia
>


From bugzilla-daemon at bugzilla.kernel.org  Mon Mar 29 04:46:25 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Mon, 29 Mar 2010 08:46:25 GMT
Subject: [Bug 15621] BUG: unable to handle kernel paging request  - comm:
	pccardd
In-Reply-To: <bug-15621-4463@https.bugzilla.kernel.org/>
References: <bug-15621-4463@https.bugzilla.kernel.org/>
Message-ID: <201003290846.o2T8kPuY018844@demeter.kernel.org>

https://bugzilla.kernel.org/show_bug.cgi?id=15621





--- Comment #7 from Ozgur Yuksel <ozgur.yuksel at oracle.com>  2010-03-29 08:46:20 ---
Created an attachment (id=25755)
 --> (https://bugzilla.kernel.org/attachment.cgi?id=25755)
Serial console log with pci=nocrs set

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From bugzilla-daemon at bugzilla.kernel.org  Mon Mar 29 05:08:21 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Mon, 29 Mar 2010 09:08:21 GMT
Subject: [Bug 15621] BUG: unable to handle kernel paging request  - comm:
	pccardd
In-Reply-To: <bug-15621-4463@https.bugzilla.kernel.org/>
References: <bug-15621-4463@https.bugzilla.kernel.org/>
Message-ID: <201003290908.o2T98Luu024833@demeter.kernel.org>

https://bugzilla.kernel.org/show_bug.cgi?id=15621





--- Comment #8 from Ozgur Yuksel <ozgur.yuksel at oracle.com>  2010-03-29 09:08:06 ---
Created an attachment (id=25756)
 --> (https://bugzilla.kernel.org/attachment.cgi?id=25756)
dmesg iomem ioports acpidump outputs

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From bugzilla-daemon at bugzilla.kernel.org  Mon Mar 29 05:13:36 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Mon, 29 Mar 2010 09:13:36 GMT
Subject: [Bug 15621] BUG: unable to handle kernel paging request  - comm:
	pccardd
In-Reply-To: <bug-15621-4463@https.bugzilla.kernel.org/>
References: <bug-15621-4463@https.bugzilla.kernel.org/>
Message-ID: <201003290913.o2T9DaJL026193@demeter.kernel.org>

https://bugzilla.kernel.org/show_bug.cgi?id=15621





--- Comment #9 from Ozgur Yuksel <ozgur.yuksel at oracle.com>  2010-03-29 09:13:32 ---
Thu, Mar 25, 2010 at 06:01:38PM +0100 was the time for Dominik Brodowski to
speak thus:
> 
> On Thu, Mar 25, 2010 at 10:51:39AM -0600, Bjorn Helgaas wrote:
> > > It looks like the iomem_resource tree got wrecked.  Has anyone been
> > > changing anything in there lately?
> > 
> > My pci=use_crs patches change the contents of the iomem_resource tree,
> > and it's possible they broke some assumptions PCMCIA was making, so
> > you might see if "pci=nocrs" makes any difference.  If it does, please
> > attach an acpidump and the entire dmesg logs with and without that option.
> 
> ... and /proc/iomem as well as /proc/ioports , please.
Using pci=nocrs workarounds the problem. For data collection, since the boot
does not complete without the w/a - only dmesg is available. 

With pci=nocrs, accessing /proc/iomem gets killed by kernel for some reason.

/proc/iomem /proc/ioports and acpidump are provided for 2.6.31-20-generic-pae
kernel for convenience / comparison.

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From linux at dominikbrodowski.net  Mon Mar 29 09:13:17 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 29 Mar 2010 15:13:17 +0200
Subject: [PATCH] Don't link pcmcia-check-broken-cis against libsysfs
In-Reply-To: <20100329005959.GA22333@riva.ucam.org>
References: <20100329005959.GA22333@riva.ucam.org>
Message-ID: <20100329131317.GA5557@comet.dominikbrodowski.net>

On Mon, Mar 29, 2010 at 01:59:59AM +0100, Colin Watson wrote:
> It uses the SYSFS_PATH_MAX macro from <sysfs/libsysfs.h>, but nothing
> that requires run-time linkage.
> 
> Signed-off-by: Colin Watson <cjwatson at debian.org>

Applied, thanks.

Best,
	Dominik


From julia at diku.dk  Mon Mar 29 11:35:24 2010
From: julia at diku.dk (Julia Lawall)
Date: Mon, 29 Mar 2010 17:35:24 +0200 (CEST)
Subject: [PATCH 7/12] drivers/pcmcia: Add missing local_irq_restore
Message-ID: <Pine.LNX.4.64.1003291735050.21896@ask.diku.dk>

From: Julia Lawall <julia at diku.dk>

Use local_irq_restore in this error-handling case just like in the one just
below.

A simplified version of the semantic patch that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
expression E1;
identifier f;
@@

f (...) { <+...
* local_irq_save (E1,...);
... when != E1
* return ...;
...+> }
// </smpl>

Signed-off-by: Julia Lawall <julia at diku.dk>

---
 drivers/pcmcia/db1xxx_ss.c          |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/pcmcia/db1xxx_ss.c b/drivers/pcmcia/db1xxx_ss.c
index a520193..a3fec01 100644
--- a/drivers/pcmcia/db1xxx_ss.c
+++ b/drivers/pcmcia/db1xxx_ss.c
@@ -165,8 +165,10 @@ static int db1x_pcmcia_setup_irqs(struct db1x_pcmcia_sock *sock)
 
 		ret = request_irq(sock->insert_irq, db1200_pcmcia_cdirq,
 				  IRQF_DISABLED, "pcmcia_insert", sock);
-		if (ret)
+		if (ret) {
+			local_irq_restore(flags);
 			goto out1;
+		}
 
 		ret = request_irq(sock->eject_irq, db1200_pcmcia_cdirq,
 				  IRQF_DISABLED, "pcmcia_eject", sock);


From jbarnes at virtuousgeek.org  Mon Mar 29 12:41:37 2010
From: jbarnes at virtuousgeek.org (Jesse Barnes)
Date: Mon, 29 Mar 2010 09:41:37 -0700
Subject: pci_bus_for_each_resource, transparent bridges and
	rsrc_nonstatic.c
In-Reply-To: <20100328114559.GA2504@comet.dominikbrodowski.net>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<201003221628.56232.bjorn.helgaas@hp.com>
	<20100322225235.GA29522@isilmar.linta.de>
	<201003221711.34997.bjorn.helgaas@hp.com>
	<20100322232800.GA532@isilmar.linta.de>
	<20100327190340.27310.qmail@stuge.se>
	<20100328114559.GA2504@comet.dominikbrodowski.net>
Message-ID: <20100329094137.25a0e695@jbarnes-piketon>

On Sun, 28 Mar 2010 13:45:59 +0200
Dominik Brodowski <linux at dominikbrodowski.net> wrote:

> 
> On Sat, Mar 27, 2010 at 08:03:40PM +0100, Peter Stuge wrote:
> > Dominik Brodowski wrote:
> > > can we safely trust BIOS authors to get it right?
> > 
> > As a long time member of the coreboot project I can assure you that
> > the answer to that is "No!!"
> 
> Thanks. Jesse, Bjorn: recalling my mesage of 22 March 2010, what's your
> opinion on the two options spelled out there:
> 
> | (1) The best way seems to be to skip all resources of type
> | PCI_SUBTRACTIVE_DECODE, but this flag is only stored in
> | struct pci_bus_resource, which is hard to access, and nonexistent for the
> | first four resources. Actually, the "flag" field is unused otherwise. Could
> | we set res->flags |= PCI_SUBTRACTIVE_DECODE instead? (it probably needs to
> | be != 0x1 then, but anyways). Then it's trivial in rsrc_nonstatic.c
> | 
> | (2) An alternative would be to
> |
> | diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c
> | index ba3a53e..b0e60a1 100644
> | --- a/drivers/pcmcia/rsrc_nonstatic.c
> | +++ b/drivers/pcmcia/rsrc_nonstatic.c
> | @@ -933,7 +933,8 @@ static int nonstatic_autoadd_resources(struct pcmcia_socket *s)
> |                 return -EINVAL;
> |  #endif
> | 
> | -       pci_bus_for_each_resource(s->cb_dev->bus, res, i) {
> | +       for (i = 0; i < PCI_BRIDGE_RESOURCE_NUM; i++) {
> | +               res = s->cb_dev->bus->resource[i];
> |                 if (!res)
> |                         continue;

It would be nice to avoid pushing subtractive decode into the generic
resource code, since it's pretty PCI specific, but the second hunk
looks ok.  Alternatively we could add a field to the bus struct for you
to check.

-- 
Jesse Barnes, Intel Open Source Technology Center


From linux at dominikbrodowski.net  Mon Mar 29 15:47:03 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 29 Mar 2010 21:47:03 +0200
Subject: pci_bus_for_each_resource, transparent bridges and
	rsrc_nonstatic.c
In-Reply-To: <20100329094137.25a0e695@jbarnes-piketon>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<201003221628.56232.bjorn.helgaas@hp.com>
	<20100322225235.GA29522@isilmar.linta.de>
	<201003221711.34997.bjorn.helgaas@hp.com>
	<20100322232800.GA532@isilmar.linta.de>
	<20100327190340.27310.qmail@stuge.se>
	<20100328114559.GA2504@comet.dominikbrodowski.net>
	<20100329094137.25a0e695@jbarnes-piketon>
Message-ID: <20100329194703.GC8450@comet.dominikbrodowski.net>

On Mon, Mar 29, 2010 at 09:41:37AM -0700, Jesse Barnes wrote:
> On Sun, 28 Mar 2010 13:45:59 +0200
> Dominik Brodowski <linux at dominikbrodowski.net> wrote:
> 
> > 
> > On Sat, Mar 27, 2010 at 08:03:40PM +0100, Peter Stuge wrote:
> > > Dominik Brodowski wrote:
> > > > can we safely trust BIOS authors to get it right?
> > > 
> > > As a long time member of the coreboot project I can assure you that
> > > the answer to that is "No!!"
> > 
> > Thanks. Jesse, Bjorn: recalling my mesage of 22 March 2010, what's your
> > opinion on the two options spelled out there:
> > 
> > | (1) The best way seems to be to skip all resources of type
> > | PCI_SUBTRACTIVE_DECODE, but this flag is only stored in
> > | struct pci_bus_resource, which is hard to access, and nonexistent for the
> > | first four resources. Actually, the "flag" field is unused otherwise. Could
> > | we set res->flags |= PCI_SUBTRACTIVE_DECODE instead? (it probably needs to
> > | be != 0x1 then, but anyways). Then it's trivial in rsrc_nonstatic.c
> > | 
> > | (2) An alternative would be to
> > |
> > | diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c
> > | index ba3a53e..b0e60a1 100644
> > | --- a/drivers/pcmcia/rsrc_nonstatic.c
> > | +++ b/drivers/pcmcia/rsrc_nonstatic.c
> > | @@ -933,7 +933,8 @@ static int nonstatic_autoadd_resources(struct pcmcia_socket *s)
> > |                 return -EINVAL;
> > |  #endif
> > | 
> > | -       pci_bus_for_each_resource(s->cb_dev->bus, res, i) {
> > | +       for (i = 0; i < PCI_BRIDGE_RESOURCE_NUM; i++) {
> > | +               res = s->cb_dev->bus->resource[i];
> > |                 if (!res)
> > |                         continue;
> 
> It would be nice to avoid pushing subtractive decode into the generic
> resource code, since it's pretty PCI specific

Well, isn't that what 
#define IORESOURCE_BITS         0x000000ff      /* Bus-specific bits */
are for; and at least PCI ROM control bits are already defined in
include/linux/ioport.h . Still, I'm perfectly fine with the second approach:

From: Dominik Brodowski <linux at dominikbrodowski.net>
Date: Mon, 29 Mar 2010 21:40:35 +0200
Subject: [PATCH] pcmcia: do not autoadd root PCI bus resources

On the PCI root bus on the x86 architecture, the risk of hitting
some strange system devices which aren't protected by either ACPI
resource tables or properly requested resources is too big. In
the past, we were protected by the PCI root bridge being set to
&iomem_resource or &ioport_resource. However, on systems where CRS
is enabled, this no longer is true. Therefore, only loop over the
first (non-subtractive) resources of the upstream PCI bus brdige.

CC: Jesse Barnes <jbarnes at virtuousgeek.org>
CC: Bjorn Helgaas <bjorn.helgaas at hp.com>
Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>

diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c
index 39c89e1..ad68e53 100644
--- a/drivers/pcmcia/rsrc_nonstatic.c
+++ b/drivers/pcmcia/rsrc_nonstatic.c
@@ -940,7 +940,8 @@ static int nonstatic_autoadd_resources(struct pcmcia_socket *s)
 		return -EINVAL;
 #endif
 
-	pci_bus_for_each_resource(s->cb_dev->bus, res, i) {
+	for (i = 0; i < PCI_BRIDGE_RESOURCE_NUM; i++) {
+		res = s->cb_dev->bus->resource[i];
 		if (!res)
 			continue;
 


From jeff at garzik.org  Mon Mar 29 16:15:16 2010
From: jeff at garzik.org (Jeff Garzik)
Date: Mon, 29 Mar 2010 16:15:16 -0400
Subject: [RFC PATCH 19/19] pata_pcmcia: get rid of extra indirection
In-Reply-To: <1269212857-25364-19-git-send-email-linux@dominikbrodowski.net>
References: <20100321230617.GA24791@comet.dominikbrodowski.net>
	<1269212857-25364-19-git-send-email-linux@dominikbrodowski.net>
Message-ID: <4BB10A54.30108@garzik.org>

On 03/21/2010 07:07 PM, Dominik Brodowski wrote:
> We don't need ata_pcmcia_info any more.
>
> CC: linux-ide at vger.kernel.org
> Signed-off-by: Dominik Brodowski<linux at dominikbrodowski.net>
> ---
>   drivers/ata/pata_pcmcia.c |   41 ++++++-----------------------------------
>   1 files changed, 6 insertions(+), 35 deletions(-)

Acked-by: Jeff Garzik <jgarzik at redhat.com>




From bjorn.helgaas at hp.com  Mon Mar 29 19:33:13 2010
From: bjorn.helgaas at hp.com (Bjorn Helgaas)
Date: Mon, 29 Mar 2010 17:33:13 -0600
Subject: pci_bus_for_each_resource, transparent bridges and
	rsrc_nonstatic.c
In-Reply-To: <20100329194703.GC8450@comet.dominikbrodowski.net>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<201003221628.56232.bjorn.helgaas@hp.com>
	<20100322225235.GA29522@isilmar.linta.de>
	<201003221711.34997.bjorn.helgaas@hp.com>
	<20100322232800.GA532@isilmar.linta.de>
	<20100327190340.27310.qmail@stuge.se>
	<20100328114559.GA2504@comet.dominikbrodowski.net>
	<20100329094137.25a0e695@jbarnes-piketon>
	<20100329194703.GC8450@comet.dominikbrodowski.net>
Message-ID: <1269905593.10752.73.camel@dc7800.home>

On Mon, 2010-03-29 at 21:47 +0200, Dominik Brodowski wrote:

> On the PCI root bus on the x86 architecture, the risk of hitting
> some strange system devices which aren't protected by either ACPI
> resource tables or properly requested resources is too big. In
> the past, we were protected by the PCI root bridge being set to
> &iomem_resource or &ioport_resource. However, on systems where CRS
> is enabled, this no longer is true. Therefore, only loop over the
> first (non-subtractive) resources of the upstream PCI bus brdige.
> 
> CC: Jesse Barnes <jbarnes at virtuousgeek.org>
> CC: Bjorn Helgaas <bjorn.helgaas at hp.com>
> Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
> 
> diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c
> index 39c89e1..ad68e53 100644
> --- a/drivers/pcmcia/rsrc_nonstatic.c
> +++ b/drivers/pcmcia/rsrc_nonstatic.c
> @@ -940,7 +940,8 @@ static int nonstatic_autoadd_resources(struct pcmcia_socket *s)
>  		return -EINVAL;
>  #endif
>  
> -	pci_bus_for_each_resource(s->cb_dev->bus, res, i) {
> +	for (i = 0; i < PCI_BRIDGE_RESOURCE_NUM; i++) {
> +		res = s->cb_dev->bus->resource[i];
>  		if (!res)
>  			continue;

I think you are just trying to avoid allocating resources that are
likely to collide with a system device we don't know about.  But I don't
think any of this code expresses that intent very clearly.

Avoiding this kind of collision only requires that you identify the
range you want to avoid; it has nothing to do with whether a bridge
window is &iomem_resource or &ioport_resource or whether it is
subtractively decoded.  Obviously, you have something more in mind,
since 9713ab28 already avoids ports < 0x100.  

Here's a topology where I think you would want to pay attention to the
subtractively decoded window forwarded to bus 01:

  host bridge window [io  0x4000-0x4fff] to bus 00
    00:00.0 PCI bridge to bus 01 (subtractive decode mode)
      01:00.0 CardBus bridge to bus 02

As an aside, even if the BIOS provided perfect ACPI resource
information, Linux would happily ignore almost all of it, since the
Linux/ACPI core doesn't even look at those resource descriptions, and
while PNPACPI does evaluate _CRS methods, it never puts any of the
information in the resource trees.  It's only when a driver claims a
device and reserves its resources that those resources become visible to
the rest of the system.  So it's all well and good to acknowledge that
BIOSes often have bugs, but we're on pretty shaky ground in Linux, too.

Bjorn




From linux at dominikbrodowski.net  Tue Mar 30 02:51:11 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Tue, 30 Mar 2010 08:51:11 +0200
Subject: pci_bus_for_each_resource, transparent bridges and
	rsrc_nonstatic.c
In-Reply-To: <1269905593.10752.73.camel@dc7800.home>
References: <20091111203303.GA7939@comet.dominikbrodowski.net>
	<201003221628.56232.bjorn.helgaas@hp.com>
	<20100322225235.GA29522@isilmar.linta.de>
	<201003221711.34997.bjorn.helgaas@hp.com>
	<20100322232800.GA532@isilmar.linta.de>
	<20100327190340.27310.qmail@stuge.se>
	<20100328114559.GA2504@comet.dominikbrodowski.net>
	<20100329094137.25a0e695@jbarnes-piketon>
	<20100329194703.GC8450@comet.dominikbrodowski.net>
	<1269905593.10752.73.camel@dc7800.home>
Message-ID: <20100330065111.GB4498@comet.dominikbrodowski.net>

> Avoiding this kind of collision only requires that you identify the
> range you want to avoid; it has nothing to do with whether a bridge
> window is &iomem_resource or &ioport_resource or whether it is
> subtractively decoded. 

Well, it's actually not only a range I want to avoid, it's _anything_ which
is not made available exclusively for the secondary PCI bus. It seems to me
that such secondary PCI buses are usually well enumerated, all resource
users well known PCI devices etc.

> Here's a topology where I think you would want to pay attention to the
> subtractively decoded window forwarded to bus 01:
> 
>   host bridge window [io  0x4000-0x4fff] to bus 00
>     00:00.0 PCI bridge to bus 01 (subtractive decode mode)
>       01:00.0 CardBus bridge to bus 02

Exactly.

> As an aside, even if the BIOS provided perfect ACPI resource
> information, Linux would happily ignore almost all of it, since the
> Linux/ACPI core doesn't even look at those resource descriptions, and
> while PNPACPI does evaluate _CRS methods, it never puts any of the
> information in the resource trees.  It's only when a driver claims a
> device and reserves its resources that those resources become visible to
> the rest of the system.  So it's all well and good to acknowledge that
> BIOSes often have bugs, but we're on pretty shaky ground in Linux, too.

Thanks for the clarification.

From: Dominik Brodowski <linux at dominikbrodowski.net>
Date: Mon, 29 Mar 2010 21:40:35 +0200
Subject: [PATCH] pcmcia: do not autoadd root PCI bus resources

On the PCI root bus on the x86 architecture, the risk of hitting
some strange system devices is too high: If a driver isn't loaded,
the resources are not claimed; even if a driver is loaded, it
may not request all resources or even the wrong one. We can neither
trust the rest of the kernel nor ACPI/PNP and CRS parsing to get it
right.

Therefore, explicitly spell out what safeguards we provide, and add
a safeguard to only use resources which are set up exclusively for
the secondary PCI bus (non-subtractive mode): the risk of hitting
system devices is quite low, as they usually aren't connected to
the secondary PCI bus.

CC: Jesse Barnes <jbarnes at virtuousgeek.org>
CC: Bjorn Helgaas <bjorn.helgaas at hp.com>
Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>

diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c
index 39c89e1..bfb2774 100644
--- a/drivers/pcmcia/rsrc_nonstatic.c
+++ b/drivers/pcmcia/rsrc_nonstatic.c
@@ -930,23 +930,42 @@ static int nonstatic_autoadd_resources(struct pcmcia_socket *s)
 		return -ENODEV;
 
 #if defined(CONFIG_X86)
-	/* If this is the root bus, the risk of hitting
-	 * some strange system devices which aren't protected
-	 * by either ACPI resource tables or properly requested
-	 * resources is too big. Therefore, don't do auto-adding
-	 * of resources at the moment.
+	/* If this is the root bus, the risk of hitting some strange
+	 * system devices is too high: If a driver isn't loaded, the
+	 * resources are not claimed; even if a driver is loaded, it
+	 * may not request all resources or even the wrong one. We
+	 * can neither trust the rest of the kernel nor ACPI/PNP and
+	 * CRS parsing to get it right. Therefore, use several
+	 * safeguards:
+	 *
+	 * - Do not auto-add resources if the CardBus bridge is on 
+	 *   the PCI root bus
+	 *
+	 * - Avoid any I/O ports < 0x100.
+	 *
+	 * - On PCI-PCI bridges, only use resources which are set up
+	 *   exclusively for the secondary PCI bus: the risk of hitting
+	 *   system devices is quite low, as they usually aren't
+	 *   connected to the secondary PCI bus.
 	 */
 	if (s->cb_dev->bus->number == 0)
 		return -EINVAL;
-#endif
 
+	for (i = 0; i < PCI_BRIDGE_RESOURCE_NUM; i++) {
+		res = s->cb_dev->bus->resource[i];
+#else
 	pci_bus_for_each_resource(s->cb_dev->bus, res, i) {
+#endif
 		if (!res)
 			continue;
 
 		if (res->flags & IORESOURCE_IO) {
+			/* safeguard against the root resource, where the
+			 * risk of hitting any other device would be too
+			 * high */
 			if (res == &ioport_resource)
 				continue;
+
 			dev_printk(KERN_INFO, &s->cb_dev->dev,
 				   "pcmcia: parent PCI bridge window: %pR\n",
 				   res);
@@ -956,8 +975,12 @@ static int nonstatic_autoadd_resources(struct pcmcia_socket *s)
 		}
 
 		if (res->flags & IORESOURCE_MEM) {
+			/* safeguard against the root resource, where the
+			 * risk of hitting any other device would be too
+			 * high */
 			if (res == &iomem_resource)
 				continue;
+
 			dev_printk(KERN_INFO, &s->cb_dev->dev,
 				   "pcmcia: parent PCI bridge window: %pR\n",
 				   res);


From mroberto at cpti.cetuc.puc-rio.br  Tue Mar 30 14:14:39 2010
From: mroberto at cpti.cetuc.puc-rio.br (Marcelo Roberto Jimenez)
Date: Tue, 30 Mar 2010 15:14:39 -0300
Subject: [PATCH] ARM: pcmcia: Adds nanoEngine PCMCIA support.
Message-ID: <1269972879-27400-1-git-send-email-mroberto@cpti.cetuc.puc-rio.br>

This patch adds nanoEngine PCMCIA support, with support for two sockets.

In order to have a fully functional pcmcia subsystem in a BSE nanoEngine board
you should carefully read this:

http://cambuca.ldhs.cetuc.puc-rio.br/nanoengine/

Signed-off-by: Marcelo Roberto Jimenez <mroberto at cpti.cetuc.puc-rio.br>
---
 arch/arm/mach-sa1100/include/mach/nanoengine.h |   30 ++++
 arch/arm/mach-sa1100/nanoengine.c              |    2 +-
 drivers/pcmcia/Makefile                        |    1 +
 drivers/pcmcia/sa1100_generic.c                |    3 +
 drivers/pcmcia/sa1100_generic.h                |    1 +
 drivers/pcmcia/sa1100_nanoengine.c             |  218 ++++++++++++++++++++++++
 6 files changed, 254 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/mach-sa1100/include/mach/nanoengine.h
 create mode 100644 drivers/pcmcia/sa1100_nanoengine.c

diff --git a/arch/arm/mach-sa1100/include/mach/nanoengine.h b/arch/arm/mach-sa1100/include/mach/nanoengine.h
new file mode 100644
index 0000000..0537766
--- /dev/null
+++ b/arch/arm/mach-sa1100/include/mach/nanoengine.h
@@ -0,0 +1,30 @@
+/*
+ * arch/arm/mach-sa1100/include/mach/nanoengine.h
+ *
+ * This file contains the hardware specific definitions for nanoEngine.
+ * Only include this file from SA1100-specific files.
+ *
+ * Copyright (C) 2010 Marcelo Roberto Jimenez <mroberto at cpti.cetuc.puc-rio.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+#ifndef __ASM_ARCH_NANOENGINE_H
+#define __ASM_ARCH_NANOENGINE_H
+
+#define GPIO_PC_READY0	GPIO_GPIO(11) /* ready for socket 0 (active high)*/
+#define GPIO_PC_READY1	GPIO_GPIO(12) /* ready for socket 1 (active high) */
+#define GPIO_PC_CD0	GPIO_GPIO(13) /* detect for socket 0 (active low) */
+#define GPIO_PC_CD1	GPIO_GPIO(14) /* detect for socket 1 (active low) */
+#define GPIO_PC_RESET0	GPIO_GPIO(15) /* reset socket 0 */
+#define GPIO_PC_RESET1	GPIO_GPIO(16) /* reset socket 1 */
+
+#define NANOENGINE_IRQ_GPIO_PC_READY0	IRQ_GPIO11
+#define NANOENGINE_IRQ_GPIO_PC_READY1	IRQ_GPIO12
+#define NANOENGINE_IRQ_GPIO_PC_CD0	IRQ_GPIO13
+#define NANOENGINE_IRQ_GPIO_PC_CD1	IRQ_GPIO14
+
+#endif
+
diff --git a/arch/arm/mach-sa1100/nanoengine.c b/arch/arm/mach-sa1100/nanoengine.c
index 73a7922..36cdc8a 100644
--- a/arch/arm/mach-sa1100/nanoengine.c
+++ b/arch/arm/mach-sa1100/nanoengine.c
@@ -3,7 +3,7 @@
  *
  * Bright Star Engineering's nanoEngine board init code.
  *
- * Copyright (C) 2009 Marcelo Roberto Jimenez <mroberto at cpti.cetuc.puc-rio.br>
+ * Copyright (C) 2010 Marcelo Roberto Jimenez <mroberto at cpti.cetuc.puc-rio.br>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile
index 381b031..bb9fa64 100644
--- a/drivers/pcmcia/Makefile
+++ b/drivers/pcmcia/Makefile
@@ -50,6 +50,7 @@ sa1100_cs-$(CONFIG_SA1100_ASSABET)		+= sa1100_assabet.o
 sa1100_cs-$(CONFIG_SA1100_CERF)			+= sa1100_cerf.o
 sa1100_cs-$(CONFIG_SA1100_COLLIE)              += pxa2xx_sharpsl.o
 sa1100_cs-$(CONFIG_SA1100_H3600)		+= sa1100_h3600.o
+sa1100_cs-$(CONFIG_SA1100_NANOENGINE)		+= sa1100_nanoengine.o
 sa1100_cs-$(CONFIG_SA1100_SHANNON)		+= sa1100_shannon.o
 sa1100_cs-$(CONFIG_SA1100_SIMPAD)		+= sa1100_simpad.o
 
diff --git a/drivers/pcmcia/sa1100_generic.c b/drivers/pcmcia/sa1100_generic.c
index 5188962..a1fce5d 100644
--- a/drivers/pcmcia/sa1100_generic.c
+++ b/drivers/pcmcia/sa1100_generic.c
@@ -54,6 +54,9 @@ static int (*sa11x0_pcmcia_hw_init[])(struct device *dev) = {
 #if defined(CONFIG_SA1100_H3100) || defined(CONFIG_SA1100_H3600)
 	pcmcia_h3600_init,
 #endif
+#ifdef CONFIG_SA1100_NANOENGINE
+	pcmcia_nanoengine_init,
+#endif
 #ifdef CONFIG_SA1100_SHANNON
 	pcmcia_shannon_init,
 #endif
diff --git a/drivers/pcmcia/sa1100_generic.h b/drivers/pcmcia/sa1100_generic.h
index 794f96a..adb08db 100644
--- a/drivers/pcmcia/sa1100_generic.h
+++ b/drivers/pcmcia/sa1100_generic.h
@@ -13,6 +13,7 @@ extern int pcmcia_freebird_init(struct device *);
 extern int pcmcia_gcplus_init(struct device *);
 extern int pcmcia_graphicsmaster_init(struct device *);
 extern int pcmcia_h3600_init(struct device *);
+extern int pcmcia_nanoengine_init(struct device *);
 extern int pcmcia_pangolin_init(struct device *);
 extern int pcmcia_pfs168_init(struct device *);
 extern int pcmcia_shannon_init(struct device *);
diff --git a/drivers/pcmcia/sa1100_nanoengine.c b/drivers/pcmcia/sa1100_nanoengine.c
new file mode 100644
index 0000000..2f164e6
--- /dev/null
+++ b/drivers/pcmcia/sa1100_nanoengine.c
@@ -0,0 +1,218 @@
+/*
+ * drivers/pcmcia/sa1100_nanoengine.c
+ *
+ * PCMCIA implementation routines for BSI nanoEngine.
+ *
+ * In order to have a fully functional pcmcia subsystem in a BSE nanoEngine
+ * board you should carefully read this:
+ * http://cambuca.ldhs.cetuc.puc-rio.br/nanoengine/
+ *
+ * Copyright (C) 2010 Marcelo Roberto Jimenez <mroberto at cpti.cetuc.puc-rio.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+#include <linux/device.h>
+#include <linux/errno.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/signal.h>
+
+#include <asm/mach-types.h>
+#include <asm/irq.h>
+
+#include <mach/hardware.h>
+#include <mach/nanoengine.h>
+
+#include "sa1100_generic.h"
+
+static struct pcmcia_irqs irqs_skt0[] = {
+	/* socket, IRQ, name */
+	{ 0, NANOENGINE_IRQ_GPIO_PC_CD0, "PC CD0" },
+};
+
+static struct pcmcia_irqs irqs_skt1[] = {
+	/* socket, IRQ, name */
+	{ 1, NANOENGINE_IRQ_GPIO_PC_CD1, "PC CD1" },
+};
+
+struct nanoengine_pins {
+	unsigned input_pins;
+	unsigned output_pins;
+	unsigned clear_outputs;
+	unsigned transition_pins;
+	unsigned pci_irq;
+	struct pcmcia_irqs *pcmcia_irqs;
+	unsigned pcmcia_irqs_size;
+};
+
+static struct nanoengine_pins nano_skts[] = {
+	{
+		.input_pins		= GPIO_PC_READY0 | GPIO_PC_CD0,
+		.output_pins		= GPIO_PC_RESET0,
+		.clear_outputs		= GPIO_PC_RESET0,
+		.transition_pins	= NANOENGINE_IRQ_GPIO_PC_CD0,
+		.pci_irq		= NANOENGINE_IRQ_GPIO_PC_READY0,
+		.pcmcia_irqs		= irqs_skt0,
+		.pcmcia_irqs_size	= ARRAY_SIZE(irqs_skt0)
+	}, {
+		.input_pins		= GPIO_PC_READY1 | GPIO_PC_CD1,
+		.output_pins		= GPIO_PC_RESET1,
+		.clear_outputs		= GPIO_PC_RESET1,
+		.transition_pins	= NANOENGINE_IRQ_GPIO_PC_CD1,
+		.pci_irq		= NANOENGINE_IRQ_GPIO_PC_READY1,
+		.pcmcia_irqs		= irqs_skt1,
+		.pcmcia_irqs_size	= ARRAY_SIZE(irqs_skt1)
+	}
+};
+
+unsigned num_nano_pcmcia_sockets = ARRAY_SIZE(nano_skts);
+
+static int nanoengine_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
+{
+	unsigned i = skt->nr;
+
+	if (i >= num_nano_pcmcia_sockets)
+		return -ENXIO;
+
+	GPDR &= ~nano_skts[i].input_pins;
+	GPDR |=  nano_skts[i].output_pins;
+	GPCR =   nano_skts[i].clear_outputs;
+	set_irq_type(nano_skts[i].transition_pins, IRQ_TYPE_EDGE_BOTH);
+	skt->socket.pci_irq = nano_skts[i].pci_irq;
+
+	return soc_pcmcia_request_irqs(skt,
+		nano_skts[i].pcmcia_irqs, nano_skts[i].pcmcia_irqs_size);
+}
+
+/*
+ * Release all resources.
+ */
+static void nanoengine_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
+{
+	unsigned i = skt->nr;
+
+	if (i >= num_nano_pcmcia_sockets)
+		return;
+
+	soc_pcmcia_free_irqs(skt,
+		nano_skts[i].pcmcia_irqs, nano_skts[i].pcmcia_irqs_size);
+}
+
+static int nanoengine_pcmcia_configure_socket(
+	struct soc_pcmcia_socket *skt, const socket_state_t *state)
+{
+	unsigned reset;
+	unsigned i = skt->nr;
+
+	if (i >= num_nano_pcmcia_sockets)
+		return -ENXIO;
+
+	switch (i) {
+	case 0:
+		reset = GPIO_PC_RESET0;
+		break;
+	case 1:
+		reset = GPIO_PC_RESET1;
+		break;
+	default:
+		return -ENXIO;
+	}
+
+	if (state->flags & SS_RESET)
+		GPSR = reset;
+	else
+		GPCR = reset;
+
+	return 0;
+}
+
+static void nanoengine_pcmcia_socket_state(
+	struct soc_pcmcia_socket *skt, struct pcmcia_state *state)
+{
+	unsigned long levels = GPLR;
+	unsigned i = skt->nr;
+
+	if (i >= num_nano_pcmcia_sockets)
+		return;
+
+	memset(state, 0, sizeof(struct pcmcia_state));
+	switch (i) {
+	case 0:
+		state->ready	=  (levels & GPIO_PC_READY0)	? 1 : 0;
+		state->detect	= !(levels & GPIO_PC_CD0)	? 1 : 0;
+		break;
+	case 1:
+		state->ready	=  (levels & GPIO_PC_READY1)	? 1 : 0;
+		state->detect	= !(levels & GPIO_PC_CD1)	? 1 : 0;
+		break;
+	default:
+		return;
+	}
+	state->bvd1	= 1;
+	state->bvd2	= 1;
+	state->wrprot	= 0; /* Not available */
+	state->vs_3v	= 1; /* Can only apply 3.3V */
+	state->vs_Xv	= 0;
+}
+
+/*
+ * Enable card status IRQs on (re-)initialisation.  This can
+ * be called at initialisation, power management event, or
+ * pcmcia event.
+ */
+static void nanoengine_pcmcia_socket_init(struct soc_pcmcia_socket *skt)
+{
+	unsigned i = skt->nr;
+
+	if (i >= num_nano_pcmcia_sockets)
+		return;
+
+	soc_pcmcia_enable_irqs(skt,
+		nano_skts[i].pcmcia_irqs, nano_skts[i].pcmcia_irqs_size);
+}
+
+/*
+ * Disable card status IRQs on suspend.
+ */
+static void nanoengine_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
+{
+	unsigned i = skt->nr;
+
+	if (i >= num_nano_pcmcia_sockets)
+		return;
+
+	soc_pcmcia_disable_irqs(skt,
+		nano_skts[i].pcmcia_irqs, nano_skts[i].pcmcia_irqs_size);
+}
+
+static struct pcmcia_low_level nanoengine_pcmcia_ops = {
+	.owner			= THIS_MODULE,
+
+	.hw_init		= nanoengine_pcmcia_hw_init,
+	.hw_shutdown		= nanoengine_pcmcia_hw_shutdown,
+
+	.configure_socket	= nanoengine_pcmcia_configure_socket,
+	.socket_state		= nanoengine_pcmcia_socket_state,
+	.socket_init		= nanoengine_pcmcia_socket_init,
+	.socket_suspend		= nanoengine_pcmcia_socket_suspend,
+};
+
+int pcmcia_nanoengine_init(struct device *dev)
+{
+	int ret = -ENODEV;
+
+	printk(KERN_INFO "BSE nanoEngine pcmcia support by "
+		"Miguel Freitas & Marcelo Jimenez.\n");
+	if (machine_is_nanoengine())
+		ret = sa11xx_drv_pcmcia_probe(
+			dev, &nanoengine_pcmcia_ops, 0, 2);
+
+	return ret;
+}
+
-- 
1.7.0.3



From bugzilla-daemon at bugzilla.kernel.org  Tue Mar 30 16:05:59 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Tue, 30 Mar 2010 20:05:59 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@https.bugzilla.kernel.org/>
References: <bug-7304-4463@https.bugzilla.kernel.org/>
Message-ID: <201003302005.o2UK5xbC010797@demeter.kernel.org>

https://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #89 from Thomas Nemeth <nemeth.thomas at gmail.com>  2010-03-30 20:05:42 ---
I often have to read datasheets. Mainly for touchscreens, I2C devices and some
other external devices. However, reading through the ToPIC97 datasheet gave me
headaches :(

What can I do now, in order to help you ?

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From bugzilla-daemon at bugzilla.kernel.org  Tue Mar 30 16:12:44 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Tue, 30 Mar 2010 20:12:44 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@https.bugzilla.kernel.org/>
References: <bug-7304-4463@https.bugzilla.kernel.org/>
Message-ID: <201003302012.o2UKCiec012736@demeter.kernel.org>

https://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #90 from Thomas Nemeth <nemeth.thomas at gmail.com>  2010-03-30 20:12:34 ---
Created an attachment (id=25766)
 --> (https://bugzilla.kernel.org/attachment.cgi?id=25766)
Patch to force IRQ number as a module parameter.

I know this is not the ideal solution for this problem. Probing would be way
better to handle this, but in the end, if we can't, there's still this handy
solution...

And it's not very intrusive ;) It applies against the 2.6.34-rc2.

Still it does not fix the problem with the non-working slot, of course :(

However what about the 2.2.x code used to detect the IRQ ? Extracting the used
algorithm should be rather difficult mainly due to kernel architecture changes
but it used to work.

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From bugzilla-daemon at bugzilla.kernel.org  Tue Mar 30 19:12:45 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Tue, 30 Mar 2010 23:12:45 GMT
Subject: [Bug 15621] BUG: unable to handle kernel paging request  - comm:
	pccardd
In-Reply-To: <bug-15621-4463@https.bugzilla.kernel.org/>
References: <bug-15621-4463@https.bugzilla.kernel.org/>
Message-ID: <201003302312.o2UNCjjL024354@demeter.kernel.org>

https://bugzilla.kernel.org/show_bug.cgi?id=15621





--- Comment #10 from Bjorn Helgaas <bjorn.helgaas at hp.com>  2010-03-30 23:12:37 ---
Rafael, this is a regression from 2.6.33, in case it's not on your
list yet.

Ozgur, thanks for attaching the logs.  There's some interesting stuff
there that I don't understand yet, such as this from the pci=nocrs dmesg:

  [    1.577758] pci 0000:00:1e.0: PCI bridge to [bus 03-04]
  [    1.583031] pci 0000:00:1e.0:   bridge window [io  0x5000-0x5fff]
  [    1.551889] pci 0000:03:01.0: CardBus bridge to [bus 04-07]
  [    1.557507] pci 0000:03:01.0:   bridge window [io  0x5000-0x50ff]
  [    1.603303] PCI: No. 2 try to assign unassigned res
  [    1.688208] pci 0000:03:01.0: CardBus bridge to [bus 04-07]
  [    1.693826] pci 0000:03:01.0:   bridge window [io  0x0000-0x00ff]

Apparently we moved that CardBus I/O window from [0x5000-0x5fff] to
[0x0-0xff].  I'm dubious about that because the upstream bridge at
00:1e.0 only positively decodes [0x5000-0x5fff] (though it *is* in
subtractive decode mode, so it will forward more).  I wish we had
a little more debug output about when & why we moved that window.

I'm especially dubious because your /proc/ioports with pci=nocrs
from comment 8 (which is the case that's supposed to be working)
contains this:

  5000-5fff : PCI Bus 0000:03
    0000-00ff : PCI CardBus 0000:04
    0000-00ff : PCI CardBus 0000:04

That looks completely broken in terms of the hierarchy.  It looks
like you have a USB device in the CardBus slot (ohci_hcd 0000:04:00.0).
Maybe the broken hierarchy doesn't cause problems with this device
because it doesn't use I/O ports.

Anyway, I'd like to see the entire dmesg log when booted *without*
pci=nocrs, because that's the case that fails.  Since the system doesn't
boot, you'll have to use a serial console or netconsole to collect the
whole thing.  The serial console log in comment 7 is corrupted; it looks
like all the lines got truncated to 80 columns or something.  And please
boot with "ignore_loglevel" so we see all the debug messages on the console.
Also, no need to tar up and compress your attachments -- I always figure
if bugzilla wants to compress stuff, it can do it internally without
bothering us.

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From bugzilla-daemon at bugzilla.kernel.org  Wed Mar 31 02:46:09 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Wed, 31 Mar 2010 06:46:09 GMT
Subject: [Bug 7304] no PCI irq, Cardbus support disabled
In-Reply-To: <bug-7304-4463@https.bugzilla.kernel.org/>
References: <bug-7304-4463@https.bugzilla.kernel.org/>
Message-ID: <201003310646.o2V6k9Ea010269@demeter.kernel.org>

https://bugzilla.kernel.org/show_bug.cgi?id=7304





--- Comment #91 from Dominik Brodowski <linux at brodo.de>  2010-03-31 06:45:07 ---
The problem isn't detecting the IRQ -- we can use ISA IRQ 3 (as 2.2.xx did) or
ISA IRQ 9 and 10 (as the patch in comment #86 did).

The problem is setting up the bridge so that it routes CSC (card status change)
IRQs for CardBus and 16bit cards to the ISA IRQ and also card IRQs for CardBus
and 16bit cards to the ISA IRQ. This seems to be impossible on the ToPIC97.

However, 2.2. seems to do some "polling" to get the IRQs right. I.e., it isn't
really using the IRQs, but polls whether an IRQ occured. That seems necessary
at least or the CSC interrupt.

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


From linux at dominikbrodowski.net  Wed Mar 31 02:47:07 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Wed, 31 Mar 2010 08:47:07 +0200
Subject: [PATCH] ARM: pcmcia: Adds nanoEngine PCMCIA support.
In-Reply-To: <1269972879-27400-1-git-send-email-mroberto@cpti.cetuc.puc-rio.br>
References: <1269972879-27400-1-git-send-email-mroberto@cpti.cetuc.puc-rio.br>
Message-ID: <20100331064707.GA11428@isilmar.linta.de>

On Tue, Mar 30, 2010 at 03:14:39PM -0300, Marcelo Roberto Jimenez wrote:
> This patch adds nanoEngine PCMCIA support, with support for two sockets.
> 
> In order to have a fully functional pcmcia subsystem in a BSE nanoEngine board
> you should carefully read this:
> 
> http://cambuca.ldhs.cetuc.puc-rio.br/nanoengine/

That website still talks about pcmcia-cs ... which was superseded by
pcmciautils.

The patch gets an

	Acked-by: Dominik Brodowski <linux at dominikbrodowski.net>

as I assume that Russell prefers to take it into his tree?

Best,
	Dominik


From w.sang at pengutronix.de  Wed Mar 31 03:06:48 2010
From: w.sang at pengutronix.de (Wolfram Sang)
Date: Wed, 31 Mar 2010 09:06:48 +0200
Subject: [PATCH] ARM: pcmcia: Adds nanoEngine PCMCIA support.
In-Reply-To: <1269972879-27400-1-git-send-email-mroberto@cpti.cetuc.puc-rio.br>
References: <1269972879-27400-1-git-send-email-mroberto@cpti.cetuc.puc-rio.br>
Message-ID: <20100331070648.GA23391@pengutronix.de>

Hi Marcelo,

On Tue, Mar 30, 2010 at 03:14:39PM -0300, Marcelo Roberto Jimenez wrote:
> This patch adds nanoEngine PCMCIA support, with support for two sockets.
> 
> In order to have a fully functional pcmcia subsystem in a BSE nanoEngine board
> you should carefully read this:
> 
> http://cambuca.ldhs.cetuc.puc-rio.br/nanoengine/
> 
> Signed-off-by: Marcelo Roberto Jimenez <mroberto at cpti.cetuc.puc-rio.br>
> ---
>  arch/arm/mach-sa1100/include/mach/nanoengine.h |   30 ++++
>  arch/arm/mach-sa1100/nanoengine.c              |    2 +-
>  drivers/pcmcia/Makefile                        |    1 +
>  drivers/pcmcia/sa1100_generic.c                |    3 +
>  drivers/pcmcia/sa1100_generic.h                |    1 +
>  drivers/pcmcia/sa1100_nanoengine.c             |  218 ++++++++++++++++++++++++
>  6 files changed, 254 insertions(+), 1 deletions(-)
>  create mode 100644 arch/arm/mach-sa1100/include/mach/nanoengine.h
>  create mode 100644 drivers/pcmcia/sa1100_nanoengine.c
> 
> diff --git a/arch/arm/mach-sa1100/include/mach/nanoengine.h b/arch/arm/mach-sa1100/include/mach/nanoengine.h
> new file mode 100644
> index 0000000..0537766
> --- /dev/null
> +++ b/arch/arm/mach-sa1100/include/mach/nanoengine.h
> @@ -0,0 +1,30 @@
> +/*
> + * arch/arm/mach-sa1100/include/mach/nanoengine.h
> + *
> + * This file contains the hardware specific definitions for nanoEngine.
> + * Only include this file from SA1100-specific files.
> + *
> + * Copyright (C) 2010 Marcelo Roberto Jimenez <mroberto at cpti.cetuc.puc-rio.br>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + */
> +#ifndef __ASM_ARCH_NANOENGINE_H
> +#define __ASM_ARCH_NANOENGINE_H
> +
> +#define GPIO_PC_READY0	GPIO_GPIO(11) /* ready for socket 0 (active high)*/
> +#define GPIO_PC_READY1	GPIO_GPIO(12) /* ready for socket 1 (active high) */
> +#define GPIO_PC_CD0	GPIO_GPIO(13) /* detect for socket 0 (active low) */
> +#define GPIO_PC_CD1	GPIO_GPIO(14) /* detect for socket 1 (active low) */
> +#define GPIO_PC_RESET0	GPIO_GPIO(15) /* reset socket 0 */
> +#define GPIO_PC_RESET1	GPIO_GPIO(16) /* reset socket 1 */
> +
> +#define NANOENGINE_IRQ_GPIO_PC_READY0	IRQ_GPIO11
> +#define NANOENGINE_IRQ_GPIO_PC_READY1	IRQ_GPIO12
> +#define NANOENGINE_IRQ_GPIO_PC_CD0	IRQ_GPIO13
> +#define NANOENGINE_IRQ_GPIO_PC_CD1	IRQ_GPIO14
> +
> +#endif
> +
> diff --git a/arch/arm/mach-sa1100/nanoengine.c b/arch/arm/mach-sa1100/nanoengine.c
> index 73a7922..36cdc8a 100644
> --- a/arch/arm/mach-sa1100/nanoengine.c
> +++ b/arch/arm/mach-sa1100/nanoengine.c
> @@ -3,7 +3,7 @@
>   *
>   * Bright Star Engineering's nanoEngine board init code.
>   *
> - * Copyright (C) 2009 Marcelo Roberto Jimenez <mroberto at cpti.cetuc.puc-rio.br>
> + * Copyright (C) 2010 Marcelo Roberto Jimenez <mroberto at cpti.cetuc.puc-rio.br>
>   *
>   * This program is free software; you can redistribute it and/or modify
>   * it under the terms of the GNU General Public License version 2 as
> diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile
> index 381b031..bb9fa64 100644
> --- a/drivers/pcmcia/Makefile
> +++ b/drivers/pcmcia/Makefile
> @@ -50,6 +50,7 @@ sa1100_cs-$(CONFIG_SA1100_ASSABET)		+= sa1100_assabet.o
>  sa1100_cs-$(CONFIG_SA1100_CERF)			+= sa1100_cerf.o
>  sa1100_cs-$(CONFIG_SA1100_COLLIE)              += pxa2xx_sharpsl.o
>  sa1100_cs-$(CONFIG_SA1100_H3600)		+= sa1100_h3600.o
> +sa1100_cs-$(CONFIG_SA1100_NANOENGINE)		+= sa1100_nanoengine.o
>  sa1100_cs-$(CONFIG_SA1100_SHANNON)		+= sa1100_shannon.o
>  sa1100_cs-$(CONFIG_SA1100_SIMPAD)		+= sa1100_simpad.o
>  
> diff --git a/drivers/pcmcia/sa1100_generic.c b/drivers/pcmcia/sa1100_generic.c
> index 5188962..a1fce5d 100644
> --- a/drivers/pcmcia/sa1100_generic.c
> +++ b/drivers/pcmcia/sa1100_generic.c
> @@ -54,6 +54,9 @@ static int (*sa11x0_pcmcia_hw_init[])(struct device *dev) = {
>  #if defined(CONFIG_SA1100_H3100) || defined(CONFIG_SA1100_H3600)
>  	pcmcia_h3600_init,
>  #endif
> +#ifdef CONFIG_SA1100_NANOENGINE
> +	pcmcia_nanoengine_init,
> +#endif
>  #ifdef CONFIG_SA1100_SHANNON
>  	pcmcia_shannon_init,
>  #endif
> diff --git a/drivers/pcmcia/sa1100_generic.h b/drivers/pcmcia/sa1100_generic.h
> index 794f96a..adb08db 100644
> --- a/drivers/pcmcia/sa1100_generic.h
> +++ b/drivers/pcmcia/sa1100_generic.h
> @@ -13,6 +13,7 @@ extern int pcmcia_freebird_init(struct device *);
>  extern int pcmcia_gcplus_init(struct device *);
>  extern int pcmcia_graphicsmaster_init(struct device *);
>  extern int pcmcia_h3600_init(struct device *);
> +extern int pcmcia_nanoengine_init(struct device *);
>  extern int pcmcia_pangolin_init(struct device *);
>  extern int pcmcia_pfs168_init(struct device *);
>  extern int pcmcia_shannon_init(struct device *);
> diff --git a/drivers/pcmcia/sa1100_nanoengine.c b/drivers/pcmcia/sa1100_nanoengine.c
> new file mode 100644
> index 0000000..2f164e6
> --- /dev/null
> +++ b/drivers/pcmcia/sa1100_nanoengine.c
> @@ -0,0 +1,218 @@
> +/*
> + * drivers/pcmcia/sa1100_nanoengine.c
> + *
> + * PCMCIA implementation routines for BSI nanoEngine.
> + *
> + * In order to have a fully functional pcmcia subsystem in a BSE nanoEngine
> + * board you should carefully read this:
> + * http://cambuca.ldhs.cetuc.puc-rio.br/nanoengine/
> + *
> + * Copyright (C) 2010 Marcelo Roberto Jimenez <mroberto at cpti.cetuc.puc-rio.br>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + */
> +#include <linux/device.h>
> +#include <linux/errno.h>
> +#include <linux/interrupt.h>
> +#include <linux/irq.h>
> +#include <linux/init.h>
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/signal.h>
> +
> +#include <asm/mach-types.h>
> +#include <asm/irq.h>
> +
> +#include <mach/hardware.h>
> +#include <mach/nanoengine.h>
> +
> +#include "sa1100_generic.h"
> +
> +static struct pcmcia_irqs irqs_skt0[] = {
> +	/* socket, IRQ, name */
> +	{ 0, NANOENGINE_IRQ_GPIO_PC_CD0, "PC CD0" },
> +};
> +
> +static struct pcmcia_irqs irqs_skt1[] = {
> +	/* socket, IRQ, name */
> +	{ 1, NANOENGINE_IRQ_GPIO_PC_CD1, "PC CD1" },
> +};
> +
> +struct nanoengine_pins {
> +	unsigned input_pins;
> +	unsigned output_pins;
> +	unsigned clear_outputs;
> +	unsigned transition_pins;
> +	unsigned pci_irq;
> +	struct pcmcia_irqs *pcmcia_irqs;
> +	unsigned pcmcia_irqs_size;
> +};
> +
> +static struct nanoengine_pins nano_skts[] = {
> +	{
> +		.input_pins		= GPIO_PC_READY0 | GPIO_PC_CD0,
> +		.output_pins		= GPIO_PC_RESET0,
> +		.clear_outputs		= GPIO_PC_RESET0,
> +		.transition_pins	= NANOENGINE_IRQ_GPIO_PC_CD0,
> +		.pci_irq		= NANOENGINE_IRQ_GPIO_PC_READY0,
> +		.pcmcia_irqs		= irqs_skt0,
> +		.pcmcia_irqs_size	= ARRAY_SIZE(irqs_skt0)
> +	}, {
> +		.input_pins		= GPIO_PC_READY1 | GPIO_PC_CD1,
> +		.output_pins		= GPIO_PC_RESET1,
> +		.clear_outputs		= GPIO_PC_RESET1,
> +		.transition_pins	= NANOENGINE_IRQ_GPIO_PC_CD1,
> +		.pci_irq		= NANOENGINE_IRQ_GPIO_PC_READY1,
> +		.pcmcia_irqs		= irqs_skt1,
> +		.pcmcia_irqs_size	= ARRAY_SIZE(irqs_skt1)
> +	}
> +};
> +
> +unsigned num_nano_pcmcia_sockets = ARRAY_SIZE(nano_skts);
> +
> +static int nanoengine_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
> +{
> +	unsigned i = skt->nr;
> +
> +	if (i >= num_nano_pcmcia_sockets)
> +		return -ENXIO;
> +
> +	GPDR &= ~nano_skts[i].input_pins;
> +	GPDR |=  nano_skts[i].output_pins;
> +	GPCR =   nano_skts[i].clear_outputs;
> +	set_irq_type(nano_skts[i].transition_pins, IRQ_TYPE_EDGE_BOTH);
> +	skt->socket.pci_irq = nano_skts[i].pci_irq;
> +
> +	return soc_pcmcia_request_irqs(skt,
> +		nano_skts[i].pcmcia_irqs, nano_skts[i].pcmcia_irqs_size);
> +}
> +
> +/*
> + * Release all resources.
> + */
> +static void nanoengine_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
> +{
> +	unsigned i = skt->nr;
> +
> +	if (i >= num_nano_pcmcia_sockets)
> +		return;
> +
> +	soc_pcmcia_free_irqs(skt,
> +		nano_skts[i].pcmcia_irqs, nano_skts[i].pcmcia_irqs_size);
> +}
> +
> +static int nanoengine_pcmcia_configure_socket(
> +	struct soc_pcmcia_socket *skt, const socket_state_t *state)
> +{
> +	unsigned reset;
> +	unsigned i = skt->nr;
> +
> +	if (i >= num_nano_pcmcia_sockets)
> +		return -ENXIO;
> +
> +	switch (i) {
> +	case 0:
> +		reset = GPIO_PC_RESET0;
> +		break;
> +	case 1:
> +		reset = GPIO_PC_RESET1;
> +		break;
> +	default:
> +		return -ENXIO;
> +	}
> +
> +	if (state->flags & SS_RESET)
> +		GPSR = reset;
> +	else
> +		GPCR = reset;
> +
> +	return 0;
> +}
> +
> +static void nanoengine_pcmcia_socket_state(
> +	struct soc_pcmcia_socket *skt, struct pcmcia_state *state)
> +{
> +	unsigned long levels = GPLR;
> +	unsigned i = skt->nr;
> +
> +	if (i >= num_nano_pcmcia_sockets)
> +		return;
> +
> +	memset(state, 0, sizeof(struct pcmcia_state));
> +	switch (i) {
> +	case 0:
> +		state->ready	=  (levels & GPIO_PC_READY0)	? 1 : 0;
> +		state->detect	= !(levels & GPIO_PC_CD0)	? 1 : 0;

If lines are added at a later stage, all this indentation might have to be
redone. This breaks 'git blame'. Please just one space around operators as
suggested in CodingStyle, chapter 3.1.

> +		break;
> +	case 1:
> +		state->ready	=  (levels & GPIO_PC_READY1)	? 1 : 0;
> +		state->detect	= !(levels & GPIO_PC_CD1)	? 1 : 0;
> +		break;
> +	default:
> +		return;
> +	}
> +	state->bvd1	= 1;
> +	state->bvd2	= 1;
> +	state->wrprot	= 0; /* Not available */
> +	state->vs_3v	= 1; /* Can only apply 3.3V */
> +	state->vs_Xv	= 0;
> +}
> +
> +/*
> + * Enable card status IRQs on (re-)initialisation.  This can
> + * be called at initialisation, power management event, or
> + * pcmcia event.
> + */
> +static void nanoengine_pcmcia_socket_init(struct soc_pcmcia_socket *skt)
> +{
> +	unsigned i = skt->nr;
> +
> +	if (i >= num_nano_pcmcia_sockets)
> +		return;
> +
> +	soc_pcmcia_enable_irqs(skt,
> +		nano_skts[i].pcmcia_irqs, nano_skts[i].pcmcia_irqs_size);
> +}
> +
> +/*
> + * Disable card status IRQs on suspend.
> + */
> +static void nanoengine_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
> +{
> +	unsigned i = skt->nr;
> +
> +	if (i >= num_nano_pcmcia_sockets)
> +		return;
> +
> +	soc_pcmcia_disable_irqs(skt,
> +		nano_skts[i].pcmcia_irqs, nano_skts[i].pcmcia_irqs_size);
> +}
> +
> +static struct pcmcia_low_level nanoengine_pcmcia_ops = {
> +	.owner			= THIS_MODULE,
> +
> +	.hw_init		= nanoengine_pcmcia_hw_init,
> +	.hw_shutdown		= nanoengine_pcmcia_hw_shutdown,
> +
> +	.configure_socket	= nanoengine_pcmcia_configure_socket,
> +	.socket_state		= nanoengine_pcmcia_socket_state,
> +	.socket_init		= nanoengine_pcmcia_socket_init,
> +	.socket_suspend		= nanoengine_pcmcia_socket_suspend,
> +};
> +
> +int pcmcia_nanoengine_init(struct device *dev)
> +{
> +	int ret = -ENODEV;
> +
> +	printk(KERN_INFO "BSE nanoEngine pcmcia support by "
> +		"Miguel Freitas & Marcelo Jimenez.\n");

Is this really necessary? Log would get quite messy if all drivers do this.
I haven't checked, can't you just use MODULE_AUTHOR here?

> +	if (machine_is_nanoengine())
> +		ret = sa11xx_drv_pcmcia_probe(
> +			dev, &nanoengine_pcmcia_ops, 0, 2);
> +
> +	return ret;
> +}
> +
> -- 
> 1.7.0.3
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-pcmcia/attachments/20100331/7f3b909b/attachment.sig>

From mroberto at cpti.cetuc.puc-rio.br  Wed Mar 31 10:26:28 2010
From: mroberto at cpti.cetuc.puc-rio.br (Marcelo Jimenez)
Date: Wed, 31 Mar 2010 11:26:28 -0300
Subject: [PATCH] ARM: pcmcia: Adds nanoEngine PCMCIA support.
In-Reply-To: <20100331064707.GA11428@isilmar.linta.de>
References: <1269972879-27400-1-git-send-email-mroberto@cpti.cetuc.puc-rio.br>
	<20100331064707.GA11428@isilmar.linta.de>
Message-ID: <w2ycecb6d8f1003310726lead65adcq2de9cb4b8560a034@mail.gmail.com>

Hi Dominik,

On Wed, Mar 31, 2010 at 03:47, Dominik Brodowski
<linux at dominikbrodowski.net> wrote:
> On Tue, Mar 30, 2010 at 03:14:39PM -0300, Marcelo Roberto Jimenez wrote:
>> This patch adds nanoEngine PCMCIA support, with support for two sockets.
>>
>> In order to have a fully functional pcmcia subsystem in a BSE nanoEngine board
>> you should carefully read this:
>>
>> http://cambuca.ldhs.cetuc.puc-rio.br/nanoengine/
>
> That website still talks about pcmcia-cs ... which was superseded by
> pcmciautils.

Indeed, pcmcia-cs is not needed anymore, in fact, does not work with
my setup, I am using pcmciautils now. The web site has not been
updated because it refers to the project as it was with the kernel 2.4
implementation. The link is there because there are two serious
hardware problems when implementing PCMCIA with nanoengine: one is
that it needs external logic, the other is that it is necessary to
reprogram the bogus version of the CPLD that originally came with the
nanoEngine board.

> The patch gets an
>
> ? ? ? ?Acked-by: Dominik Brodowski <linux at dominikbrodowski.net>
>
> as I assume that Russell prefers to take it into his tree?

Thanks!

> Best,
> ? ? ? ?Dominik

Regards,
Marcelo.


From mroberto at cpti.cetuc.puc-rio.br  Wed Mar 31 10:41:07 2010
From: mroberto at cpti.cetuc.puc-rio.br (Marcelo Jimenez)
Date: Wed, 31 Mar 2010 11:41:07 -0300
Subject: [PATCH] ARM: pcmcia: Adds nanoEngine PCMCIA support.
In-Reply-To: <20100331070648.GA23391@pengutronix.de>
References: <1269972879-27400-1-git-send-email-mroberto@cpti.cetuc.puc-rio.br>
	<20100331070648.GA23391@pengutronix.de>
Message-ID: <q2ncecb6d8f1003310741g542debabs1fd8044983cc1c37@mail.gmail.com>

Hi Wolgram,

On Wed, Mar 31, 2010 at 04:06, Wolfram Sang <w.sang at pengutronix.de> wrote:
> Hi Marcelo,
>
> On Tue, Mar 30, 2010 at 03:14:39PM -0300, Marcelo Roberto Jimenez wrote:
>> This patch adds nanoEngine PCMCIA support, with support for two sockets.
>> ...
>> +
>> + ? ? memset(state, 0, sizeof(struct pcmcia_state));
>> + ? ? switch (i) {
>> + ? ? case 0:
>> + ? ? ? ? ? ? state->ready ? ?= ?(levels & GPIO_PC_READY0) ? ?? 1 : 0;
>> + ? ? ? ? ? ? state->detect ? = !(levels & GPIO_PC_CD0) ? ? ? ? 1 : 0;
>
> If lines are added at a later stage, all this indentation might have to be
> redone. This breaks 'git blame'. Please just one space around operators as
> suggested in CodingStyle, chapter 3.1.

Sorry, I didn't know about that. I ran the patch through checkpatch.pl
and it did not complain, so I thought it was ok. I will change that
and resubmit.

>> +
>> +int pcmcia_nanoengine_init(struct device *dev)
>> +{
>> + ? ? int ret = -ENODEV;
>> +
>> + ? ? printk(KERN_INFO "BSE nanoEngine pcmcia support by "
>> + ? ? ? ? ? ? "Miguel Freitas & Marcelo Jimenez.\n");
>
> Is this really necessary? Log would get quite messy if all drivers do this.
> I haven't checked, can't you just use MODULE_AUTHOR here?

I can remove it, in fact. It was there at the first version of the
driver, so I just added my name. In this case, this file becomes part
of another module, in this case the module is "sa1100_cs", so I don't
think I could add MODULE_AUTHOR there, but I could use some advice
here.

>
> --
> Pengutronix e.K. ? ? ? ? ? ? ? ? ? ? ? ? ? | Wolfram Sang ? ? ? ? ? ? ? ?|
> Industrial Linux Solutions ? ? ? ? ? ? ? ? | http://www.pengutronix.de/ ?|

Thanks for your comments,
Marcelo.


From mroberto at cpti.cetuc.puc-rio.br  Wed Mar 31 11:23:28 2010
From: mroberto at cpti.cetuc.puc-rio.br (Marcelo Roberto Jimenez)
Date: Wed, 31 Mar 2010 12:23:28 -0300
Subject: [PATCH] ARM: pcmcia: Adds nanoEngine PCMCIA support.
Message-ID: <1270049008-11646-1-git-send-email-mroberto@cpti.cetuc.puc-rio.br>

This patch adds nanoEngine PCMCIA support, with support for two sockets.

In order to have a fully functional pcmcia subsystem in a BSE nanoEngine board
you should carefully read this:

http://cambuca.ldhs.cetuc.puc-rio.br/nanoengine/

Signed-off-by: Marcelo Roberto Jimenez <mroberto at cpti.cetuc.puc-rio.br>
Acked-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 arch/arm/mach-sa1100/include/mach/nanoengine.h |   30 ++++
 arch/arm/mach-sa1100/nanoengine.c              |    2 +-
 drivers/pcmcia/Makefile                        |    3 +-
 drivers/pcmcia/sa1100_generic.c                |    3 +
 drivers/pcmcia/sa1100_generic.h                |    1 +
 drivers/pcmcia/sa1100_nanoengine.c             |  219 ++++++++++++++++++++++++
 6 files changed, 256 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/mach-sa1100/include/mach/nanoengine.h
 create mode 100644 drivers/pcmcia/sa1100_nanoengine.c

diff --git a/arch/arm/mach-sa1100/include/mach/nanoengine.h b/arch/arm/mach-sa1100/include/mach/nanoengine.h
new file mode 100644
index 0000000..0537766
--- /dev/null
+++ b/arch/arm/mach-sa1100/include/mach/nanoengine.h
@@ -0,0 +1,30 @@
+/*
+ * arch/arm/mach-sa1100/include/mach/nanoengine.h
+ *
+ * This file contains the hardware specific definitions for nanoEngine.
+ * Only include this file from SA1100-specific files.
+ *
+ * Copyright (C) 2010 Marcelo Roberto Jimenez <mroberto at cpti.cetuc.puc-rio.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+#ifndef __ASM_ARCH_NANOENGINE_H
+#define __ASM_ARCH_NANOENGINE_H
+
+#define GPIO_PC_READY0	GPIO_GPIO(11) /* ready for socket 0 (active high)*/
+#define GPIO_PC_READY1	GPIO_GPIO(12) /* ready for socket 1 (active high) */
+#define GPIO_PC_CD0	GPIO_GPIO(13) /* detect for socket 0 (active low) */
+#define GPIO_PC_CD1	GPIO_GPIO(14) /* detect for socket 1 (active low) */
+#define GPIO_PC_RESET0	GPIO_GPIO(15) /* reset socket 0 */
+#define GPIO_PC_RESET1	GPIO_GPIO(16) /* reset socket 1 */
+
+#define NANOENGINE_IRQ_GPIO_PC_READY0	IRQ_GPIO11
+#define NANOENGINE_IRQ_GPIO_PC_READY1	IRQ_GPIO12
+#define NANOENGINE_IRQ_GPIO_PC_CD0	IRQ_GPIO13
+#define NANOENGINE_IRQ_GPIO_PC_CD1	IRQ_GPIO14
+
+#endif
+
diff --git a/arch/arm/mach-sa1100/nanoengine.c b/arch/arm/mach-sa1100/nanoengine.c
index 73a7922..36cdc8a 100644
--- a/arch/arm/mach-sa1100/nanoengine.c
+++ b/arch/arm/mach-sa1100/nanoengine.c
@@ -3,7 +3,7 @@
  *
  * Bright Star Engineering's nanoEngine board init code.
  *
- * Copyright (C) 2009 Marcelo Roberto Jimenez <mroberto at cpti.cetuc.puc-rio.br>
+ * Copyright (C) 2010 Marcelo Roberto Jimenez <mroberto at cpti.cetuc.puc-rio.br>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile
index 381b031..e12a721 100644
--- a/drivers/pcmcia/Makefile
+++ b/drivers/pcmcia/Makefile
@@ -48,8 +48,9 @@ sa1111_cs-$(CONFIG_SA1100_JORNADA720)		+= sa1100_jornada720.o
 sa1100_cs-y					+= sa1100_generic.o
 sa1100_cs-$(CONFIG_SA1100_ASSABET)		+= sa1100_assabet.o
 sa1100_cs-$(CONFIG_SA1100_CERF)			+= sa1100_cerf.o
-sa1100_cs-$(CONFIG_SA1100_COLLIE)              += pxa2xx_sharpsl.o
+sa1100_cs-$(CONFIG_SA1100_COLLIE)		+= pxa2xx_sharpsl.o
 sa1100_cs-$(CONFIG_SA1100_H3600)		+= sa1100_h3600.o
+sa1100_cs-$(CONFIG_SA1100_NANOENGINE)		+= sa1100_nanoengine.o
 sa1100_cs-$(CONFIG_SA1100_SHANNON)		+= sa1100_shannon.o
 sa1100_cs-$(CONFIG_SA1100_SIMPAD)		+= sa1100_simpad.o
 
diff --git a/drivers/pcmcia/sa1100_generic.c b/drivers/pcmcia/sa1100_generic.c
index 5188962..a1fce5d 100644
--- a/drivers/pcmcia/sa1100_generic.c
+++ b/drivers/pcmcia/sa1100_generic.c
@@ -54,6 +54,9 @@ static int (*sa11x0_pcmcia_hw_init[])(struct device *dev) = {
 #if defined(CONFIG_SA1100_H3100) || defined(CONFIG_SA1100_H3600)
 	pcmcia_h3600_init,
 #endif
+#ifdef CONFIG_SA1100_NANOENGINE
+	pcmcia_nanoengine_init,
+#endif
 #ifdef CONFIG_SA1100_SHANNON
 	pcmcia_shannon_init,
 #endif
diff --git a/drivers/pcmcia/sa1100_generic.h b/drivers/pcmcia/sa1100_generic.h
index 794f96a..adb08db 100644
--- a/drivers/pcmcia/sa1100_generic.h
+++ b/drivers/pcmcia/sa1100_generic.h
@@ -13,6 +13,7 @@ extern int pcmcia_freebird_init(struct device *);
 extern int pcmcia_gcplus_init(struct device *);
 extern int pcmcia_graphicsmaster_init(struct device *);
 extern int pcmcia_h3600_init(struct device *);
+extern int pcmcia_nanoengine_init(struct device *);
 extern int pcmcia_pangolin_init(struct device *);
 extern int pcmcia_pfs168_init(struct device *);
 extern int pcmcia_shannon_init(struct device *);
diff --git a/drivers/pcmcia/sa1100_nanoengine.c b/drivers/pcmcia/sa1100_nanoengine.c
new file mode 100644
index 0000000..3d2652e
--- /dev/null
+++ b/drivers/pcmcia/sa1100_nanoengine.c
@@ -0,0 +1,219 @@
+/*
+ * drivers/pcmcia/sa1100_nanoengine.c
+ *
+ * PCMCIA implementation routines for BSI nanoEngine.
+ *
+ * In order to have a fully functional pcmcia subsystem in a BSE nanoEngine
+ * board you should carefully read this:
+ * http://cambuca.ldhs.cetuc.puc-rio.br/nanoengine/
+ *
+ * Copyright (C) 2010 Marcelo Roberto Jimenez <mroberto at cpti.cetuc.puc-rio.br>
+ *
+ * Based on original work for kernel 2.4 by
+ * Miguel Freitas <miguel at cpti.cetuc.puc-rio.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+#include <linux/device.h>
+#include <linux/errno.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/signal.h>
+
+#include <asm/mach-types.h>
+#include <asm/irq.h>
+
+#include <mach/hardware.h>
+#include <mach/nanoengine.h>
+
+#include "sa1100_generic.h"
+
+static struct pcmcia_irqs irqs_skt0[] = {
+	/* socket, IRQ, name */
+	{ 0, NANOENGINE_IRQ_GPIO_PC_CD0, "PC CD0" },
+};
+
+static struct pcmcia_irqs irqs_skt1[] = {
+	/* socket, IRQ, name */
+	{ 1, NANOENGINE_IRQ_GPIO_PC_CD1, "PC CD1" },
+};
+
+struct nanoengine_pins {
+	unsigned input_pins;
+	unsigned output_pins;
+	unsigned clear_outputs;
+	unsigned transition_pins;
+	unsigned pci_irq;
+	struct pcmcia_irqs *pcmcia_irqs;
+	unsigned pcmcia_irqs_size;
+};
+
+static struct nanoengine_pins nano_skts[] = {
+	{
+		.input_pins		= GPIO_PC_READY0 | GPIO_PC_CD0,
+		.output_pins		= GPIO_PC_RESET0,
+		.clear_outputs		= GPIO_PC_RESET0,
+		.transition_pins	= NANOENGINE_IRQ_GPIO_PC_CD0,
+		.pci_irq		= NANOENGINE_IRQ_GPIO_PC_READY0,
+		.pcmcia_irqs		= irqs_skt0,
+		.pcmcia_irqs_size	= ARRAY_SIZE(irqs_skt0)
+	}, {
+		.input_pins		= GPIO_PC_READY1 | GPIO_PC_CD1,
+		.output_pins		= GPIO_PC_RESET1,
+		.clear_outputs		= GPIO_PC_RESET1,
+		.transition_pins	= NANOENGINE_IRQ_GPIO_PC_CD1,
+		.pci_irq		= NANOENGINE_IRQ_GPIO_PC_READY1,
+		.pcmcia_irqs		= irqs_skt1,
+		.pcmcia_irqs_size	= ARRAY_SIZE(irqs_skt1)
+	}
+};
+
+unsigned num_nano_pcmcia_sockets = ARRAY_SIZE(nano_skts);
+
+static int nanoengine_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
+{
+	unsigned i = skt->nr;
+
+	if (i >= num_nano_pcmcia_sockets)
+		return -ENXIO;
+
+	GPDR &= ~nano_skts[i].input_pins;
+	GPDR |= nano_skts[i].output_pins;
+	GPCR = nano_skts[i].clear_outputs;
+	set_irq_type(nano_skts[i].transition_pins, IRQ_TYPE_EDGE_BOTH);
+	skt->socket.pci_irq = nano_skts[i].pci_irq;
+
+	return soc_pcmcia_request_irqs(skt,
+		nano_skts[i].pcmcia_irqs, nano_skts[i].pcmcia_irqs_size);
+}
+
+/*
+ * Release all resources.
+ */
+static void nanoengine_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
+{
+	unsigned i = skt->nr;
+
+	if (i >= num_nano_pcmcia_sockets)
+		return;
+
+	soc_pcmcia_free_irqs(skt,
+		nano_skts[i].pcmcia_irqs, nano_skts[i].pcmcia_irqs_size);
+}
+
+static int nanoengine_pcmcia_configure_socket(
+	struct soc_pcmcia_socket *skt, const socket_state_t *state)
+{
+	unsigned reset;
+	unsigned i = skt->nr;
+
+	if (i >= num_nano_pcmcia_sockets)
+		return -ENXIO;
+
+	switch (i) {
+	case 0:
+		reset = GPIO_PC_RESET0;
+		break;
+	case 1:
+		reset = GPIO_PC_RESET1;
+		break;
+	default:
+		return -ENXIO;
+	}
+
+	if (state->flags & SS_RESET)
+		GPSR = reset;
+	else
+		GPCR = reset;
+
+	return 0;
+}
+
+static void nanoengine_pcmcia_socket_state(
+	struct soc_pcmcia_socket *skt, struct pcmcia_state *state)
+{
+	unsigned long levels = GPLR;
+	unsigned i = skt->nr;
+
+	if (i >= num_nano_pcmcia_sockets)
+		return;
+
+	memset(state, 0, sizeof(struct pcmcia_state));
+	switch (i) {
+	case 0:
+		state->ready = (levels & GPIO_PC_READY0) ? 1 : 0;
+		state->detect = !(levels & GPIO_PC_CD0) ? 1 : 0;
+		break;
+	case 1:
+		state->ready = (levels & GPIO_PC_READY1) ? 1 : 0;
+		state->detect = !(levels & GPIO_PC_CD1) ? 1 : 0;
+		break;
+	default:
+		return;
+	}
+	state->bvd1 = 1;
+	state->bvd2 = 1;
+	state->wrprot = 0; /* Not available */
+	state->vs_3v = 1; /* Can only apply 3.3V */
+	state->vs_Xv = 0;
+}
+
+/*
+ * Enable card status IRQs on (re-)initialisation.  This can
+ * be called at initialisation, power management event, or
+ * pcmcia event.
+ */
+static void nanoengine_pcmcia_socket_init(struct soc_pcmcia_socket *skt)
+{
+	unsigned i = skt->nr;
+
+	if (i >= num_nano_pcmcia_sockets)
+		return;
+
+	soc_pcmcia_enable_irqs(skt,
+		nano_skts[i].pcmcia_irqs, nano_skts[i].pcmcia_irqs_size);
+}
+
+/*
+ * Disable card status IRQs on suspend.
+ */
+static void nanoengine_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
+{
+	unsigned i = skt->nr;
+
+	if (i >= num_nano_pcmcia_sockets)
+		return;
+
+	soc_pcmcia_disable_irqs(skt,
+		nano_skts[i].pcmcia_irqs, nano_skts[i].pcmcia_irqs_size);
+}
+
+static struct pcmcia_low_level nanoengine_pcmcia_ops = {
+	.owner			= THIS_MODULE,
+
+	.hw_init		= nanoengine_pcmcia_hw_init,
+	.hw_shutdown		= nanoengine_pcmcia_hw_shutdown,
+
+	.configure_socket	= nanoengine_pcmcia_configure_socket,
+	.socket_state		= nanoengine_pcmcia_socket_state,
+	.socket_init		= nanoengine_pcmcia_socket_init,
+	.socket_suspend		= nanoengine_pcmcia_socket_suspend,
+};
+
+int pcmcia_nanoengine_init(struct device *dev)
+{
+	int ret = -ENODEV;
+
+	if (machine_is_nanoengine())
+		ret = sa11xx_drv_pcmcia_probe(
+			dev, &nanoengine_pcmcia_ops, 0, 2);
+
+	return ret;
+}
+
-- 
1.7.0.3



From bugzilla-daemon at bugzilla.kernel.org  Wed Mar 31 17:52:17 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Wed, 31 Mar 2010 21:52:17 GMT
Subject: [Bug 15621] BUG: unable to handle kernel paging request  - comm:
	pccardd
In-Reply-To: <bug-15621-4463@https.bugzilla.kernel.org/>
References: <bug-15621-4463@https.bugzilla.kernel.org/>
Message-ID: <201003312152.o2VLqHN5011592@demeter.kernel.org>

https://bugzilla.kernel.org/show_bug.cgi?id=15621


Bjorn Helgaas <bjorn.helgaas at hp.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bjorn.helgaas at hp.com




--- Comment #11 from Bjorn Helgaas <bjorn.helgaas at hp.com>  2010-03-31 21:51:02 ---
Ozgur, can you please apply the patch from bug 15533, comment 5, turn on
CONFIG_ACPI_DEBUG, and boot with "acpi.debug_level=0x00010000
acpi.debug_layer=0x00000100" when you collect the console log without
"pci=nocrs"?

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


