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
41 Note that send_event() and struct pcmcia_callback *callback must not be
42 called with "ops_mutex" held.
50 struct list_head pcmcia_socket_list;
52 protected by pcmcia_socket_list_rwsem;
57 The resource_ops are on their own to provide proper locking.
59 The "main" struct pcmcia_socket is protected as follows (read-only fields
60 or single-use fields not mentioned):
62 - by pcmcia_socket_list_rwsem:
63 struct list_head socket_list;
66 unsigned int thread_events;
69 u_int suspended_state;
71 struct pcmcia_callback *callback;
75 socket_state_t socket;
78 pccard_mem_map cis_mem;
79 void __iomem *cis_virt;
83 struct list_head cis_cache;
90 struct list_head devices_list;
95 3. Per PCMCIA-device Data:
96 --------------------------
98 The "main" struct pcmcia_devie is protected as follows (read-only fields
99 or single-use fields not mentioned):
102 - by pcmcia_socket->ops_mutex:
103 struct list_head socket_device_list;
104 struct config_t *function_config;
109 u16 allow_func_id_match:1;
113 - by the PCMCIA driver: