1 This file explains the locking and exclusion scheme used in the PCCARD
5 A) Overview, Locking Hierarchy:
6 ===============================
8 pcmcia_socket_list_rwsem - protects only the list of sockets
9 - skt_mutex - serializes card insert / ejection
10 - ops_mutex - serializes socket operation
16 The following functions and callbacks to struct pcmcia_socket must
17 be called with "skt_mutex" held:
19 socket_detect_change()
31 struct pcmcia_callback *callback
33 The following functions and callbacks to struct pcmcia_socket must
34 be called with "ops_mutex" held:
39 struct pccard_operations *ops
40 struct pccard_resource_ops *resource_ops;
42 Note that send_event() and struct pcmcia_callback *callback must not be
43 called with "ops_mutex" held.
51 struct list_head pcmcia_socket_list;
53 protected by pcmcia_socket_list_rwsem;
58 The resource_ops and their data are protected by ops_mutex.
60 The "main" struct pcmcia_socket is protected as follows (read-only fields
61 or single-use fields not mentioned):
63 - by pcmcia_socket_list_rwsem:
64 struct list_head socket_list;
67 unsigned int thread_events;
70 u_int suspended_state;
72 struct pcmcia_callback *callback;
76 socket_state_t socket;
79 pccard_mem_map cis_mem;
80 void __iomem *cis_virt;
84 struct list_head cis_cache;
91 struct list_head devices_list;
96 3. Per PCMCIA-device Data:
97 --------------------------
99 The "main" struct pcmcia_device is protected as follows (read-only fields
100 or single-use fields not mentioned):
103 - by pcmcia_socket->ops_mutex:
104 struct list_head socket_device_list;
105 struct config_t *function_config;
110 u16 allow_func_id_match:1;
114 - by the PCMCIA driver: