1. 07 11月, 2016 1 次提交
  2. 10 10月, 2016 2 次提交
    • J
      mmc: core: Annotate cmd_hdr as __le32 · 3f2d2664
      Jiri Slaby 提交于
      Commit f68381a7 (mmc: block: fix packed command header endianness)
      correctly fixed endianness handling of packed_cmd_hdr in
      mmc_blk_packed_hdr_wrq_prep.
      
      But now, sparse complains about incorrect types:
      drivers/mmc/card/block.c:1613:27: sparse: incorrect type in assignment (different base types)
      drivers/mmc/card/block.c:1613:27:    expected unsigned int [unsigned] [usertype] <noident>
      drivers/mmc/card/block.c:1613:27:    got restricted __le32 [usertype] <noident>
      ...
      
      So annotate cmd_hdr properly using __le32 to make everyone happy.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Fixes: f68381a7 (mmc: block: fix packed command header endianness)
      Cc: stable@vger.kernel.org
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      3f2d2664
    • B
      mmc: block: add missing header dependencies · 48ab086d
      Baoyou Xie 提交于
      We get 1 warning when building kernel with W=1:
      drivers/mmc/card/block.c:2147:5: warning: no previous prototype for
      'mmc_blk_issue_rq' [-Wmissing-prototypes]
      
      In fact, this function is declared in drivers/mmc/card/block.h, so this
      patch adds missing header dependencies.
      Signed-off-by: NBaoyou Xie <baoyou.xie@linaro.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      48ab086d
  3. 27 9月, 2016 4 次提交
    • L
      mmc: card: do away with indirection pointer · 29eb7bd0
      Linus Walleij 提交于
      We have enough vtables in the kernel as it is, we don't need
      this one to create even more artificial separation of concerns.
      
      As is proved by the Makefile:
      
      obj-$(CONFIG_MMC_BLOCK)         += mmc_block.o
      mmc_block-objs                  := block.o queue.o
      
      block.c and queue.c are baked into the same mmc_block.o object.
      So why would one of these objects access a function in the
      other object by dereferencing a pointer?
      
      Create a new block.h header file for the single shared function
      from block to queue and remove the function pointer and just
      call the queue request function.
      
      Apart from making the code more readable, this also makes link
      optimizations possible and probably speeds up the call as well.
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      29eb7bd0
    • A
      mmc: mmc_test: Add tests for sending commands during transfer · 4bbb9aac
      Adrian Hunter 提交于
      Add 6 tests for sending commands during transfer. The tests are:
       * Commands during read - no Set Block Count (CMD23).
       * Commands during write - no Set Block Count (CMD23).
       * Commands during read - use Set Block Count (CMD23).
       * Commands during write - use Set Block Count (CMD23).
       * Commands during non-blocking read - use Set Block Count (CMD23).
       * Commands during non-blocking write - use Set Block Count (CMD23).
      
      For a range of transfer sizes, the tests start an ongoing data transfer and
      then repeatedly send the status command (CMD13) while the transfer
      continues. The tests pass if all requests complete with no errors. The host
      controller driver must support MMC_CAP_CMD_DURING_TFR.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      4bbb9aac
    • D
      mmc: block: don't use CMD23 with very old MMC cards · 0ed50abb
      Daniel Glöckner 提交于
      CMD23 aka SET_BLOCK_COUNT was introduced with MMC v3.1.
      Older versions of the specification allowed to terminate
      multi-block transfers only with CMD12.
      
      The patch fixes the following problem:
      
        mmc0: new MMC card at address 0001
        mmcblk0: mmc0:0001 SDMB-16 15.3 MiB
        mmcblk0: timed out sending SET_BLOCK_COUNT command, card status 0x400900
        ...
        blk_update_request: I/O error, dev mmcblk0, sector 0
        Buffer I/O error on dev mmcblk0, logical block 0, async page read
         mmcblk0: unable to read partition table
      Signed-off-by: NDaniel Glöckner <dg@emlix.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      0ed50abb
    • S
      mmc: block: remove the check of packed for packed request routine · 96e52daa
      Shawn Lin 提交于
      packed should always exist without calling its cleanup function
      explicitly. Moreover, we have use it when preparing packed list.
      So I don't believe we should ever fall into this check again when
      doing mmc_blk_packed_hdr_wrq_prep or mmc_blk_end_packed_req,etc.
      And the code of mmc_blk_end_packed_req is trying to use packed before
      checking it which makes it quite weird. This patch is trying to
      remove these two checks and move it to the mmc_blk_prep_packed_list.
      If we find packed is null, then we should never use MMC_BLK_PACKED_CMD.
      By doing this, we could fall back to non-packed request if finding null
      packed, though it's impossible theoretically.
      
      After removing these two BUG_ONs, we also remove all other similar
      checks within the routine of mmc_blk_issue_rw_rq which checks the
      error handling of packed request.
      Signed-off-by: NShawn Lin <shawn.lin@rock-chips.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      96e52daa
  4. 26 8月, 2016 1 次提交
  5. 16 8月, 2016 1 次提交
  6. 25 7月, 2016 3 次提交
  7. 18 7月, 2016 2 次提交
  8. 23 6月, 2016 1 次提交
  9. 09 6月, 2016 1 次提交
  10. 08 6月, 2016 2 次提交
  11. 23 5月, 2016 1 次提交
  12. 17 5月, 2016 2 次提交
  13. 16 5月, 2016 1 次提交
  14. 02 5月, 2016 2 次提交
  15. 01 5月, 2016 1 次提交
  16. 14 4月, 2016 1 次提交
    • U
      mmc: block: Use the mmc host device index as the mmcblk device index · 9aaf3437
      Ulf Hansson 提交于
      Commit 520bd7a8 ("mmc: core: Optimize boot time by detecting cards
      simultaneously") causes regressions for some platforms.
      
      These platforms relies on fixed mmcblk device indexes, instead of
      deploying the defacto standard with UUID/PARTUUID. In other words their
      rootfs needs to be available at hardcoded paths, like /dev/mmcblk0p2.
      
      Such guarantees have never been made by the kernel, but clearly the above
      commit changes the behaviour. More precisely, because of that the order
      changes of how cards becomes detected, so do their corresponding mmcblk
      device indexes.
      
      As the above commit significantly improves boot time for some platforms
      (magnitude of seconds), let's avoid reverting this change but instead
      restore the behaviour of how mmcblk device indexes becomes picked.
      
      By using the same index for the mmcblk device as for the corresponding mmc
      host device, the probe order of mmc host devices decides the index we get
      for the mmcblk device.
      
      For those platforms that suffers from a regression, one could expect that
      this updated behaviour should be sufficient to meet their expectations of
      "fixed" mmcblk device indexes.
      
      Another side effect from this change, is that the same index is used for
      the mmc host device, the mmcblk device and the mmc block queue. That
      should clarify their relationship.
      Reported-by: NPeter Hurley <peter@hurleysoftware.com>
      Reported-by: NLaszlo Fiat <laszlo.fiat@gmail.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Fixes: 520bd7a8 ("mmc: core: Optimize boot time by detecting cards
      simultaneously")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      9aaf3437
  17. 13 4月, 2016 1 次提交
  18. 17 3月, 2016 1 次提交
    • S
      mmc: block: fix ABI regression of mmc_blk_ioctl · 83c742c3
      Shawn Lin 提交于
      If mmc_blk_ioctl returns -EINVAL, blkdev_ioctl continues to
      work without returning err to user-space. But now we check
      CAP_SYS_RAWIO firstly, so we return -EPERM to blkdev_ioctl,
      which make blkdev_ioctl return -EPERM to user-space directly.
      So this will break all the ioctl with BLKROSET. Now we find
      Android-adb suffer it for the following log:
      
      remount of /system failed;
      couldn't make block device writable: Operation not permitted
      openat(AT_FDCWD, "/dev/block/platform/ff420000.dwmmc/by-name/system", O_RDONLY) = 3
      ioctl(3, BLKROSET, 0)  = -1 EPERM (Operation not permitted)
      
      Fixes: a5f5774c ("mmc: block: Add new ioctl to send multi commands")
      Cc: stable@vger.kernel.org
      Signed-off-by: NShawn Lin <shawn.lin@rock-chips.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      83c742c3
  19. 29 2月, 2016 3 次提交
  20. 11 2月, 2016 1 次提交
  21. 10 2月, 2016 1 次提交
  22. 29 1月, 2016 1 次提交
  23. 28 12月, 2015 1 次提交
    • C
      mmc: block: Allow more than 8 partitions per card · 382c55f8
      Colin Cross 提交于
      It is quite common for Android devices to utilize more
      then 8 partitions on internal eMMC storage.
      
      The vanilla kernel can support this via
      CONFIG_MMC_BLOCK_MINORS, however that solution caps the
      system to 256 minors total, which limits the number of
      mmc cards the system can support.
      
      This patch, which has been carried for quite awhile in
      the AOSP common tree, provides an alternative solution
      that doesn't seem to limit the total card count. So I
      wanted to submit it for consideration upstream.
      
      This patch sets the GENHD_FL_EXT_DEVT flag, which will
      allocate minor number in major 259 for partitions past
      disk->minors.
      
      It also removes the use of disk_devt to determine devidx
      from md->disk. md->disk->first_minor is always initialized
      from devidx and can always be used to recover it.
      
      Cc: Ulf Hansson <ulf.hansson@linaro.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Ben Hutchings <ben@decadent.org.uk>
      Cc: Chuanxiao Dong <chuanxiao.dong@intel.com>
      Cc: Shawn Lin <shawn.lin@rock-chips.com>
      Cc: Austin S Hemmelgarn <ahferroin7@gmail.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Android Kernel Team <kernel-team@android.com>
      Cc: linux-mmc@vger.kernel.org
      Signed-off-by: NColin Cross <ccross@android.com>
      [jstultz: Added context to commit message]
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      382c55f8
  24. 22 12月, 2015 1 次提交
  25. 09 11月, 2015 1 次提交
  26. 26 10月, 2015 2 次提交
  27. 21 10月, 2015 1 次提交