* [RFC PATCH 0/11] pcmcia: bugfixes for 2.6.19-rc3
@ 2006-10-26 2:10 Dominik Brodowski
2006-10-26 2:11 ` [RFC PATCH 1/11] pcmcia: at91_cf update Dominik Brodowski
` (10 more replies)
0 siblings, 11 replies; 12+ messages in thread
From: Dominik Brodowski @ 2006-10-26 2:10 UTC (permalink / raw)
To: linux-pcmcia; +Cc: linux-kernel, netdev, hostap, linville, jkmaline, proski
[-- Attachment #1: Type: text/plain, Size: 1871 bytes --]
Hi,
The following eleven patches have all been queued in -mm for quite some
time; the only change is that one suggestion by Pavel Roskin (to remove the
"RevA" part of the new ID for hostap_cs.c) is implemented. Please let me
know if there are any objections to any of these patches; if not, I'll
submit them to Linus really soon now.
Thanks,
Dominik
drivers/net/wireless/hostap/hostap_cs.c | 7 +++++++
drivers/pcmcia/at91_cf.c | 28 +++++++++-------------------
drivers/pcmcia/au1000_generic.c | 25 +++++++++++++++++++------
drivers/pcmcia/ds.c | 29 ++++++++++++++++++++++++-----
drivers/pcmcia/i82092.c | 9 +++++----
drivers/pcmcia/m8xx_pcmcia.c | 12 ++++++++----
drivers/pcmcia/omap_cf.c | 3 ++-
drivers/pcmcia/pcmcia_ioctl.c | 11 ++++++++---
drivers/pcmcia/pcmcia_resource.c | 2 +-
drivers/pcmcia/pd6729.c | 4 ++++
drivers/pcmcia/soc_common.c | 1 +
drivers/pcmcia/yenta_socket.c | 22 +++++++++++++++++-----
12 files changed, 105 insertions(+), 48 deletions(-)
----
Alexey Dobriyan (2):
CONFIG_PM=n slim: drivers/pcmcia/*
i82092: wire up errors from pci_register_driver()
Amol Lad (1):
ioremap balanced with iounmap for drivers/pcmcia
David Brownell (1):
pcmcia: at91_cf update
Dominik Brodowski (2):
pcmcia: add more IDs to hostap_cs.c
PCMCIA: fix __must_check warnings
Jeff Garzik (1):
PCMCIA: handle sysfs, PCI errors
Jonathan McDowell (1):
Export soc_common_drv_pcmcia_remove to allow modular PCMCIA.
Kaustav Majumdar (1):
pcmcia: update alloc_io_space for conflict checking for multifunction PC card
Om Narasimhan (1):
pcmcia: au1000_generic fix
Randy Dunlap (1):
pcmcia/ds: driver layer error checking
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* [RFC PATCH 1/11] pcmcia: at91_cf update
2006-10-26 2:10 [RFC PATCH 0/11] pcmcia: bugfixes for 2.6.19-rc3 Dominik Brodowski
@ 2006-10-26 2:11 ` Dominik Brodowski
2006-10-26 2:12 ` [RFC PATCH 2/11] pcmcia: add more IDs to hostap_cs.c Dominik Brodowski
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Dominik Brodowski @ 2006-10-26 2:11 UTC (permalink / raw)
To: linux-pcmcia; +Cc: linux-kernel, dbrownell, andrew
From: David Brownell <david-b@pacbell.net>
Date: Sat, 1 Jul 2006 13:39:55 -0700
Subject: [PATCH] pcmcia: at91_cf update
More correct AT91 CF wakeup logic ... only enable/disable the IRQ wakeup
capability, not the IRQ itself. That way the we know that the IRQ will be
disabled correctly, in suspend/resume logic instead of ARM IRQ code.
Most of the pin multiplexing setup has moved to the devices.c setup code.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Victor <andrew@sanpeople.com>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
---
drivers/pcmcia/at91_cf.c | 25 +++++++------------------
1 files changed, 7 insertions(+), 18 deletions(-)
diff --git a/drivers/pcmcia/at91_cf.c b/drivers/pcmcia/at91_cf.c
index 7f5df9a..f8db6e3 100644
--- a/drivers/pcmcia/at91_cf.c
+++ b/drivers/pcmcia/at91_cf.c
@@ -241,12 +241,6 @@ static int __init at91_cf_probe(struct p
csa = at91_sys_read(AT91_EBI_CSA);
at91_sys_write(AT91_EBI_CSA, csa | AT91_EBI_CS4A_SMC_COMPACTFLASH);
- /* force poweron defaults for these pins ... */
- (void) at91_set_A_periph(AT91_PIN_PC9, 0); /* A25/CFRNW */
- (void) at91_set_A_periph(AT91_PIN_PC10, 0); /* NCS4/CFCS */
- (void) at91_set_A_periph(AT91_PIN_PC11, 0); /* NCS5/CFCE1 */
- (void) at91_set_A_periph(AT91_PIN_PC12, 0); /* NCS6/CFCE2 */
-
/* nWAIT is _not_ a default setting */
(void) at91_set_A_periph(AT91_PIN_PC6, 1); /* nWAIT */
@@ -322,6 +316,7 @@ fail1:
if (board->irq_pin)
free_irq(board->irq_pin, cf);
fail0a:
+ device_init_wakeup(&pdev->dev, 0);
free_irq(board->det_pin, cf);
device_init_wakeup(&pdev->dev, 0);
fail0:
@@ -360,26 +355,20 @@ static int at91_cf_suspend(struct platfo
struct at91_cf_data *board = cf->board;
pcmcia_socket_dev_suspend(&pdev->dev, mesg);
- if (device_may_wakeup(&pdev->dev))
+ if (device_may_wakeup(&pdev->dev)) {
enable_irq_wake(board->det_pin);
- else {
+ if (board->irq_pin)
+ enable_irq_wake(board->irq_pin);
+ } else {
disable_irq_wake(board->det_pin);
- disable_irq(board->det_pin);
+ if (board->irq_pin)
+ disable_irq_wake(board->irq_pin);
}
- if (board->irq_pin)
- disable_irq(board->irq_pin);
return 0;
}
static int at91_cf_resume(struct platform_device *pdev)
{
- struct at91_cf_socket *cf = platform_get_drvdata(pdev);
- struct at91_cf_data *board = cf->board;
-
- if (board->irq_pin)
- enable_irq(board->irq_pin);
- if (!device_may_wakeup(&pdev->dev))
- enable_irq(board->det_pin);
pcmcia_socket_dev_resume(&pdev->dev);
return 0;
}
--
1.4.3
^ permalink raw reply [flat|nested] 12+ messages in thread
* [RFC PATCH 2/11] pcmcia: add more IDs to hostap_cs.c
2006-10-26 2:10 [RFC PATCH 0/11] pcmcia: bugfixes for 2.6.19-rc3 Dominik Brodowski
2006-10-26 2:11 ` [RFC PATCH 1/11] pcmcia: at91_cf update Dominik Brodowski
@ 2006-10-26 2:12 ` Dominik Brodowski
2006-10-26 2:13 ` [RFC PATCH 3/11] pcmcia: update alloc_io_space for conflict checking for multifunction PC card Dominik Brodowski
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Dominik Brodowski @ 2006-10-26 2:12 UTC (permalink / raw)
To: linux-pcmcia; +Cc: linux-kernel, netdev, hostap, linville, jkmaline, proski
From: Dominik Brodowski <linux@dominikbrodowski.net>
Date: Sun, 2 Jul 2006 21:21:51 +0200
Subject: [PATCH] pcmcia: add more IDs to hostap_cs.c
As a replacement for the broad manufactor/card ID match we commented out
because of conflicts with pcnet_cs, add two product ID matches.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
---
drivers/net/wireless/hostap/hostap_cs.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c
index 686d895..f63909e 100644
--- a/drivers/net/wireless/hostap/hostap_cs.c
+++ b/drivers/net/wireless/hostap/hostap_cs.c
@@ -887,6 +887,13 @@ static struct pcmcia_device_id hostap_cs
PCMCIA_DEVICE_PROD_ID123(
"U.S. Robotics", "IEEE 802.11b PC-CARD", "Version 01.02",
0xc7b8df9d, 0x1700d087, 0x4b74baa0),
+ PCMCIA_DEVICE_PROD_ID123(
+ "Allied Telesyn", "AT-WCL452 Wireless PCMCIA Radio",
+ "Ver. 1.00",
+ 0x5cd01705, 0x4271660f, 0x9d08ee12),
+ PCMCIA_DEVICE_PROD_ID123(
+ "corega", "WL PCCL-11", "ISL37300P",
+ 0xa21501a, 0x59868926, 0xc9049a39),
PCMCIA_DEVICE_NULL
};
MODULE_DEVICE_TABLE(pcmcia, hostap_cs_ids);
--
1.4.3
^ permalink raw reply [flat|nested] 12+ messages in thread
* [RFC PATCH 3/11] pcmcia: update alloc_io_space for conflict checking for multifunction PC card
2006-10-26 2:10 [RFC PATCH 0/11] pcmcia: bugfixes for 2.6.19-rc3 Dominik Brodowski
2006-10-26 2:11 ` [RFC PATCH 1/11] pcmcia: at91_cf update Dominik Brodowski
2006-10-26 2:12 ` [RFC PATCH 2/11] pcmcia: add more IDs to hostap_cs.c Dominik Brodowski
@ 2006-10-26 2:13 ` Dominik Brodowski
2006-10-26 2:13 ` [RFC PATCH 4/11] pcmcia/ds: driver layer error checking Dominik Brodowski
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Dominik Brodowski @ 2006-10-26 2:13 UTC (permalink / raw)
To: linux-pcmcia; +Cc: linux-kernel, kaustav.majumdar
From: Kaustav Majumdar <kaustav.majumdar@wipro.com>
Date: Fri, 20 Oct 2006 14:44:09 -0700
Subject: [PATCH] pcmcia: update alloc_io_space for conflict checking for multifunction PC card
Some PCMCIA cards do not mention specific IO addresses in the CIS. In that
case, inside the alloc_io_space function, conflicts are detected (the
function returns 1) for the second function of a multifunction card unless
the length of IO address range required is greater than 0x100.
The following patch will remove this conflict checking for a PCMCIA
function which had not mentioned any specific IO address to be mapped from.
The patch is tested for Linux kernel 2.6.15.4 and works fine in the above
case and is as suggested by Dave Hinds.
Signed-off-by: Kaustav Majumdar <kaustav.majumdar@wipro.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
---
drivers/pcmcia/pcmcia_resource.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index 74cebd4..b9201c2 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -95,7 +95,7 @@ static int alloc_io_space(struct pcmcia_
* potential conflicts, just the most obvious ones.
*/
for (i = 0; i < MAX_IO_WIN; i++)
- if ((s->io[i].res) &&
+ if ((s->io[i].res) && *base &&
((s->io[i].res->start & (align-1)) == *base))
return 1;
for (i = 0; i < MAX_IO_WIN; i++) {
--
1.4.3
^ permalink raw reply [flat|nested] 12+ messages in thread
* [RFC PATCH 4/11] pcmcia/ds: driver layer error checking
2006-10-26 2:10 [RFC PATCH 0/11] pcmcia: bugfixes for 2.6.19-rc3 Dominik Brodowski
` (2 preceding siblings ...)
2006-10-26 2:13 ` [RFC PATCH 3/11] pcmcia: update alloc_io_space for conflict checking for multifunction PC card Dominik Brodowski
@ 2006-10-26 2:13 ` Dominik Brodowski
2006-10-26 2:14 ` [RFC PATCH 5/11] CONFIG_PM=n slim: drivers/pcmcia/* Dominik Brodowski
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Dominik Brodowski @ 2006-10-26 2:13 UTC (permalink / raw)
To: linux-pcmcia; +Cc: linux-kernel, rdunlap
From: Randy Dunlap <rdunlap@xenotime.net>
Date: Fri, 20 Oct 2006 14:44:12 -0700
Subject: [PATCH] pcmcia/ds: driver layer error checking
Check driver layer return values in pcmcia/ds.c
Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
---
drivers/pcmcia/ds.c | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 74b3124..af392bf 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -1292,10 +1292,22 @@ struct bus_type pcmcia_bus_type = {
static int __init init_pcmcia_bus(void)
{
+ int ret;
+
spin_lock_init(&pcmcia_dev_list_lock);
- bus_register(&pcmcia_bus_type);
- class_interface_register(&pcmcia_bus_interface);
+ ret = bus_register(&pcmcia_bus_type);
+ if (ret < 0) {
+ printk(KERN_WARNING "pcmcia: bus_register error: %d\n", ret);
+ return ret;
+ }
+ ret = class_interface_register(&pcmcia_bus_interface);
+ if (ret < 0) {
+ printk(KERN_WARNING
+ "pcmcia: class_interface_register error: %d\n", ret);
+ bus_unregister(&pcmcia_bus_type);
+ return ret;
+ }
pcmcia_setup_ioctl();
--
1.4.3
^ permalink raw reply [flat|nested] 12+ messages in thread
* [RFC PATCH 5/11] CONFIG_PM=n slim: drivers/pcmcia/*
2006-10-26 2:10 [RFC PATCH 0/11] pcmcia: bugfixes for 2.6.19-rc3 Dominik Brodowski
` (3 preceding siblings ...)
2006-10-26 2:13 ` [RFC PATCH 4/11] pcmcia/ds: driver layer error checking Dominik Brodowski
@ 2006-10-26 2:14 ` Dominik Brodowski
2006-10-26 2:14 ` [RFC PATCH 6/11] i82092: wire up errors from pci_register_driver() Dominik Brodowski
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Dominik Brodowski @ 2006-10-26 2:14 UTC (permalink / raw)
To: linux-pcmcia; +Cc: linux-kernel, adobriyan
From: Alexey Dobriyan <adobriyan@gmail.com>
Date: Fri, 20 Oct 2006 14:44:13 -0700
Subject: [PATCH] CONFIG_PM=n slim: drivers/pcmcia/*
Remove some code which is unneeded if CONFIG_PM=n.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
---
drivers/pcmcia/i82092.c | 4 ++++
drivers/pcmcia/pd6729.c | 4 ++++
drivers/pcmcia/yenta_socket.c | 6 ++++--
3 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/pcmcia/i82092.c b/drivers/pcmcia/i82092.c
index 82715f4..d316d95 100644
--- a/drivers/pcmcia/i82092.c
+++ b/drivers/pcmcia/i82092.c
@@ -41,6 +41,7 @@ static struct pci_device_id i82092aa_pci
};
MODULE_DEVICE_TABLE(pci, i82092aa_pci_ids);
+#ifdef CONFIG_PM
static int i82092aa_socket_suspend (struct pci_dev *dev, pm_message_t state)
{
return pcmcia_socket_dev_suspend(&dev->dev, state);
@@ -50,14 +51,17 @@ static int i82092aa_socket_resume (struc
{
return pcmcia_socket_dev_resume(&dev->dev);
}
+#endif
static struct pci_driver i82092aa_pci_drv = {
.name = "i82092aa",
.id_table = i82092aa_pci_ids,
.probe = i82092aa_pci_probe,
.remove = __devexit_p(i82092aa_pci_remove),
+#ifdef CONFIG_PM
.suspend = i82092aa_socket_suspend,
.resume = i82092aa_socket_resume,
+#endif
};
diff --git a/drivers/pcmcia/pd6729.c b/drivers/pcmcia/pd6729.c
index c83a0a6..a70f97f 100644
--- a/drivers/pcmcia/pd6729.c
+++ b/drivers/pcmcia/pd6729.c
@@ -755,6 +755,7 @@ static void __devexit pd6729_pci_remove(
kfree(socket);
}
+#ifdef CONFIG_PM
static int pd6729_socket_suspend(struct pci_dev *dev, pm_message_t state)
{
return pcmcia_socket_dev_suspend(&dev->dev, state);
@@ -764,6 +765,7 @@ static int pd6729_socket_resume(struct p
{
return pcmcia_socket_dev_resume(&dev->dev);
}
+#endif
static struct pci_device_id pd6729_pci_ids[] = {
{
@@ -781,8 +783,10 @@ static struct pci_driver pd6729_pci_drv
.id_table = pd6729_pci_ids,
.probe = pd6729_pci_probe,
.remove = __devexit_p(pd6729_pci_remove),
+#ifdef CONFIG_PM
.suspend = pd6729_socket_suspend,
.resume = pd6729_socket_resume,
+#endif
};
static int pd6729_module_init(void)
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
index 26229d9..9ced52a 100644
--- a/drivers/pcmcia/yenta_socket.c
+++ b/drivers/pcmcia/yenta_socket.c
@@ -1213,7 +1213,7 @@ static int __devinit yenta_probe (struct
return ret;
}
-
+#ifdef CONFIG_PM
static int yenta_dev_suspend (struct pci_dev *dev, pm_message_t state)
{
struct yenta_socket *socket = pci_get_drvdata(dev);
@@ -1262,7 +1262,7 @@ static int yenta_dev_resume (struct pci_
return pcmcia_socket_dev_resume(&dev->dev);
}
-
+#endif
#define CB_ID(vend,dev,type) \
{ \
@@ -1359,8 +1359,10 @@ static struct pci_driver yenta_cardbus_d
.id_table = yenta_table,
.probe = yenta_probe,
.remove = __devexit_p(yenta_close),
+#ifdef CONFIG_PM
.suspend = yenta_dev_suspend,
.resume = yenta_dev_resume,
+#endif
};
--
1.4.3
^ permalink raw reply [flat|nested] 12+ messages in thread
* [RFC PATCH 6/11] i82092: wire up errors from pci_register_driver()
2006-10-26 2:10 [RFC PATCH 0/11] pcmcia: bugfixes for 2.6.19-rc3 Dominik Brodowski
` (4 preceding siblings ...)
2006-10-26 2:14 ` [RFC PATCH 5/11] CONFIG_PM=n slim: drivers/pcmcia/* Dominik Brodowski
@ 2006-10-26 2:14 ` Dominik Brodowski
2006-10-26 2:15 ` [RFC PATCH 7/11] pcmcia: au1000_generic fix Dominik Brodowski
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Dominik Brodowski @ 2006-10-26 2:14 UTC (permalink / raw)
To: linux-pcmcia; +Cc: linux-kernel, adobriyan
From: Alexey Dobriyan <adobriyan@gmail.com>
Date: Fri, 20 Oct 2006 14:44:13 -0700
Subject: [PATCH] i82092: wire up errors from pci_register_driver()
debugging goo removed to not leave assymetry in it after possible "leave"
removal.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
---
drivers/pcmcia/i82092.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/drivers/pcmcia/i82092.c b/drivers/pcmcia/i82092.c
index d316d95..c2ea07a 100644
--- a/drivers/pcmcia/i82092.c
+++ b/drivers/pcmcia/i82092.c
@@ -709,10 +709,7 @@ static int i82092aa_set_mem_map(struct p
static int i82092aa_module_init(void)
{
- enter("i82092aa_module_init");
- pci_register_driver(&i82092aa_pci_drv);
- leave("i82092aa_module_init");
- return 0;
+ return pci_register_driver(&i82092aa_pci_drv);
}
static void i82092aa_module_exit(void)
--
1.4.3
^ permalink raw reply [flat|nested] 12+ messages in thread
* [RFC PATCH 7/11] pcmcia: au1000_generic fix
2006-10-26 2:10 [RFC PATCH 0/11] pcmcia: bugfixes for 2.6.19-rc3 Dominik Brodowski
` (5 preceding siblings ...)
2006-10-26 2:14 ` [RFC PATCH 6/11] i82092: wire up errors from pci_register_driver() Dominik Brodowski
@ 2006-10-26 2:15 ` Dominik Brodowski
2006-10-26 2:16 ` [RFC PATCH 8/11] ioremap balanced with iounmap for drivers/pcmcia Dominik Brodowski
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Dominik Brodowski @ 2006-10-26 2:15 UTC (permalink / raw)
To: linux-pcmcia; +Cc: linux-kernel, om.turyx, yoichi_yuasa
From: Om Narasimhan <om.turyx@gmail.com>
Date: Fri, 20 Oct 2006 14:44:15 -0700
Subject: [PATCH] pcmcia: au1000_generic fix
The previous code did something like,
if (error) goto out_err;
....
do {
struct au1000_pcmcia_socket *skt = PCMCIA_SOCKET(i);
del_timer_sync(&skt->poll_timer);
pcmcia_unregister_socket(&skt->socket);
out_err:
flush_scheduled_work();
ops->hw_shutdown(skt);
i--;
} while (i > 0)
.....
- On the error path, skt would not contain a valid value for the first
iteration (skt is masked by uninitialized automatic skt)
- Does not do hw_shutdown() for 0th element of PCMCIA_SOCKET
Signed-off-by: Om Narasimhan <om.turyx@gmail.com>
Cc: "Yoichi Yuasa" <yoichi_yuasa@tripeaks.co.jp>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
---
drivers/pcmcia/au1000_generic.c | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/drivers/pcmcia/au1000_generic.c b/drivers/pcmcia/au1000_generic.c
index d5dd0ce..5387de6 100644
--- a/drivers/pcmcia/au1000_generic.c
+++ b/drivers/pcmcia/au1000_generic.c
@@ -351,6 +351,7 @@ struct skt_dev_info {
int au1x00_pcmcia_socket_probe(struct device *dev, struct pcmcia_low_level *ops, int first, int nr)
{
struct skt_dev_info *sinfo;
+ struct au1000_pcmcia_socket *skt;
int ret, i;
sinfo = kzalloc(sizeof(struct skt_dev_info), GFP_KERNEL);
@@ -365,7 +366,7 @@ int au1x00_pcmcia_socket_probe(struct de
* Initialise the per-socket structure.
*/
for (i = 0; i < nr; i++) {
- struct au1000_pcmcia_socket *skt = PCMCIA_SOCKET(i);
+ skt = PCMCIA_SOCKET(i);
memset(skt, 0, sizeof(*skt));
skt->socket.resource_ops = &pccard_static_ops;
@@ -438,17 +439,19 @@ #endif
dev_set_drvdata(dev, sinfo);
return 0;
- do {
- struct au1000_pcmcia_socket *skt = PCMCIA_SOCKET(i);
+
+out_err:
+ flush_scheduled_work();
+ ops->hw_shutdown(skt);
+ while (i-- > 0) {
+ skt = PCMCIA_SOCKET(i);
del_timer_sync(&skt->poll_timer);
pcmcia_unregister_socket(&skt->socket);
-out_err:
flush_scheduled_work();
ops->hw_shutdown(skt);
- i--;
- } while (i > 0);
+ }
kfree(sinfo);
out:
return ret;
--
1.4.3
^ permalink raw reply [flat|nested] 12+ messages in thread
* [RFC PATCH 8/11] ioremap balanced with iounmap for drivers/pcmcia
2006-10-26 2:10 [RFC PATCH 0/11] pcmcia: bugfixes for 2.6.19-rc3 Dominik Brodowski
` (6 preceding siblings ...)
2006-10-26 2:15 ` [RFC PATCH 7/11] pcmcia: au1000_generic fix Dominik Brodowski
@ 2006-10-26 2:16 ` Dominik Brodowski
2006-10-26 2:17 ` [RFC PATCH 9/11] Export soc_common_drv_pcmcia_remove to allow modular PCMCIA Dominik Brodowski
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Dominik Brodowski @ 2006-10-26 2:16 UTC (permalink / raw)
To: linux-pcmcia; +Cc: linux-kernel, amol
From: Amol Lad <amol@verismonetworks.com>
Date: Fri, 20 Oct 2006 14:44:18 -0700
Subject: [PATCH] ioremap balanced with iounmap for drivers/pcmcia
ioremap must be balanced by an iounmap and failing to do so can result
in a memory leak.
Signed-off-by: Amol Lad <amol@verismonetworks.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
---
drivers/pcmcia/at91_cf.c | 3 ++-
drivers/pcmcia/au1000_generic.c | 10 ++++++++++
drivers/pcmcia/m8xx_pcmcia.c | 12 ++++++++----
drivers/pcmcia/omap_cf.c | 3 ++-
4 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/drivers/pcmcia/at91_cf.c b/drivers/pcmcia/at91_cf.c
index f8db6e3..3bcb7dc 100644
--- a/drivers/pcmcia/at91_cf.c
+++ b/drivers/pcmcia/at91_cf.c
@@ -310,9 +310,10 @@ static int __init at91_cf_probe(struct p
return 0;
fail2:
- iounmap((void __iomem *) cf->socket.io_offset);
release_mem_region(io->start, io->end + 1 - io->start);
fail1:
+ if (cf->socket.io_offset)
+ iounmap((void __iomem *) cf->socket.io_offset);
if (board->irq_pin)
free_irq(board->irq_pin, cf);
fail0a:
diff --git a/drivers/pcmcia/au1000_generic.c b/drivers/pcmcia/au1000_generic.c
index 5387de6..551bde5 100644
--- a/drivers/pcmcia/au1000_generic.c
+++ b/drivers/pcmcia/au1000_generic.c
@@ -449,6 +449,16 @@ out_err:
del_timer_sync(&skt->poll_timer);
pcmcia_unregister_socket(&skt->socket);
flush_scheduled_work();
+ if (i == 0) {
+ iounmap(skt->virt_io + (u32)mips_io_port_base);
+ skt->virt_io = NULL;
+ }
+#ifndef CONFIG_MIPS_XXS1500
+ else {
+ iounmap(skt->virt_io + (u32)mips_io_port_base);
+ skt->virt_io = NULL;
+ }
+#endif
ops->hw_shutdown(skt);
}
diff --git a/drivers/pcmcia/m8xx_pcmcia.c b/drivers/pcmcia/m8xx_pcmcia.c
index e070a28..3b72be8 100644
--- a/drivers/pcmcia/m8xx_pcmcia.c
+++ b/drivers/pcmcia/m8xx_pcmcia.c
@@ -427,7 +427,7 @@ static int voltage_set(int slot, int vcc
reg |= BCSR1_PCCVCC1;
break;
default:
- return 1;
+ goto out_unmap;
}
switch(vpp) {
@@ -438,15 +438,15 @@ static int voltage_set(int slot, int vcc
if(vcc == vpp)
reg |= BCSR1_PCCVPP1;
else
- return 1;
+ goto out_unmap;
break;
case 120:
if ((vcc == 33) || (vcc == 50))
reg |= BCSR1_PCCVPP0;
else
- return 1;
+ goto out_unmap;
default:
- return 1;
+ goto out_unmap;
}
/* first, turn off all power */
@@ -457,6 +457,10 @@ static int voltage_set(int slot, int vcc
iounmap(bcsr_io);
return 0;
+
+out_unmap:
+ iounmap(bcsr_io);
+ return 1;
}
#define socket_get(_slot_) PCMCIA_SOCKET_KEY_5V
diff --git a/drivers/pcmcia/omap_cf.c b/drivers/pcmcia/omap_cf.c
index c8e838c..06bf7f4 100644
--- a/drivers/pcmcia/omap_cf.c
+++ b/drivers/pcmcia/omap_cf.c
@@ -309,9 +309,10 @@ static int __devinit omap_cf_probe(struc
return 0;
fail2:
- iounmap((void __iomem *) cf->socket.io_offset);
release_mem_region(cf->phys_cf, SZ_8K);
fail1:
+ if (cf->socket.io_offset)
+ iounmap((void __iomem *) cf->socket.io_offset);
free_irq(irq, cf);
fail0:
kfree(cf);
--
1.4.3
^ permalink raw reply [flat|nested] 12+ messages in thread
* [RFC PATCH 9/11] Export soc_common_drv_pcmcia_remove to allow modular PCMCIA
2006-10-26 2:10 [RFC PATCH 0/11] pcmcia: bugfixes for 2.6.19-rc3 Dominik Brodowski
` (7 preceding siblings ...)
2006-10-26 2:16 ` [RFC PATCH 8/11] ioremap balanced with iounmap for drivers/pcmcia Dominik Brodowski
@ 2006-10-26 2:17 ` Dominik Brodowski
2006-10-26 2:17 ` [RFC PATCH 10/11] PCMCIA: handle sysfs, PCI errors Dominik Brodowski
2006-10-26 2:18 ` [RFC PATCH 11/11] PCMCIA: fix __must_check warnings Dominik Brodowski
10 siblings, 0 replies; 12+ messages in thread
From: Dominik Brodowski @ 2006-10-26 2:17 UTC (permalink / raw)
To: linux-pcmcia; +Cc: linux-kernel, noodles
From: Jonathan McDowell <noodles@earth.li>
Date: Fri, 20 Oct 2006 14:44:19 -0700
Subject: [PATCH] Export soc_common_drv_pcmcia_remove to allow modular PCMCIA.
Allow a modular sa1100_cs.
Signed-off-by: Jonathan McDowell <noodles@earth.li>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
---
drivers/pcmcia/soc_common.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c
index 3627e52..e433704 100644
--- a/drivers/pcmcia/soc_common.c
+++ b/drivers/pcmcia/soc_common.c
@@ -824,3 +824,4 @@ int soc_common_drv_pcmcia_remove(struct
return 0;
}
+EXPORT_SYMBOL(soc_common_drv_pcmcia_remove);
--
1.4.3
^ permalink raw reply [flat|nested] 12+ messages in thread
* [RFC PATCH 10/11] PCMCIA: handle sysfs, PCI errors
2006-10-26 2:10 [RFC PATCH 0/11] pcmcia: bugfixes for 2.6.19-rc3 Dominik Brodowski
` (8 preceding siblings ...)
2006-10-26 2:17 ` [RFC PATCH 9/11] Export soc_common_drv_pcmcia_remove to allow modular PCMCIA Dominik Brodowski
@ 2006-10-26 2:17 ` Dominik Brodowski
2006-10-26 2:18 ` [RFC PATCH 11/11] PCMCIA: fix __must_check warnings Dominik Brodowski
10 siblings, 0 replies; 12+ messages in thread
From: Dominik Brodowski @ 2006-10-26 2:17 UTC (permalink / raw)
To: linux-pcmcia; +Cc: linux-kernel, jeff
From: Jeff Garzik <jeff@garzik.org>
Date: Fri, 20 Oct 2006 14:44:23 -0700
Subject: [PATCH] PCMCIA: handle sysfs, PCI errors
Handle sysfs and PCI errors correctly.
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
---
drivers/pcmcia/pcmcia_ioctl.c | 11 ++++++++---
drivers/pcmcia/yenta_socket.c | 16 +++++++++++++---
2 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/drivers/pcmcia/pcmcia_ioctl.c b/drivers/pcmcia/pcmcia_ioctl.c
index 9ad18e6..310ede5 100644
--- a/drivers/pcmcia/pcmcia_ioctl.c
+++ b/drivers/pcmcia/pcmcia_ioctl.c
@@ -128,9 +128,12 @@ static int proc_read_drivers(char *buf,
int count, int *eof, void *data)
{
char *p = buf;
+ int rc;
- bus_for_each_drv(&pcmcia_bus_type, NULL,
- (void *) &p, proc_read_drivers_callback);
+ rc = bus_for_each_drv(&pcmcia_bus_type, NULL,
+ (void *) &p, proc_read_drivers_callback);
+ if (rc < 0)
+ return rc;
return (p - buf);
}
@@ -269,8 +272,10 @@ rescan:
* Prevent this racing with a card insertion.
*/
mutex_lock(&s->skt_mutex);
- bus_rescan_devices(&pcmcia_bus_type);
+ ret = bus_rescan_devices(&pcmcia_bus_type);
mutex_unlock(&s->skt_mutex);
+ if (ret)
+ goto err_put_module;
/* check whether the driver indeed matched. I don't care if this
* is racy or not, because it can only happen on cardmgr access
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
index 9ced52a..da471bd 100644
--- a/drivers/pcmcia/yenta_socket.c
+++ b/drivers/pcmcia/yenta_socket.c
@@ -1197,8 +1197,12 @@ static int __devinit yenta_probe (struct
ret = pcmcia_register_socket(&socket->socket);
if (ret == 0) {
/* Add the yenta register attributes */
- device_create_file(&dev->dev, &dev_attr_yenta_registers);
- goto out;
+ ret = device_create_file(&dev->dev, &dev_attr_yenta_registers);
+ if (ret == 0)
+ goto out;
+
+ /* error path... */
+ pcmcia_unregister_socket(&socket->socket);
}
unmap:
@@ -1248,12 +1252,18 @@ static int yenta_dev_resume (struct pci_
struct yenta_socket *socket = pci_get_drvdata(dev);
if (socket) {
+ int rc;
+
pci_set_power_state(dev, 0);
/* FIXME: pci_restore_state needs to have a better interface */
pci_restore_state(dev);
pci_write_config_dword(dev, 16*4, socket->saved_state[0]);
pci_write_config_dword(dev, 17*4, socket->saved_state[1]);
- pci_enable_device(dev);
+
+ rc = pci_enable_device(dev);
+ if (rc)
+ return rc;
+
pci_set_master(dev);
if (socket->type && socket->type->restore_state)
--
1.4.3
^ permalink raw reply [flat|nested] 12+ messages in thread
* [RFC PATCH 11/11] PCMCIA: fix __must_check warnings
2006-10-26 2:10 [RFC PATCH 0/11] pcmcia: bugfixes for 2.6.19-rc3 Dominik Brodowski
` (9 preceding siblings ...)
2006-10-26 2:17 ` [RFC PATCH 10/11] PCMCIA: handle sysfs, PCI errors Dominik Brodowski
@ 2006-10-26 2:18 ` Dominik Brodowski
10 siblings, 0 replies; 12+ messages in thread
From: Dominik Brodowski @ 2006-10-26 2:18 UTC (permalink / raw)
To: linux-pcmcia; +Cc: linux-kernel
From: Dominik Brodowski <linux@dominikbrodowski.net>
Date: Wed, 25 Oct 2006 19:56:55 -0400
Subject: [PATCH] PCMCIA: fix __must_check warnings
Fix the remaining __must_check warnings in the PCMCIA core.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
---
drivers/pcmcia/ds.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index af392bf..0f70192 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -717,6 +717,7 @@ static int pcmcia_requery(struct device
static void pcmcia_bus_rescan(struct pcmcia_socket *skt)
{
int no_devices=0;
+ int ret = 0;
unsigned long flags;
/* must be called with skt_mutex held */
@@ -729,7 +730,7 @@ static void pcmcia_bus_rescan(struct pcm
* missing resource information or other trouble, we need to
* do this now. */
if (no_devices) {
- int ret = pcmcia_card_add(skt);
+ ret = pcmcia_card_add(skt);
if (ret)
return;
}
@@ -741,7 +742,9 @@ static void pcmcia_bus_rescan(struct pcm
/* we re-scan all devices, not just the ones connected to this
* socket. This does not matter, though. */
- bus_rescan_devices(&pcmcia_bus_type);
+ ret = bus_rescan_devices(&pcmcia_bus_type);
+ if (ret)
+ printk(KERN_INFO "pcmcia: bus_rescan_devices failed\n");
}
static inline int pcmcia_devmatch(struct pcmcia_device *dev,
@@ -1001,6 +1004,7 @@ static ssize_t pcmcia_store_allow_func_i
struct device_attribute *attr, const char *buf, size_t count)
{
struct pcmcia_device *p_dev = to_pcmcia_dev(dev);
+ int ret;
if (!count)
return -EINVAL;
@@ -1009,7 +1013,10 @@ static ssize_t pcmcia_store_allow_func_i
p_dev->allow_func_id_match = 1;
mutex_unlock(&p_dev->socket->skt_mutex);
- bus_rescan_devices(&pcmcia_bus_type);
+ ret = bus_rescan_devices(&pcmcia_bus_type);
+ if (ret)
+ printk(KERN_INFO "pcmcia: bus_rescan_devices failed after "
+ "allowing func_id matches\n");
return count;
}
--
1.4.3
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2006-10-26 2:22 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-26 2:10 [RFC PATCH 0/11] pcmcia: bugfixes for 2.6.19-rc3 Dominik Brodowski
2006-10-26 2:11 ` [RFC PATCH 1/11] pcmcia: at91_cf update Dominik Brodowski
2006-10-26 2:12 ` [RFC PATCH 2/11] pcmcia: add more IDs to hostap_cs.c Dominik Brodowski
2006-10-26 2:13 ` [RFC PATCH 3/11] pcmcia: update alloc_io_space for conflict checking for multifunction PC card Dominik Brodowski
2006-10-26 2:13 ` [RFC PATCH 4/11] pcmcia/ds: driver layer error checking Dominik Brodowski
2006-10-26 2:14 ` [RFC PATCH 5/11] CONFIG_PM=n slim: drivers/pcmcia/* Dominik Brodowski
2006-10-26 2:14 ` [RFC PATCH 6/11] i82092: wire up errors from pci_register_driver() Dominik Brodowski
2006-10-26 2:15 ` [RFC PATCH 7/11] pcmcia: au1000_generic fix Dominik Brodowski
2006-10-26 2:16 ` [RFC PATCH 8/11] ioremap balanced with iounmap for drivers/pcmcia Dominik Brodowski
2006-10-26 2:17 ` [RFC PATCH 9/11] Export soc_common_drv_pcmcia_remove to allow modular PCMCIA Dominik Brodowski
2006-10-26 2:17 ` [RFC PATCH 10/11] PCMCIA: handle sysfs, PCI errors Dominik Brodowski
2006-10-26 2:18 ` [RFC PATCH 11/11] PCMCIA: fix __must_check warnings Dominik Brodowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®