The approach to allow userspace ~5s to consume the uevent, which is triggered when a new card is inserted/initialized, currently requires the mmc host to support system wakeup. This is unnecessary limiting, especially for an mmc host that relies on a GPIO IRQ for card detect. More precisely, the mmc host may not support system wakeup for its corresponding struct device, while the GPIO IRQ still could be configured as a wakeup IRQ via enable_irq_wake(). To support all various cases, let's simply drop the need for the wakeup support. Instead let's always register a wakeup source and activate it for all card detect IRQs by calling __pm_wakeup_event().
Showing the changes to include/linux (1 of 3 files). Show all
Unified · Split
| @@ -287,6 +287,7 @@ struct mmc_host { · 286 unmodified lines | |||
| 287 | #ifdef CONFIG_PM_SLEEP | 287 | #ifdef CONFIG_PM_SLEEP |
| 288 | struct notifier_block pm_notify; | 288 | struct notifier_block pm_notify; |
| 289 | #endif | 289 | #endif |
| 290 | struct wakeup_source *ws; /* Enable consume of uevents */ | ||
| 290 | u32 max_current_330; | 291 | u32 max_current_330; |
| 291 | u32 max_current_300; | 292 | u32 max_current_300; |
| 292 | u32 max_current_180; | 293 | u32 max_current_180; |