aboutsummaryrefslogtreecommitdiffstats
path: root/include/pcmcia
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2010-04-20 08:49:01 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2010-04-21 02:09:17 -0400
commit04de0816173c86948b75da93a6344a0a02bbec4d (patch)
treeed4b274c1ce5da03a9c37f5858a331529e5b150f /include/pcmcia
parent05ce7bfe547c9fa967d9cab6c37867a9cb6fb3fa (diff)
pcmcia: pcmcia_dev_present bugfix
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@dominikbrodowski.net>
Diffstat (limited to 'include/pcmcia')
-rw-r--r--include/pcmcia/ds.h7
-rw-r--r--include/pcmcia/ss.h8
2 files changed, 6 insertions, 9 deletions
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
index d57847f2f6c1..aab3c13dc310 100644
--- a/include/pcmcia/ds.h
+++ b/include/pcmcia/ds.h
@@ -26,6 +26,7 @@
26#ifdef __KERNEL__ 26#ifdef __KERNEL__
27#include <linux/device.h> 27#include <linux/device.h>
28#include <pcmcia/ss.h> 28#include <pcmcia/ss.h>
29#include <asm/atomic.h>
29 30
30/* 31/*
31 * PCMCIA device drivers (16-bit cards only; 32-bit cards require CardBus 32 * PCMCIA device drivers (16-bit cards only; 32-bit cards require CardBus
@@ -94,10 +95,8 @@ struct pcmcia_device {
94 config_req_t conf; 95 config_req_t conf;
95 window_handle_t win; 96 window_handle_t win;
96 97
97 /* Is the device suspended, or in the process of 98 /* Is the device suspended? */
98 * being removed? */
99 u16 suspended:1; 99 u16 suspended:1;
100 u16 _removed:1;
101 100
102 /* Flags whether io, irq, win configurations were 101 /* Flags whether io, irq, win configurations were
103 * requested, and whether the configuration is "locked" */ 102 * requested, and whether the configuration is "locked" */
@@ -115,7 +114,7 @@ struct pcmcia_device {
115 u16 has_card_id:1; 114 u16 has_card_id:1;
116 u16 has_func_id:1; 115 u16 has_func_id:1;
117 116
118 u16 reserved:3; 117 u16 reserved:4;
119 118
120 u8 func_id; 119 u8 func_id;
121 u16 manf_id; 120 u16 manf_id;
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h
index 2e488b60bc76..344705cb42f4 100644
--- a/include/pcmcia/ss.h
+++ b/include/pcmcia/ss.h
@@ -224,18 +224,16 @@ struct pcmcia_socket {
224 224
225 /* 16-bit state: */ 225 /* 16-bit state: */
226 struct { 226 struct {
227 /* PCMCIA card is present in socket */
228 u8 present:1;
229 /* "master" ioctl is used */ 227 /* "master" ioctl is used */
230 u8 busy:1; 228 u8 busy:1;
231 /* pcmcia module is being unloaded */
232 u8 dead:1;
233 /* the PCMCIA card consists of two pseudo devices */ 229 /* the PCMCIA card consists of two pseudo devices */
234 u8 has_pfc:1; 230 u8 has_pfc:1;
235 231
236 u8 reserved:4; 232 u8 reserved:6;
237 } pcmcia_state; 233 } pcmcia_state;
238 234
235 /* non-zero if PCMCIA card is present */
236 atomic_t present;
239 237
240#ifdef CONFIG_PCMCIA_IOCTL 238#ifdef CONFIG_PCMCIA_IOCTL
241 struct user_info_t *user; 239 struct user_info_t *user;