From bugzilla-daemon at bugzilla.kernel.org  Thu Apr  1 04:30:53 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Thu, 1 Apr 2010 08:30:53 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: <201004010830.o318UrVf000542@demeter.kernel.org>

https://bugzilla.kernel.org/show_bug.cgi?id=15621


Ozgur Yuksel <ozgur.yuksel at oracle.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #25680|0                           |1
        is obsolete|                            |
  Attachment #25681|0                           |1
        is obsolete|                            |




--- Comment #12 from Ozgur Yuksel <ozgur.yuksel at oracle.com>  2010-04-01 08:30:37 ---
Created an attachment (id=25797)
 --> (https://bugzilla.kernel.org/attachment.cgi?id=25797)
Serial console log without pci=nocrs and ignore_loglevel

-- 
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 Apr  1 04:31:43 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Thu, 1 Apr 2010 08:31: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: <201004010831.o318Vhcc001320@demeter.kernel.org>

https://bugzilla.kernel.org/show_bug.cgi?id=15621





--- Comment #13 from Ozgur Yuksel <ozgur.yuksel at oracle.com>  2010-04-01 08:31:34 ---
Created an attachment (id=25798)
 --> (https://bugzilla.kernel.org/attachment.cgi?id=25798)
Serial console log without pci=nocrs and with ignore_loglevel

-- 
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 Apr  1 04:34:35 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Thu, 1 Apr 2010 08:34:35 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: <201004010834.o318YZ08003390@demeter.kernel.org>

https://bugzilla.kernel.org/show_bug.cgi?id=15621





--- Comment #14 from Ozgur Yuksel <ozgur.yuksel at oracle.com>  2010-04-01 08:33:32 ---
Interestingly when ignore_loglevel is used, the problem does not reproduce. Now
I'll proceed with actions in comment #11.

-- 
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 Apr  1 05:20:52 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Thu, 1 Apr 2010 09:20:52 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: <201004010920.o319KqUo015793@demeter.kernel.org>

https://bugzilla.kernel.org/show_bug.cgi?id=15621





--- Comment #15 from Ozgur Yuksel <ozgur.yuksel at oracle.com>  2010-04-01 09:19:29 ---
Tue, Mar 30, 2010 at 05:10:59PM -0600 was the time for Bjorn Helgaas to speak
thus:
> 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.

Interestingly when ignore_loglevel is used, the problem does not reproduce. Now
I'll proceed with actions in comment #11.

-- 
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 Apr  1 07:52:20 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Thu, 1 Apr 2010 11:52:20 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: <201004011152.o31BqKaf016666@demeter.kernel.org>

https://bugzilla.kernel.org/show_bug.cgi?id=15621





--- Comment #16 from Ozgur Yuksel <ozgur.yuksel at oracle.com>  2010-04-01 11:49:57 ---
Created an attachment (id=25799)
 --> (https://bugzilla.kernel.org/attachment.cgi?id=25799)
Serial console log without pci=nocrs and with acpi debugging

-- 
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 Apr  1 08:16:04 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Thu, 1 Apr 2010 12:16:04 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: <201004011216.o31CG4rC028278@demeter.kernel.org>

https://bugzilla.kernel.org/show_bug.cgi?id=15621





--- Comment #16 from Ozgur Yuksel <ozgur.yuksel at oracle.com>  2010-04-01 11:49:57 ---
Created an attachment (id=25799)
 --> (https://bugzilla.kernel.org/attachment.cgi?id=25799)
Serial console log without pci=nocrs and with acpi debugging

--- Comment #17 from Ozgur Yuksel <ozgur.yuksel at oracle.com>  2010-04-01 12:15:46 ---
Applied the patch from bug 15533, comment 5, turned on CONFIG_ACPI_DEBUG, and
booted with "acpi.debug_level=0x00010000 acpi.debug_layer=0x00000100" without
"pci=nocrs" - problem did not reproduce and the console log is uploaded.

-- 
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 Apr  1 13:36:20 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Thu, 1 Apr 2010 17:36:20 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: <201004011736.o31HaKaT019544@demeter.kernel.org>

https://bugzilla.kernel.org/show_bug.cgi?id=15621





--- Comment #18 from Bjorn Helgaas <bjorn.helgaas at hp.com>  2010-04-01 17:36:04 ---
Using ignore_loglevel shouldn't affect the problem, so I'm confused.
Can you reproduce the original problem and attach the entire serial
console log?

-- 
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 Apr  2 13:05:10 2010
From: bugzilla-daemon at bugzilla.kernel.org (bugzilla-daemon at bugzilla.kernel.org)
Date: Fri, 2 Apr 2010 17:05:10 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: <201004021705.o32H59KC011323@demeter.kernel.org>

https://bugzilla.kernel.org/show_bug.cgi?id=15621





--- Comment #19 from Ozgur Yuksel <ozgur.yuksel at oracle.com>  2010-04-02 17:03:07 ---
Thu, Apr 01, 2010 at 11:34:13AM -0600 was the time for Bjorn Helgaas to speak
thus:
> Using ignore_loglevel shouldn't affect the problem, so I'm confused.
> Can you reproduce the original problem and attach the entire serial
> console log?

It seems that the problem does not reproduce at all now. Unfortunately I do not
have the images I have built on 2010-03-29 08:46 and building from a fresh
ae6be51ed01d6c4aaf249a207b4434bc7785853b does not reproduce the problem. It is
most likely the specific .config I used at the time (which I do not have
anymore). Also I have been doing other builds on the same system, so maybe it
was just a stale module or smth. 

FWIW the problem does not reproduce with 2.6.34-rc3 at all too (on the very
same
hardware).

-- 
Configure bugmail: https://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  Fri Apr  2 22:27:11 2010
From: komurojun-mbn at nifty.com (Komuro)
Date: Sat, 3 Apr 2010 11:27:11 +0900
Subject: [BUG] [RFC PATCH 07/19] pcmcia: re-work pcmcia_request_irq()
In-Reply-To: <20100328094933.7a8b9271.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>
	<20100328094933.7a8b9271.komurojun-mbn@nifty.com>
Message-ID: <20100403112711.2227d898.komurojun-mbn@nifty.com>

Hi,

no interrupt is delivered to the pcmcia card.

I think pcmcia_request_configuration does not setup irq properly.



Best Regards
Komuro


From linux at dominikbrodowski.net  Sat Apr  3 03:09:13 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Sat, 3 Apr 2010 09:09:13 +0200
Subject: [BUG] [RFC PATCH 07/19] pcmcia: re-work pcmcia_request_irq()
In-Reply-To: <20100403112711.2227d898.komurojun-mbn@nifty.com>
References: <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>
	<20100328094933.7a8b9271.komurojun-mbn@nifty.com>
	<20100403112711.2227d898.komurojun-mbn@nifty.com>
Message-ID: <20100403070913.GA17126@comet.dominikbrodowski.net>

Hey,

do you mean this?


diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index bb927ed..63d09df 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -452,7 +452,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_PULSE_IRQ)
+		if ((req->Attributes & CONF_ENABLE_IRQ) &&
+			!(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);


Best,
	Dominik


From komurojun-mbn at nifty.com  Sat Apr  3 05:19:09 2010
From: komurojun-mbn at nifty.com (Komuro)
Date: Sat, 3 Apr 2010 18:19:09 +0900
Subject: [BUG] [RFC PATCH 07/19] pcmcia: re-work pcmcia_request_irq()
In-Reply-To: <20100403112711.2227d898.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>
	<20100328094933.7a8b9271.komurojun-mbn@nifty.com>
	<20100403112711.2227d898.komurojun-mbn@nifty.com>
Message-ID: <20100403181909.b5b0cb8f.komurojun-mbn@nifty.com>

Hi,

>do you mean this?
>
>
>diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
>index bb927ed..63d09df 100644
>--- a/drivers/pcmcia/pcmcia_resource.c
>+++ b/drivers/pcmcia/pcmcia_resource.c
>@@ -452,7 +452,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_PULSE_IRQ)
>+		if ((req->Attributes & CONF_ENABLE_IRQ) &&
>+			!(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);


OK. works.


From markinbox at inbox.lv  Sat Apr  3 16:00:16 2010
From: markinbox at inbox.lv (Mark Anthony)
Date: Sat, 3 Apr 2010 22:00:16 +0200
Subject: message
Message-ID: <02ad3c42-40271-13029167467477@vvv>

I greet you as I write to invite you as a partner.

I have outlined plans in conjunction with my colleague in the cargo handling department to legally assign a beneficiary to a box deposited with us for onward delivery by our customer who died in 2004. We have discovered it contains money which came from various contracting jobs he executed.

I am writing basically because of your location, and also because he departed leaving no will.

At the moment, it is in our company storage-facility without a claimant. The content was not officially declared; therefore it is better to put it into use for good purposes rather than let it remain in the vaults. You will be given complete procedural details of how we intend to genuinely achieve this objective.

I do not have information about your competence, but this is a great opportunity that can be consummated on the background of sincerity and openness.
Your response is anticipated.

Sincerely,

Mark Anthony
email: marksedds at inbox.lv



From komurojun-mbn at nifty.com  Sun Apr  4 08:13:44 2010
From: komurojun-mbn at nifty.com (Komuro)
Date: Sun, 4 Apr 2010 21:13:44 +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: <20100404211344.077c6b2f.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

>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...


This problem happens to the net/pcmcia/smc91c92_cs.c driver too.
so this is not a drivers/ata problem.

cf->io.win[0].base returns 0 at smc_configcheck();
So I think this is a pcmcia_request_io problem.


[dmesg]
pcmcia 0.0: pcmcia: registering new device pcmcia0.0
eth0: smc91c92 rev 3: io 0x30, irq 17, hw_addr 00:00:86:xx:xx:xx
  4608 byte buffer, auto xcvr



static int smc_configcheck(struct pcmcia_device *p_dev,
			   cistpl_cftable_entry_t *cf,
			   cistpl_cftable_entry_t *dflt,
			   unsigned int vcc,
			   void *priv_data)
{
	p_dev->io.BasePort1 = cf->io.win[0].base;
	p_dev->io.IOAddrLines = cf->io.flags & CISTPL_IO_LINES_MASK;
	return pcmcia_request_io(p_dev, &p_dev->io);
}



[lspcmcia]
Socket 0 Bridge:   	[yenta_cardbus] 	(bus ID: 0000:00:0c.0)
	Configuration:	state: on	ready: yes
			Voltage: 5.0V Vcc: 5.0V Vpp: 0.0V
			Available IRQs: none
			Available ioports:	0x00000100 - 0x000003af
						0x000003e0 - 0x000004ff
						0x00000820 - 0x000008ff
						0x00000a00 - 0x00000aff
						0x00000c00 - 0x00000cf7
			Available iomem:	0xa0000000 - 0xa0ffffff

[dump_cis]

offset 0x54, tuple 0x1a, link 0x05
  01 01 00 03 01 
config base 0x0300 mask 0x0001 last_index 0x01

offset 0x5b, tuple 0x1b, link 0x0c
  c1 01 19 71 55 06 0e 2d 64 30 ff ff 
cftable_entry 0x01 [default]
  Vcc Vnom 5V Iavg 100mA Ipeak 120mA Idown 25mA
  io 0x0000-0x000f [lines=4] [8bit] [16bit]
  irq mask 0xffff [level]

offset 0x69, tuple 0x1b, link 0x05
  83 01 08 65 ff 
cftable_entry 0x03
  io 0x0000-0x001f [lines=5] [8bit] [16bit]
  1 bytes in subtuples

offset 0x70, tuple 0x20, link 0x04
  28 01 03 01 
manfid 0x0128, 0x0103

offset 0x76, tuple 0x14, link 0x00
no_long_link

Best Regards
Komuro


From linux at dominikbrodowski.net  Sun Apr  4 12:18:02 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Sun, 4 Apr 2010 18:18:02 +0200
Subject: [PATCH] pcmcia: fix up alignf issues
In-Reply-To: <20100404211344.077c6b2f.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>
	<20100404211344.077c6b2f.komurojun-mbn@nifty.com>
Message-ID: <20100404161802.GA9225@comet.dominikbrodowski.net>

Hey,

On Sun, Apr 04, 2010 at 09:13:44PM +0900, Komuro wrote:
> cf->io.win[0].base returns 0 at smc_configcheck();
> So I think this is a pcmcia_request_io problem.

Actually, it seems to be an issue with rsrc_nonstatic. Attached is a patch
for 2.6.34-rc; I'll look whether 2.6.33 requires a backport right away.

Best,
	Dominik

From: Dominik Brodowski <linux at dominikbrodowski.net>
Date: Sun, 4 Apr 2010 18:10:35 +0200
Subject: [PATCH] pcmcia: fix up alignf issues

- pcmcia_align() used a "start" variable twice. That's obviously a bad
  idea.

- pcmcia_common_resource() needs the current "start" parameter being
  passed, instead of res->start.

- pcmcia_common_resource() doesn't use the size and align parameters,
  so get rid of those.

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

diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c
index 2e47991..559069a 100644
--- a/drivers/pcmcia/rsrc_nonstatic.c
+++ b/drivers/pcmcia/rsrc_nonstatic.c
@@ -596,19 +596,17 @@ struct pcmcia_align_data {
 	struct resource_map	*map;
 };
 
-static resource_size_t
-pcmcia_common_align(void *align_data, const struct resource *res,
-			resource_size_t size, resource_size_t align)
+static resource_size_t pcmcia_common_align(struct pcmcia_align_data *align_data,
+					resource_size_t start)
 {
-	struct pcmcia_align_data *data = align_data;
-	resource_size_t start;
+	resource_size_t ret;
 	/*
 	 * Ensure that we have the correct start address
 	 */
-	start = (res->start & ~data->mask) + data->offset;
-	if (start < res->start)
-		start += data->mask + 1;
-	return start;
+	ret = (start & ~align_data->mask) + align_data->offset;
+	if (ret < start)
+		ret += align_data->mask + 1;
+	return ret;
 }
 
 static resource_size_t
@@ -619,29 +617,28 @@ pcmcia_align(void *align_data, const struct resource *res,
 	struct resource_map *m;
 	resource_size_t start;
 
-	start = pcmcia_common_align(data, res, size, align);
+	start = pcmcia_common_align(data, res->start);
 
 	for (m = data->map->next; m != data->map; m = m->next) {
-		unsigned long start = m->base;
-		unsigned long end = m->base + m->num - 1;
+		unsigned long map_start = m->base;
+		unsigned long map_end = m->base + m->num - 1;
 
 		/*
 		 * If the lower resources are not available, try aligning
 		 * to this entry of the resource database to see if it'll
 		 * fit here.
 		 */
-		if (res->start < start) {
-			start = pcmcia_common_align(data, res, size, align);
-		}
+		if (start < map_start)
+			start = pcmcia_common_align(data, map_start);
 
 		/*
 		 * If we're above the area which was passed in, there's
 		 * no point proceeding.
 		 */
-		if (res->start >= res->end)
+		if (start >= res->end)
 			break;
 
-		if ((res->start + size - 1) <= end)
+		if ((start + size - 1) <= map_end)
 			break;
 	}
 


From komurojun-mbn at nifty.com  Mon Apr  5 07:18:52 2010
From: komurojun-mbn at nifty.com (Komuro)
Date: Mon, 5 Apr 2010 20:18:52 +0900
Subject: [PATCH] pcmcia: fix up alignf issues
In-Reply-To: <20100404211344.077c6b2f.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>
	<20100404211344.077c6b2f.komurojun-mbn@nifty.com>
Message-ID: <20100405201852.89e3396b.komurojun-mbn@nifty.com>

Hi,

>> cf->io.win[0].base returns 0 at smc_configcheck();
>> So I think this is a pcmcia_request_io problem.
>
>Actually, it seems to be an issue with rsrc_nonstatic. Attached is a patch
>for 2.6.34-rc;

OK. works.



From linux at dominikbrodowski.net  Mon Apr  5 16:40:50 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 5 Apr 2010 22:40:50 +0200
Subject: [PATCH] pcmcia: fix up alignf issues
In-Reply-To: <20100405201852.89e3396b.komurojun-mbn@nifty.com>
References: <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>
	<20100404211344.077c6b2f.komurojun-mbn@nifty.com>
	<20100405201852.89e3396b.komurojun-mbn@nifty.com>
Message-ID: <20100405204050.GA23159@comet.dominikbrodowski.net>

On Mon, Apr 05, 2010 at 08:18:52PM +0900, Komuro wrote:
> Hi,
> 
> >> cf->io.win[0].base returns 0 at smc_configcheck();
> >> So I think this is a pcmcia_request_io problem.
> >
> >Actually, it seems to be an issue with rsrc_nonstatic. Attached is a patch
> >for 2.6.34-rc;
> 
> OK. works.

Thanks for testing! 2.6.33 does not seem to have this problem. I'll push the
fix to Linus soon.

Best,
	Dominik


From linux at dominikbrodowski.net  Tue Apr  6 15:50:23 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Tue, 6 Apr 2010 21:50:23 +0200
Subject: [git pull] PCMCIA bugfix for 2.6.34-rc3
Message-ID: <20100406195023.GA7068@comet.dominikbrodowski.net>

Linus,

one important PCMCIA bugfix for 2.6.34-rc4 is 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.

Thanks,
	Dominik

----

Dominik Brodowski (1):
      pcmcia: fix up alignf issues

 drivers/pcmcia/rsrc_nonstatic.c |   31 ++++++++++++++-----------------
 1 files changed, 14 insertions(+), 17 deletions(-)


From komurojun-mbn at nifty.com  Thu Apr  8 08:37:17 2010
From: komurojun-mbn at nifty.com (Komuro)
Date: Thu, 8 Apr 2010 21:37:17 +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: <20100408213717.905d56d8.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.
> 

I read the data from port 0x378 to 0x37f at kernel 2.6.34-rc3.

0x378 => 0
0x379 => 7f
0x37a => c4
0x37b => ff
0x37c => ff
0x37e => ff
0x37f => ff

It means this area is _not_ clean.

So I think this is a pcmcia_core problem
not _CRS / ACPI.

It was reliably detected by io_probe before.

Best Regards
Komuro


From linux at dominikbrodowski.net  Thu Apr  8 13:29:01 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Thu, 8 Apr 2010 19:29:01 +0200
Subject: [kernel 2.6.34-rc2] cs: IO port probe 0x100-0x3af: excluding
	0x378-0x37f
In-Reply-To: <20100408213717.905d56d8.komurojun-mbn@nifty.com>
References: <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>
	<20100408213717.905d56d8.komurojun-mbn@nifty.com>
Message-ID: <20100408172901.GA28725@comet.dominikbrodowski.net>

Hey,

> So I think this is a pcmcia_core problem not _CRS / ACPI.
> 
> It was reliably detected by io_probe before.

I think we got hit by the same issue as at commit
7a96e87d6e58a07235a2bc3eff9b093af4937a72 . Could you test this patch,
please?

Best,
	Dominik


Author: Dominik Brodowski <linux at dominikbrodowski.net>
Date:   Thu Apr 8 19:23:07 2010 +0200

    pcmcia: fix io_probe due to parent (PCI) resources
    
    Similar to commit 7a96e87d, we need to be aware of any parent PCI
    device when requesting IO regions, even only for testing
    ("probing").
    
    Reported-by: Komuro <komurojun-mbn at nifty.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 559069a..1178a82 100644
--- a/drivers/pcmcia/rsrc_nonstatic.c
+++ b/drivers/pcmcia/rsrc_nonstatic.c
@@ -214,7 +214,7 @@ static void do_io_probe(struct pcmcia_socket *s, unsigned int base,
 		return;
 	}
 	for (i = base, most = 0; i < base+num; i += 8) {
-		res = claim_region(NULL, i, 8, IORESOURCE_IO, "PCMCIA ioprobe");
+		res = claim_region(s, i, 8, IORESOURCE_IO, "PCMCIA ioprobe");
 		if (!res)
 			continue;
 		hole = inb(i);
@@ -231,9 +231,14 @@ static void do_io_probe(struct pcmcia_socket *s, unsigned int base,
 
 	bad = any = 0;
 	for (i = base; i < base+num; i += 8) {
-		res = claim_region(NULL, i, 8, IORESOURCE_IO, "PCMCIA ioprobe");
-		if (!res)
+		res = claim_region(s, i, 8, IORESOURCE_IO, "PCMCIA ioprobe");
+		if (!res) {
+			if (!any)
+				printk(" excluding");
+			if (!bad)
+				bad = any = i;
 			continue;
+		}
 		for (j = 0; j < 8; j++)
 			if (inb(i+j) != most)
 				break;
@@ -253,6 +258,7 @@ static void do_io_probe(struct pcmcia_socket *s, unsigned int base,
 	}
 	if (bad) {
 		if ((num > 16) && (bad == base) && (i == base+num)) {
+			sub_interval(&s_data->io_db, bad, i-bad);
 			printk(" nothing: probe failed.\n");
 			return;
 		} else {


From komurojun-mbn at nifty.com  Sat Apr 10 20:15:14 2010
From: komurojun-mbn at nifty.com (Komuro)
Date: Sun, 11 Apr 2010 09:15:14 +0900
Subject: [kernel 2.6.34-rc2] cs: IO port probe 0x100-0x3af: excluding
	0x378-0x37f
In-Reply-To: <20100408213717.905d56d8.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>
	<20100408213717.905d56d8.komurojun-mbn@nifty.com>
Message-ID: <20100411091514.3d5e1026.komurojun-mbn@nifty.com>

Hi,

>> So I think this is a pcmcia_core problem not _CRS / ACPI.
>> 
>> It was reliably detected by io_probe before.
>
>I think we got hit by the same issue as at commit
>7a96e87d6e58a07235a2bc3eff9b093af4937a72 . Could you test this patch,
>please?

OK. works.


pcmcia_socket pcmcia_socket1: cs: IO port probe 0x100-0x3af: excluding 0x170-0x177 0x1f0-0x1f7 0x290-0x297 0x370-0x37f
pcmcia_socket pcmcia_socket1: cs: IO port probe 0x3e0-0x4ff: excluding 0x3e0-0x3e7 0x3f0-0x41f 0x4d0-0x4d7
pcmcia_socket pcmcia_socket1: cs: IO port probe 0x820-0x8ff: excluding 0x820-0x87f
pcmcia_socket pcmcia_socket1: cs: IO port probe 0xc00-0xcf7: clean.


From kristoffer.ericson at gmail.com  Sun Apr 11 06:54:51 2010
From: kristoffer.ericson at gmail.com (Kristoffer Ericson)
Date: Sun, 11 Apr 2010 12:54:51 +0200
Subject: 0001-Add-support-for-Kingston-4GB-Compact-Flash-card.patch
Message-ID: <20100411125451.35cdceb9.kristoffer.ericson@gmail.com>


This patch adds support for the Kingston 4GB compact flash card
when used together with ide-cs.c

Signed-off-by:Kristoffer Ericson <kristoffer.ericson at gmail.com>

diff --git a/drivers/ide/ide-cs.c b/drivers/ide/ide-cs.c
index ab87e4f..e9cc731 100644
--- a/drivers/ide/ide-cs.c
+++ b/drivers/ide/ide-cs.c
@@ -409,6 +409,7 @@ static struct pcmcia_device_id ide_ids[] = {
 	PCMCIA_DEVICE_PROD_ID12("Hyperstone", "Model1", 0x3d5b9ef5, 0xca6ab420),
 	PCMCIA_DEVICE_PROD_ID12("IBM", "microdrive", 0xb569a6e5, 0xa6d76178),
 	PCMCIA_DEVICE_PROD_ID12("IBM", "IBM17JSSFP20", 0xb569a6e5, 0xf2508753),
+	PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF CARD 4GB", 0x2e6d1829, 0x531E7D10),
 	PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF8GB", 0x2e6d1829, 0xacbe682e),
 	PCMCIA_DEVICE_PROD_ID12("IO DATA", "CBIDE2      ", 0x547e66dc, 0x8671043b),
 	PCMCIA_DEVICE_PROD_ID12("IO DATA", "PCIDE", 0x547e66dc, 0x5c5ab149),
-- 
1.7.0.3





-- 
Kristoffer Ericson <kristoffer.ericson at gmail.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-support-for-Kingston-4GB-Compact-Flash-card.patch
Type: application/octet-stream
Size: 1124 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-pcmcia/attachments/20100411/ea5a7b47/attachment.obj>

From kristoffer.ericson at gmail.com  Sun Apr 11 06:56:41 2010
From: kristoffer.ericson at gmail.com (Kristoffer Ericson)
Date: Sun, 11 Apr 2010 12:56:41 +0200
Subject: 0002-Add-support-for-Kingston-1GB-Compact-Flash-card.patch
Message-ID: <20100411125641.e46fab99.kristoffer.ericson@gmail.com>

This patch adds support for the Kingston 1GB compact flash card
when used together with ide-cs.

Signed-off-by:Kristoffer Ericson <kristoffer.ericson at gmail.com>

diff --git a/drivers/ide/ide-cs.c b/drivers/ide/ide-cs.c
index e9cc731..3134335 100644
--- a/drivers/ide/ide-cs.c
+++ b/drivers/ide/ide-cs.c
@@ -409,7 +409,8 @@ static struct pcmcia_device_id ide_ids[] = {
 	PCMCIA_DEVICE_PROD_ID12("Hyperstone", "Model1", 0x3d5b9ef5, 0xca6ab420),
 	PCMCIA_DEVICE_PROD_ID12("IBM", "microdrive", 0xb569a6e5, 0xa6d76178),
 	PCMCIA_DEVICE_PROD_ID12("IBM", "IBM17JSSFP20", 0xb569a6e5, 0xf2508753),
-	PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF CARD 4GB", 0x2e6d1829, 0x531E7D10),
+	PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF CARD 1GB", 0x2e6d1829, 0x3e520e17),
+	PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF CARD 4GB", 0x2e6d1829, 0x531e7d10),
 	PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF8GB", 0x2e6d1829, 0xacbe682e),
 	PCMCIA_DEVICE_PROD_ID12("IO DATA", "CBIDE2      ", 0x547e66dc, 0x8671043b),
 	PCMCIA_DEVICE_PROD_ID12("IO DATA", "PCIDE", 0x547e66dc, 0x5c5ab149),
-- 
1.7.0.3



-- 
Kristoffer Ericson <kristoffer.ericson at gmail.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Add-support-for-Kingston-1GB-Compact-Flash-card.patch
Type: application/octet-stream
Size: 1283 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-pcmcia/attachments/20100411/fefe50a4/attachment.obj>

From kristoffer.ericson at gmail.com  Sun Apr 11 06:58:30 2010
From: kristoffer.ericson at gmail.com (Kristoffer Ericson)
Date: Sun, 11 Apr 2010 12:58:30 +0200
Subject: 0003-Add-support-for-Transcend-4GB-Compact-flash-card.patch
Message-ID: <20100411125830.9adf0010.kristoffer.ericson@gmail.com>

This patch adds support for the Transcend 4GB card compact flash card
when used together with ide-cs.

Signed-off-by: Kristoffer Ericson <kristoffer.ericson at gmail.com>

diff --git a/drivers/ide/ide-cs.c b/drivers/ide/ide-cs.c
index 3134335..31493f0 100644
--- a/drivers/ide/ide-cs.c
+++ b/drivers/ide/ide-cs.c
@@ -431,6 +431,7 @@ static struct pcmcia_device_id ide_ids[] = {
 	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS1GCF80", 0x709b1bf1, 0x2a54d4b1),
 	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS2GCF120", 0x709b1bf1, 0x969aa4f2),
 	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF120", 0x709b1bf1, 0xf54a91c8),
+	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF133", 0x709b1bf1, 0x9351e59d),
 	PCMCIA_DEVICE_PROD_ID12("WIT", "IDE16", 0x244e5994, 0x3e232852),
 	PCMCIA_DEVICE_PROD_ID12("WEIDA", "TWTTI", 0xcc7cf69c, 0x212bb918),
 	PCMCIA_DEVICE_PROD_ID1("STI Flash", 0xe4a13209),
-- 
1.7.0.3



-- 
Kristoffer Ericson <kristoffer.ericson at gmail.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Add-support-for-Transcend-4GB-Compact-flash-card.patch
Type: application/octet-stream
Size: 1100 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-pcmcia/attachments/20100411/5c2f04f8/attachment.obj>

From linux at dominikbrodowski.net  Sun Apr 11 08:25:36 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Sun, 11 Apr 2010 14:25:36 +0200
Subject: 0001-Add-support-for-Kingston-4GB-Compact-Flash-card.patch
In-Reply-To: <20100411125830.9adf0010.kristoffer.ericson@gmail.com>
	<20100411125641.e46fab99.kristoffer.ericson@gmail.com>
	<20100411125451.35cdceb9.kristoffer.ericson@gmail.com>
Message-ID: <20100411122536.GB17719@comet.dominikbrodowski.net>

Kristoffer,

could you merge these three patches into one, please, use no caps in hex
values, and add the same lines also to pata_pcmcia.c, please?

Best,
	Dominik


From kristoffer.ericson at gmail.com  Sun Apr 11 09:18:43 2010
From: kristoffer.ericson at gmail.com (Kristoffer Ericson)
Date: Sun, 11 Apr 2010 15:18:43 +0200
Subject: 0001-Add-support-for-Kingston-4GB-Compact-Flash-card.patch
In-Reply-To: <20100411122536.GB17719@comet.dominikbrodowski.net>
References: <20100411125451.35cdceb9.kristoffer.ericson@gmail.com>
	<20100411122536.GB17719@comet.dominikbrodowski.net>
Message-ID: <20100411151843.704f9494.kristoffer.ericson@gmail.com>

On Sun, 11 Apr 2010 14:25:36 +0200
Dominik Brodowski <linux at dominikbrodowski.net> wrote:

> Kristoffer,
> 
> could you merge these three patches into one, please, use no caps in hex
> values, and add the same lines also to pata_pcmcia.c, please?

roger will do.

> 
> Best,
> 	Dominik


-- 
Kristoffer Ericson <kristoffer.ericson at gmail.com>


From linux at blala.de  Mon Apr 12 11:49:15 2010
From: linux at blala.de (Alexander Kurz)
Date: Mon, 12 Apr 2010 19:49:15 +0400 (MSD)
Subject: [PATCH 1/2] drivers/mtd/maps/pcmciamtd.c: fixing obvious errors
Message-ID: <alpine.DEB.1.10.1004121945510.7438@blala.de>

Hello folks,
this is an attempt, to reanimate the pcmciamtd driver.
The driver has been marked as BROKEN for much too long.
After fixing the obvious errors, the patched driver will now compile
again on v2.6.34-rc3. First tests with two 4MB-Flashcards including
erase- and write test with one of the cards where successfull.
Here is an erase/write/read example:

# pccardctl ident
Socket 1:
  product info: "SMART Modular Technologies", " 4MB FLASH Card", "", ""
  function: 1 (memory)
 
# flash_erase /dev/mtd0 0 64
Erase Total 64 Units
Region 0 is at 0 of 16 sector and with sector size 20000
Region 1 is at 2097152 of 16 sector and with sector size 20000
Performing Flash Erase of length 131072 at offset 0x1e0000
Moving to region 1
Performing Flash Erase of length 131072 at offset 0x3e0000
Moving to region 2
 done

# dd if=/dev/mtd0 | od -t x1       
0000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
*
20000000
4194304 Bytes (4,2 MB) kopiert, 5,99274 s, 700 kB/s

# dd bs=65536 if=~/r4 of=/dev/mtd0
64+0 Datens?tze ein
64+0 Datens?tze aus
4194304 Bytes (4,2 MB) kopiert, 39,5289 s, 106 kB/s

# dd if=/dev/mtd0 of=c1
# diff c1 ~/r4 && echo 'jipeee!'
jipeee!

Cheers, Alexander Kurz

From linux at kbdbabel.org  Sun Apr 11 17:05:28 2010
From: linux at kbdbabel.org (Alexander Kurz)
Date: Sun, 11 Apr 2010 23:05:28 +0200
Subject: [PATCH 1/2] drivers/mtd/maps/pcmciamtd.c: fixing obvious errors to get the
 BROKEN-flag off this nice module + two new PCMCIA_DEVICE_PROD_IDs
Message-ID: <mailman.300.1271087372.2170.linux-pcmcia@lists.infradead.org>

Signed-off-by: Alexander Kurz <linux at kbdbabel.org>
---
 drivers/mtd/maps/Kconfig     |    2 +-
 drivers/mtd/maps/pcmciamtd.c |   32 ++++++++++++++++----------------
 2 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig
index aa2807d..f22bc9f 100644
--- a/drivers/mtd/maps/Kconfig
+++ b/drivers/mtd/maps/Kconfig
@@ -435,7 +435,7 @@ config MTD_PCI
 
 config MTD_PCMCIA
 	tristate "PCMCIA MTD driver"
-	depends on PCMCIA && MTD_COMPLEX_MAPPINGS && BROKEN
+	depends on PCMCIA && MTD_COMPLEX_MAPPINGS
 	help
 	  Map driver for accessing PCMCIA linear flash memory cards. These
 	  cards are usually around 4-16MiB in size. This does not include
diff --git a/drivers/mtd/maps/pcmciamtd.c b/drivers/mtd/maps/pcmciamtd.c
index 689d6a7..2dbe939 100644
--- a/drivers/mtd/maps/pcmciamtd.c
+++ b/drivers/mtd/maps/pcmciamtd.c
@@ -137,7 +137,7 @@ static map_word pcmcia_read8_remap(struct map_info *map, unsigned long ofs)
 		return d;
 
 	d.x[0] = readb(addr);
-	DEBUG(3, "ofs = 0x%08lx (%p) data = 0x%02x", ofs, addr, d.x[0]);
+	DEBUG(3, "ofs = 0x%08lx (%p) data = 0x%02lx", ofs, addr, d.x[0]);
 	return d;
 }
 
@@ -152,7 +152,7 @@ static map_word pcmcia_read16_remap(struct map_info *map, unsigned long ofs)
 		return d;
 
 	d.x[0] = readw(addr);
-	DEBUG(3, "ofs = 0x%08lx (%p) data = 0x%04x", ofs, addr, d.x[0]);
+	DEBUG(3, "ofs = 0x%08lx (%p) data = 0x%04lx", ofs, addr, d.x[0]);
 	return d;
 }
 
@@ -190,7 +190,7 @@ static void pcmcia_write8_remap(struct map_info *map, map_word d, unsigned long
 	if(!addr)
 		return;
 
-	DEBUG(3, "adr = 0x%08lx (%p)  data = 0x%02x", adr, addr, d.x[0]);
+	DEBUG(3, "adr = 0x%08lx (%p)  data = 0x%02lx", adr, addr, d.x[0]);
 	writeb(d.x[0], addr);
 }
 
@@ -201,7 +201,7 @@ static void pcmcia_write16_remap(struct map_info *map, map_word d, unsigned long
 	if(!addr)
 		return;
 
-	DEBUG(3, "adr = 0x%08lx (%p)  data = 0x%04x", adr, addr, d.x[0]);
+	DEBUG(3, "adr = 0x%08lx (%p)  data = 0x%04lx", adr, addr, d.x[0]);
 	writew(d.x[0], addr);
 }
 
@@ -245,7 +245,7 @@ static map_word pcmcia_read8(struct map_info *map, unsigned long ofs)
 		return d;
 
 	d.x[0] = readb(win_base + ofs);
-	DEBUG(3, "ofs = 0x%08lx (%p) data = 0x%02x", ofs, win_base + ofs, d.x[0]);
+	DEBUG(3, "ofs = 0x%08lx (%p) data = 0x%02lx", ofs, win_base + ofs, d.x[0]);
 	return d;
 }
 
@@ -259,7 +259,7 @@ static map_word pcmcia_read16(struct map_info *map, unsigned long ofs)
 		return d;
 
 	d.x[0] = readw(win_base + ofs);
-	DEBUG(3, "ofs = 0x%08lx (%p) data = 0x%04x", ofs, win_base + ofs, d.x[0]);
+	DEBUG(3, "ofs = 0x%08lx (%p) data = 0x%04lx", ofs, win_base + ofs, d.x[0]);
 	return d;
 }
 
@@ -276,27 +276,27 @@ static void pcmcia_copy_from(struct map_info *map, void *to, unsigned long from,
 }
 
 
-static void pcmcia_write8(struct map_info *map, u8 d, unsigned long adr)
+static void pcmcia_write8(struct map_info *map, map_word d, unsigned long adr)
 {
 	caddr_t win_base = (caddr_t)map->map_priv_2;
 
 	if(DEV_REMOVED(map))
 		return;
 
-	DEBUG(3, "adr = 0x%08lx (%p)  data = 0x%02x", adr, win_base + adr, d);
-	writeb(d, win_base + adr);
+	DEBUG(3, "adr = 0x%08lx (%p)  data = 0x%02lx", adr, win_base + adr, d.x[0]);
+	writeb(d.x[0], win_base + adr);
 }
 
 
-static void pcmcia_write16(struct map_info *map, u16 d, unsigned long adr)
+static void pcmcia_write16(struct map_info *map, map_word d, unsigned long adr)
 {
 	caddr_t win_base = (caddr_t)map->map_priv_2;
 
 	if(DEV_REMOVED(map))
 		return;
 
-	DEBUG(3, "adr = 0x%08lx (%p)  data = 0x%04x", adr, win_base + adr, d);
-	writew(d, win_base + adr);
+	DEBUG(3, "adr = 0x%08lx (%p)  data = 0x%04lx", adr, win_base + adr, d.x[0]);
+	writew(d.x[0], win_base + adr);
 }
 
 
@@ -432,7 +432,7 @@ static int pcmciamtd_cistpl_geo(struct pcmcia_device *p_dev,
 }
 
 
-static void card_settings(struct pcmciamtd_dev *dev, struct pcmcia_device *link, int *new_name)
+static void card_settings(struct pcmciamtd_dev *dev, struct pcmcia_device *p_dev, int *new_name)
 {
 	int i;
 
@@ -490,7 +490,6 @@ static int pcmciamtd_config(struct pcmcia_device *link)
 {
 	struct pcmciamtd_dev *dev = link->priv;
 	struct mtd_info *mtd = NULL;
-	cs_status_t status;
 	win_req_t req;
 	int ret;
 	int i;
@@ -565,7 +564,7 @@ static int pcmciamtd_config(struct pcmcia_device *link)
 	dev->pcmcia_map.map_priv_1 = (unsigned long)dev;
 	dev->pcmcia_map.map_priv_2 = (unsigned long)link->win;
 
-	dev->vpp = (vpp) ? vpp : link->socket.socket.Vpp;
+	dev->vpp = (vpp) ? vpp : link->socket->socket.Vpp;
 	link->conf.Attributes = 0;
 	if(setvpp == 2) {
 		link->conf.Vpp = dev->vpp;
@@ -652,7 +651,6 @@ static int pcmciamtd_config(struct pcmcia_device *link)
 	link->dev_node = &dev->node;
 	return 0;
 
- failed:
 	err("CS Error, exiting");
 	pcmciamtd_release(link);
 	return -ENODEV;
@@ -737,8 +735,10 @@ static struct pcmcia_device_id pcmciamtd_ids[] = {
 	PCMCIA_DEVICE_PROD_ID12("intel", "VALUE SERIES 100 ", 0x40ade711, 0xdf8506d8),
 	PCMCIA_DEVICE_PROD_ID12("KINGMAX TECHNOLOGY INC.", "SRAM 256K Bytes", 0x54d0c69c, 0xad12c29c),
 	PCMCIA_DEVICE_PROD_ID12("Maxtor", "MAXFL MobileMax Flash Memory Card", 0xb68968c8, 0x2dfb47b0),
+	PCMCIA_DEVICE_PROD_ID123("M-Systems", "M-SYS Flash Memory Card", "(c) M-Systems", 0x7ed2ad87, 0x675dc3fb, 0x7aef3965),
 	PCMCIA_DEVICE_PROD_ID12("SEIKO EPSON", "WWB101EN20", 0xf9876baf, 0xad0b207b),
 	PCMCIA_DEVICE_PROD_ID12("SEIKO EPSON", "WWB513EN20", 0xf9876baf, 0xe8d884ad),
+	PCMCIA_DEVICE_PROD_ID12("SMART Modular Technologies", " 4MB FLASH Card", 0x96fd8277, 0x737a5b05),
 	PCMCIA_DEVICE_PROD_ID12("Starfish, Inc.", "REX-3000", 0x05ddca47, 0xe7d67bca),
 	PCMCIA_DEVICE_PROD_ID12("Starfish, Inc.", "REX-4100", 0x05ddca47, 0x7bc32944),
 	/* the following was commented out in pcmcia-cs-3.2.7 */
-- 
1.7.0

--8323328-188330283-1271087360=:7438--


From linux at blala.de  Mon Apr 12 11:51:12 2010
From: linux at blala.de (Alexander Kurz)
Date: Mon, 12 Apr 2010 19:51:12 +0400 (MSD)
Subject: [PATCH 2/2] drivers/mtd/maps/pcmciamtd.c: coding style cleanups
Message-ID: <alpine.DEB.1.10.1004121949570.7438@blala.de>


From linux at kbdbabel.org  Sun Apr 11 17:07:19 2010
From: linux at kbdbabel.org (Alexander Kurz)
Date: Sun, 11 Apr 2010 23:07:19 +0200
Subject: [PATCH 2/2] drivers/mtd/maps/pcmciamtd.c: coding style cleanups
Message-ID: <mailman.302.1271087477.2170.linux-pcmcia@lists.infradead.org>

Signed-off-by: Alexander Kurz <linux at kbdbabel.org>
---
 drivers/mtd/maps/pcmciamtd.c |   55 +++++++++++++++++++++++++----------------
 1 files changed, 33 insertions(+), 22 deletions(-)

diff --git a/drivers/mtd/maps/pcmciamtd.c b/drivers/mtd/maps/pcmciamtd.c
index 2dbe939..0db1ac4 100644
--- a/drivers/mtd/maps/pcmciamtd.c
+++ b/drivers/mtd/maps/pcmciamtd.c
@@ -40,10 +40,7 @@ MODULE_PARM_DESC(debug, "Set Debug Level 0=quiet, 5=noisy");
 static const int debug = 0;
 #endif
 
-#define err(format, arg...) printk(KERN_ERR "pcmciamtd: " format "\n" , ## arg)
 #define info(format, arg...) printk(KERN_INFO "pcmciamtd: " format "\n" , ## arg)
-#define warn(format, arg...) printk(KERN_WARNING "pcmciamtd: " format "\n" , ## arg)
-
 
 #define DRIVER_DESC	"PCMCIA Flash memory card driver"
 
@@ -100,7 +97,9 @@ module_param(mem_type, int, 0);
 MODULE_PARM_DESC(mem_type, "Set Memory type (0=Flash, 1=RAM, 2=ROM, default=0)");
 
 
-/* read/write{8,16} copy_{from,to} routines with window remapping to access whole card */
+/* read/write{8,16} copy_{from,to} routines with window remapping
+ * to access whole card
+ */
 static caddr_t remap_window(struct map_info *map, unsigned long to)
 {
 	struct pcmciamtd_dev *dev = (struct pcmciamtd_dev *)map->map_priv_1;
@@ -245,7 +244,8 @@ static map_word pcmcia_read8(struct map_info *map, unsigned long ofs)
 		return d;
 
 	d.x[0] = readb(win_base + ofs);
-	DEBUG(3, "ofs = 0x%08lx (%p) data = 0x%02lx", ofs, win_base + ofs, d.x[0]);
+	DEBUG(3, "ofs = 0x%08lx (%p) data = 0x%02lx",
+	      ofs, win_base + ofs, d.x[0]);
 	return d;
 }
 
@@ -259,7 +259,8 @@ static map_word pcmcia_read16(struct map_info *map, unsigned long ofs)
 		return d;
 
 	d.x[0] = readw(win_base + ofs);
-	DEBUG(3, "ofs = 0x%08lx (%p) data = 0x%04lx", ofs, win_base + ofs, d.x[0]);
+	DEBUG(3, "ofs = 0x%08lx (%p) data = 0x%04lx",
+	      ofs, win_base + ofs, d.x[0]);
 	return d;
 }
 
@@ -283,7 +284,8 @@ static void pcmcia_write8(struct map_info *map, map_word d, unsigned long adr)
 	if(DEV_REMOVED(map))
 		return;
 
-	DEBUG(3, "adr = 0x%08lx (%p)  data = 0x%02lx", adr, win_base + adr, d.x[0]);
+	DEBUG(3, "adr = 0x%08lx (%p)  data = 0x%02lx",
+	      adr, win_base + adr, d.x[0]);
 	writeb(d.x[0], win_base + adr);
 }
 
@@ -295,7 +297,8 @@ static void pcmcia_write16(struct map_info *map, map_word d, unsigned long adr)
 	if(DEV_REMOVED(map))
 		return;
 
-	DEBUG(3, "adr = 0x%08lx (%p)  data = 0x%04lx", adr, win_base + adr, d.x[0]);
+	DEBUG(3, "adr = 0x%08lx (%p)  data = 0x%04lx",
+	      adr, win_base + adr, d.x[0]);
 	writew(d.x[0], win_base + adr);
 }
 
@@ -376,7 +379,8 @@ static int pcmciamtd_cistpl_jedec(struct pcmcia_device *p_dev,
 	if (!pcmcia_parse_tuple(tuple, &parse)) {
 		cistpl_jedec_t *t = &parse.jedec;
 		for (i = 0; i < t->nid; i++)
-			DEBUG(2, "JEDEC: 0x%02x 0x%02x", t->id[i].mfr, t->id[i].info);
+			DEBUG(2, "JEDEC: 0x%02x 0x%02x",
+			      t->id[i].mfr, t->id[i].info);
 	}
 	return -ENOSPC;
 }
@@ -477,7 +481,8 @@ static void card_settings(struct pcmciamtd_dev *dev, struct pcmcia_device *p_dev
 	}
 
 	DEBUG(1, "Device: Size: %lu Width:%d Name: %s",
-	      dev->pcmcia_map.size, dev->pcmcia_map.bankwidth << 3, dev->mtd_name);
+	      dev->pcmcia_map.size,
+	      dev->pcmcia_map.bankwidth << 3, dev->mtd_name);
 }
 
 
@@ -513,9 +518,11 @@ static int pcmciamtd_config(struct pcmcia_device *link)
 	if(setvpp == 1)
 		dev->pcmcia_map.set_vpp = pcmciamtd_set_vpp;
 
-	/* Request a memory window for PCMCIA. Some architeures can map windows upto the maximum
-	   that PCMCIA can support (64MiB) - this is ideal and we aim for a window the size of the
-	   whole card - otherwise we try smaller windows until we succeed */
+	/* Request a memory window for PCMCIA. Some architeures can map windows
+	 * upto the maximum that PCMCIA can support (64MiB) - this is ideal and
+	 * we aim for a window the size of the whole card - otherwise we try
+	 * smaller windows until we succeed
+	 */
 
 	req.Attributes =  WIN_MEMORY_TYPE_CM | WIN_ENABLE;
 	req.Attributes |= (dev->pcmcia_map.bankwidth == 1) ? WIN_DATA_WIDTH_8 : WIN_DATA_WIDTH_16;
@@ -543,7 +550,7 @@ static int pcmciamtd_config(struct pcmcia_device *link)
 	DEBUG(2, "dev->win_size = %d", dev->win_size);
 
 	if(!dev->win_size) {
-		err("Cant allocate memory window");
+		dev_err(&dev->p_dev->dev, "Cannot allocate memory window\n");
 		pcmciamtd_release(link);
 		return -ENODEV;
 	}
@@ -553,7 +560,8 @@ static int pcmciamtd_config(struct pcmcia_device *link)
 	DEBUG(2, "window handle = 0x%8.8lx", (unsigned long)link->win);
 	dev->win_base = ioremap(req.Base, req.Size);
 	if(!dev->win_base) {
-		err("ioremap(%lu, %u) failed", req.Base, req.Size);
+		dev_err(&dev->p_dev->dev, "ioremap(%lu, %u) failed\n",
+			req.Base, req.Size);
 		pcmciamtd_release(link);
 		return -ENODEV;
 	}
@@ -600,7 +608,7 @@ static int pcmciamtd_config(struct pcmcia_device *link)
 	}
 
 	if(!mtd) {
-		DEBUG(1, "Cant find an MTD");
+		DEBUG(1, "Can not find an MTD");
 		pcmciamtd_release(link);
 		return -ENODEV;
 	}
@@ -611,8 +619,9 @@ static int pcmciamtd_config(struct pcmcia_device *link)
 	if(new_name) {
 		int size = 0;
 		char unit = ' ';
-		/* Since we are using a default name, make it better by adding in the
-		   size */
+		/* Since we are using a default name, make it better by adding
+		 * in the size
+		 */
 		if(mtd->size < 1048576) { /* <1MiB in size, show size in KiB */
 			size = mtd->size >> 10;
 			unit = 'K';
@@ -642,16 +651,17 @@ static int pcmciamtd_config(struct pcmcia_device *link)
 	if(add_mtd_device(mtd)) {
 		map_destroy(mtd);
 		dev->mtd_info = NULL;
-		err("Couldnt register MTD device");
+		dev_err(&dev->p_dev->dev,
+			"Could not register the MTD device\n");
 		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);
+	dev_info(&dev->p_dev->dev, "mtd%d: %s\n", mtd->index, mtd->name);
 	link->dev_node = &dev->node;
 	return 0;
 
-	err("CS Error, exiting");
+	dev_err(&dev->p_dev->dev, "CS Error, exiting\n");
 	pcmciamtd_release(link);
 	return -ENODEV;
 }
@@ -691,7 +701,8 @@ static void pcmciamtd_detach(struct pcmcia_device *link)
 	if(dev->mtd_info) {
 		del_mtd_device(dev->mtd_info);
 		map_destroy(dev->mtd_info);
-		info("mtd%d: Removed", dev->mtd_info->index);
+		dev_info(&dev->p_dev->dev, "mtd%d: Removed\n",
+			 dev->mtd_info->index);
 	}
 
 	pcmciamtd_release(link);
-- 
1.7.0



From w.sang at pengutronix.de  Mon Apr 12 21:01:13 2010
From: w.sang at pengutronix.de (Wolfram Sang)
Date: Tue, 13 Apr 2010 03:01:13 +0200
Subject: [PATCH 1/2] drivers/mtd/maps/pcmciamtd.c: fixing obvious errors
In-Reply-To: <alpine.DEB.1.10.1004121945510.7438@blala.de>
References: <alpine.DEB.1.10.1004121945510.7438@blala.de>
Message-ID: <20100413010112.GC8978@pengutronix.de>

On Mon, Apr 12, 2010 at 07:49:15PM +0400, Alexander Kurz wrote:
> Hello folks,
> this is an attempt, to reanimate the pcmciamtd driver.

Nice :)

> @@ -652,7 +651,6 @@ static int pcmciamtd_config(struct pcmcia_device *link)
>  	link->dev_node = &dev->node;
>  	return 0;
>  
> - failed:
>  	err("CS Error, exiting");
>  	pcmciamtd_release(link);
>  	return -ENODEV;

I'd suggest keeping 'failed', removing the 'err'-statement and using 'goto
failed' in error cases. Currently, pcmciamtd_release() is used many times on
errors.

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/20100413/5cf8b0e2/attachment.sig>

From w.sang at pengutronix.de  Mon Apr 12 21:06:17 2010
From: w.sang at pengutronix.de (Wolfram Sang)
Date: Tue, 13 Apr 2010 03:06:17 +0200
Subject: [PATCH 2/2] drivers/mtd/maps/pcmciamtd.c: coding style cleanups
In-Reply-To: <alpine.DEB.1.10.1004121949570.7438@blala.de>
References: <alpine.DEB.1.10.1004121949570.7438@blala.de>
Message-ID: <20100413010617.GD8978@pengutronix.de>

On Mon, Apr 12, 2010 at 07:51:12PM +0400, Alexander Kurz wrote:
> From df0e6529165643058e87595f40258a08bc01fec5 Mon Sep 17 00:00:00 2001
> From: Alexander Kurz <linux at kbdbabel.org>
> Date: Sun, 11 Apr 2010 23:07:19 +0200
> Subject: [PATCH 2/2] drivers/mtd/maps/pcmciamtd.c: coding style cleanups
> 
> Signed-off-by: Alexander Kurz <linux at kbdbabel.org>
> ---
>  drivers/mtd/maps/pcmciamtd.c |   55 +++++++++++++++++++++++++----------------
>  1 files changed, 33 insertions(+), 22 deletions(-)
> 
> diff --git a/drivers/mtd/maps/pcmciamtd.c b/drivers/mtd/maps/pcmciamtd.c
> index 2dbe939..0db1ac4 100644
> --- a/drivers/mtd/maps/pcmciamtd.c
> +++ b/drivers/mtd/maps/pcmciamtd.c
> @@ -40,10 +40,7 @@ MODULE_PARM_DESC(debug, "Set Debug Level 0=quiet, 5=noisy");
>  static const int debug = 0;
>  #endif
>  
> -#define err(format, arg...) printk(KERN_ERR "pcmciamtd: " format "\n" , ## arg)
>  #define info(format, arg...) printk(KERN_INFO "pcmciamtd: " format "\n" , ## arg)
> -#define warn(format, arg...) printk(KERN_WARNING "pcmciamtd: " format "\n" , ## arg)
> -
>  
>  #define DRIVER_DESC	"PCMCIA Flash memory card driver"
>  
> @@ -100,7 +97,9 @@ module_param(mem_type, int, 0);
>  MODULE_PARM_DESC(mem_type, "Set Memory type (0=Flash, 1=RAM, 2=ROM, default=0)");
>  
>  
> -/* read/write{8,16} copy_{from,to} routines with window remapping to access whole card */
> +/* read/write{8,16} copy_{from,to} routines with window remapping
> + * to access whole card
> + */

When you are touching these anyway: CodingStyle suggests

	/*
	 * Multi
	 * line comment
	 */

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/20100413/c3367f79/attachment.sig>

From linux at blala.de  Wed Apr 14 15:36:24 2010
From: linux at blala.de (Alexander Kurz)
Date: Wed, 14 Apr 2010 23:36:24 +0400 (MSD)
Subject: pccard_validate_cis() vs. antiquated SRAM PCMCIA-Cards
Message-ID: <alpine.DEB.1.10.1004142334270.32413@blala.de>

Hi Folks,
for the pcmciamtd driver there exists a Kconfig option
CONFIG_MTD_PCMCIA_ANONYMOUS to support anonymous storage cards.
At present, using this option has no effect at all,
because anonymous PCMCIA-Cards are filtered out
by pccard_validate_cis() in the pcmcia_card_add() stage.

Access to this card is possible with the fixed version of the
pcmciamtd driver, when pccard_validate_cis() is disabled. e.g.:
# modprobe pcmciamtd mem_type=1 force_size=1 bankwidth=1

Here is an example for a quasi-anonymous card,   
a Kingmax (maybe clone) 1MB SRAM-Card SJA-001M5C:

# pccardctl status
Socket 1:
  5.0V 16-bit PC Card
  Subdevice 0 (function 0) bound to driver "pcmciamtd"
# pccardctl info
PRODID_1=""
PRODID_2=""
PRODID_3=""
PRODID_4=""
MANFID=0000,0000
FUNCID=64

Should I build an exception, or should we declare those
antiquated cards as "not supported"?
An other alternative would be to skip the pccard_validate_cis()
when CONFIG_MTD_PCMCIA_ANONYMOUS is set.
What do you think about this?

cheers, Alexander



From linux at blala.de  Thu Apr 15 04:00:36 2010
From: linux at blala.de (Alexander Kurz)
Date: Thu, 15 Apr 2010 12:00:36 +0400 (MSD)
Subject: [PATCH 1/2] drivers/mtd/maps/pcmciamtd.c: fixing obvious
 errors
In-Reply-To: <20100413010112.GC8978@pengutronix.de>
References: <alpine.DEB.1.10.1004121945510.7438@blala.de>
	<20100413010112.GC8978@pengutronix.de>
Message-ID: <alpine.DEB.1.10.1004151145440.25680@blala.de>

Hi Wolfram,
 thanks for your comment,

On Tue, 13 Apr 2010, Wolfram Sang wrote:
> 
> I'd suggest keeping 'failed', removing the 'err'-statement and using 'goto
> failed' in error cases. Currently, pcmciamtd_release() is used many times on
> errors.
right, sorry, I missed this.

Hopefully I will get some more Storage-Cards for further tests
next week, so I will post the patch again afterwards.

Cheers, Alexander


From komurojun-mbn at nifty.com  Thu Apr 15 08:12:21 2010
From: komurojun-mbn at nifty.com (Komuro)
Date: Thu, 15 Apr 2010 21:12:21 +0900
Subject: pci_bus_for_each_resource, transparent bridges and
	rsrc_nonstatic.c
In-Reply-To: <20100405201852.89e3396b.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>
	<20100404211344.077c6b2f.komurojun-mbn@nifty.com>
	<20100405201852.89e3396b.komurojun-mbn@nifty.com>
Message-ID: <20100415211221.8b2f4cbf.komurojun-mbn@nifty.com>


Hi,

After setting start = 0x100,
size becomes wrong value...



 	unsigned long size = end - start + 1;          <=== HERE
 	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;                          <=== HERE
+#endif
+
	if (end < start)
 		return -EINVAL;


From linux at dominikbrodowski.net  Thu Apr 15 13:04:47 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Thu, 15 Apr 2010 19:04:47 +0200
Subject: pci_bus_for_each_resource, transparent bridges and
	rsrc_nonstatic.c
In-Reply-To: <20100415211221.8b2f4cbf.komurojun-mbn@nifty.com>
References: <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>
	<20100404211344.077c6b2f.komurojun-mbn@nifty.com>
	<20100405201852.89e3396b.komurojun-mbn@nifty.com>
	<20100415211221.8b2f4cbf.komurojun-mbn@nifty.com>
Message-ID: <20100415170447.GA26946@comet.dominikbrodowski.net>

Thanks, Komuro.

From: Dominik Brodowski <linux at dominikbrodowski.net>
Date: Thu, 15 Apr 2010 19:01:53 +0200
Subject: [PATCH] pcmcia: fix ioport size calculation in rsrc_nonstatic

Size needs to be calculated after manipulating with the start value.

Reported-by: Komuro <komurojun-mbn at nifty.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 1178a82..a6eb7b5 100644
--- a/drivers/pcmcia/rsrc_nonstatic.c
+++ b/drivers/pcmcia/rsrc_nonstatic.c
@@ -810,7 +810,7 @@ static int adjust_memory(struct pcmcia_socket *s, unsigned int action, unsigned
 static int adjust_io(struct pcmcia_socket *s, unsigned int action, unsigned long start, unsigned long end)
 {
 	struct socket_data *data = s->resource_data;
-	unsigned long size = end - start + 1;
+	unsigned long size;
 	int ret = 0;
 
 #if defined(CONFIG_X86)
@@ -820,6 +820,8 @@ static int adjust_io(struct pcmcia_socket *s, unsigned int action, unsigned long
 		start = 0x100;
 #endif
 
+	size = end - start + 1;
+
 	if (end < start)
 		return -EINVAL;
 



From linux at dominikbrodowski.net  Thu Apr 15 13:25:56 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Thu, 15 Apr 2010 19:25:56 +0200
Subject: pccard_validate_cis() vs. antiquated SRAM PCMCIA-Cards
In-Reply-To: <alpine.DEB.1.10.1004142334270.32413@blala.de>
References: <alpine.DEB.1.10.1004142334270.32413@blala.de>
Message-ID: <20100415172556.GA27756@comet.dominikbrodowski.net>

Hey,

On Wed, Apr 14, 2010 at 11:36:24PM +0400, Alexander Kurz wrote:
> for the pcmciamtd driver there exists a Kconfig option
> CONFIG_MTD_PCMCIA_ANONYMOUS to support anonymous storage cards.
> At present, using this option has no effect at all,
> because anonymous PCMCIA-Cards are filtered out
> by pccard_validate_cis() in the pcmcia_card_add() stage.
> 
> Access to this card is possible with the fixed version of the
> pcmciamtd driver, when pccard_validate_cis() is disabled. e.g.:
> # modprobe pcmciamtd mem_type=1 force_size=1 bankwidth=1
> 
> Here is an example for a quasi-anonymous card,   
> a Kingmax (maybe clone) 1MB SRAM-Card SJA-001M5C:
> 
> # pccardctl status
> Socket 1:
>   5.0V 16-bit PC Card
>   Subdevice 0 (function 0) bound to driver "pcmciamtd"
> # pccardctl info
> PRODID_1=""
> PRODID_2=""
> PRODID_3=""
> PRODID_4=""
> MANFID=0000,0000
> FUNCID=64
> 
> Should I build an exception, or should we declare those
> antiquated cards as "not supported"?
> An other alternative would be to skip the pccard_validate_cis()
> when CONFIG_MTD_PCMCIA_ANONYMOUS is set.
> What do you think about this?

I don't think it's a good idea to skip the test _in all cases_ if
CONFIG_MTD_PCMCIA_ANONYMOUS is set. We should at least be certain
that

	a) either statically mapped sockets are used, or
	b) the resource setup worked fine.

Else we might end up considering a network device (where we can't read the
CIS due to the socket not being set up properly) an MTD device. Possibly,
forcing an usersapce override (e.g. to a sysfs file) might be needed as
well.

Best,
	Dominik


From linux at dominikbrodowski.net  Thu Apr 15 13:27:50 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Thu, 15 Apr 2010 19:27:50 +0200
Subject: [PATCH 2/2] drivers/mtd/maps/pcmciamtd.c: coding style cleanups
In-Reply-To: <alpine.DEB.1.10.1004121949570.7438@blala.de>
References: <alpine.DEB.1.10.1004121949570.7438@blala.de>
Message-ID: <20100415172750.GB27756@comet.dominikbrodowski.net>

Alexander,

On Mon, Apr 12, 2010 at 07:51:12PM +0400, Alexander Kurz wrote:
> @@ -691,7 +701,8 @@ static void pcmciamtd_detach(struct pcmcia_device *link)
>  	if(dev->mtd_info) {
>  		del_mtd_device(dev->mtd_info);
>  		map_destroy(dev->mtd_info);
> -		info("mtd%d: Removed", dev->mtd_info->index);
> +		dev_info(&dev->p_dev->dev, "mtd%d: Removed\n",
> +			 dev->mtd_info->index);
>  	}

Could you switch the ordering between map_destroy() and dev_info(), please,
to avoid an use-after-free? See the attached message by Julia Lawall, who
noted this issue first.

Best,
	Dominik
-------------- next part --------------
An embedded message was scrubbed...
From: Julia Lawall <julia at diku.dk>
Subject: [PATCH 2/3] drivers/mtd/maps: Eliminate use after free
Date: Fri, 2 Apr 2010 14:47:38 +0200 (CEST)
Size: 3561
URL: <http://lists.infradead.org/pipermail/linux-pcmcia/attachments/20100415/5b4cb215/attachment.mail>

From linux at dominikbrodowski.net  Thu Apr 15 13:59:04 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Thu, 15 Apr 2010 19:59:04 +0200
Subject: [PATCH 2/2] drivers/mtd/maps/pcmciamtd.c: coding style cleanups
In-Reply-To: <20100415172750.GB27756@comet.dominikbrodowski.net>
References: <alpine.DEB.1.10.1004121949570.7438@blala.de>
	<20100415172750.GB27756@comet.dominikbrodowski.net>
Message-ID: <20100415175904.GC31336@comet.dominikbrodowski.net>

On Thu, Apr 15, 2010 at 07:27:50PM +0200, Dominik Brodowski wrote:
> On Mon, Apr 12, 2010 at 07:51:12PM +0400, Alexander Kurz wrote:
> > @@ -691,7 +701,8 @@ static void pcmciamtd_detach(struct pcmcia_device *link)
> >  	if(dev->mtd_info) {
> >  		del_mtd_device(dev->mtd_info);
> >  		map_destroy(dev->mtd_info);
> > -		info("mtd%d: Removed", dev->mtd_info->index);
> > +		dev_info(&dev->p_dev->dev, "mtd%d: Removed\n",
> > +			 dev->mtd_info->index);
> >  	}
> 
> Could you switch the ordering between map_destroy() and dev_info(), please,
> to avoid an use-after-free? See the attached message by Julia Lawall, who
> noted this issue first.

Actually, to avoid any of the patches getting lost, I created a branch
"pcmciamtd" at:

http://git.kernel.org/?p=linux/kernel/git/brodo/pcmcia-2.6.git;a=shortlog;h=refs/heads/pcmciamtd


From komurojun-mbn at nifty.com  Fri Apr 16 09:21:35 2010
From: komurojun-mbn at nifty.com (Komuro)
Date: Fri, 16 Apr 2010 22:21:35 +0900
Subject: Questions about ioport-assignments
In-Reply-To: <20100221200951.6c97de1c.komurojun-mbn@nifty.com>
References: <20100114203917.658efc78.komurojun-mbn@nifty.com>
	<20100116064145.8ce970f1.komurojun-mbn@nifty.com>
	<20100221200951.6c97de1c.komurojun-mbn@nifty.com>
Message-ID: <20100416222135.79762709.komurojun-mbn@nifty.com>

Hi,

> Wolfram wrote:
> 
> >>- Is it just a buggy card if it works at 0x300 but not 0xc300
> >>  (or is it maybe a problem with Linux assigning the io area)?
> >>- Why is IOAddrLines forced to 16 (and thus alignment to 0x10000), but only
> >>  if BasePort1 is 0?
> 

In this case, 
start = 0xc000, 
align_data->mask = 0x3ff, 
align_data->offset = 0x300
then ret becomes 0xc300;

but ret should be 0x300.

static resource_size_t pcmcia_common_align(struct pcmcia_align_data *align_data,
                                        resource_size_t start)
{
        resource_size_t ret;
        /*
         * Ensure that we have the correct start address
         */
        ret = (start & ~align_data->mask) + align_data->offset;
        if (ret < start)
                ret += align_data->mask + 1;

        return ret;
}

Best Regards
Komuro


From linux at dominikbrodowski.net  Fri Apr 16 14:44:33 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Fri, 16 Apr 2010 20:44:33 +0200
Subject: Questions about ioport-assignments
In-Reply-To: <20100416222135.79762709.komurojun-mbn@nifty.com>
References: <20100114203917.658efc78.komurojun-mbn@nifty.com>
	<20100116064145.8ce970f1.komurojun-mbn@nifty.com>
	<20100221200951.6c97de1c.komurojun-mbn@nifty.com>
	<20100416222135.79762709.komurojun-mbn@nifty.com>
Message-ID: <20100416184433.GA5020@isilmar-3.linta.de>

On Fri, Apr 16, 2010 at 10:21:35PM +0900, Komuro wrote:
> Hi,
> 
> > Wolfram wrote:
> > 
> > >>- Is it just a buggy card if it works at 0x300 but not 0xc300
> > >>  (or is it maybe a problem with Linux assigning the io area)?
> > >>- Why is IOAddrLines forced to 16 (and thus alignment to 0x10000), but only
> > >>  if BasePort1 is 0?
> > 
> 
> In this case, 
> start = 0xc000, 
> align_data->mask = 0x3ff, 
> align_data->offset = 0x300
> then ret becomes 0xc300;
> 
> but ret should be 0x300.

That's not pcmcia_common_align()s fault -- but this line in alloc_io_space:

	align = (*base) ? (lines ? 1<<lines : 0) : 1;

Should we try replacing it with

	align = lines ? 1 << lines : 0;

unconditionally?

Best,
	Dominik


From komurojun-mbn at nifty.com  Fri Apr 16 17:22:45 2010
From: komurojun-mbn at nifty.com (Komuro)
Date: Sat, 17 Apr 2010 06:22:45 +0900
Subject: Questions about ioport-assignments
In-Reply-To: <20100416222135.79762709.komurojun-mbn@nifty.com>
References: <20100114203917.658efc78.komurojun-mbn@nifty.com>
	<20100116064145.8ce970f1.komurojun-mbn@nifty.com>
	<20100221200951.6c97de1c.komurojun-mbn@nifty.com>
	<20100416222135.79762709.komurojun-mbn@nifty.com>
Message-ID: <20100417062245.d71017f1.komurojun-mbn@nifty.com>

Hi,

>That's not pcmcia_common_align()s fault -- but this line in alloc_io_space:
>
>	align = (*base) ? (lines ? 1<<lines : 0) : 1;
>
>Should we try replacing it with
>
>	align = lines ? 1 << lines : 0;
>
>unconditionally?


In this case, *base = 0x300
So 
align = (*base) ? (lines ? 1<<lines : 0) : 1;
is correct.

Actually, lines defines the max ioport,
not align.

if lines = 10, the max ioport is 0x3ff.
if lines = 16, the max ioport is 0xffff.


From komurojun-mbn at nifty.com  Fri Apr 16 20:21:40 2010
From: komurojun-mbn at nifty.com (Komuro)
Date: Sat, 17 Apr 2010 09:21:40 +0900
Subject: Questions about ioport-assignments
In-Reply-To: <20100417062245.d71017f1.komurojun-mbn@nifty.com>
References: <20100114203917.658efc78.komurojun-mbn@nifty.com>
	<20100116064145.8ce970f1.komurojun-mbn@nifty.com>
	<20100221200951.6c97de1c.komurojun-mbn@nifty.com>
	<20100416222135.79762709.komurojun-mbn@nifty.com>
	<20100417062245.d71017f1.komurojun-mbn@nifty.com>
Message-ID: <20100417092140.cd7318a7.komurojun-mbn@nifty.com>

Hi,

sorry, "lines" seems to be align.

but some devices with lines=10,
it means max io-port = 0x3ff.


From w.sang at pengutronix.de  Fri Apr 16 21:19:23 2010
From: w.sang at pengutronix.de (Wolfram Sang)
Date: Sat, 17 Apr 2010 03:19:23 +0200
Subject: Questions about ioport-assignments
In-Reply-To: <20100417092140.cd7318a7.komurojun-mbn@nifty.com>
References: <20100114203917.658efc78.komurojun-mbn@nifty.com>
	<20100116064145.8ce970f1.komurojun-mbn@nifty.com>
	<20100221200951.6c97de1c.komurojun-mbn@nifty.com>
	<20100416222135.79762709.komurojun-mbn@nifty.com>
	<20100417062245.d71017f1.komurojun-mbn@nifty.com>
	<20100417092140.cd7318a7.komurojun-mbn@nifty.com>
Message-ID: <20100417011923.GC9664@pengutronix.de>

> sorry, "lines" seems to be align.
> 
> but some devices with lines=10,
> it means max io-port = 0x3ff.

This would lead to consider the CIS of the card broken and override it? (And
the fact that it used to work was just Linux doing the assignment "wrong" back
then?)

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/20100417/74b88e15/attachment.sig>

From komurojun-mbn at nifty.com  Sat Apr 17 06:47:48 2010
From: komurojun-mbn at nifty.com (Komuro)
Date: Sat, 17 Apr 2010 19:47:48 +0900
Subject: Questions about ioport-assignments
In-Reply-To: <20100417092140.cd7318a7.komurojun-mbn@nifty.com>
References: <20100114203917.658efc78.komurojun-mbn@nifty.com>
	<20100116064145.8ce970f1.komurojun-mbn@nifty.com>
	<20100221200951.6c97de1c.komurojun-mbn@nifty.com>
	<20100416222135.79762709.komurojun-mbn@nifty.com>
	<20100417062245.d71017f1.komurojun-mbn@nifty.com>
	<20100417092140.cd7318a7.komurojun-mbn@nifty.com>
Message-ID: <20100417194748.22551971.komurojun-mbn@nifty.com>


Hi,

[solution]

If we have two io-resource io-res1, io-res2 (for example)
we try to allocate io-resource from io-res2(lower ioport).

if it fails , try to allocate io-resource from io-res1.


io-res1  0xc000-0xcfff
io-res2  0x0100-0x03ff



From linux at dominikbrodowski.net  Sat Apr 17 10:04:59 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Sat, 17 Apr 2010 16:04:59 +0200
Subject: Questions about ioport-assignments
In-Reply-To: <20100417194748.22551971.komurojun-mbn@nifty.com>
References: <20100114203917.658efc78.komurojun-mbn@nifty.com>
	<20100116064145.8ce970f1.komurojun-mbn@nifty.com>
	<20100221200951.6c97de1c.komurojun-mbn@nifty.com>
	<20100416222135.79762709.komurojun-mbn@nifty.com>
	<20100417062245.d71017f1.komurojun-mbn@nifty.com>
	<20100417092140.cd7318a7.komurojun-mbn@nifty.com>
	<20100417194748.22551971.komurojun-mbn@nifty.com>
Message-ID: <20100417140459.GA17938@isilmar-3.linta.de>

On Sat, Apr 17, 2010 at 07:47:48PM +0900, Komuro wrote:
> 
> Hi,
> 
> [solution]
> 
> If we have two io-resource io-res1, io-res2 (for example)
> we try to allocate io-resource from io-res2(lower ioport).
> 
> if it fails , try to allocate io-resource from io-res1.
> 
> 
> io-res1  0xc000-0xcfff
> io-res2  0x0100-0x03ff
> 

Hm, I don't get (yet) where you're heading to -- could you provide me with a
patch and/or more extensive explanation?

Best,
	Dominik


From w.sang at pengutronix.de  Sat Apr 17 10:20:06 2010
From: w.sang at pengutronix.de (Wolfram Sang)
Date: Sat, 17 Apr 2010 16:20:06 +0200
Subject: Questions about ioport-assignments
In-Reply-To: <20100417140459.GA17938@isilmar-3.linta.de>
References: <20100114203917.658efc78.komurojun-mbn@nifty.com>
	<20100116064145.8ce970f1.komurojun-mbn@nifty.com>
	<20100221200951.6c97de1c.komurojun-mbn@nifty.com>
	<20100416222135.79762709.komurojun-mbn@nifty.com>
	<20100417062245.d71017f1.komurojun-mbn@nifty.com>
	<20100417092140.cd7318a7.komurojun-mbn@nifty.com>
	<20100417194748.22551971.komurojun-mbn@nifty.com>
	<20100417140459.GA17938@isilmar-3.linta.de>
Message-ID: <20100417142006.GA2348@pengutronix.de>

> > io-res1  0xc000-0xcfff
> > io-res2  0x0100-0x03ff
> > 
> 
> Hm, I don't get (yet) where you're heading to -- could you provide me with a
> patch and/or more extensive explanation?

Do you have the complete thread?

http://thread.gmane.org/gmane.linux.kernel.pcmcia.devel/2884

-- 
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/20100417/330e0d9e/attachment.sig>

From komurojun-mbn at nifty.com  Sat Apr 17 21:11:41 2010
From: komurojun-mbn at nifty.com (Komuro)
Date: Sun, 18 Apr 2010 10:11:41 +0900
Subject: Questions about ioport-assignments
In-Reply-To: <20100417194748.22551971.komurojun-mbn@nifty.com>
References: <20100114203917.658efc78.komurojun-mbn@nifty.com>
	<20100116064145.8ce970f1.komurojun-mbn@nifty.com>
	<20100221200951.6c97de1c.komurojun-mbn@nifty.com>
	<20100416222135.79762709.komurojun-mbn@nifty.com>
	<20100417062245.d71017f1.komurojun-mbn@nifty.com>
	<20100417092140.cd7318a7.komurojun-mbn@nifty.com>
	<20100417194748.22551971.komurojun-mbn@nifty.com>
Message-ID: <20100418101141.ca296ff2.komurojun-mbn@nifty.com>


Hi,

>Hm, I don't get (yet) where you're heading to -- could you provide me with a
>patch and/or more extensive explanation?

OK. Here is the patch.

pci_bus_alloc_resource calls pcmcia_align with res->start=0xc000.
To avoid this , we need to call pcmcia_align manually.



--- linux-2.6.34-rc4-git4/drivers/pcmcia/rsrc_nonstatic.c.orig	2010-04-18 09:52:12.000000000 +0900
+++ linux-2.6.34-rc4-git4/drivers/pcmcia/rsrc_nonstatic.c	2010-04-18 09:56:09.000000000 +0900
@@ -697,6 +697,9 @@ static struct resource *nonstatic_find_i
 	struct pcmcia_align_data data;
 	unsigned long min = base;
 	int ret;
+#if defined(CONFIG_X86)
+	resource_size_t start;
+#endif
 
 	if (align == 0)
 		align = 0x10000;
@@ -705,6 +708,16 @@ static struct resource *nonstatic_find_i
 	data.offset = base & data.mask;
 	data.map = &s_data->io_db;
 
+#if defined(CONFIG_X86)
+	start = pcmcia_align(&data, res, num, align);
+
+	if (start) {
+		res->start = start;
+		res->end = start+num-1;
+		return res;
+	}
+#endif
+
 #ifdef CONFIG_PCI
 	if (s->cb_dev) {
 		ret = pci_bus_alloc_resource(s->cb_dev->bus, res, num, 1,


From linux at dominikbrodowski.net  Sun Apr 18 05:30:38 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Sun, 18 Apr 2010 11:30:38 +0200
Subject: Questions about ioport-assignments
In-Reply-To: <20100418101141.ca296ff2.komurojun-mbn@nifty.com>
References: <20100114203917.658efc78.komurojun-mbn@nifty.com>
	<20100116064145.8ce970f1.komurojun-mbn@nifty.com>
	<20100221200951.6c97de1c.komurojun-mbn@nifty.com>
	<20100416222135.79762709.komurojun-mbn@nifty.com>
	<20100417062245.d71017f1.komurojun-mbn@nifty.com>
	<20100417092140.cd7318a7.komurojun-mbn@nifty.com>
	<20100417194748.22551971.komurojun-mbn@nifty.com>
	<20100418101141.ca296ff2.komurojun-mbn@nifty.com>
Message-ID: <20100418093038.GA17136@isilmar-3.linta.de>

Hey,

On Sun, Apr 18, 2010 at 10:11:41AM +0900, Komuro wrote:
> 
> Hi,
> 
> >Hm, I don't get (yet) where you're heading to -- could you provide me with a
> >patch and/or more extensive explanation?
> 
> OK. Here is the patch.
> 
> pci_bus_alloc_resource calls pcmcia_align with res->start=0xc000.
> To avoid this , we need to call pcmcia_align manually.
> 
> 
> 
> --- linux-2.6.34-rc4-git4/drivers/pcmcia/rsrc_nonstatic.c.orig	2010-04-18 09:52:12.000000000 +0900
> +++ linux-2.6.34-rc4-git4/drivers/pcmcia/rsrc_nonstatic.c	2010-04-18 09:56:09.000000000 +0900
> @@ -697,6 +697,9 @@ static struct resource *nonstatic_find_i
>  	struct pcmcia_align_data data;
>  	unsigned long min = base;
>  	int ret;
> +#if defined(CONFIG_X86)
> +	resource_size_t start;
> +#endif
>  
>  	if (align == 0)
>  		align = 0x10000;
> @@ -705,6 +708,16 @@ static struct resource *nonstatic_find_i
>  	data.offset = base & data.mask;
>  	data.map = &s_data->io_db;
>  
> +#if defined(CONFIG_X86)
> +	start = pcmcia_align(&data, res, num, align);
> +
> +	if (start) {
> +		res->start = start;
> +		res->end = start+num-1;
> +		return res;
> +	}
> +#endif
> +
>  #ifdef CONFIG_PCI
>  	if (s->cb_dev) {
>  		ret = pci_bus_alloc_resource(s->cb_dev->bus, res, num, 1,

No, that can't be right -- see commits 509b0865 and 7a96e87d , both based on
reports from you, on why we need to call pci_bus_alloc_resource...

Best,
	Dominik



From linux at dominikbrodowski.net  Mon Apr 19 10:13:51 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 19 Apr 2010 16:13:51 +0200
Subject: [PATCH 2/8] pcmcia: fix io_probe due to parent (PCI) resources
In-Reply-To: <20100419141252.GA25320@comet.dominikbrodowski.net>
References: <20100419141252.GA25320@comet.dominikbrodowski.net>
Message-ID: <1271686437-25604-2-git-send-email-linux@dominikbrodowski.net>

Similar to commit 7a96e87d, we need to be aware of any parent PCI
device when requesting IO regions, even only for testing
("probing").

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

diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c
index 559069a..1178a82 100644
--- a/drivers/pcmcia/rsrc_nonstatic.c
+++ b/drivers/pcmcia/rsrc_nonstatic.c
@@ -214,7 +214,7 @@ static void do_io_probe(struct pcmcia_socket *s, unsigned int base,
 		return;
 	}
 	for (i = base, most = 0; i < base+num; i += 8) {
-		res = claim_region(NULL, i, 8, IORESOURCE_IO, "PCMCIA ioprobe");
+		res = claim_region(s, i, 8, IORESOURCE_IO, "PCMCIA ioprobe");
 		if (!res)
 			continue;
 		hole = inb(i);
@@ -231,9 +231,14 @@ static void do_io_probe(struct pcmcia_socket *s, unsigned int base,
 
 	bad = any = 0;
 	for (i = base; i < base+num; i += 8) {
-		res = claim_region(NULL, i, 8, IORESOURCE_IO, "PCMCIA ioprobe");
-		if (!res)
+		res = claim_region(s, i, 8, IORESOURCE_IO, "PCMCIA ioprobe");
+		if (!res) {
+			if (!any)
+				printk(" excluding");
+			if (!bad)
+				bad = any = i;
 			continue;
+		}
 		for (j = 0; j < 8; j++)
 			if (inb(i+j) != most)
 				break;
@@ -253,6 +258,7 @@ static void do_io_probe(struct pcmcia_socket *s, unsigned int base,
 	}
 	if (bad) {
 		if ((num > 16) && (bad == base) && (i == base+num)) {
+			sub_interval(&s_data->io_db, bad, i-bad);
 			printk(" nothing: probe failed.\n");
 			return;
 		} else {
-- 
1.6.3.3



From linux at dominikbrodowski.net  Mon Apr 19 10:13:52 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 19 Apr 2010 16:13:52 +0200
Subject: [PATCH 3/8] pcmcia: re-start on MFC override
In-Reply-To: <20100419141252.GA25320@comet.dominikbrodowski.net>
References: <20100419141252.GA25320@comet.dominikbrodowski.net>
Message-ID: <1271686437-25604-3-git-send-email-linux@dominikbrodowski.net>

If there are changes to the number of socket devices, we need to
start over in all cases: else pcmcia_request_configuration() might
get confused.

Reported-by: Alexander Kurz <linux at kbdbabel.org>
Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 drivers/pcmcia/ds.c |   22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index cb6036d..4014cf8 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -687,12 +687,10 @@ static void pcmcia_requery(struct pcmcia_socket *s)
 			new_funcs = mfc.nfn;
 		else
 			new_funcs = 1;
-		if (old_funcs > new_funcs) {
+		if (old_funcs != new_funcs) {
+			/* we need to re-start */
 			pcmcia_card_remove(s, NULL);
 			pcmcia_card_add(s);
-		} else if (new_funcs > old_funcs) {
-			s->functions = new_funcs;
-			pcmcia_device_add(s, 1);
 		}
 	}
 
@@ -728,6 +726,8 @@ static int pcmcia_load_firmware(struct pcmcia_device *dev, char * filename)
 	struct pcmcia_socket *s = dev->socket;
 	const struct firmware *fw;
 	int ret = -ENOMEM;
+	cistpl_longlink_mfc_t mfc;
+	int old_funcs, new_funcs = 1;
 
 	if (!filename)
 		return -EINVAL;
@@ -750,6 +750,14 @@ static int pcmcia_load_firmware(struct pcmcia_device *dev, char * filename)
 			goto release;
 		}
 
+		/* we need to re-start if the number of functions changed */
+		old_funcs = s->functions;
+		if (!pccard_read_tuple(s, BIND_FN_ALL, CISTPL_LONGLINK_MFC,
+					&mfc))
+			new_funcs = mfc.nfn;
+
+		if (old_funcs != new_funcs)
+			ret = -EBUSY;
 
 		/* update information */
 		pcmcia_device_query(dev);
@@ -858,10 +866,8 @@ static inline int pcmcia_devmatch(struct pcmcia_device *dev,
 	if (did->match_flags & PCMCIA_DEV_ID_MATCH_FAKE_CIS) {
 		dev_dbg(&dev->dev, "device needs a fake CIS\n");
 		if (!dev->socket->fake_cis)
-			pcmcia_load_firmware(dev, did->cisfile);
-
-		if (!dev->socket->fake_cis)
-			return 0;
+			if (pcmcia_load_firmware(dev, did->cisfile))
+				return 0;
 	}
 
 	if (did->match_flags & PCMCIA_DEV_ID_MATCH_ANONYMOUS) {
-- 
1.6.3.3



From linux at dominikbrodowski.net  Mon Apr 19 10:12:52 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 19 Apr 2010 16:12:52 +0200
Subject: [RFC] PCMCIA patches for 2.6.36-rc5
Message-ID: <20100419141252.GA25320@comet.dominikbrodowski.net>

Hey,

to solve most of the outstanding bugs I'm aware of, I intend to submit a
pull request for a few patches tomorrow. They're available at

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

As usual, I'm interested in your input to this patch series. The individual
patches will be sent out to the PCMCIA list in a few moments.

Best,
	Dominik


Dan Carpenter (1):
      pcmcia: fix error handling in cm4000_cs.c

Dominik Brodowski (5):
      pcmcia: use previously assigned IRQ for all card functions
      pcmcia: fix io_probe due to parent (PCI) resources
      pcmcia: re-start on MFC override
      pcmcia: fix ioport size calculation in rsrc_nonstatic
      pcmcia: avoid late calls to pccard_validate_cis

Julia Lawall (1):
      drivers/pcmcia: Add missing local_irq_restore

Timur Maximov (1):
      serial_cs: MD55x support (PCMCIA GPRS/EDGE modem) (kernel 2.6.33)

 drivers/char/pcmcia/cm4000_cs.c  |    8 +++++---
 drivers/pcmcia/cistpl.c          |    9 +++++++--
 drivers/pcmcia/db1xxx_ss.c       |    4 +++-
 drivers/pcmcia/ds.c              |   22 ++++++++++++++--------
 drivers/pcmcia/pcmcia_resource.c |   10 +++++-----
 drivers/pcmcia/rsrc_nonstatic.c  |   16 ++++++++++++----
 drivers/serial/serial_cs.c       |    9 +++++++++
 7 files changed, 55 insertions(+), 23 deletions(-)


From linux at dominikbrodowski.net  Mon Apr 19 10:13:50 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 19 Apr 2010 16:13:50 +0200
Subject: [PATCH 1/8] pcmcia: use previously assigned IRQ for all card functions
In-Reply-To: <20100419141252.GA25320@comet.dominikbrodowski.net>
References: <20100419141252.GA25320@comet.dominikbrodowski.net>
Message-ID: <1271686437-25604-1-git-send-email-linux@dominikbrodowski.net>

Use a previously assigned IRQ for all card functions, not only if
CONFIG_PCMCIA_PROBE is set.

Reported-by: Alexander Kurz <linux at kbdbabel.org>
Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 drivers/pcmcia/pcmcia_resource.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index caec1de..7c3d03b 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -755,12 +755,12 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
 	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 */
+	/* If the interrupt is already assigned, it must be the same */
+	if (s->irq.AssignedIRQ != 0)
 		irq = s->irq.AssignedIRQ;
-	} else {
+
+#ifdef CONFIG_PCMCIA_PROBE
+	if (!irq) {
 		int try;
 		u32 mask = s->irq_mask;
 		void *data = p_dev; /* something unique to this device */
-- 
1.6.3.3



From linux at dominikbrodowski.net  Mon Apr 19 10:13:57 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 19 Apr 2010 16:13:57 +0200
Subject: [PATCH 8/8] pcmcia: fix error handling in cm4000_cs.c
In-Reply-To: <20100419141252.GA25320@comet.dominikbrodowski.net>
References: <20100419141252.GA25320@comet.dominikbrodowski.net>
Message-ID: <1271686437-25604-8-git-send-email-linux@dominikbrodowski.net>

From: Dan Carpenter <error27 at gmail.com>

In the original code we used -ENODEV as the number of bytes to
copy_to_user() and we didn't release the locks.

Signed-off-by: Dan Carpenter <error27 at gmail.com>
Acked-by: Harald Welte <laforge at gnumonks.org>
Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 drivers/char/pcmcia/cm4000_cs.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/char/pcmcia/cm4000_cs.c b/drivers/char/pcmcia/cm4000_cs.c
index c9bc896..90b199f 100644
--- a/drivers/char/pcmcia/cm4000_cs.c
+++ b/drivers/char/pcmcia/cm4000_cs.c
@@ -1026,14 +1026,16 @@ static ssize_t cmm_read(struct file *filp, __user char *buf, size_t count,
 
 	xoutb(0, REG_FLAGS1(iobase));	/* clear detectCMM */
 	/* last check before exit */
-	if (!io_detect_cm4000(iobase, dev))
-		count = -ENODEV;
+	if (!io_detect_cm4000(iobase, dev)) {
+		rc = -ENODEV;
+		goto release_io;
+	}
 
 	if (test_bit(IS_INVREV, &dev->flags) && count > 0)
 		str_invert_revert(dev->rbuf, count);
 
 	if (copy_to_user(buf, dev->rbuf, count))
-		return -EFAULT;
+		rc = -EFAULT;
 
 release_io:
 	clear_bit(LOCK_IO, &dev->flags);
-- 
1.6.3.3



From linux at dominikbrodowski.net  Mon Apr 19 10:13:54 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 19 Apr 2010 16:13:54 +0200
Subject: [PATCH 5/8] pcmcia: avoid late calls to pccard_validate_cis
In-Reply-To: <20100419141252.GA25320@comet.dominikbrodowski.net>
References: <20100419141252.GA25320@comet.dominikbrodowski.net>
Message-ID: <1271686437-25604-5-git-send-email-linux@dominikbrodowski.net>

pccard_validate_cis() nowadays destroys the CIS cache. Therefore,
calling it after card setup should be avoided. We can't control
the deprecated PCMCIA ioctl (which is only used on ARM nowadays),
but we can avoid -- and report -- any other calls.

Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 drivers/pcmcia/cistpl.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/pcmcia/cistpl.c b/drivers/pcmcia/cistpl.c
index f230f65..854959c 100644
--- a/drivers/pcmcia/cistpl.c
+++ b/drivers/pcmcia/cistpl.c
@@ -1484,6 +1484,11 @@ int pccard_validate_cis(struct pcmcia_socket *s, unsigned int *info)
 	if (!s)
 		return -EINVAL;
 
+	if (s->functions) {
+		WARN_ON(1);
+		return -EINVAL;
+	}
+
 	/* We do not want to validate the CIS cache... */
 	mutex_lock(&s->ops_mutex);
 	destroy_cis_cache(s);
@@ -1639,7 +1644,7 @@ static ssize_t pccard_show_cis(struct kobject *kobj,
 		count = 0;
 	else {
 		struct pcmcia_socket *s;
-		unsigned int chains;
+		unsigned int chains = 1;
 
 		if (off + count > size)
 			count = size - off;
@@ -1648,7 +1653,7 @@ static ssize_t pccard_show_cis(struct kobject *kobj,
 
 		if (!(s->state & SOCKET_PRESENT))
 			return -ENODEV;
-		if (pccard_validate_cis(s, &chains))
+		if (!s->functions && pccard_validate_cis(s, &chains))
 			return -EIO;
 		if (!chains)
 			return -ENODATA;
-- 
1.6.3.3



From linux at dominikbrodowski.net  Mon Apr 19 10:13:55 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 19 Apr 2010 16:13:55 +0200
Subject: [PATCH 6/8] serial_cs: MD55x support (PCMCIA GPRS/EDGE modem) (kernel
	2.6.33)
In-Reply-To: <20100419141252.GA25320@comet.dominikbrodowski.net>
References: <20100419141252.GA25320@comet.dominikbrodowski.net>
Message-ID: <1271686437-25604-6-git-send-email-linux@dominikbrodowski.net>

From: Timur Maximov <xcom.org at gmail.com>

Many PCMCIA GPRS modems like: Onda Edge N100E, Novaway PC98 (OEM SPC98Z),
Rovermate Edgus Adaptmate-039 and others have same construction and
identification:

lspcmcia -vvv
Product Name:   Generic Modem: MD55x 1.00 Serial number: xxxxx-xxx
Identification: manf_id: 0x015d card_id: 0x4c45
                function: 2 (serial)
                prod_id(1): "Generic" (0xc49e4731)
                prod_id(2): "Modem: MD55x" (0x8913b110)
                prod_id(3): "1.00" (0x83dbf271)
                prod_id(4): "Serial number: xxxxx-xxx" (0x73ee9514)

Serial connection to GSM module based on Elan VPU16551 PCMCIA UART with
datasheet recommeded 14.7456MHz crystal oscillator.

By default serial_cs set UART clock == 1843200 Hz
For correct work need set clock 14745600 Hz.
This quirk already present in driver, only need add device in quirk list.

Signed-off-by: Timur Maximov <xcom.org at gmail.com>
Acked-by: Alan Cox <alan at linux.intel.com>
Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 drivers/serial/serial_cs.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/serial/serial_cs.c b/drivers/serial/serial_cs.c
index 175d202..8cfa5b1 100644
--- a/drivers/serial/serial_cs.c
+++ b/drivers/serial/serial_cs.c
@@ -105,6 +105,10 @@ struct serial_cfg_mem {
  * manfid 0x0160, 0x0104
  * This card appears to have a 14.7456MHz clock.
  */
+/* Generic Modem: MD55x (GPRS/EDGE) have
+ * Elan VPU16551 UART with 14.7456MHz oscillator
+ * manfid 0x015D, 0x4C45
+ */
 static void quirk_setup_brainboxes_0104(struct pcmcia_device *link, struct uart_port *port)
 {
 	port->uartclk = 14745600;
@@ -196,6 +200,11 @@ static const struct serial_quirk quirks[] = {
 		.multi	= -1,
 		.setup	= quirk_setup_brainboxes_0104,
 	}, {
+		.manfid	= 0x015D,
+		.prodid	= 0x4C45,
+		.multi	= -1,
+		.setup	= quirk_setup_brainboxes_0104,
+	}, {
 		.manfid	= MANFID_IBM,
 		.prodid	= ~0,
 		.multi	= -1,
-- 
1.6.3.3



From linux at dominikbrodowski.net  Mon Apr 19 10:13:56 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 19 Apr 2010 16:13:56 +0200
Subject: [PATCH 7/8] drivers/pcmcia: Add missing local_irq_restore
In-Reply-To: <20100419141252.GA25320@comet.dominikbrodowski.net>
References: <20100419141252.GA25320@comet.dominikbrodowski.net>
Message-ID: <1271686437-25604-7-git-send-email-linux@dominikbrodowski.net>

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>
Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 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 6206408..2d48196 100644
--- a/drivers/pcmcia/db1xxx_ss.c
+++ b/drivers/pcmcia/db1xxx_ss.c
@@ -166,8 +166,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);
-- 
1.6.3.3



From linux at dominikbrodowski.net  Mon Apr 19 10:13:53 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 19 Apr 2010 16:13:53 +0200
Subject: [PATCH 4/8] pcmcia: fix ioport size calculation in rsrc_nonstatic
In-Reply-To: <20100419141252.GA25320@comet.dominikbrodowski.net>
References: <20100419141252.GA25320@comet.dominikbrodowski.net>
Message-ID: <1271686437-25604-4-git-send-email-linux@dominikbrodowski.net>

Size needs to be calculated after manipulating with the start value.

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

diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c
index 1178a82..a6eb7b5 100644
--- a/drivers/pcmcia/rsrc_nonstatic.c
+++ b/drivers/pcmcia/rsrc_nonstatic.c
@@ -810,7 +810,7 @@ static int adjust_memory(struct pcmcia_socket *s, unsigned int action, unsigned
 static int adjust_io(struct pcmcia_socket *s, unsigned int action, unsigned long start, unsigned long end)
 {
 	struct socket_data *data = s->resource_data;
-	unsigned long size = end - start + 1;
+	unsigned long size;
 	int ret = 0;
 
 #if defined(CONFIG_X86)
@@ -820,6 +820,8 @@ static int adjust_io(struct pcmcia_socket *s, unsigned int action, unsigned long
 		start = 0x100;
 #endif
 
+	size = end - start + 1;
+
 	if (end < start)
 		return -EINVAL;
 
-- 
1.6.3.3



From kristoffer.ericson at gmail.com  Mon Apr 19 13:54:11 2010
From: kristoffer.ericson at gmail.com (Kristoffer Ericson)
Date: Mon, 19 Apr 2010 19:54:11 +0200
Subject: PATCH - update pata_pcmcia/ide-cs with transcend and kingston cards
Message-ID: <20100419195411.f16d8f68.kristoffer.ericson@gmail.com>

This patch adds idstrings for Kingston 1GB/4GB and Transcend 4GB/8GB.

Signed-off-by: Kristoffer Ericson <kristoffer.ericson at gmail.com>

diff --git a/drivers/ide/ide-cs.c b/drivers/ide/ide-cs.c
index ab87e4f..defce28 100644
--- a/drivers/ide/ide-cs.c
+++ b/drivers/ide/ide-cs.c
@@ -409,6 +409,8 @@ static struct pcmcia_device_id ide_ids[] = {
 	PCMCIA_DEVICE_PROD_ID12("Hyperstone", "Model1", 0x3d5b9ef5, 0xca6ab420),
 	PCMCIA_DEVICE_PROD_ID12("IBM", "microdrive", 0xb569a6e5, 0xa6d76178),
 	PCMCIA_DEVICE_PROD_ID12("IBM", "IBM17JSSFP20", 0xb569a6e5, 0xf2508753),
+	PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF CARD 1GB", 0x2e6d1829, 0x3e520e17),
+	PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF CARD 4GB", 0x2e6d1829, 0x531e7d10),
 	PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF8GB", 0x2e6d1829, 0xacbe682e),
 	PCMCIA_DEVICE_PROD_ID12("IO DATA", "CBIDE2      ", 0x547e66dc, 0x8671043b),
 	PCMCIA_DEVICE_PROD_ID12("IO DATA", "PCIDE", 0x547e66dc, 0x5c5ab149),
@@ -429,6 +431,8 @@ static struct pcmcia_device_id ide_ids[] = {
 	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS1GCF80", 0x709b1bf1, 0x2a54d4b1),
 	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS2GCF120", 0x709b1bf1, 0x969aa4f2),
 	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF120", 0x709b1bf1, 0xf54a91c8),
+	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF133", 0x709b1bf1, 0x9351e59d),
+	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS8GCF133", 0x709b1bf1, 0xb2f89b47),
 	PCMCIA_DEVICE_PROD_ID12("WIT", "IDE16", 0x244e5994, 0x3e232852),
 	PCMCIA_DEVICE_PROD_ID12("WEIDA", "TWTTI", 0xcc7cf69c, 0x212bb918),
 	PCMCIA_DEVICE_PROD_ID1("STI Flash", 0xe4a13209),
diff --git a/drivers/ata/pata_pcmcia.c b/drivers/ata/pata_pcmcia.c
index 3c3172d..4164dd2 100644
--- a/drivers/ata/pata_pcmcia.c
+++ b/drivers/ata/pata_pcmcia.c
@@ -424,6 +424,8 @@ static struct pcmcia_device_id pcmcia_devices[] = {
 	PCMCIA_DEVICE_PROD_ID12("Hyperstone", "Model1", 0x3d5b9ef5, 0xca6ab420),
 	PCMCIA_DEVICE_PROD_ID12("IBM", "microdrive", 0xb569a6e5, 0xa6d76178),
 	PCMCIA_DEVICE_PROD_ID12("IBM", "IBM17JSSFP20", 0xb569a6e5, 0xf2508753),
+	PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF CARD 1GB", 0x2e6d1829, 0x3e520e17),
+	PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF CARD 4GB", 0x2e6d1829, 0x531e7d10),
 	PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF8GB", 0x2e6d1829, 0xacbe682e),
 	PCMCIA_DEVICE_PROD_ID12("IO DATA", "CBIDE2      ", 0x547e66dc, 0x8671043b),
 	PCMCIA_DEVICE_PROD_ID12("IO DATA", "PCIDE", 0x547e66dc, 0x5c5ab149),
@@ -444,6 +446,8 @@ static struct pcmcia_device_id pcmcia_devices[] = {
 	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS1GCF80", 0x709b1bf1, 0x2a54d4b1),
 	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS2GCF120", 0x709b1bf1, 0x969aa4f2),
 	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF120", 0x709b1bf1, 0xf54a91c8),
+	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF133", 0x709b1bf1, 0x9351e59d),
+	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS8GCF133", 0x709b1bf1, 0xb2f89b47),
 	PCMCIA_DEVICE_PROD_ID12("WIT", "IDE16", 0x244e5994, 0x3e232852),
 	PCMCIA_DEVICE_PROD_ID12("WEIDA", "TWTTI", 0xcc7cf69c, 0x212bb918),
 	PCMCIA_DEVICE_PROD_ID1("STI Flash", 0xe4a13209),


-- 
Kristoffer Ericson <kristoffer.ericson at gmail.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: drivers-ide-pata-add-support-for-more-cards.patch
Type: application/octet-stream
Size: 2914 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-pcmcia/attachments/20100419/c4692e88/attachment.obj>

From linux at dominikbrodowski.net  Tue Apr 20 07:54:09 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Tue, 20 Apr 2010 13:54:09 +0200
Subject: [git pull] PCMCIA bugfixes for 2.6.34-rc6
Message-ID: <20100420115409.GA30097@comet.dominikbrodowski.net>

Linus,

to solve most of the outstanding PCMCIA bugs I'm aware of -- notable
exception is the regression in kernel bugzilla 13426 --, please pull from

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

The diffstat and list of changes follows; the patches went to the PCMCIA
list yesterday.

Thanks,
	Dominik

----

Dan Carpenter (1):
      pcmcia: fix error handling in cm4000_cs.c

Dominik Brodowski (5):
      pcmcia: use previously assigned IRQ for all card functions
      pcmcia: fix io_probe due to parent (PCI) resources
      pcmcia: re-start on MFC override
      pcmcia: fix ioport size calculation in rsrc_nonstatic
      pcmcia: avoid late calls to pccard_validate_cis

Julia Lawall (1):
      drivers/pcmcia: Add missing local_irq_restore

Timur Maximov (1):
      serial_cs: MD55x support (PCMCIA GPRS/EDGE modem) (kernel 2.6.33)

 drivers/char/pcmcia/cm4000_cs.c  |    8 +++++---
 drivers/pcmcia/cistpl.c          |    9 +++++++--
 drivers/pcmcia/db1xxx_ss.c       |    4 +++-
 drivers/pcmcia/ds.c              |   22 ++++++++++++++--------
 drivers/pcmcia/pcmcia_resource.c |   10 +++++-----
 drivers/pcmcia/rsrc_nonstatic.c  |   16 ++++++++++++----
 drivers/serial/serial_cs.c       |    9 +++++++++
 7 files changed, 55 insertions(+), 23 deletions(-)


From linux at dominikbrodowski.net  Tue Apr 20 13:23:15 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Tue, 20 Apr 2010 19:23:15 +0200
Subject: PATCH - update pata_pcmcia/ide-cs with transcend and kingston
	cards
In-Reply-To: <20100419195411.f16d8f68.kristoffer.ericson@gmail.com>
References: <20100419195411.f16d8f68.kristoffer.ericson@gmail.com>
Message-ID: <20100420172315.GA22138@isilmar-3.linta.de>


On Mon, Apr 19, 2010 at 07:54:11PM +0200, Kristoffer Ericson wrote:
> This patch adds idstrings for Kingston 1GB/4GB and Transcend 4GB/8GB.

Thanks!

> Signed-off-by: Kristoffer Ericson <kristoffer.ericson at gmail.com>

Applied to the PCMCIA urgent tree -- Bartlomiej, David and Jeff, do you
agree this is pused upstream through PCMCIA?

Best,
	Dominik

> diff --git a/drivers/ide/ide-cs.c b/drivers/ide/ide-cs.c
> index ab87e4f..defce28 100644
> --- a/drivers/ide/ide-cs.c
> +++ b/drivers/ide/ide-cs.c
> @@ -409,6 +409,8 @@ static struct pcmcia_device_id ide_ids[] = {
>  	PCMCIA_DEVICE_PROD_ID12("Hyperstone", "Model1", 0x3d5b9ef5, 0xca6ab420),
>  	PCMCIA_DEVICE_PROD_ID12("IBM", "microdrive", 0xb569a6e5, 0xa6d76178),
>  	PCMCIA_DEVICE_PROD_ID12("IBM", "IBM17JSSFP20", 0xb569a6e5, 0xf2508753),
> +	PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF CARD 1GB", 0x2e6d1829, 0x3e520e17),
> +	PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF CARD 4GB", 0x2e6d1829, 0x531e7d10),
>  	PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF8GB", 0x2e6d1829, 0xacbe682e),
>  	PCMCIA_DEVICE_PROD_ID12("IO DATA", "CBIDE2      ", 0x547e66dc, 0x8671043b),
>  	PCMCIA_DEVICE_PROD_ID12("IO DATA", "PCIDE", 0x547e66dc, 0x5c5ab149),
> @@ -429,6 +431,8 @@ static struct pcmcia_device_id ide_ids[] = {
>  	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS1GCF80", 0x709b1bf1, 0x2a54d4b1),
>  	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS2GCF120", 0x709b1bf1, 0x969aa4f2),
>  	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF120", 0x709b1bf1, 0xf54a91c8),
> +	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF133", 0x709b1bf1, 0x9351e59d),
> +	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS8GCF133", 0x709b1bf1, 0xb2f89b47),
>  	PCMCIA_DEVICE_PROD_ID12("WIT", "IDE16", 0x244e5994, 0x3e232852),
>  	PCMCIA_DEVICE_PROD_ID12("WEIDA", "TWTTI", 0xcc7cf69c, 0x212bb918),
>  	PCMCIA_DEVICE_PROD_ID1("STI Flash", 0xe4a13209),
> diff --git a/drivers/ata/pata_pcmcia.c b/drivers/ata/pata_pcmcia.c
> index 3c3172d..4164dd2 100644
> --- a/drivers/ata/pata_pcmcia.c
> +++ b/drivers/ata/pata_pcmcia.c
> @@ -424,6 +424,8 @@ static struct pcmcia_device_id pcmcia_devices[] = {
>  	PCMCIA_DEVICE_PROD_ID12("Hyperstone", "Model1", 0x3d5b9ef5, 0xca6ab420),
>  	PCMCIA_DEVICE_PROD_ID12("IBM", "microdrive", 0xb569a6e5, 0xa6d76178),
>  	PCMCIA_DEVICE_PROD_ID12("IBM", "IBM17JSSFP20", 0xb569a6e5, 0xf2508753),
> +	PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF CARD 1GB", 0x2e6d1829, 0x3e520e17),
> +	PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF CARD 4GB", 0x2e6d1829, 0x531e7d10),
>  	PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF8GB", 0x2e6d1829, 0xacbe682e),
>  	PCMCIA_DEVICE_PROD_ID12("IO DATA", "CBIDE2      ", 0x547e66dc, 0x8671043b),
>  	PCMCIA_DEVICE_PROD_ID12("IO DATA", "PCIDE", 0x547e66dc, 0x5c5ab149),
> @@ -444,6 +446,8 @@ static struct pcmcia_device_id pcmcia_devices[] = {
>  	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS1GCF80", 0x709b1bf1, 0x2a54d4b1),
>  	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS2GCF120", 0x709b1bf1, 0x969aa4f2),
>  	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF120", 0x709b1bf1, 0xf54a91c8),
> +	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF133", 0x709b1bf1, 0x9351e59d),
> +	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS8GCF133", 0x709b1bf1, 0xb2f89b47),
>  	PCMCIA_DEVICE_PROD_ID12("WIT", "IDE16", 0x244e5994, 0x3e232852),
>  	PCMCIA_DEVICE_PROD_ID12("WEIDA", "TWTTI", 0xcc7cf69c, 0x212bb918),
>  	PCMCIA_DEVICE_PROD_ID1("STI Flash", 0xe4a13209),
> 
> 
> -- 
> Kristoffer Ericson <kristoffer.ericson at gmail.com>




From jeff at garzik.org  Tue Apr 20 13:29:33 2010
From: jeff at garzik.org (Jeff Garzik)
Date: Tue, 20 Apr 2010 13:29:33 -0400
Subject: PATCH - update pata_pcmcia/ide-cs with transcend and kingston
	cards
In-Reply-To: <20100420172315.GA22138@isilmar-3.linta.de>
References: <20100419195411.f16d8f68.kristoffer.ericson@gmail.com>
	<20100420172315.GA22138@isilmar-3.linta.de>
Message-ID: <4BCDE47D.3000700@garzik.org>

On 04/20/2010 01:23 PM, Dominik Brodowski wrote:
>
> On Mon, Apr 19, 2010 at 07:54:11PM +0200, Kristoffer Ericson wrote:
>> This patch adds idstrings for Kingston 1GB/4GB and Transcend 4GB/8GB.
>
> Thanks!
>
>> Signed-off-by: Kristoffer Ericson<kristoffer.ericson at gmail.com>
>
> Applied to the PCMCIA urgent tree -- Bartlomiej, David and Jeff, do you
> agree this is pused upstream through PCMCIA?

PCI ID additions are normally pushed through the relevant subsystem tree 
and not the PCI tree, so I do not understand why PCMCIA must be different.

But, it is a simple change and no big deal to push via PCMCIA tree.

Either way,

Acked-by: Jeff Garzik <jgarzik at redhat.com>



From linux at dominikbrodowski.net  Tue Apr 20 13:33:16 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Tue, 20 Apr 2010 19:33:16 +0200
Subject: PATCH - update pata_pcmcia/ide-cs with transcend and kingston
	cards
In-Reply-To: <4BCDE47D.3000700@garzik.org>
References: <20100419195411.f16d8f68.kristoffer.ericson@gmail.com>
	<20100420172315.GA22138@isilmar-3.linta.de>
	<4BCDE47D.3000700@garzik.org>
Message-ID: <20100420173316.GA24616@isilmar-3.linta.de>

Jeff,

On Tue, Apr 20, 2010 at 01:29:33PM -0400, Jeff Garzik wrote:
> On 04/20/2010 01:23 PM, Dominik Brodowski wrote:
>>
>> On Mon, Apr 19, 2010 at 07:54:11PM +0200, Kristoffer Ericson wrote:
>>> This patch adds idstrings for Kingston 1GB/4GB and Transcend 4GB/8GB.
>>
>> Thanks!
>>
>>> Signed-off-by: Kristoffer Ericson<kristoffer.ericson at gmail.com>
>>
>> Applied to the PCMCIA urgent tree -- Bartlomiej, David and Jeff, do you
>> agree this is pused upstream through PCMCIA?
>
> PCI ID additions are normally pushed through the relevant subsystem tree  
> and not the PCI tree, so I do not understand why PCMCIA must be 
> different.
>
> But, it is a simple change and no big deal to push via PCMCIA tree.

Actually, I do not care either way -- so it isn't a "must" at all... So if
you prefer to pick it up, I'm all fine with it. Just let me know how you
prefer :)

Best,
	Dominik


From jeff at garzik.org  Tue Apr 20 17:26:54 2010
From: jeff at garzik.org (Jeff Garzik)
Date: Tue, 20 Apr 2010 17:26:54 -0400
Subject: PATCH - update pata_pcmcia/ide-cs with transcend and kingston
	cards
In-Reply-To: <20100420173316.GA24616@isilmar-3.linta.de>
References: <20100419195411.f16d8f68.kristoffer.ericson@gmail.com>
	<20100420172315.GA22138@isilmar-3.linta.de>
	<4BCDE47D.3000700@garzik.org>
	<20100420173316.GA24616@isilmar-3.linta.de>
Message-ID: <4BCE1C1E.90706@garzik.org>

On 04/20/2010 01:33 PM, Dominik Brodowski wrote:
> Jeff,
>
> On Tue, Apr 20, 2010 at 01:29:33PM -0400, Jeff Garzik wrote:
>> On 04/20/2010 01:23 PM, Dominik Brodowski wrote:
>>>
>>> On Mon, Apr 19, 2010 at 07:54:11PM +0200, Kristoffer Ericson wrote:
>>>> This patch adds idstrings for Kingston 1GB/4GB and Transcend 4GB/8GB.
>>>
>>> Thanks!
>>>
>>>> Signed-off-by: Kristoffer Ericson<kristoffer.ericson at gmail.com>
>>>
>>> Applied to the PCMCIA urgent tree -- Bartlomiej, David and Jeff, do you
>>> agree this is pused upstream through PCMCIA?
>>
>> PCI ID additions are normally pushed through the relevant subsystem tree
>> and not the PCI tree, so I do not understand why PCMCIA must be
>> different.
>>
>> But, it is a simple change and no big deal to push via PCMCIA tree.
>
> Actually, I do not care either way -- so it isn't a "must" at all... So if
> you prefer to pick it up, I'm all fine with it. Just let me know how you
> prefer :)


I would tend to prefer that ID patches go through the libata/IDE 
subsystem trees, to be similar to PCI and other bus ID patches.

But it is such a small matter that, if you have already applied the 
patch to your tree, I would rather not waste your time removing the patch!

If you have not yet applied it, though, I can merge it into my tree.

	Jeff




From kristoffer.ericson at gmail.com  Wed Apr 21 11:40:01 2010
From: kristoffer.ericson at gmail.com (Kristoffer Ericson)
Date: Wed, 21 Apr 2010 17:40:01 +0200
Subject: PATCH - update pata_pcmcia/ide-cs with transcend and kingston
	cards
In-Reply-To: <4BCE1C1E.90706@garzik.org>
References: <20100419195411.f16d8f68.kristoffer.ericson@gmail.com>
	<20100420172315.GA22138@isilmar-3.linta.de>
	<4BCDE47D.3000700@garzik.org>
	<20100420173316.GA24616@isilmar-3.linta.de>
	<4BCE1C1E.90706@garzik.org>
Message-ID: <20100421174001.65201fa3.kristoffer.ericson@gmail.com>

On Tue, 20 Apr 2010 17:26:54 -0400
Jeff Garzik <jeff at garzik.org> wrote:

> On 04/20/2010 01:33 PM, Dominik Brodowski wrote:
> > Jeff,
> >
> > On Tue, Apr 20, 2010 at 01:29:33PM -0400, Jeff Garzik wrote:
> >> On 04/20/2010 01:23 PM, Dominik Brodowski wrote:
> >>>
> >>> On Mon, Apr 19, 2010 at 07:54:11PM +0200, Kristoffer Ericson wrote:
> >>>> This patch adds idstrings for Kingston 1GB/4GB and Transcend 4GB/8GB.
> >>>
> >>> Thanks!
> >>>
> >>>> Signed-off-by: Kristoffer Ericson<kristoffer.ericson at gmail.com>
> >>>
> >>> Applied to the PCMCIA urgent tree -- Bartlomiej, David and Jeff, do you
> >>> agree this is pused upstream through PCMCIA?
> >>
> >> PCI ID additions are normally pushed through the relevant subsystem tree
> >> and not the PCI tree, so I do not understand why PCMCIA must be
> >> different.
> >>
> >> But, it is a simple change and no big deal to push via PCMCIA tree.
> >
> > Actually, I do not care either way -- so it isn't a "must" at all... So if
> > you prefer to pick it up, I'm all fine with it. Just let me know how you
> > prefer :)
> 
> 
> I would tend to prefer that ID patches go through the libata/IDE 
> subsystem trees, to be similar to PCI and other bus ID patches.

Goodie, then I know where to drop the patches in the future. Thanks
for clearing that up.

> 
> But it is such a small matter that, if you have already applied the 
> patch to your tree, I would rather not waste your time removing the patch!
> 
> If you have not yet applied it, though, I can merge it into my tree.
> 
> 	Jeff
> 
> 


-- 
Kristoffer Ericson <kristoffer.ericson at gmail.com>


From jeff at garzik.org  Thu Apr 22 21:52:40 2010
From: jeff at garzik.org (Jeff Garzik)
Date: Thu, 22 Apr 2010 21:52:40 -0400
Subject: PATCH - update pata_pcmcia/ide-cs with transcend and kingston
	cards
In-Reply-To: <20100419195411.f16d8f68.kristoffer.ericson@gmail.com>
References: <20100419195411.f16d8f68.kristoffer.ericson@gmail.com>
Message-ID: <4BD0FD68.90408@garzik.org>

On 04/19/2010 01:54 PM, Kristoffer Ericson wrote:
> This patch adds idstrings for Kingston 1GB/4GB and Transcend 4GB/8GB.
>
> Signed-off-by: Kristoffer Ericson<kristoffer.ericson at gmail.com>
>
> diff --git a/drivers/ide/ide-cs.c b/drivers/ide/ide-cs.c
> index ab87e4f..defce28 100644
> --- a/drivers/ide/ide-cs.c
> +++ b/drivers/ide/ide-cs.c
> @@ -409,6 +409,8 @@ static struct pcmcia_device_id ide_ids[] = {
>   	PCMCIA_DEVICE_PROD_ID12("Hyperstone", "Model1", 0x3d5b9ef5, 0xca6ab420),
>   	PCMCIA_DEVICE_PROD_ID12("IBM", "microdrive", 0xb569a6e5, 0xa6d76178),
>   	PCMCIA_DEVICE_PROD_ID12("IBM", "IBM17JSSFP20", 0xb569a6e5, 0xf2508753),
> +	PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF CARD 1GB", 0x2e6d1829, 0x3e520e17),
> +	PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF CARD 4GB", 0x2e6d1829, 0x531e7d10),
>   	PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF8GB", 0x2e6d1829, 0xacbe682e),
>   	PCMCIA_DEVICE_PROD_ID12("IO DATA", "CBIDE2      ", 0x547e66dc, 0x8671043b),
>   	PCMCIA_DEVICE_PROD_ID12("IO DATA", "PCIDE", 0x547e66dc, 0x5c5ab149),
> @@ -429,6 +431,8 @@ static struct pcmcia_device_id ide_ids[] = {
>   	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS1GCF80", 0x709b1bf1, 0x2a54d4b1),
>   	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS2GCF120", 0x709b1bf1, 0x969aa4f2),
>   	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF120", 0x709b1bf1, 0xf54a91c8),
> +	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF133", 0x709b1bf1, 0x9351e59d),
> +	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS8GCF133", 0x709b1bf1, 0xb2f89b47),
>   	PCMCIA_DEVICE_PROD_ID12("WIT", "IDE16", 0x244e5994, 0x3e232852),
>   	PCMCIA_DEVICE_PROD_ID12("WEIDA", "TWTTI", 0xcc7cf69c, 0x212bb918),
>   	PCMCIA_DEVICE_PROD_ID1("STI Flash", 0xe4a13209),
> diff --git a/drivers/ata/pata_pcmcia.c b/drivers/ata/pata_pcmcia.c
> index 3c3172d..4164dd2 100644
> --- a/drivers/ata/pata_pcmcia.c
> +++ b/drivers/ata/pata_pcmcia.c
> @@ -424,6 +424,8 @@ static struct pcmcia_device_id pcmcia_devices[] = {
>   	PCMCIA_DEVICE_PROD_ID12("Hyperstone", "Model1", 0x3d5b9ef5, 0xca6ab420),
>   	PCMCIA_DEVICE_PROD_ID12("IBM", "microdrive", 0xb569a6e5, 0xa6d76178),
>   	PCMCIA_DEVICE_PROD_ID12("IBM", "IBM17JSSFP20", 0xb569a6e5, 0xf2508753),
> +	PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF CARD 1GB", 0x2e6d1829, 0x3e520e17),
> +	PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF CARD 4GB", 0x2e6d1829, 0x531e7d10),
>   	PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF8GB", 0x2e6d1829, 0xacbe682e),
>   	PCMCIA_DEVICE_PROD_ID12("IO DATA", "CBIDE2      ", 0x547e66dc, 0x8671043b),
>   	PCMCIA_DEVICE_PROD_ID12("IO DATA", "PCIDE", 0x547e66dc, 0x5c5ab149),
> @@ -444,6 +446,8 @@ static struct pcmcia_device_id pcmcia_devices[] = {
>   	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS1GCF80", 0x709b1bf1, 0x2a54d4b1),
>   	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS2GCF120", 0x709b1bf1, 0x969aa4f2),
>   	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF120", 0x709b1bf1, 0xf54a91c8),
> +	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF133", 0x709b1bf1, 0x9351e59d),
> +	PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS8GCF133", 0x709b1bf1, 0xb2f89b47),
>   	PCMCIA_DEVICE_PROD_ID12("WIT", "IDE16", 0x244e5994, 0x3e232852),
>   	PCMCIA_DEVICE_PROD_ID12("WEIDA", "TWTTI", 0xcc7cf69c, 0x212bb918),
>   	PCMCIA_DEVICE_PROD_ID1("STI Flash", 0xe4a13209),
>
>

applied



From linux at blala.de  Sun Apr 25 05:44:35 2010
From: linux at blala.de (Alexander Kurz)
Date: Sun, 25 Apr 2010 13:44:35 +0400 (MSD)
Subject: [PATCH] pcmcia: fix matching rules for pseudo-multi-function cards
Message-ID: <alpine.DEB.1.10.1004251329140.16036@blala.de>

Hi Dominik,
here is a fix for the rule to prevent PCMCIA_DEV_ID_MATCH_FUNC_ID entries 
to match on PFC-cards. e.g. serial_cs PCMCIA_DEVICE_FUNC_ID(2)
will match on device 0 of a xircom CEM33 card resulting in a
failure in xirc2ps_cs.
I changed the code, so that the first matching struct pcmcia_device_id
_PFC_ entry will mark the card has_pfc, preventing 
PCMCIA_DEV_ID_MATCH_FUNC_ID to match.

Cheers, Alexander


From linux at kbdbabel.org  Sat Apr 24 03:49:43 2010
From: linux at kbdbabel.org (Alexander Kurz)
Date: Sat, 24 Apr 2010 09:49:43 +0200
Subject: [PATCH] pcmcia: fix matching rules for pseudo-multi-function cards,
 prevent PCMCIA_DEV_ID_MATCH_FUNC_ID from grabbing PFC-cards.
Message-ID: <mailman.317.1272188687.2170.linux-pcmcia@lists.infradead.org>

Signed-off-by: Alexander Kurz <linux at kbdbabel.org>
CC: linux-pcmcia at lists.infradead.org
---
 drivers/pcmcia/ds.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 4014cf8..6ae35b3 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -828,11 +828,12 @@ static inline int pcmcia_devmatch(struct pcmcia_device *dev,
 	}
 
 	if (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) {
-		if (dev->device_no != did->device_no)
-			return 0;
+		dev_dbg(&dev->dev, "this is a pseudo-multi-function device\n");
 		mutex_lock(&dev->socket->ops_mutex);
 		dev->socket->pcmcia_state.has_pfc = 1;
 		mutex_unlock(&dev->socket->ops_mutex);
+		if (dev->device_no != did->device_no)
+			return 0;
 	}
 
 	if (did->match_flags & PCMCIA_DEV_ID_MATCH_FUNC_ID) {
@@ -843,7 +844,7 @@ static inline int pcmcia_devmatch(struct pcmcia_device *dev,
 
 		/* if this is a pseudo-multi-function device,
 		 * we need explicit matches */
-		if (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO)
+		if (dev->socket->pcmcia_state.has_pfc)
 			return 0;
 		if (dev->device_no)
 			return 0;
-- 
1.7.0



From linux at dominikbrodowski.net  Mon Apr 26 16:07:11 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Mon, 26 Apr 2010 22:07:11 +0200
Subject: [PATCH] pcmcia: fix matching rules for pseudo-multi-function cards
In-Reply-To: <alpine.DEB.1.10.1004251329140.16036@blala.de>
References: <alpine.DEB.1.10.1004251329140.16036@blala.de>
Message-ID: <20100426200711.GA1235@comet.dominikbrodowski.net>

Hey Alexander,

On Sun, Apr 25, 2010 at 01:44:35PM +0400, Alexander Kurz wrote:
> here is a fix for the rule to prevent PCMCIA_DEV_ID_MATCH_FUNC_ID entries 
> to match on PFC-cards. e.g. serial_cs PCMCIA_DEVICE_FUNC_ID(2)
> will match on device 0 of a xircom CEM33 card resulting in a
> failure in xirc2ps_cs.
> I changed the code, so that the first matching struct pcmcia_device_id
> _PFC_ entry will mark the card has_pfc, preventing 
> PCMCIA_DEV_ID_MATCH_FUNC_ID to match.
> 
> Cheers, Alexander
> 
> From adea8dbc5de871f72572bb0ae5158e91051f6ed5 Mon Sep 17 00:00:00 2001
> From: Alexander Kurz <linux at kbdbabel.org>
> Date: Sat, 24 Apr 2010 09:49:43 +0200
> Subject: [PATCH] pcmcia: fix matching rules for pseudo-multi-function cards,
>  prevent PCMCIA_DEV_ID_MATCH_FUNC_ID from grabbing PFC-cards.
> 
> Signed-off-by: Alexander Kurz <linux at kbdbabel.org>
> CC: linux-pcmcia at lists.infradead.org


Applied to -urgent, thanks.

	Dominik


From linux at dominikbrodowski.net  Tue Apr 27 13:01:15 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Tue, 27 Apr 2010 19:01:15 +0200
Subject: [PATCH 2/2] pcmcia: fix matching rules for pseudo-multi-function cards
In-Reply-To: <20100427165951.GA9276@comet.dominikbrodowski.net>
References: <20100427165951.GA9276@comet.dominikbrodowski.net>
Message-ID: <1272387675-9480-2-git-send-email-linux@dominikbrodowski.net>

From: Alexander Kurz <linux at kbdbabel.org>

Prevent PCMCIA_DEV_ID_MATCH_FUNC_ID from grabbing PFC-cards:
I changed the code, so that the first matching struct
pcmcia_device_id _PFC_ entry will mark the card has_pfc,
preventing PCMCIA_DEV_ID_MATCH_FUNC_ID to match.

[linux-pcmcia at lists.infradead.org: re-order commit message]
Signed-off-by: Alexander Kurz <linux at kbdbabel.org>
Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 drivers/pcmcia/ds.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 92a5af8..508f94a 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -820,11 +820,12 @@ static inline int pcmcia_devmatch(struct pcmcia_device *dev,
 	}
 
 	if (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) {
-		if (dev->device_no != did->device_no)
-			return 0;
+		dev_dbg(&dev->dev, "this is a pseudo-multi-function device\n");
 		mutex_lock(&dev->socket->ops_mutex);
 		dev->socket->pcmcia_state.has_pfc = 1;
 		mutex_unlock(&dev->socket->ops_mutex);
+		if (dev->device_no != did->device_no)
+			return 0;
 	}
 
 	if (did->match_flags & PCMCIA_DEV_ID_MATCH_FUNC_ID) {
@@ -835,7 +836,7 @@ static inline int pcmcia_devmatch(struct pcmcia_device *dev,
 
 		/* if this is a pseudo-multi-function device,
 		 * we need explicit matches */
-		if (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO)
+		if (dev->socket->pcmcia_state.has_pfc)
 			return 0;
 		if (dev->device_no)
 			return 0;
-- 
1.6.3.3



From linux at dominikbrodowski.net  Tue Apr 27 13:01:14 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Tue, 27 Apr 2010 19:01:14 +0200
Subject: [PATCH 1/2] pcmcia: pcmcia_dev_present bugfix
In-Reply-To: <20100427165951.GA9276@comet.dominikbrodowski.net>
References: <20100427165951.GA9276@comet.dominikbrodowski.net>
Message-ID: <1272387675-9480-1-git-send-email-linux@dominikbrodowski.net>

pcmcia_dev_present is in and by itself buggy. Add a note specifying
why it is broken, and replace the broken locking -- taking a mutex
is a bad idea in IRQ context, from which this function is rarely
called -- by an atomic_t.

Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 drivers/pcmcia/ds.c |   47 ++++++++++++++---------------------------------
 include/pcmcia/ds.h |    7 +++----
 include/pcmcia/ss.h |    8 +++-----
 3 files changed, 20 insertions(+), 42 deletions(-)

diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 4014cf8..92a5af8 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -335,7 +335,6 @@ static void pcmcia_card_remove(struct pcmcia_socket *s, struct pcmcia_device *le
 
 		mutex_lock(&s->ops_mutex);
 		list_del(&p_dev->socket_device_list);
-		p_dev->_removed = 1;
 		mutex_unlock(&s->ops_mutex);
 
 		dev_dbg(&p_dev->dev, "unregistering device\n");
@@ -654,14 +653,7 @@ static int pcmcia_requery_callback(struct device *dev, void * _data)
 
 static void pcmcia_requery(struct pcmcia_socket *s)
 {
-	int present, has_pfc;
-
-	mutex_lock(&s->ops_mutex);
-	present = s->pcmcia_state.present;
-	mutex_unlock(&s->ops_mutex);
-
-	if (!present)
-		return;
+	int has_pfc;
 
 	if (s->functions == 0) {
 		pcmcia_card_add(s);
@@ -1260,9 +1252,7 @@ static int ds_event(struct pcmcia_socket *skt, event_t event, int priority)
 
 	switch (event) {
 	case CS_EVENT_CARD_REMOVAL:
-		mutex_lock(&s->ops_mutex);
-		s->pcmcia_state.present = 0;
-		mutex_unlock(&s->ops_mutex);
+		atomic_set(&skt->present, 0);
 		pcmcia_card_remove(skt, NULL);
 		handle_event(skt, event);
 		mutex_lock(&s->ops_mutex);
@@ -1271,9 +1261,9 @@ static int ds_event(struct pcmcia_socket *skt, event_t event, int priority)
 		break;
 
 	case CS_EVENT_CARD_INSERTION:
+		atomic_set(&skt->present, 1);
 		mutex_lock(&s->ops_mutex);
 		s->pcmcia_state.has_pfc = 0;
-		s->pcmcia_state.present = 1;
 		destroy_cis_cache(s); /* to be on the safe side... */
 		mutex_unlock(&s->ops_mutex);
 		pcmcia_card_add(skt);
@@ -1313,7 +1303,13 @@ static int ds_event(struct pcmcia_socket *skt, event_t event, int priority)
     return 0;
 } /* ds_event */
 
-
+/*
+ * NOTE: This is racy. There's no guarantee the card will still be
+ * physically present, even if the call to this function returns
+ * non-NULL. Furthermore, the device driver most likely is unbound
+ * almost immediately, so the timeframe where pcmcia_dev_present
+ * returns NULL is probably really really small.
+ */
 struct pcmcia_device *pcmcia_dev_present(struct pcmcia_device *_p_dev)
 {
 	struct pcmcia_device *p_dev;
@@ -1323,22 +1319,9 @@ struct pcmcia_device *pcmcia_dev_present(struct pcmcia_device *_p_dev)
 	if (!p_dev)
 		return NULL;
 
-	mutex_lock(&p_dev->socket->ops_mutex);
-	if (!p_dev->socket->pcmcia_state.present)
-		goto out;
+	if (atomic_read(&p_dev->socket->present) != 0)
+		ret = p_dev;
 
-	if (p_dev->socket->pcmcia_state.dead)
-		goto out;
-
-	if (p_dev->_removed)
-		goto out;
-
-	if (p_dev->suspended)
-		goto out;
-
-	ret = p_dev;
- out:
-	mutex_unlock(&p_dev->socket->ops_mutex);
 	pcmcia_put_dev(p_dev);
 	return ret;
 }
@@ -1388,6 +1371,8 @@ static int __devinit pcmcia_bus_add_socket(struct device *dev,
 		return ret;
 	}
 
+	atomic_set(&socket->present, 0);
+
 	return 0;
 }
 
@@ -1399,10 +1384,6 @@ static void pcmcia_bus_remove_socket(struct device *dev,
 	if (!socket)
 		return;
 
-	mutex_lock(&socket->ops_mutex);
-	socket->pcmcia_state.dead = 1;
-	mutex_unlock(&socket->ops_mutex);
-
 	pccard_register_pcmcia(socket, NULL);
 
 	/* unregister any unbound devices */
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
index d57847f..aab3c13 100644
--- a/include/pcmcia/ds.h
+++ b/include/pcmcia/ds.h
@@ -26,6 +26,7 @@
 #ifdef __KERNEL__
 #include <linux/device.h>
 #include <pcmcia/ss.h>
+#include <asm/atomic.h>
 
 /*
  * PCMCIA device drivers (16-bit cards only; 32-bit cards require CardBus
@@ -94,10 +95,8 @@ struct pcmcia_device {
 	config_req_t		conf;
 	window_handle_t		win;
 
-	/* Is the device suspended, or in the process of
-	 * being removed? */
+	/* Is the device suspended? */
 	u16			suspended:1;
-	u16			_removed:1;
 
 	/* Flags whether io, irq, win configurations were
 	 * requested, and whether the configuration is "locked" */
@@ -115,7 +114,7 @@ struct pcmcia_device {
 	u16			has_card_id:1;
 	u16			has_func_id:1;
 
-	u16			reserved:3;
+	u16			reserved:4;
 
 	u8			func_id;
 	u16			manf_id;
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h
index 2e488b6..344705c 100644
--- a/include/pcmcia/ss.h
+++ b/include/pcmcia/ss.h
@@ -224,18 +224,16 @@ struct pcmcia_socket {
 
 	/* 16-bit state: */
 	struct {
-		/* PCMCIA card is present in socket */
-		u8			present:1;
 		/* "master" ioctl is used */
 		u8			busy:1;
-		/* pcmcia module is being unloaded */
-		u8			dead:1;
 		/* the PCMCIA card consists of two pseudo devices */
 		u8			has_pfc:1;
 
-		u8			reserved:4;
+		u8			reserved:6;
 	} pcmcia_state;
 
+	/* non-zero if PCMCIA card is present */
+	atomic_t			present;
 
 #ifdef CONFIG_PCMCIA_IOCTL
 	struct user_info_t		*user;
-- 
1.6.3.3



From linux at dominikbrodowski.net  Tue Apr 27 12:59:51 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Tue, 27 Apr 2010 18:59:51 +0200
Subject: [RFC] PCMCIA patches for 2.6.34-rc5 -- 2nd batch
Message-ID: <20100427165951.GA9276@comet.dominikbrodowski.net>

Hey,

in order to solve bugzilla bug 13426, and to fix another bug Alexander Kurz
tracked down, I intend to submit a pull request for two additional
patches tomorrow. They're available at

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

As usual, I'm interested in your input to this patch series. The individual
patches will be sent out to the PCMCIA list in a few moments.

Best,
	Dominik

Alexander Kurz (1):
      pcmcia: fix matching rules for pseudo-multi-function cards

Dominik Brodowski (1):
      pcmcia: pcmcia_dev_present bugfix

 drivers/pcmcia/ds.c |   54 +++++++++++++++++----------------------------------
 include/pcmcia/ds.h |    7 ++---
 include/pcmcia/ss.h |    8 ++----
 3 files changed, 24 insertions(+), 45 deletions(-)


From linux at dominikbrodowski.net  Wed Apr 28 02:11:30 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Wed, 28 Apr 2010 08:11:30 +0200
Subject: [git pull] PCMCIA bugfixes for 2.6.34-rc6
Message-ID: <20100428061130.GA4497@comet.dominikbrodowski.net>

Linus,

in order to solve bugzilla bug 13426, and to fix another bug Alexander Kurz
tracked down, please pull from

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

The diffstat and list of changes follows; the patches went to the PCMCIA
list yesterday.

Thanks,
	Dominik

----

Alexander Kurz (1):
      pcmcia: fix matching rules for pseudo-multi-function cards

Dominik Brodowski (1):
      pcmcia: pcmcia_dev_present bugfix

 drivers/pcmcia/ds.c |   54 +++++++++++++++++----------------------------------
 include/pcmcia/ds.h |    7 ++---
 include/pcmcia/ss.h |    8 ++----
 3 files changed, 24 insertions(+), 45 deletions(-)


From komurojun-mbn at nifty.com  Wed Apr 28 07:51:19 2010
From: komurojun-mbn at nifty.com (Komuro)
Date: Wed, 28 Apr 2010 20:51:19 +0900 (JST)
Subject: [PATCH] pcmcia: fix matching rules for pseudo-multi-function cards
In-Reply-To: <alpine.DEB.1.10.1004251329140.16036@blala.de>
References: <alpine.DEB.1.10.1004251329140.16036@blala.de>
Message-ID: <15339870.357451272455479281.komurojun-mbn@nifty.com>


>here is a fix for the rule to prevent PCMCIA_DEV_ID_MATCH_FUNC_ID entries 
>to match on PFC-cards. e.g. serial_cs PCMCIA_DEVICE_FUNC_ID(2)
>will match on device 0 of a xircom CEM33 card resulting in a
>failure in xirc2ps_cs.
>I changed the code, so that the first matching struct pcmcia_device_id
>_PFC_ entry will mark the card has_pfc, preventing 
>PCMCIA_DEV_ID_MATCH_FUNC_ID to match.
>

OK. works.




From komurojun-mbn at nifty.com  Wed Apr 28 20:40:46 2010
From: komurojun-mbn at nifty.com (Komuro)
Date: Thu, 29 Apr 2010 09:40:46 +0900 (JST)
Subject: [BUG? KERNEL 2.6.34-rc5-git5] pccard_validate_cis WARN_ON error
In-Reply-To: <15339870.357451272455479281.komurojun-mbn@nifty.com>
References: <15339870.357451272455479281.komurojun-mbn@nifty.com>
	<alpine.DEB.1.10.1004251329140.16036@blala.de>
Message-ID: <26458756.45801272501646854.komurojun-mbn@nifty.com>

Hi,

After issuing the "pccardctl reset",
I get the WARN_ON error from pccard_validate_cis
and the card does not work.

(Megahertz multi-function card)


WARNING: at drivers/pcmcia/cistpl.c:1488 pccard_validate_cis+0x32/0x2c6()


int pccard_validate_cis(struct pcmcia_socket *s, unsigned int *info)
{
        tuple_t *tuple;
        cisparse_t *p;
        unsigned int count = 0;
        int ret, reserved, dev_ok = 0, ident_ok = 0;

        if (!s)
                return -EINVAL;

        if (s->functions) {
                WARN_ON(1);                       <= HERE
                return -EINVAL;
        }

Best Regards
Komuro



From linux at dominikbrodowski.net  Thu Apr 29 02:15:30 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Thu, 29 Apr 2010 08:15:30 +0200
Subject: [BUG? KERNEL 2.6.34-rc5-git5] pccard_validate_cis WARN_ON error
In-Reply-To: <26458756.45801272501646854.komurojun-mbn@nifty.com>
References: <15339870.357451272455479281.komurojun-mbn@nifty.com>
	<alpine.DEB.1.10.1004251329140.16036@blala.de>
	<26458756.45801272501646854.komurojun-mbn@nifty.com>
Message-ID: <20100429061530.GA6567@isilmar-3.linta.de>

Hey,

On Thu, Apr 29, 2010 at 09:40:46AM +0900, Komuro wrote:
> After issuing the "pccardctl reset",
> I get the WARN_ON error from pccard_validate_cis
> and the card does not work.
> 
> (Megahertz multi-function card)
> 
> 
> WARNING: at drivers/pcmcia/cistpl.c:1488 pccard_validate_cis+0x32/0x2c6()

is a call trace printed? If so, what is it?

Thanks & best,
	Dominik


From komurojun-mbn at nifty.com  Thu Apr 29 04:17:07 2010
From: komurojun-mbn at nifty.com (Komuro)
Date: Thu, 29 Apr 2010 17:17:07 +0900 (JST)
Subject: [BUG? KERNEL 2.6.34-rc5-git5] pccard_validate_cis WARN_ON
	error
In-Reply-To: <20100429061530.GA6567@isilmar-3.linta.de>
References: <20100429061530.GA6567@isilmar-3.linta.de>
	<15339870.357451272455479281.komurojun-mbn@nifty.com>
	<alpine.DEB.1.10.1004251329140.16036@blala.de>
	<26458756.45801272501646854.komurojun-mbn@nifty.com>
Message-ID: <4879172.174021272529027185.komurojun-mbn@nifty.com>

Hi,

>> 
>> WARNING: at drivers/pcmcia/cistpl.c:1488 pccard_validate_cis+0x32/0x2c6()
>
>is a call trace printed? If so, what is it?
>

Here is the call trace.

------------[ cut here ]------------
WARNING: at drivers/pcmcia/cistpl.c:1488 pccard_validate_cis+0x32/0x2c6()
Hardware name: System Product Name
Modules linked in: smc91c92_cs mii serial_cs video output sbs sbshc battery ac
 sg button floppy sr_mod cdrom yenta_socket rsrc_nonstatic sata_via ata_generi
c pata_via libata sd_mod scsi_mod ext3 jbd mbcache [last unloaded: scsi_wait_s
can]
Pid: 1126, comm: pccardd Not tainted 2.6.34-rc5-git5 #5
Call Trace:
 [<c042b90c>] ? warn_slowpath_common+0x41/0x71
 [<c042b929>] ? warn_slowpath_common+0x5e/0x71
 [<c042b946>] ? warn_slowpath_null+0xa/0xc
 [<c057f7c3>] ? pccard_validate_cis+0x32/0x2c6
 [<c057c0ab>] ? pcmcia_card_add+0x4a/0xa0
 [<c04ff1fe>] ? kref_put+0x36/0x40
 [<c04fe6ce>] ? kobject_release+0x0/0x4f
 [<c04ff1fe>] ? kref_put+0x36/0x40
 [<c057c1c6>] ? ds_event+0xc5/0x12f
 [<c057c222>] ? ds_event+0x121/0x12f
 [<c057a3dd>] ? send_event+0x7b/0x97
 [<c057a7f6>] ? socket_late_resume+0x81/0x86
 [<c057adfe>] ? pccardd+0x21c/0x30e
 [<c057abe2>] ? pccardd+0x0/0x30e
 [<c043f535>] ? kthread+0x61/0x66
 [<c043f4d4>] ? kthread+0x0/0x66
 [<c0402bf6>] ? kernel_thread_helper+0x6/0x12
---[ end trace 1855fc3c55f1e08e ]---




From linux at dominikbrodowski.net  Thu Apr 29 09:59:14 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Thu, 29 Apr 2010 15:59:14 +0200
Subject: [BUG? KERNEL 2.6.34-rc5-git5] pccard_validate_cis WARN_ON
	error
In-Reply-To: <4879172.174021272529027185.komurojun-mbn@nifty.com>
References: <20100429061530.GA6567@isilmar-3.linta.de>
	<15339870.357451272455479281.komurojun-mbn@nifty.com>
	<alpine.DEB.1.10.1004251329140.16036@blala.de>
	<26458756.45801272501646854.komurojun-mbn@nifty.com>
	<4879172.174021272529027185.komurojun-mbn@nifty.com>
Message-ID: <20100429135914.GA17838@comet.dominikbrodowski.net>

Hey,

On Thu, Apr 29, 2010 at 05:17:07PM +0900, Komuro wrote:
> >> WARNING: at drivers/pcmcia/cistpl.c:1488 pccard_validate_cis+0x32/0x2c6()
> >
> >is a call trace printed? If so, what is it?
> 
> Here is the call trace.

Thanks! Does this patch help?

From: Dominik Brodowski <linux at dominikbrodowski.net>
Date: Thu, 29 Apr 2010 15:56:25 +0200
Subject: [PATCH] pcmcia: avoid pccard_validate_cis failure in resume callpath

If the PCMCIA CIS changed before a resume event (e.g. due to
a card exchange while being suspended, possibly also during
a call to "pccardctl reset"), also set the function count to
zero so that the subsequent call to pccard_validate_cis() does
not fail.

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

diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 508f94a..041eee4 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -1283,6 +1283,7 @@ static int ds_event(struct pcmcia_socket *skt, event_t event, int priority)
 			destroy_cis_cache(skt);
 			kfree(skt->fake_cis);
 			skt->fake_cis = NULL;
+			s->functions = 0;
 			mutex_unlock(&s->ops_mutex);
 			/* now, add the new card */
 			ds_event(skt, CS_EVENT_CARD_INSERTION,





From lisastevens at mail.zwht.com  Thu Apr 29 12:56:35 2010
From: lisastevens at mail.zwht.com (Lane alcmena)
Date: 30 Apr 2010 00:56:35 +0800
Subject: physician mailing lists
Message-ID: <GDXC-SERVERe3s9U6TO0000024c@zwht.com>

We have lists for healthcare, business & finance, consumers and professionals. Lots of different lists from various optin sources.

Just send me an email here for additional info: Adela.Gleason at goodlists.co.cc

  


Send us an email to disappear at goodlists.co.cc we will discontinue from the list


From komurojun-mbn at nifty.com  Thu Apr 29 14:00:00 2010
From: komurojun-mbn at nifty.com (Komuro)
Date: Fri, 30 Apr 2010 03:00:00 +0900 (JST)
Subject: [BUG? KERNEL 2.6.34-rc5-git5] pccard_validate_cis WARN_ON
	error
In-Reply-To: <20100429135914.GA17838@comet.dominikbrodowski.net>
References: <20100429135914.GA17838@comet.dominikbrodowski.net>
	<20100429061530.GA6567@isilmar-3.linta.de>
	<15339870.357451272455479281.komurojun-mbn@nifty.com>
	<alpine.DEB.1.10.1004251329140.16036@blala.de>
	<26458756.45801272501646854.komurojun-mbn@nifty.com>
	<4879172.174021272529027185.komurojun-mbn@nifty.com>
Message-ID: <5193065.358611272564000220.komurojun-mbn@nifty.com>

Hi,

>> >> WARNING: at drivers/pcmcia/cistpl.c:1488 pccard_validate_cis+0x32/0x2c6(
)
>> >
>> >is a call trace printed? If so, what is it?
>> 
>> Here is the call trace.
>
>Thanks! Does this patch help?
>

The WARN_ON error is fixed.

But, after "pccardctl reset", the card still does not work.

case1: eth0 does not appear.
case2: eth0 appears, but ping command does not work.




From linux at dominikbrodowski.net  Thu Apr 29 14:30:37 2010
From: linux at dominikbrodowski.net (Dominik Brodowski)
Date: Thu, 29 Apr 2010 20:30:37 +0200
Subject: [BUG? KERNEL 2.6.34-rc5-git5] pccard_validate_cis
	WARN_ON error
In-Reply-To: <5193065.358611272564000220.komurojun-mbn@nifty.com>
References: <20100429135914.GA17838@comet.dominikbrodowski.net>
	<20100429061530.GA6567@isilmar-3.linta.de>
	<15339870.357451272455479281.komurojun-mbn@nifty.com>
	<alpine.DEB.1.10.1004251329140.16036@blala.de>
	<26458756.45801272501646854.komurojun-mbn@nifty.com>
	<4879172.174021272529027185.komurojun-mbn@nifty.com>
	<5193065.358611272564000220.komurojun-mbn@nifty.com>
Message-ID: <20100429183037.GA29231@isilmar-3.linta.de>

Hey,

On Fri, Apr 30, 2010 at 03:00:00AM +0900, Komuro wrote:
> >Thanks! Does this patch help?
> >
> 
> The WARN_ON error is fixed.
> 
> But, after "pccardctl reset", the card still does not work.

Why is "pccardctl reset" needed in any case? It seems that the CIS is
different when you call "pccardctl reset" compared to what it used to be.

> case1: eth0 does not appear.
> case2: eth0 appears, but ping command does not work.

Best,
	Dominik


From komurojun-mbn at nifty.com  Fri Apr 30 16:23:18 2010
From: komurojun-mbn at nifty.com (Komuro)
Date: Sat, 1 May 2010 05:23:18 +0900 (JST)
Subject: [BUG? KERNEL 2.6.34-rc5-git5] pccard_validate_cis
	WARN_ON error
In-Reply-To: <20100429183037.GA29231@isilmar-3.linta.de>
References: <20100429183037.GA29231@isilmar-3.linta.de>
	<20100429135914.GA17838@comet.dominikbrodowski.net>
	<20100429061530.GA6567@isilmar-3.linta.de>
	<15339870.357451272455479281.komurojun-mbn@nifty.com>
	<alpine.DEB.1.10.1004251329140.16036@blala.de>
	<26458756.45801272501646854.komurojun-mbn@nifty.com>
	<4879172.174021272529027185.komurojun-mbn@nifty.com>
	<5193065.358611272564000220.komurojun-mbn@nifty.com>
Message-ID: <14651093.601272658998398.komurojun-mbn@nifty.com>

Hi,

>> But, after "pccardctl reset", the card still does not work.
>
>Why is "pccardctl reset" needed in any case? 

When the device becomes unstable, "pccardctl reset" reset the driver.


>It seems that the CIS is
>different when you call "pccardctl reset" compared to what it used to be.

The CIS is same. I don't change the card.



From linux at kbdbabel.org  Fri Apr 30 07:50:55 2010
From: linux at kbdbabel.org (Alexander Kurz)
Date: Fri, 30 Apr 2010 13:50:55 +0200
Subject: [PATCH] staging/comedi PCMCIA-drivers: adding MODULE_AUTHOR, MODULE_DESCRIPTION and MODULE_LICENSE
Message-ID: <mailman.406.1273744590.2170.linux-pcmcia@lists.infradead.org>

Signed-off-by: Alexander Kurz <linux at kbdbabel.org>
---
 drivers/staging/comedi/drivers/cb_das16_cs.c     |    3 +++
 drivers/staging/comedi/drivers/das08_cs.c        |    5 ++++-
 drivers/staging/comedi/drivers/ni_daq_700.c      |    6 +++++-
 drivers/staging/comedi/drivers/ni_daq_dio24.c    |    4 ++++
 drivers/staging/comedi/drivers/ni_labpc_cs.c     |    4 +++-
 drivers/staging/comedi/drivers/ni_mio_cs.c       |    5 +++--
 drivers/staging/comedi/drivers/quatech_daqp_cs.c |    3 +++
 7 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/comedi/drivers/cb_das16_cs.c b/drivers/staging/comedi/drivers/cb_das16_cs.c
index 5632991..13c8c43 100644
--- a/drivers/staging/comedi/drivers/cb_das16_cs.c
+++ b/drivers/staging/comedi/drivers/cb_das16_cs.c
@@ -859,6 +859,9 @@ static struct pcmcia_device_id das16cs_id_table[] = {
 };
 
 MODULE_DEVICE_TABLE(pcmcia, das16cs_id_table);
+MODULE_AUTHOR("David A. Schleef <ds at schleef.org>");
+MODULE_DESCRIPTION("Comedi driver for Computer Boards PC-CARD DAS16/16");
+MODULE_LICENSE("GPL");
 
 struct pcmcia_driver das16cs_driver = {
 	.probe = das16cs_pcmcia_attach,
diff --git a/drivers/staging/comedi/drivers/das08_cs.c b/drivers/staging/comedi/drivers/das08_cs.c
index 9164ce1..456661c 100644
--- a/drivers/staging/comedi/drivers/das08_cs.c
+++ b/drivers/staging/comedi/drivers/das08_cs.c
@@ -371,6 +371,10 @@ static struct pcmcia_device_id das08_cs_id_table[] = {
 };
 
 MODULE_DEVICE_TABLE(pcmcia, das08_cs_id_table);
+MODULE_AUTHOR("David A. Schleef <ds at schleef.org>, "
+	      "Frank Mori Hess <fmhess at users.sourceforge.net>");
+MODULE_DESCRIPTION("Comedi driver for ComputerBoards DAS-08 PCMCIA boards");
+MODULE_LICENSE("GPL");
 
 struct pcmcia_driver das08_cs_driver = {
 	.probe = das08_pcmcia_attach,
@@ -413,6 +417,5 @@ static void __exit das08_cs_exit_module(void)
 	comedi_driver_unregister(&driver_das08_cs);
 }
 
-MODULE_LICENSE("GPL");
 module_init(das08_cs_init_module);
 module_exit(das08_cs_exit_module);
diff --git a/drivers/staging/comedi/drivers/ni_daq_700.c b/drivers/staging/comedi/drivers/ni_daq_700.c
index 7ea6453..8c06f7e 100644
--- a/drivers/staging/comedi/drivers/ni_daq_700.c
+++ b/drivers/staging/comedi/drivers/ni_daq_700.c
@@ -735,8 +735,12 @@ static struct pcmcia_device_id dio700_cs_ids[] = {
 	PCMCIA_DEVICE_NULL
 };
 
-MODULE_LICENSE("GPL");
+
 MODULE_DEVICE_TABLE(pcmcia, dio700_cs_ids);
+MODULE_AUTHOR("Fred Brooks <nsaspook at nsaspook.com>");
+MODULE_DESCRIPTION("Comedi driver for National Instruments "
+		   "PCMCIA DAQCard-700 DIO");
+MODULE_LICENSE("GPL");
 
 struct pcmcia_driver dio700_cs_driver = {
 	.probe = dio700_cs_attach,
diff --git a/drivers/staging/comedi/drivers/ni_daq_dio24.c b/drivers/staging/comedi/drivers/ni_daq_dio24.c
index ddc312b..f9e49e6 100644
--- a/drivers/staging/comedi/drivers/ni_daq_dio24.c
+++ b/drivers/staging/comedi/drivers/ni_daq_dio24.c
@@ -487,6 +487,10 @@ static struct pcmcia_device_id dio24_cs_ids[] = {
 };
 
 MODULE_DEVICE_TABLE(pcmcia, dio24_cs_ids);
+MODULE_AUTHOR("Daniel Vecino Castel <dvecino at able.es>");
+MODULE_DESCRIPTION("Comedi driver for National Instruments "
+		   "PCMCIA DAQ-Card DIO-24");
+MODULE_LICENSE("GPL");
 
 struct pcmcia_driver dio24_cs_driver = {
 	.probe = dio24_cs_attach,
diff --git a/drivers/staging/comedi/drivers/ni_labpc_cs.c b/drivers/staging/comedi/drivers/ni_labpc_cs.c
index 8ad1055..d2935e5 100644
--- a/drivers/staging/comedi/drivers/ni_labpc_cs.c
+++ b/drivers/staging/comedi/drivers/ni_labpc_cs.c
@@ -463,6 +463,9 @@ static struct pcmcia_device_id labpc_cs_ids[] = {
 };
 
 MODULE_DEVICE_TABLE(pcmcia, labpc_cs_ids);
+MODULE_AUTHOR("Frank Mori Hess <fmhess at users.sourceforge.net>");
+MODULE_DESCRIPTION("Comedi driver for National Instruments Lab-PC");
+MODULE_LICENSE("GPL");
 
 struct pcmcia_driver labpc_cs_driver = {
 	.probe = labpc_cs_attach,
@@ -504,6 +507,5 @@ void __exit labpc_exit_module(void)
 	comedi_driver_unregister(&driver_labpc_cs);
 }
 
-MODULE_LICENSE("GPL");
 module_init(labpc_init_module);
 module_exit(labpc_exit_module);
diff --git a/drivers/staging/comedi/drivers/ni_mio_cs.c b/drivers/staging/comedi/drivers/ni_mio_cs.c
index dc4849a..dcb1579 100644
--- a/drivers/staging/comedi/drivers/ni_mio_cs.c
+++ b/drivers/staging/comedi/drivers/ni_mio_cs.c
@@ -439,8 +439,6 @@ static int ni_getboardtype(struct comedi_device *dev,
 
 #ifdef MODULE
 
-MODULE_LICENSE("GPL");
-
 static struct pcmcia_device_id ni_mio_cs_ids[] = {
 	PCMCIA_DEVICE_MANF_CARD(0x010b, 0x010d),	/* DAQCard-ai-16xe-50 */
 	PCMCIA_DEVICE_MANF_CARD(0x010b, 0x010c),	/* DAQCard-ai-16e-4 */
@@ -451,6 +449,9 @@ static struct pcmcia_device_id ni_mio_cs_ids[] = {
 };
 
 MODULE_DEVICE_TABLE(pcmcia, ni_mio_cs_ids);
+MODULE_AUTHOR("David A. Schleef <ds at schleef.org>");
+MODULE_DESCRIPTION("Comedi driver for National Instruments DAQCard E series");
+MODULE_LICENSE("GPL");
 
 struct pcmcia_driver ni_mio_cs_driver = {
 	.probe = &cs_attach,
diff --git a/drivers/staging/comedi/drivers/quatech_daqp_cs.c b/drivers/staging/comedi/drivers/quatech_daqp_cs.c
index 3325f24..0d7cc50 100644
--- a/drivers/staging/comedi/drivers/quatech_daqp_cs.c
+++ b/drivers/staging/comedi/drivers/quatech_daqp_cs.c
@@ -1243,6 +1243,9 @@ static struct pcmcia_device_id daqp_cs_id_table[] = {
 };
 
 MODULE_DEVICE_TABLE(pcmcia, daqp_cs_id_table);
+MODULE_AUTHOR("Brent Baccala <baccala at freesoft.org>");
+MODULE_DESCRIPTION("Comedi driver for Quatech DAQP PCMCIA data capture cards");
+MODULE_LICENSE("GPL");
 
 struct pcmcia_driver daqp_cs_driver = {
 	.probe = daqp_cs_attach,
-- 
1.7.1



