Linux Kernel
3.7.1
|
struct atmel_mci - MMC controller state shared between all slots : Spinlock protecting the queue and associated data. : Pointer to MMIO registers. : Scatterlist entry currently being processed by PIO or PDC code. : Offset into the current scatterlist entry. : Buffer used if we don't have the r/w proof capability. We don't have the time to switch pdc buffers so we have to use only one buffer for the full transaction. : size of the buffer. : buffer address needed for pdc. : The slot which is currently using the controller. : The request currently being processed on , or NULL if the controller is idle. : The command currently being sent to the card, or NULL. : The data currently being transferred, or NULL if no data transfer is in progress. : just data->blocks * data->blksz. : DMA client state. : DMA channel being used for the current data transfer. : Snapshot of SR taken upon completion of the current command. Only valid when EVENT_CMD_COMPLETE is pending. : Snapshot of SR taken upon completion of the current data transfer. Only valid when EVENT_DATA_COMPLETE or EVENT_DATA_ERROR is pending. : Value to be loaded into CMDR when the stop command is to be sent. : Tasklet running the request state machine. : Bitmask of events flagged by the interrupt handler to be processed by the tasklet. : Bitmask of events which the state machine has processed. : Tasklet state. : List of slots waiting for access to the controller. : Update the clock rate before the next request. : Reset controller before next request. : Timer to balance the data timeout error flag which cannot rise. : Value of the MR register. : Value of the CFG register. : The rate of in Hz. This forms the basis for MMC bus rate and timeout calculations. : Physical address of the MMIO registers. : The peripheral bus clock hooked up to the MMC controller. : Platform device associated with the MMC controller. : Slots sharing this MMC controller. : MCI capabilities depending on MCI version. : function to setup MCI before data transfer which depends on MCI capabilities. : function to start data transfer which depends on MCI capabilities. : function to stop data transfer which depends on MCI capabilities.
is a softirq-safe spinlock protecting as well as , and . These must always be updated at the same time while holding .
also protects mode_reg and need_clock_update since these are used to synchronize mode register updates with the queue processing.
The field of struct atmel_mci_slot is also protected by , and must always be written at the same time as the slot is added to .
and are accessed using atomic bit operations, so they don't need any locking.
None of the fields touched by the interrupt handler need any locking. However, ordering is important: Before EVENT_DATA_ERROR or EVENT_DATA_COMPLETE is set in , all data-related interrupts must be disabled and updated with a snapshot of SR. Similarly, before EVENT_CMD_COMPLETE is set, the CMDRDY interrupt must be disabled and updated with a snapshot of SR, and before EVENT_XFER_COMPLETE can be set, the bytes_xfered field of must be written. This is ensured by using barriers.
Definition at line 176 of file atmel-mci.c.
dma_addr_t buf_phys_addr |
Definition at line 184 of file atmel-mci.c.
unsigned int buf_size |
Definition at line 183 of file atmel-mci.c.
Definition at line 182 of file atmel-mci.c.
unsigned long bus_hz |
Definition at line 211 of file atmel-mci.c.
struct atmel_mci_caps caps |
Definition at line 218 of file atmel-mci.c.
u32 cfg_reg |
Definition at line 210 of file atmel-mci.c.
Definition at line 188 of file atmel-mci.c.
u32 cmd_status |
Definition at line 196 of file atmel-mci.c.
unsigned long completed_events |
Definition at line 202 of file atmel-mci.c.
struct atmel_mci_slot* cur_slot |
Definition at line 186 of file atmel-mci.c.
Definition at line 189 of file atmel-mci.c.
Definition at line 193 of file atmel-mci.c.
Definition at line 190 of file atmel-mci.c.
u32 data_status |
Definition at line 197 of file atmel-mci.c.
struct atmel_mci_dma dma |
Definition at line 192 of file atmel-mci.c.
struct dma_slave_config dma_conf |
Definition at line 194 of file atmel-mci.c.
spinlock_t lock |
Definition at line 177 of file atmel-mci.c.
unsigned long mapbase |
Definition at line 212 of file atmel-mci.c.
Definition at line 213 of file atmel-mci.c.
u32 mode_reg |
Definition at line 209 of file atmel-mci.c.
struct mmc_request* mrq |
Definition at line 187 of file atmel-mci.c.
bool need_clock_update |
Definition at line 206 of file atmel-mci.c.
bool need_reset |
Definition at line 207 of file atmel-mci.c.
struct platform_device* pdev |
Definition at line 214 of file atmel-mci.c.
unsigned long pending_events |
Definition at line 201 of file atmel-mci.c.
unsigned int pio_offset |
Definition at line 181 of file atmel-mci.c.
Definition at line 220 of file atmel-mci.c.
Definition at line 204 of file atmel-mci.c.
Definition at line 178 of file atmel-mci.c.
struct scatterlist* sg |
Definition at line 180 of file atmel-mci.c.
Definition at line 216 of file atmel-mci.c.
enum atmel_mci_state state |
Definition at line 203 of file atmel-mci.c.
u32 stop_cmdr |
Definition at line 198 of file atmel-mci.c.
Definition at line 221 of file atmel-mci.c.
struct tasklet_struct tasklet |
Definition at line 200 of file atmel-mci.c.
Definition at line 208 of file atmel-mci.c.