1. 25 4月, 2017 5 次提交
  2. 16 3月, 2017 1 次提交
  3. 15 3月, 2017 2 次提交
  4. 15 2月, 2017 3 次提交
  5. 14 2月, 2017 2 次提交
    • L
      mmc: block: respect bool returned from blk_end_request() · 0e65f10c
      Linus Walleij 提交于
      The return value from blk_end_request() is a bool but is
      treated like an int. This is generally safe, but the variable
      also has the opaque name "ret" and gets returned from the
      helper function mmc_blk_cmd_err().
      
      - Switch the variable to a bool, applies everywhere.
      
      - Return a bool from mmc_blk_cmd_err() and rename the function
        mmc_blk_rw_cmd_err() to indicate through the namespace that
        this is a helper for mmc_blk_issue_rw_rq().
      
      - Rename the variable from "ret" to "req_pending" inside the
        while() loop inside mmc_blk_issue_rq_rq(), which finally
        makes it very clear what this while loop is waiting for.
      
      - Augment the argument "ret" to mmc_blk_rq_cmd_err() to
        old_req_pending so it becomes evident that this is an
        older state, and it is returned only if we fail to get
        the number of written blocks from an SD card in the
        function mmc_sd_num_wr_blocks().
      
      - Augment the while() loop in mmc_blk_rq_cmd_abort(): it
        is evident now that we know this is a bool variable,
        that the function is just spinning waiting for
        blk_end_request() to return false.
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      0e65f10c
    • L
      mmc: block: return errorcode from mmc_sd_num_wr_blocks() · 169f03a0
      Linus Walleij 提交于
      mmc_sd_num_wr_blocks() has an interesting construction that
      saves one return argument by casting (u32)-1 as error code
      if something goes wrong.
      
      This is however a bit confusing when the normal kernel
      pattern is to return an int error code on success.
      
      So instead pass a variable "blocks" that the function can
      fill in with the number of successfully transferred blocks
      and return an integer as error code.
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      [Ulf: Changed a return code to -EIO, reported by Dan Carpenter and fixed
      by Linus Walleij]
      169f03a0
  6. 13 2月, 2017 19 次提交
  7. 25 12月, 2016 1 次提交
  8. 12 12月, 2016 1 次提交
    • U
      mmc: block: Move files to core · f397c8d8
      Ulf Hansson 提交于
      Once upon a time it made sense to keep the mmc block device driver and its
      related code, in its own directory called card. Over time, more an more
      functions/structures have become shared through generic mmc header files,
      between the core and the card directory. In other words, the relationship
      between them has become closer.
      
      By sharing functions/structures via generic header files, it becomes easy
      for outside users to abuse them. In a way to avoid that from happen, let's
      move the files from card directory into the core directory, as it enables
      us to move definitions of functions/structures into mmc core specific
      header files.
      
      Note, this is only the first step in providing a cleaner mmc interface for
      outside users. Following changes will do the actual cleanup, as that is not
      part of this change.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Reviewed-by: NLinus Walleij <linus.walleij@linaro.org>
      f397c8d8
  9. 05 12月, 2016 3 次提交
  10. 29 11月, 2016 3 次提交
    • L
      mmc: block: delete packed command support · 03d640ae
      Linus Walleij 提交于
      I've had it with this code now.
      
      The packed command support is a complex hurdle in the MMC/SD block
      layer, around 500+ lines of code which was introduced in 2013 in
      
      commit ce39f9d1 ("mmc: support packed write command for eMMC4.5
      devices")
      commit abd9ac14 ("mmc: add packed command feature of eMMC4.5")
      
      ...and since then it has been rotting. The original author of the
      code has disappeared from the community and the mail address is
      bouncing.
      
      For the code to be exercised the host must flag that it supports
      packed commands, so in mmc_blk_prep_packed_list() which is called for
      every single request, the following construction appears:
      
      u8 max_packed_rw = 0;
      
      if ((rq_data_dir(cur) == WRITE) &&
          mmc_host_packed_wr(card->host))
              max_packed_rw = card->ext_csd.max_packed_writes;
      
      if (max_packed_rw == 0)
          goto no_packed;
      
      This has the following logical deductions:
      
      - Only WRITE commands can really be packed, so the solution is
        only half-done: we support packed WRITE but not packed READ.
        The packed command support has not been finalized by supporting
        reads in three years!
      
      - mmc_host_packed_wr() is just a static inline that checks
        host->caps2 & MMC_CAP2_PACKED_WR. The problem with this is
        that NO upstream host sets this capability flag! No driver
        in the kernel is using it, and we can't test it. Packed
        command may be supported in out-of-tree code, but I doubt
        it. I doubt that the code is even working anymore due to
        other refactorings in the MMC block layer, who would
        notice if patches affecting it broke packed commands?
        No one.
      
      - There is no Device Tree binding or code to mark a host as
        supporting packed read or write commands, just this flag
        in caps2, so for sure there are not any DT systems using
        it either.
      
      It has other problems as well: mmc_blk_prep_packed_list() is
      speculatively picking requests out of the request queue with
      blk_fetch_request() making the MMC/SD stack harder to convert
      to the multiqueue block layer. By this we get rid of an
      obstacle.
      
      The way I see it this is just cruft littering the MMC/SD
      stack.
      
      Cc: Namjae Jeon <namjae.jeon@samsung.com>
      Cc: Maya Erez <qca_merez@qca.qualcomm.com>
      Acked-by: NJaehoon Chung <jh80.chung@samsung.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      03d640ae
    • L
      mmc: block: move packed command struct init · e01071dd
      Linus Walleij 提交于
      By moving the mmc_packed_init() and mmc_packed_clean() into the
      only file in the kernel where they are used, we save two exported
      functions and can staticize those to the block.c file.
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      e01071dd
    • 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