summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-02-27 16:18:30 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2010-02-27 16:18:30 -0800
commit8d37a371b6869920e6c40c495c68eabba1ef3909 (patch)
treedad784512b13832f4f5494cfe0791965c6a2b0f6 /include
parentef1a8de8ea004a689b2aa9f5cefcba2b1a0262f2 (diff)
parent7b4884ca8853a638df0eb5d251d80d67777b8b1a (diff)
downloadlinux-3.10-8d37a371b6869920e6c40c495c68eabba1ef3909.tar.gz
linux-3.10-8d37a371b6869920e6c40c495c68eabba1ef3909.tar.bz2
linux-3.10-8d37a371b6869920e6c40c495c68eabba1ef3909.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6: (49 commits) pcmcia: validate late-added resources pcmcia: allow for extension of resource interval pcmcia: remove useless msleep in ds.c pcmcia: use read_cis_mem return value pcmcia: handle error in serial_cs config calls pcmcia: add locking to pcmcia_{read,write}_cis_mem pcmcia: avoid prod_id memleak pcmcia: avoid sysfs-related lockup for cardbus pcmcia: use state machine for extended requery pcmcia: delay re-scanning and re-querying of PCMCIA bus pcmcia: use pccardd to handle eject, insert, suspend and resume requests pcmcia: use ops_mutex for rsrc_{mgr,nonstatic} locking pcmcia: use mutex for dynid lock pcmcia: assert locking to struct pcmcia_device pcmcia: add locking documentation pcmcia: simplify locking pcmcia: add locking to struct pcmcia_socket->pcmcia_state() pcmcia: protect s->device_count pcmcia: properly lock skt->irq, skt->irq_mask pcmcia: lock ops->set_socket ...
Diffstat (limited to 'include')
-rw-r--r--include/pcmcia/ds.h2
-rw-r--r--include/pcmcia/ss.h40
2 files changed, 24 insertions, 18 deletions
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
index ee148573c11..d57847f2f6c 100644
--- a/include/pcmcia/ds.h
+++ b/include/pcmcia/ds.h
@@ -40,7 +40,7 @@ struct net_device;
* Documentation/pcmcia/driver.txt for details.
*/
struct pcmcia_dynids {
- spinlock_t lock;
+ struct mutex lock;
struct list_head list;
};
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h
index cbfba885eb8..32896a77391 100644
--- a/include/pcmcia/ss.h
+++ b/include/pcmcia/ss.h
@@ -134,9 +134,9 @@ struct pccard_operations {
struct pcmcia_socket {
struct module *owner;
- spinlock_t lock;
socket_state_t socket;
u_int state;
+ u_int suspended_state; /* state before suspend */
u_short functions;
u_short lock_count;
pccard_mem_map cis_mem;
@@ -200,9 +200,14 @@ struct pcmcia_socket {
struct task_struct *thread;
struct completion thread_done;
unsigned int thread_events;
- /* protects socket h/w state */
+ unsigned int sysfs_events;
+
+ /* For the non-trivial interaction between these locks,
+ * see Documentation/pcmcia/locking.txt */
struct mutex skt_mutex;
- /* protects thread_events */
+ struct mutex ops_mutex;
+
+ /* protects thread_events and sysfs_events */
spinlock_t thread_lock;
/* pcmcia (16-bit) */
@@ -225,30 +230,19 @@ struct pcmcia_socket {
u8 busy:1;
/* pcmcia module is being unloaded */
u8 dead:1;
- /* a multifunction-device add event is pending */
- u8 device_add_pending:1;
- /* the pending event adds a mfc (1) or pfc (0) */
- u8 mfc_pfc:1;
+ /* the PCMCIA card consists of two pseudo devices */
+ u8 has_pfc:1;
- u8 reserved:3;
+ u8 reserved:4;
} pcmcia_state;
- /* for adding further pseudo-multifunction devices */
- struct work_struct device_add;
-
#ifdef CONFIG_PCMCIA_IOCTL
struct user_info_t *user;
wait_queue_head_t queue;
#endif /* CONFIG_PCMCIA_IOCTL */
#endif /* CONFIG_PCMCIA */
- /* cardbus (32-bit) */
-#ifdef CONFIG_CARDBUS
- struct resource *cb_cis_res;
- void __iomem *cb_cis_virt;
-#endif /* CONFIG_CARDBUS */
-
/* socket device */
struct device dev;
/* data internal to the socket driver */
@@ -263,13 +257,25 @@ struct pcmcia_socket {
* - pccard_static_ops iomem and ioport areas are assigned statically
* - pccard_iodyn_ops iomem areas is assigned statically, ioport
* areas dynamically
+ * If this option is selected, use
+ * "select PCCARD_IODYN" in Kconfig.
* - pccard_nonstatic_ops iomem and ioport areas are assigned dynamically.
* If this option is selected, use
* "select PCCARD_NONSTATIC" in Kconfig.
+ *
*/
extern struct pccard_resource_ops pccard_static_ops;
+#if defined(CONFIG_PCMCIA) || defined(CONFIG_PCMCIA_MODULE)
extern struct pccard_resource_ops pccard_iodyn_ops;
extern struct pccard_resource_ops pccard_nonstatic_ops;
+#else
+/* If PCMCIA is not used, but only CARDBUS, these functions are not used
+ * at all. Therefore, do not use the large (240K!) rsrc_nonstatic module
+ */
+#define pccard_iodyn_ops pccard_static_ops
+#define pccard_nonstatic_ops pccard_static_ops
+#endif
+
/* socket drivers are expected to use these callbacks in their .drv struct */
extern int pcmcia_socket_dev_suspend(struct device *dev);