Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

(e)MMC/SD/SDIO state of affairs - SFO17-504

238 views

Published on

Session ID: SFO17-504
Session Name: (e)MMC/SD/SDIO state of affairs - SFO17-504
Speaker: Ulf Hansson - Linus Walleij
Track: Kernel


★ Session Summary ★
A lot of people may be curious about what is happening on the (e)MMC/SD/SDIO front, let’s gather up and talk to the maintainers and hear out what has been going on and what is happening next.
---------------------------------------------------
★ Resources ★
Event Page: http://connect.linaro.org/resource/sfo17/sfo17-504/
Presentation:
Video:
---------------------------------------------------

★ Event Details ★
Linaro Connect San Francisco 2017 (SFO17)
25-29 September 2017
Hyatt Regency San Francisco Airport

---------------------------------------------------
Keyword:
http://www.linaro.org
http://connect.linaro.org
---------------------------------------------------
Follow us on Social Media
https://www.facebook.com/LinaroOrg
https://twitter.com/linaroorg
https://www.youtube.com/user/linaroorg?sub_confirmation=1
https://www.linkedin.com/company/1026961

Published in: Technology
  • Be the first to comment

(e)MMC/SD/SDIO state of affairs - SFO17-504

  1. 1. (e)MMC/SD/SDIO State of Affairs Linus Walleij Ulf Hansson
  2. 2. ENGINEERS AND DEVICES WORKING TOGETHER MMC (MultiMedia Card) SD (Secure Digital) eMMC (embedded- ) SDIO (SD I/O)
  3. 3. ENGINEERS AND DEVICES WORKING TOGETHER First MMC stack by Russell King in kernel 2.6.9 <rmk@flint.arm.linux.org.uk> [MMC] Add MMC core support This patch adds core support to the Linux kernel for driving MMC interfaces found on embedded devices, such as found in the Intel PXA and ARM MMCI primecell. This patch does _not_ add support for SD or SDIO cards. It is vaguely based upon the handhelds.org MMC code, but the bulk of the core has been rewritten from scratch.
  4. 4. ENGINEERS AND DEVICES WORKING TOGETHER Lean, Mean and Clean $ ls -al total 108 280 Oct 18 2004 . 960 Oct 18 2004 .. 1346 Oct 18 2004 Kconfig 292 Oct 18 2004 Makefile 10690 Oct 18 2004 mmc_block.c 20362 Oct 18 2004 mmc.c 510 Oct 18 2004 mmc.h 14611 Oct 18 2004 mmci.c 4912 Oct 18 2004 mmci.h 5298 Oct 18 2004 mmc_queue.c 832 Oct 18 2004 mmc_queue.h 5695 Oct 18 2004 mmc_sysfs.c 13644 Oct 18 2004 pxamci.c 2184 Oct 18 2004 pxamci.h
  5. 5. ENGINEERS AND DEVICES WORKING TOGETHER Everything Grew by Feature Creep
  6. 6. ENGINEERS AND DEVICES WORKING TOGETHER Block Device Usage Violation dev ls -al mmc* brw-rw---- 1 root root 179, 0 Jan 1 02:11 mmcblk0 brw-rw---- 1 root root 179, 1 Jan 1 02:11 mmcblk0p1 brw-rw---- 1 root root 179, 2 Jan 1 02:11 mmcblk0p2 brw-rw---- 1 root root 179, 5 Jan 1 02:11 mmcblk0p5 brw-rw---- 1 root root 179, 8 Jan 1 02:11 mmcblk3 brw-rw---- 1 root root 179, 16 Jan 1 02:11 mmcblk3boot0 brw-rw---- 1 root root 179, 24 Jan 1 02:11 mmcblk3boot1 brw-rw---- 1 root root 179, 9 Jan 1 02:11 mmcblk3p1 brw-rw---- 1 root root 179, 32 Jan 1 02:11 mmcblk3rpmb Backup? dd if=/dev/mmcblk3 of=/tmp/card.img
  7. 7. ENGINEERS AND DEVICES WORKING TOGETHER The BIG MMC LOCK int __mmc_claim_host(struct mmc_host *host, atomic_t *abort) { DECLARE_WAITQUEUE(wait, current); unsigned long flags; int stop; bool pm = false; might_sleep(); add_wait_queue(&host->wq, &wait); spin_lock_irqsave(&host->lock, flags); while (1) { set_current_state(TASK_UNINTERRUPTIBLE); stop = abort ? atomic_read(abort) : 0; if (stop || !host->claimed || host->claimer == current) break; spin_unlock_irqrestore(&host->lock, flags); schedule(); spin_lock_irqsave(&host->lock, flags); } set_current_state(TASK_RUNNING); if (!stop) { host->claimed = 1; host->claimer = current; host->claim_cnt += 1; if (host->claim_cnt == 1) pm = true; } else wake_up(&host->wq); spin_unlock_irqrestore(&host->lock, flags); remove_wait_queue(&host->wq, &wait); if (pm) pm_runtime_get_sync(mmc_dev(host)); return stop; } EXPORT_SYMBOL(__mmc_claim_host);
  8. 8. ENGINEERS AND DEVICES WORKING TOGETHER Add Multiqueue (blk-mq) Support
  9. 9. ENGINEERS AND DEVICES WORKING TOGETHER Steps to Success ● Get rid of all uses of the “big MMC lock”: 1. Move RPMB partitions to a character device - not really a block device - working with the Intel people on generic RPMB support too also helps their case, patch exists today 2. Move boot partitions and generic partitions to become Linux partitions Upside: makes it possible to back up the whole mmcblkN (except RPMB) with the dd command ⋎ Alt 1: do not make the partition core aware of these partitions “special status”, just move them to the end of the default partition, give them bogus block numbers beyond the end of the default partition back there, register partitions directly with the block layer at this place Downside: it is not really true ⋎ Alt 2: do a “deep awareness” of the special partitions in the block layer partition code, so it is not just addressing “some blocks somewhere on a device” but actually handling addressed-from-0 special partitions Upside 4. Delete dual-mode card support, we only support eMMC/SD or SDIO not both at the same time. 5. Split eMMC/SD block access and SDIO host access in two worlds 6. The block layer can use a smaller lock, like a mutex or semaphore for its use cases alone 7. Voila: no big MMC host lock
  10. 10. ENGINEERS AND DEVICES WORKING TOGETHER Other Developments in MMC: Command Queueing
  11. 11. Thank You #SFO17 SFO17 keynotes and videos on: connect.linaro.org For further information: www.linaro.org

×