29 Mar, 2018

2 commits

  • commit e74ef2194b41ba5e511fab29fe5ff00e72d2f42a upstream.

    PARTITION_CONFIG is cached in mmc_card->ext_csd.part_config and the
    currently active partition in mmc_blk_data->part_curr. These caches do
    not always reflect changes if the ioctl call modifies the
    PARTITION_CONFIG registers, e.g. by changing BOOT_PARTITION_ENABLE.

    Write the PARTITION_CONFIG value extracted from the ioctl call to the
    cache and update the currently active partition accordingly. This
    ensures that the user space cannot change the values behind the
    kernel's back. The next call to mmc_blk_part_switch() will operate on
    the data set by the ioctl and reflect the changes appropriately.

    Signed-off-by: Bastian Stender
    Signed-off-by: Jan Luebbe
    Cc: stable@vger.kernel.org
    Signed-off-by: Ulf Hansson
    Signed-off-by: Greg Kroah-Hartman

    Bastian Stender
     
  • commit dbe7dc6b9b28f5b012b0bedc372aa0c52521f3e4 upstream.

    Certain Micron eMMC v4.5 cards might get broken when HPI feature is used
    and hence this patch disables the HPI feature for such buggy cards.

    In U-Boot, these cards are reported as

    Manufacturer: Micron (ID: 0xFE)
    OEM: 0x4E
    Name: MMC32G
    Revision: 19 (0x13)
    Serial: 959241022 Manufact. date: 8/2015 (0x82) CRC: 0x00
    Tran Speed: 52000000
    Rd Block Len: 512
    MMC version 4.5
    High Capacity: Yes
    Capacity: 29.1 GiB
    Boot Partition Size: 16 MiB
    Bus Width: 8-bit

    According to JEDEC JEP106 manufacturer 0xFE is Numonyx, which was bought by
    Micron.

    Signed-off-by: Dirk Behme
    Signed-off-by: Mark Craske
    Cc: # 4.8+
    Signed-off-by: Ulf Hansson
    Signed-off-by: Greg Kroah-Hartman

    Dirk Behme
     

24 Mar, 2018

2 commits

  • [ Upstream commit 0be55579a127916ebe39db2a74d906a2dfceed42 ]

    If the MMC_DRV_OP_GET_EXT_CSD request completes successfully, then
    ext_csd must be freed, but in one case it was not. Fix that.

    Signed-off-by: Liu Changcheng
    Acked-by: Adrian Hunter
    Acked-by: Linus Walleij
    Signed-off-by: Ulf Hansson
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Liu, Changcheng
     
  • [ Upstream commit de8dcc3d2c0e08e5068ee1e26fc46415c15e3637 ]

    The Weibu F3C MiniPC has an onboard AP6255 module, presenting
    two SDIO functions on a single MMC host (Bluetooth/btsdio and
    WiFi/brcmfmac), and the mmc layer correctly detects this as
    non-removable.

    After suspend/resume, the wifi and bluetooth interfaces disappear
    and do not get probed again.

    The conditions here are:

    1. During suspend, we reach mmc_pm_notify()

    2. mmc_pm_notify() calls mmc_sdio_pre_suspend() to see if we can
    suspend the SDIO host. However, mmc_sdio_pre_suspend() returns
    -ENOSYS because btsdio_driver does not have a suspend method.

    3. mmc_pm_notify() proceeds to remove the card

    4. Upon resume, mmc_rescan() does nothing with this host, because of
    the rescan_entered check which aims to only scan a non-removable
    device a single time (i.e. during boot).

    Fix the loss of functionality by detecting that we are unable to
    suspend a non-removable host, so avoid the forced removal in that
    case. The comment above this function already indicates that this
    code was only intended for removable devices.

    Signed-off-by: Daniel Drake
    Signed-off-by: Ulf Hansson
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Daniel Drake
     

19 Mar, 2018

1 commit

  • [ Upstream commit 23a185254ace8e63dc4ca36e0315aed9440ae749 ]

    mmc_test disables the command queue because none of the tests use the
    command queue. However the Reset Test will re-enable it, so disable it in
    that case too.

    Fixes: 9d4579a85c84 ("mmc: mmc_test: Disable Command Queue while mmc_test is used")
    Signed-off-by: Adrian Hunter
    Signed-off-by: Ulf Hansson
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Adrian Hunter
     

20 Dec, 2017

1 commit

  • commit 91516a2a4734614d62ee3ed921f8f88acc67c000 upstream.

    To get an usdhc Apacer and some ATP SD cards work reliable, CMD23 needs
    to be disabled. This has been tested on i.MX6 (sdhci-esdhc) and rk3288
    (dw_mmc-rockchip).

    Without this patch on i.MX6 (sdhci-esdhc):

    $ dd if=/dev/urandom of=/mnt/test bs=1M count=10 conv=fsync

    |
    | mmc0: starting CMD25 arg 00a71f00 flags 000000b5
    | mmc0: blksz 512 blocks 1024 flags 00000100 tsac 3000 ms nsac 0
    | mmc0: CMD12 arg 00000000 flags 0000049d
    | sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
    | mmc0: Timeout waiting for hardware interrupt.

    Without this patch on rk3288 (dw_mmc-rockchip):

    | mmc1: Card stuck in programming state! mmcblk1 card_busy_detect
    | dwmmc_rockchip ff0c0000.dwmmc: Busy; trying anyway
    | mmc_host mmc1: Bus speed (slot 0) = 400000Hz (slot req 400000Hz,
    | actual 400000HZ div = 0)
    | mmc1: card never left busy state
    | mmc1: tried to reset card, got error -110
    | blk_update_request: I/O error, dev mmcblk1, sector 139778
    | Buffer I/O error on dev mmcblk1p1, logical block 131586, lost async
    | page write

    Signed-off-by: Christoph Fritz
    Signed-off-by: Ulf Hansson
    Signed-off-by: Greg Kroah-Hartman

    Christoph Fritz
     

05 Dec, 2017

6 commits

  • commit c892b0d81705c566f575e489efc3c50762db1bde upstream.

    The sysfs entry "ocr" was missing the 0x prefix to identify it as hex
    formatted.

    Fixes: 5fb06af7a33b ("mmc: core: Extend sysfs with OCR register")
    Signed-off-by: Bastian Stender
    [Ulf: Amended change to also cover SD-cards]
    Signed-off-by: Ulf Hansson
    Signed-off-by: Greg Kroah-Hartman

    Bastian Stender
     
  • commit 80a780a167d9267c72867b806142bd6ec69ba123 upstream.

    The sysfs entry "pre_eol_info" was missing the 0x prefix to identify it
    as hex formatted.

    Fixes: 46bc5c408e4e ("mmc: core: Export device lifetime information through sysfs")
    Signed-off-by: Bastian Stender
    Signed-off-by: Ulf Hansson
    Signed-off-by: Greg Kroah-Hartman

    Bastian Stender
     
  • commit f9f0da98819503b06b35e61869d18cf3a8cd3323 upstream.

    The card is not necessarily being removed, but the debugfs files must be
    removed when the driver is removed, otherwise they will continue to exist
    after unbinding the card from the driver. e.g.

    # echo "mmc1:0001" > /sys/bus/mmc/drivers/mmcblk/unbind
    # cat /sys/kernel/debug/mmc1/mmc1\:0001/ext_csd
    [ 173.634584] BUG: unable to handle kernel NULL pointer dereference at 0000000000000050
    [ 173.643356] IP: mmc_ext_csd_open+0x5e/0x170

    A complication is that the debugfs_root may have already been removed, so
    check for that too.

    Fixes: 627c3ccfb46a ("mmc: debugfs: Move block debugfs into block module")
    Signed-off-by: Adrian Hunter
    Reviewed-by: Linus Walleij
    Signed-off-by: Ulf Hansson
    Signed-off-by: Greg Kroah-Hartman

    Adrian Hunter
     
  • commit ebe7dd45cf49e3b49cacbaace17f9f878f21fbea upstream.

    The block driver must be resumed if the mmc bus fails to suspend the card.

    Signed-off-by: Adrian Hunter
    Reviewed-by: Linus Walleij
    Signed-off-by: Ulf Hansson
    Signed-off-by: Greg Kroah-Hartman

    Adrian Hunter
     
  • commit fb8e456e547ed2c699f64665bd8a3b9bde7b9728 upstream.

    blk_get_request() can fail, always check the return value.

    Fixes: 0493f6fe5bde ("mmc: block: Move boot partition locking into a driver op")
    Fixes: 3ecd8cf23f88 ("mmc: block: move multi-ioctl() to use block layer")
    Fixes: 614f0388f580 ("mmc: block: move single ioctl() commands to block requests")
    Fixes: 627c3ccfb46a ("mmc: debugfs: Move block debugfs into block module")
    Signed-off-by: Adrian Hunter
    Reviewed-by: Linus Walleij
    Signed-off-by: Ulf Hansson
    Signed-off-by: Greg Kroah-Hartman

    Adrian Hunter
     
  • commit 34c089e806793a66e450b11bd167db6047399fcd upstream.

    Ensure blk_get_request() is paired with blk_put_request().

    Fixes: 0493f6fe5bde ("mmc: block: Move boot partition locking into a driver op")
    Fixes: 627c3ccfb46a ("mmc: debugfs: Move block debugfs into block module")
    Signed-off-by: Adrian Hunter
    Reviewed-by: Linus Walleij
    Signed-off-by: Ulf Hansson
    Signed-off-by: Greg Kroah-Hartman

    Adrian Hunter
     

02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

04 Oct, 2017

1 commit

  • In may, Steven sent a patch deleting the bounce buffer handling
    and the CONFIG_MMC_BLOCK_BOUNCE option.

    I chose the less invasive path of making it a runtime config
    option, and we merged that successfully for kernel v4.12.

    The code is however just standing in the way and taking up
    space for seemingly no gain on any systems in wide use today.

    Pierre says the code was there to improve speed on TI SDHCI
    controllers on certain HP laptops and possibly some Ricoh
    controllers as well. Early SDHCI controllers lacked the
    scatter-gather feature, which made software bounce buffers
    a significant speed boost.

    We are clearly talking about the list of SDHCI PCI-based
    MMC/SD card readers found in the pci_ids[] list in
    drivers/mmc/host/sdhci-pci-core.c.

    The TI SDHCI derivative is not supported by the upstream
    kernel. This leaves the Ricoh.

    What we can however notice is that the x86 defconfigs in the
    kernel did not enable CONFIG_MMC_BLOCK_BOUNCE option, which
    means that any such laptop would have to have a custom
    configured kernel to actually take advantage of this
    bounce buffer speed-up. It simply seems like there was
    a speed optimization for the Ricoh controllers that noone
    was using. (I have not checked the distro defconfigs but
    I am pretty sure the situation is the same there.)

    Bounce buffers increased performance on the OMAP HSMMC
    at one point, and was part of the original submission in
    commit a45c6cb81647 ("[ARM] 5369/1: omap mmc: Add new
    omap hsmmc controller for 2430 and 34xx, v3")

    This optimization was removed in
    commit 0ccd76d4c236 ("omap_hsmmc: Implement scatter-gather
    emulation")
    which found that scatter-gather emulation provided even
    better performance.

    The same was introduced for SDHCI in
    commit 2134a922c6e7 ("sdhci: scatter-gather (ADMA) support")

    I am pretty positively convinced that software
    scatter-gather emulation will do for any host controller what
    the bounce buffers were doing. Essentially, the bounce buffer
    was a reimplementation of software scatter-gather-emulation in
    the MMC subsystem, and it should be done away with.

    Cc: Pierre Ossman
    Cc: Juha Yrjola
    Cc: Steven J. Hill
    Cc: Shawn Lin
    Cc: Adrian Hunter
    Suggested-by: Steven J. Hill
    Suggested-by: Shawn Lin
    Signed-off-by: Linus Walleij
    Signed-off-by: Ulf Hansson

    Linus Walleij
     

02 Oct, 2017

1 commit

  • The driver strength selection is missed and required when selecting
    hs400es. So, It is added here.

    Fixes: 81ac2af65793ecf ("mmc: core: implement enhanced strobe support")
    Cc: stable@vger.kernel.org
    Signed-off-by: Hankyung Yu
    Signed-off-by: Chanho Min
    Reviewed-by: Adrian Hunter
    Reviewed-by: Shawn Lin
    Signed-off-by: Ulf Hansson

    Chanho Min
     

08 Sep, 2017

1 commit

  • mmc_init_request() depends on card->bouncesz so it must be calculated
    before blk_init_allocated_queue() starts allocating requests.

    Reported-by: Seraphime Kirkovski
    Fixes: 304419d8a7e9 ("mmc: core: Allocate per-request data using the..")
    Signed-off-by: Adrian Hunter
    Tested-by: Seraphime Kirkovski
    Cc:
    Signed-off-by: Ulf Hansson
    Tested-by: Pavel Machek

    Adrian Hunter
     

30 Aug, 2017

22 commits

  • Ulf Hansson
     
  • mmc_start_areq() is an internal mmc core API. Move the declaration
    accordingly.

    Signed-off-by: Adrian Hunter
    Signed-off-by: Ulf Hansson

    Adrian Hunter
     
  • The intention for this patch is to help folks debug the failure
    like this:

    dwmmc_rockchip fe320000.dwmmc: IDMAC supports 32-bit address mode.
    dwmmc_rockchip fe320000.dwmmc: Using internal DMA controller.
    dwmmc_rockchip fe320000.dwmmc: Version ID is 270a
    dwmmc_rockchip fe320000.dwmmc: DW MMC controller at irq 28,32 bit
    host data width,256 deep fifo
    dwmmc_rockchip fe320000.dwmmc: Got CD GPIO
    mmc_host mmc0: Bus speed (slot 0) = 400000Hz (slot req 400000Hz, actual
    400000HZ div = 0)
    mmc_host mmc0: Bus speed (slot 0) = 50000000Hz (slot req 50000000Hz,
    actual 50000000HZ div = 0)
    mmc0: new high speed SDHC card at address 0007
    mmcblk: probe of mmc0:0007 failed with error -28

    The reason may be some buggy userspace daemon miss the disk remove
    uevent sometimes so it would finally make the SD card not work.
    So from the dmesg it only shows a errno of -28 but still don't understand
    what happened.

    For quick reproduce this, we could set max_devices to 8 and run

    for i in $(seq 1 9); do
    echo "========================" $i
    echo fe320000.dwmmc > /sys/bus/platform/drivers/dwmmc_rockchip/unbind
    sleep .5
    echo fe320000.dwmmc > /sys/bus/platform/drivers/dwmmc_rockchip/bind
    sleep .5
    mount -t vfat /dev/mmcblk0 /mnt
    sleep .5
    done

    Another possible reason would be the device has more partitions than
    what we support, so that they have to increase their max_devices.

    Signed-off-by: Shawn Lin
    Signed-off-by: Ulf Hansson

    Shawn Lin
     
  • Instead of passing a block device to
    mmc_blk_ioctl[_multi]_cmd(), let's pass struct mmc_blk_data()
    so we operate ioctl()s on the MMC block device representation
    rather than the vanilla block device.

    This saves a little duplicated code and makes it possible to
    issue ioctl()s not targeted for a specific block device but
    rather for a specific partition/area.

    Signed-off-by: Linus Walleij
    Signed-off-by: Ulf Hansson

    Linus Walleij
     
  • Instead of passing a struct mmc_blk_data * to mmc_blk_part_switch()
    let's pass the actual partition type we want to switch to. This
    is necessary in order not to have a block device with a backing
    mmc_blk_data and request queue and all for every hardware partition,
    such as RPMB.

    Signed-off-by: Linus Walleij
    Signed-off-by: Ulf Hansson

    Linus Walleij
     
  • mmc_blk_ioctl() calls either mmc_blk_ioctl_cmd() or
    mmc_blk_ioctl_multi_cmd() and each of these make the same
    check. Factor it into a new helper function, call it on
    both branches of the switch() statement and save a chunk
    of duplicate code.

    Cc: Shawn Lin
    Signed-off-by: Linus Walleij
    Signed-off-by: Ulf Hansson

    Linus Walleij
     
  • If we don't have the block layer enabled, we do not present card
    status and extcsd in the debugfs.

    Debugfs is not ABI, and maintaining files of no relevance for
    non-block devices comes at a high maintenance cost if we shall
    support it with the block layer compiled out.

    The debugfs entries suffer from all the same starvation
    issues as the other userspace things, under e.g. a heavy
    dd operation.

    The expected number of debugfs users utilizing these two
    debugfs files is already low as there is an ioctl() to get the
    same information using the mmc-tools, and of these few users
    the expected number of people using it on SDIO or combo cards
    are expected to be zero.

    It is therefore logical to move this over to the block layer
    when it is enabled, using the new custom requests and issue
    it using the block request queue.

    On the other hand it moves some debugfs code from debugfs.c
    and into block.c.

    Tested during heavy dd load by cat:in the status file.

    Signed-off-by: Linus Walleij
    Signed-off-by: Ulf Hansson

    Linus Walleij
     
  • This function retrieves the status of the card with the default
    number of retries. Since the block layer wants to use this, and
    since the block layer is a loadable kernel module, we need to
    export this symbol.

    Signed-off-by: Linus Walleij
    Signed-off-by: Ulf Hansson

    Linus Walleij
     
  • We have a data pointer for the ioctl() data, but we need to
    pass other data along with the DRV_OP:s, so make this a
    void * so it can be reused.

    Signed-off-by: Linus Walleij
    Signed-off-by: Ulf Hansson

    Linus Walleij
     
  • The new lockdep annotations for completions cause a warning in the
    mmc test module, in a function that now has four 150 byte structures
    on the stack:

    drivers/mmc/core/mmc_test.c: In function 'mmc_test_nonblock_transfer.constprop':
    drivers/mmc/core/mmc_test.c:892:1: error: the frame size of 1360 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]

    The mmc_test_ongoing_transfer function evidently had a similar problem,
    and worked around it by using dynamic allocation.

    This generalizes the approach used by mmc_test_ongoing_transfer() and
    applies it to mmc_test_nonblock_transfer() as well.

    Fixes: cd8084f91c02 ("locking/lockdep: Apply crossrelease to completions")
    Signed-off-by: Arnd Bergmann
    Acked-by: Adrian Hunter
    Tested-by: Adrian Hunter
    Signed-off-by: Ulf Hansson

    Arnd Bergmann
     
  • CQE needs to be off for the host controller to accept non-CQ commands. Turn
    off the CQE before sending commands, and ensure it is off in any reset or
    power management paths, or re-tuning.

    Signed-off-by: Adrian Hunter
    Reviewed-by: Linus Walleij
    Signed-off-by: Ulf Hansson

    Adrian Hunter
     
  • mmc_return_hold() / mmc_retune_release() are used around a group of
    commands to prevent re-tuning between the commands. Re-tuning can still
    happen before the first command. In some cases, re-tuning must be
    prevented entirely. Add mmc_retune_hold_now() for that purpose. It is
    added in preparation for CQE support where it will be used by CQE recovery.

    Signed-off-by: Adrian Hunter
    Reviewed-by: Linus Walleij
    Signed-off-by: Ulf Hansson

    Adrian Hunter
     
  • Packed commands support was removed but some bits got left behind. Remove
    them.

    Signed-off-by: Adrian Hunter
    Reviewed-by: Linus Walleij
    Signed-off-by: Ulf Hansson

    Adrian Hunter
     
  • Per the SD physical layer simplified specification V4.10,
    section 4.6.2, CSD version 1.0 SD card should use taac, nsac
    and r2w_factor for calculating the data access time. But the
    taac and nsac for SDHC(CSD version 2.0) are always fixed and
    the software should use the recommended value for timeout. When
    parsing the CSD, we sanely set them to zero for SDHC(CSD version
    2.0), all the calculation for timeout_ns and timeout_clk is zero
    as well. So what we actually want to limit here is either SDHC
    case or unreasonable timeout reported by the cards. In principle
    we should at least be able to remove the bogus check for the
    mmc_card_blockaddr.

    Signed-off-by: Shawn Lin
    Signed-off-by: Ulf Hansson

    Shawn Lin
     
  • Per the spec of JESD84-B51, section 7.3, replace tacc with taac to
    fix the obvious typo.

    Signed-off-by: Shawn Lin
    Signed-off-by: Ulf Hansson

    Shawn Lin
     
  • Now that we have a custom printf format specifier, convert users of
    full_name to use %pOF instead. This is preparation to remove storing
    of the full path string for each node.

    Signed-off-by: Rob Herring
    Cc: Ulf Hansson
    Cc: Ludovic Desroches
    Cc: Jan Glauber
    Cc: David Daney
    Cc: "Steven J. Hill"
    Cc: linux-mmc@vger.kernel.org
    Acked-by: David Daney
    Tested-by: Steven J. Hill
    Acked-by: Ludovic Desroches
    Signed-off-by: Ulf Hansson

    Rob Herring
     
  • There are lots of debug message in core.c which use pr_debug
    for better dynamic log level control. So it doesn't make sense
    for those print to still keep working only under CONFIG_MMC_DEBUG.

    Signed-off-by: Shawn Lin
    Signed-off-by: Ulf Hansson

    Shawn Lin
     
  • All the check within mmc_mrq_prep seems to be all-or-none
    proposition, so it doesn't make sense to only check the
    length of sglist only under the CONFIG_MMC_DEBUG context.
    I'd prefer to always keep the check there unconditionally.

    Signed-off-by: Shawn Lin
    Signed-off-by: Ulf Hansson

    Shawn Lin
     
  • The intention of this check was to prevent the conflict between
    hotplug and removing driver for whatever reason. Currently it
    doesn't improve anything and the following rescan process could
    still saftly perform the scan flow. So these code seems pointless
    now and let's remove them.

    Signed-off-by: Shawn Lin
    Signed-off-by: Ulf Hansson

    Shawn Lin
     
  • It was never used and introduced a long standing compile
    warning:

    drivers/mmc/core/block.c: In function 'power_ro_lock_store':
    drivers/mmc/core/block.c:191:19: warning: variable 'card' set but not
    used [-Wunused-but-set-variable]

    Remove it to fix the warning.

    Signed-off-by: Shawn Lin
    Signed-off-by: Ulf Hansson

    Shawn Lin
     
  • Just a trivial fix for that found by reading the code.

    Signed-off-by: Shawn Lin
    Reviewed-by: Jaehoon Chung
    Signed-off-by: Ulf Hansson

    Shawn Lin
     
  • Commit 2a842acab109 ("block: introduce new block status code type") changed
    the error type but not in patches merged through the mmc tree, like
    commit 0493f6fe5bde ("mmc: block: Move boot partition locking into a driver
    op"). Fix one error code that is incorrect and also use BLK_STS_OK in
    preference to 0.

    Fixes: 17ece345a042 ("Merge tag 'mmc-v4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc")
    Signed-off-by: Adrian Hunter
    Signed-off-by: Ulf Hansson

    Adrian Hunter
     

21 Aug, 2017

1 commit

  • We to some extent should tolerate R1_OUT_OF_RANGE for open-ending
    mode as it is expected behaviour and most of the backup partition
    tables should be located near some of the last blocks which will
    always make open-ending read exceed the capacity of cards.

    Fixes: 9820a5b11101 ("mmc: core: for data errors, take response of stop cmd into account")
    Fixes: a04e6bae9e6f ("mmc: core: check also R1 response for stop commands")
    Signed-off-by: Shawn Lin
    Reviewed-by: Wolfram Sang
    Tested-by: Shawn Guo
    Signed-off-by: Ulf Hansson

    Shawn Lin
     

09 Aug, 2017

1 commit

  • Fix lockdep splat introduced in v4.13-rc4.

    [ 266.297226] ------------[ cut here ]------------
    [ 266.300078] WARNING: CPU: 2 PID: 176 at /mnt/src/jaja/git/tf300t/include/linux/blkdev.h:657 mmc_blk_remove_req+0xd0/0xe8 [mmc_block]
    [ 266.302937] Modules linked in: mmc_block(-) sdhci_tegra sdhci_pltfm sdhci pwrseq_simple pwrseq_emmc mmc_core
    [ 266.305941] CPU: 2 PID: 176 Comm: rmmod Tainted: G W 4.13.0-rc4mq-00208-gb691e67724b8-dirty #694
    [ 266.308852] Hardware name: NVIDIA Tegra SoC (Flattened Device Tree)
    [ 266.311719] [] (unwind_backtrace) from [] (show_stack+0x18/0x1c)
    [ 266.314664] [] (show_stack) from [] (dump_stack+0x84/0x98)
    [ 266.317644] [] (dump_stack) from [] (__warn+0xf4/0x10c)
    [ 266.320542] [] (__warn) from [] (warn_slowpath_null+0x28/0x30)
    [ 266.323534] [] (warn_slowpath_null) from [] (mmc_blk_remove_req+0xd0/0xe8 [mmc_block])
    [ 266.326568] [] (mmc_blk_remove_req [mmc_block]) from [] (mmc_blk_remove_parts.constprop.6+0x50/0x64 [mmc_block])
    [ 266.329678] [] (mmc_blk_remove_parts.constprop.6 [mmc_block]) from [] (mmc_blk_remove+0x24/0x140 [mmc_block])
    [ 266.332894] [] (mmc_blk_remove [mmc_block]) from [] (mmc_bus_remove+0x20/0x28 [mmc_core])
    [ 266.336198] [] (mmc_bus_remove [mmc_core]) from [] (device_release_driver_internal+0x164/0x200)
    [ 266.339367] [] (device_release_driver_internal) from [] (driver_detach+0x40/0x74)
    [ 266.342537] [] (driver_detach) from [] (bus_remove_driver+0x68/0xdc)
    [ 266.345660] [] (bus_remove_driver) from [] (mmc_blk_exit+0xc/0x2cc [mmc_block])
    [ 266.348875] [] (mmc_blk_exit [mmc_block]) from [] (SyS_delete_module+0x1c4/0x254)
    [ 266.352068] [] (SyS_delete_module) from [] (ret_fast_syscall+0x0/0x34)
    [ 266.355308] ---[ end trace f68728a0d3053b72 ]---

    Fixes: 7c84b8b43d3d ("mmc: block: bypass the queue even if usage is present for hotplug")
    Signed-off-by: Michał Mirosław
    Reviewed-by: Shawn Lin
    Signed-off-by: Ulf Hansson

    Michał Mirosław