1. 29 11月, 2016 5 次提交
    • L
      mmc: block: rename data to blkdata · 7db3028e
      Linus Walleij 提交于
      The struct mmc_blk_request contains an opaque void *data that
      is actually only used to store a pointer to a per-request
      struct mmc_blk_data. This is confusing, so rename the member
      to blkdata and forward-declare the block.c local struct.
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      7db3028e
    • L
      mmc: block: use mmc_req_is_special() · f2818bff
      Linus Walleij 提交于
      Instead of open coding the check for the same thing that
      the helper checks: use the helper.
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      f2818bff
    • L
      mmc: core: use enum mmc_blk_status properly · 8e8b3f51
      Linus Walleij 提交于
      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: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      8e8b3f51
    • L
      mmc: block: convert ecc_err to a bool · 2cc64587
      Linus Walleij 提交于
      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: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      2cc64587
    • L
      mmc: block: make gen_err a bool variable · c44d6cef
      Linus Walleij 提交于
      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: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      c44d6cef
  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 3 次提交
    • 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
    • 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. 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
  16. 13 4月, 2016 1 次提交
  17. 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
  18. 29 2月, 2016 2 次提交
  19. 11 2月, 2016 1 次提交
  20. 10 2月, 2016 1 次提交
  21. 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
  22. 22 12月, 2015 1 次提交
  23. 09 11月, 2015 1 次提交
  24. 26 10月, 2015 2 次提交
  25. 27 8月, 2015 1 次提交