An error occurred fetching the project authors.
  1. 29 Nov, 2016 4 commits
    • Linus Walleij's avatar
      mmc: block: use mmc_req_is_special() · f2818bff
      Linus Walleij authored
      Instead of open coding the check for the same thing that
      the helper checks: use the helper.
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      f2818bff
    • Linus Walleij's avatar
      mmc: core: use enum mmc_blk_status properly · 8e8b3f51
      Linus Walleij authored
      There were several instances of code using the
      enum mmc_blk_status by arbitrarily converting it to an int and
      throwing it around to different functions. This makes the code
      hard to understand to may give rise to strange errors.
      
      Especially the function prototype mmc_start_req() had to be
      modified to take a pointer to an enum mmc_blk_status and the
      function pointer .err_check() inside struct mmc_async_req
      needed to return an enum mmc_blk_status.
      
      In every case: instead of assigning the block layer error code
      to an int, use the enum, also change the signature of all
      functions actually passing this enum to use the enum.
      
      To make it possible to use the enum everywhere applicable, move
      it to <linux/mmc/core.h> so that all code actually using it can
      also see it.
      
      An interesting case was encountered in the MMC test code which
      did not return a enum mmc_blk_status at all in the .err_check
      function supposed to check whether asynchronous requests worked
      or not: instead it returned a normal -ERROR or even the test
      frameworks internal error codes.
      
      The test code would also pass on enum mmc_blk_status codes as
      error codes inside the test code instead of converting them
      to the local RESULT_* codes.
      
      I have tried to fix all instances properly and run some tests
      on the result.
      
      Cc: Chunyan Zhang <zhang.chunyan@linaro.org>
      Cc: Baolin Wang <baolin.wang@linaro.org>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      8e8b3f51
    • Linus Walleij's avatar
      mmc: block: convert ecc_err to a bool · 2cc64587
      Linus Walleij authored
      The ecc_err flag is only assigned 0 or 1 and treated as a bool,
      so convert it to a bool.
      
      Cc: Chunyan Zhang <zhang.chunyan@linaro.org>
      Cc: Baolin Wang <baolin.wang@linaro.org>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      2cc64587
    • Linus Walleij's avatar
      mmc: block: make gen_err a bool variable · c44d6cef
      Linus Walleij authored
      This gen_err flag is only assigned 0 or 1 and treated as a bool,
      so convert it to a bool.
      
      Cc: Chunyan Zhang <zhang.chunyan@linaro.org>
      Cc: Baolin Wang <baolin.wang@linaro.org>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      c44d6cef
  2. 10 Oct, 2016 2 commits
    • Jiri Slaby's avatar
      mmc: core: Annotate cmd_hdr as __le32 · 3f2d2664
      Jiri Slaby authored
      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: default avatarJiri Slaby <jslaby@suse.cz>
      Fixes: f68381a7 (mmc: block: fix packed command header endianness)
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      3f2d2664
    • Baoyou Xie's avatar
      mmc: block: add missing header dependencies · 48ab086d
      Baoyou Xie authored
      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: default avatarBaoyou Xie <baoyou.xie@linaro.org>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      48ab086d
  3. 26 Sep, 2016 3 commits
    • Linus Walleij's avatar
      mmc: card: do away with indirection pointer · 29eb7bd0
      Linus Walleij authored
      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: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      29eb7bd0
    • Daniel Glöckner's avatar
      mmc: block: don't use CMD23 with very old MMC cards · 0ed50abb
      Daniel Glöckner authored
      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: default avatarDaniel Glöckner <dg@emlix.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      0ed50abb
    • Shawn Lin's avatar
      mmc: block: remove the check of packed for packed request routine · 96e52daa
      Shawn Lin authored
      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: default avatarShawn Lin <shawn.lin@rock-chips.com>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      96e52daa
  4. 25 Aug, 2016 1 commit
  5. 16 Aug, 2016 1 commit
  6. 25 Jul, 2016 3 commits
  7. 18 Jul, 2016 2 commits
  8. 22 Jun, 2016 1 commit
  9. 09 Jun, 2016 1 commit
  10. 07 Jun, 2016 2 commits
  11. 23 May, 2016 1 commit
  12. 17 May, 2016 2 commits
  13. 16 May, 2016 1 commit
  14. 02 May, 2016 2 commits
  15. 14 Apr, 2016 1 commit
    • Ulf Hansson's avatar
      mmc: block: Use the mmc host device index as the mmcblk device index · 9aaf3437
      Ulf Hansson authored
      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: default avatarPeter Hurley <peter@hurleysoftware.com>
      Reported-by: default avatarLaszlo 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: default avatarUlf Hansson <ulf.hansson@linaro.org>
      9aaf3437
  16. 12 Apr, 2016 1 commit
  17. 17 Mar, 2016 1 commit
    • Shawn Lin's avatar
      mmc: block: fix ABI regression of mmc_blk_ioctl · 83c742c3
      Shawn Lin authored
      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: default avatarShawn Lin <shawn.lin@rock-chips.com>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      83c742c3
  18. 29 Feb, 2016 2 commits
  19. 11 Feb, 2016 1 commit
  20. 10 Feb, 2016 1 commit
  21. 28 Dec, 2015 1 commit
    • Colin Cross's avatar
      mmc: block: Allow more than 8 partitions per card · 382c55f8
      Colin Cross authored
      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: default avatarColin Cross <ccross@android.com>
      [jstultz: Added context to commit message]
      Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      382c55f8
  22. 22 Dec, 2015 1 commit
  23. 09 Nov, 2015 1 commit
  24. 26 Oct, 2015 2 commits
  25. 27 Aug, 2015 1 commit
  26. 17 Aug, 2015 1 commit
    • Yangbo Lu's avatar
      mmc: block: add fixup of broken CMD23 for Sandisk card · 7d70d476
      Yangbo Lu authored
      Some Sandisk cards(such as "SDMB-32" and "SDM032" cards)
      can't support CMD23, and would generate CMD timeout. So add
      FIX-UP for these two types Sandisk cards.
      
      Error log:
      mmcblk0: timed out sending SET_BLOCK_COUNT command, card status 0x400900
      mmcblk0: timed out sending SET_BLOCK_COUNT command, card status 0x400900
      mmcblk0: timed out sending SET_BLOCK_COUNT command, card status 0x400900
      end_request: I/O error, dev mmcblk0, sector 0
      Buffer I/O error on device mmcblk0, logical block 0
      mmcblk0: timed out sending SET_BLOCK_COUNT command, card status 0x400900
      Signed-off-by: default avatarYangbo Lu <yangbo.lu@freescale.com>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      7d70d476