09 Jun, 2017

1 commit

  • MMC SDHCI maintainer Adrian Hunter Introduce SDHCI flags for signal
    voltage support and set them based on the supported transfer modes,
    except in the case where 3V DDR52 is supported but 1.8V is not.

    This patch add the support to make eMMC DDR52 only work at 3.3v when
    property 'no-1-8-v' defined.

    Signed-off-by: Haibo Chen

    Haibo Chen
     

08 Jun, 2017

1 commit

  • Remove the TI wifi from defconfig and include the head file host.h
    which contain the definition of struct mmc_host to avoid the following
    compile warning:

    In file included from drivers/net/wireless/ti/wlcore/sdio.c:28:0:
    ./include/linux/mmc/sdio.h:193:35: warning: 'struct mmc_host' declared inside parameter list
    void mmc_sdio_force_remove(struct mmc_host *host);
    ^
    ./include/linux/mmc/sdio.h:193:35: warning: its scope is only this definition or declaration, which is probably not what you want

    Signed-off-by: Haibo Chen

    Haibo Chen
     

23 Feb, 2017

3 commits

  • With igore pm notify feature, MMC core will not re-detect card
    after system suspend/resume. This is needed for some special cards
    like Broadcom WiFi which can't work propertly on card re-detect
    after system resume.

    Signed-off-by: Dong Aisheng
    (cherry picked from commit 3a4a074d2ead8044afe42cd0d060fe25564b274c)

    Dong Aisheng
     
  • bcmdhd can't support removing host during suspend and
    driver crash when detect card after resume due to no response
    to CMD7.
    It looks bcmdhd has a special requirement to enumerate card
    by itself which is incompatible with current MMC core.
    So implement post-cd feature to allow driver to detect card
    as it wants, then we add back non-removable capability
    to avoid MMC core to redetect card after resume.

    root@imx6qdlsolo:~# echo standby > /sys/power/state
    PM: Syncing filesystems ... done.
    PM: Preparing system for standby sleep
    Freezing user space processes ... (elapsed 0.001 seconds) done.
    Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
    PM: Entering standby sleep
    evbug: Event. Dev: input3, Type: 0, Code: 0, Value: 1
    evbug: Event. Dev: input2, Type: 0, Code: 0, Value: 1
    PM: suspend of devices complete after 652.363 msecs
    PM: suspend devices took 0.660 seconds
    PM: late suspend of devices complete after 1.148 msecs
    PM: noirq suspend of devices complete after 1.043 msecs
    Disabling non-boot CPUs ...
    CPU1: shutdown
    Enabling non-boot CPUs ...
    CPU1 is up
    PM: noirq resume of devices complete after 0.534 msecs
    PM: early resume of devices complete after 0.553 msecs
    evbug: Event. Dev: input2, Type: 1, Code: 116, Value: 1
    evbug: Event. Dev: input2, Type: 0, Code: 0, Value: 0
    evbug: Event. Dev: input2, Type: 1, Code: 116, Value: 0
    evbug: Event. Dev: input2, Type: 0, Code: 0, Value: 0
    mmc1: error -110 during resume (card was removed?)
    PM: resume of devices complete after 605.525 msecs
    PM: resume devices took 0.610 seconds
    PM: Finishing wakeup.
    Restarting tasks ... done.
    WARNING: driver bcmsdh_sdmmc did not remove its interrupt handler!
    root@imx6qdlsolo:~# Unable to handle kernel NULL pointer dereference at virtual address 0000022c
    pgd = 80004000
    [0000022c] *pgd=00000000
    Internal error: Oops: 17 [#1] PREEMPT SMP ARM
    Modules linked in: bcmdhd evbug ov5647_camera_mipi mxc_mipi_csi mx6s_capture
    CPU: 1 PID: 780 Comm: kworker/u4:4 Not tainted 4.1.15-01434-g70f4b36 #1310
    Hardware name: Freescale i.MX7 Dual (Device Tree)
    Workqueue: kmmcd mmc_rescan
    task: a974af80 ti: a846e000 task.ti: a846e000
    PC is at _raw_spin_lock_irqsave+0x1c/0x5c
    LR is at get_parent_ip+0x10/0x2c
    pc : [] lr : [] psr: 60050093
    sp : a846fc20 ip : 0001001f fp : a800b000
    r10: 00000000 r9 : 00000001 r8 : 0000022c
    r7 : 00000002 r6 : 0000022c r5 : a0050013 r4 : 0000022c
    r3 : a974af80 r2 : 00000001 r1 : a846fc44 r0 : 00000000
    Flags: nZCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment kernel
    Control: 10c53c7d Table: a951406a DAC: 00000015
    Process kworker/u4:4 (pid: 780, stack limit = 0xa846e210)
    Stack: (0xa846fc20 to 0xa8470000)
    fc20: 00000000 a846fc50 a846fc44 80061808 00000000 000001dc 00000000 805037fc
    fc40: 8d89d5ec 00000000 a974af80 80053e88 00000000 00000000 ab7293c0 00000000
    fc60: 7f09c828 000000c9 7f09c828 a916a804 00000001 0001001f a800b000 7f0698a4
    fc80: a974afc8 00000001 00000000 00000000 00012ebc a974af80 00000001 80ad46c0
    fca0: a974af80 00000000 a8eeccc0 00000001 0001001f a846fd04 00000000 7f099440
    fcc0: a800b000 7f0699c4 a846fcdf 00000000 00000001 7f068834 a937c900 0105c688
    fce0: a846fd04 a8e20000 00000000 00000001 00000000 7f071f08 a846fd04 a80a0000
    fd00: ffffffff 00000000 ffffffff a8e20000 a8e20000 00000000 7f099440 00000000
    fd20: 00000000 7f099440 a800b000 7f072f4c a974af80 00000000 00000000 80778564
    fd40: a846fd54 a9346550 80330028 00000001 a846e000 a8e20000 7f099440 00000000
    fd60: 18005000 a8eeccc0 00000000 7f099440 a800b000 7f073744 a846fd8c 80052130
    fd80: a9273898 00000000 a800b000 a8e20000 7f099440 00000001 a8eec200 a9270000
    fda0: 00000000 7f099440 a800b000 7f07cd3c 80b81100 8040003f a800b000 00000000
    fdc0: 00000000 a8e20000 7f099440 a9270000 a9273000 a9270000 00000000 7f099440
    fde0: a800b000 7f02df4c 00000001 a8e20000 7f099440 a8eec200 00000000 a916e008
    fe00: 00000000 a90bfb00 a800b000 7f074cbc a9270000 7f099440 a8e20000 00000000
    fe20: a8f81610 7f0765ec 7f0765b0 a8eeccc0 a855df40 7f069310 a916a800 a8eec200
    fe40: 7f09b414 7f06a950 7f06a908 a8f81608 a8f81600 8050e8b8 a8f81608 7f09b414
    fe60: 80b22c70 80379744 a974af80 a8f8163c a8f81608 803797d4 00000005 a81ce930
    fe80: a8f81608 8037923c a8f81608 a8f81608 80b93cf4 80376504 a846fea0 800e0e3c
    fea0: 00000000 00000000 a8f81608 000000bd a833f000 00000000 00000000 8050ed04
    fec0: 00000001 8050dd8c 400f8c0f a833f000 ffffff92 a833f000 a81ce600 8050de30
    fee0: 8050ddbc a833f240 a833f1dc 80506048 a90bfb00 a833f240 a800b000 a81ce600
    ff00: 00000000 800462f0 a81ce600 80043c94 00000000 a800b000 a90bfb18 a800b014
    ff20: a846e000 00000088 80b39379 a90bfb00 a800b000 8004654c 80ad4100 a800b164
    ff40: a90bfb00 00000000 a84856c0 a90bfb00 80046500 00000000 00000000 00000000
    ff60: 00000000 8004b1e8 2df9acc7 00000000 b5f3ff89 a90bfb00 00000000 00000000
    ff80: a846ff80 a846ff80 00000000 00000000 a846ff90 a846ff90 a846ffac a84856c0
    ffa0: 8004b10c 00000000 00000000 8000f568 00000000 00000000 00000000 00000000
    ffc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    ffe0: 00000000 00000000 00000000 00000000 00000013 00000000 ecd61557 f82769f5
    [] (_raw_spin_lock_irqsave) from [] (add_wait_queue+0x20/0x48)
    [] (add_wait_queue) from [] (__mmc_claim_host+0x58/0x1b0)
    [] (__mmc_claim_host) from [] (sdioh_request_byte+0x1cc/0x2a4 [bcmdhd])
    [] (sdioh_request_byte [bcmdhd]) from [] (sdioh_cfg_write+0x20/0x28 [bcmdhd])
    [] (sdioh_cfg_write [bcmdhd]) from [] (bcmsdh_cfg_write+0x90/0xdc [bcmdhd])
    [] (bcmsdh_cfg_write [bcmdhd]) from [] (dhdsdio_clk_kso_enab+0x38/0x168 [bcmdhd])
    [] (dhdsdio_clk_kso_enab [bcmdhd]) from [] (dhdsdio_clk_devsleep_iovar+0xf4/0x5f4 [bcmdhd])
    [] (dhdsdio_clk_devsleep_iovar [bcmdhd]) from [] (dhdsdio_bussleep+0x2f8/0x4dc [bcmdhd])
    [] (dhdsdio_bussleep [bcmdhd]) from [] (dhd_bus_stop+0x2e8/0x3f0 [bcmdhd])
    [] (dhd_bus_stop [bcmdhd]) from [] (dhd_detach+0x2a4/0x438 [bcmdhd])
    [] (dhd_detach [bcmdhd]) from [] (dhdsdio_release+0x4c/0x1dc [bcmdhd])
    [] (dhdsdio_release [bcmdhd]) from [] (dhdsdio_disconnect+0x3c/0xa0 [bcmdhd])
    [] (dhdsdio_disconnect [bcmdhd]) from [] (bcmsdh_remove+0x3c/0x60 [bcmdhd])
    [] (bcmsdh_remove [bcmdhd]) from [] (bcmsdh_sdmmc_remove+0x48/0x60 [bcmdhd])
    [] (bcmsdh_sdmmc_remove [bcmdhd]) from [] (sdio_bus_remove+0x30/0xf8)
    [] (sdio_bus_remove) from [] (__device_release_driver+0x70/0xe4)
    [] (__device_release_driver) from [] (device_release_driver+0x1c/0x28)
    [] (device_release_driver) from [] (bus_remove_device+0xd8/0x104)
    [] (bus_remove_device) from [] (device_del+0x10c/0x210)
    [] (device_del) from [] (sdio_remove_func+0x1c/0x28)
    [] (sdio_remove_func) from [] (mmc_sdio_remove+0x40/0x70)
    [] (mmc_sdio_remove) from [] (mmc_sdio_detect+0x74/0x100)
    [] (mmc_sdio_detect) from [] (mmc_rescan+0xb8/0x314)
    [] (mmc_rescan) from [] (process_one_work+0x120/0x330)
    [] (process_one_work) from [] (worker_thread+0x4c/0x480)
    [] (worker_thread) from [] (kthread+0xdc/0xf4)
    [] (kthread) from [] (ret_from_fork+0x14/0x2c)
    Code: f10c0080 e3a00001 ebe359b1 f594f000 (e1943f9f)

    Signed-off-by: Dong Aisheng

    Dong Aisheng
     
  • As with gpio, uart and others, allow specifying the name_idx via the
    aliases-node in the devicetree.

    On embedded devices, there is often a combination of removable (e.g.
    SD card) and non-removable mmc devices (e.g. eMMC).
    Therefore the name_idx might change depending on
    - host of removable device
    - removable card present or not

    This makes it difficult to hard code the root device, if it is on the
    non-removable device. E.g. if SD card is present eMMC will be mmcblk1,
    if SD card is not present at boot, eMMC will be mmcblk0.

    If the aliases-node is not found, the driver will act as before.

    The original patch is from here:
    https://www.mail-archive.com/linux-mmc@vger.kernel.org/msg26472.html

    The patch requires additional alias_id fix or it won't work.
    Because according to function definition the max_idx parameter of idx_alloc
    is exclusive, so need add 1 or it will be unable to find the proper idx
    within an invalid range.

    Signed-off-by: Sascha Hauer
    Signed-off-by: Dong Aisheng
    (cherry picked from commit 35928d6c6a76a24a16edfa636f4c08293614a1e0)

    Sascha Hauer
     

06 Oct, 2016

1 commit

  • Pull MMC updates from Ulf Hansson:

    MMC core:
    - Add support for sending commands during data transfer
    - Erase/discard/trim improvements
    - Improved error handling
    - Extend sysfs with SD status register
    - Document info about the vmmc/vmmcq regulators
    - Extend pwrseq-simple to manage an optional post-power-on-delay
    - Some various minor improvements and cleanups

    MMC host:
    - dw_mmc: Add reset support
    - dw_mmc: Return -EILSEQ for EBE and SBE error
    - dw_mmc: Some cleanups
    - dw_mmc-k3: Add UHS-I support Hisilicon Hikey
    - tmio: Add eMMC support
    - sh_mobile_sdhi: Add r8a7796 support
    - sunxi: Don't use sample clocks for sun4i/sun5i
    - sunxi: Add support for A64 mmc controller
    - sunxi: Some cleanups and improvements
    - sdhci: Support for sending commands during data transfer
    - sdhci: Do not allow tuning procedure to be interrupted
    - sdhci-pci: Enable SD/SDIO on Merrifield
    - sdhci-pci|acpi: Enable MMC_CAP_CMD_DURING_TFR
    - sdhci-pci: Some cleanups
    - sdhci-of-arasan: Set controller to test mode when no CD bit
    - sdhci-of-arasan: Some fixes for clocks and phys
    - sdhci-brcmstb: Don't use ADMA 64-bit when not supported
    - sdhci-tegra: Mark 64-bit DMA broken on Tegra124
    - sdhci-esdhc-imx: Fixups related to data timeouts

    * tag 'mmc-v4.9' of git://git.linaro.org/people/ulf.hansson/mmc: (68 commits)
    mmc: dw_mmc: remove the deprecated "supports-highspeed" property
    mmc: dw_mmc: minor cleanup for dw_mci_adjust_fifoth
    mmc: dw_mmc: use macro to define ring buffer size
    mmc: dw_mmc: fix misleading error print if failing to do DMA transfer
    mmc: dw_mmc: avoid race condition of cpu and IDMAC
    mmc: dw_mmc: split out preparation of desc for IDMAC32 and IDMAC64
    mmc: core: don't try to switch block size for dual rate mode
    mmc: sdhci-of-arasan: Set controller to test mode when no CD bit
    dt: sdhci-of-arasan: Add device tree option xlnx, fails-without-test-cd
    mmc: tmio: add eMMC support
    mmc: rtsx_usb: use new macro for R1 without CRC
    mmc: rtsx_pci: use new macro for R1 without CRC
    mmc: add define for R1 response without CRC
    mmc: card: do away with indirection pointer
    mmc: sdhci-acpi: Set MMC_CAP_CMD_DURING_TFR for Intel eMMC controllers
    mmc: sdhci-pci: Set MMC_CAP_CMD_DURING_TFR for Intel eMMC controllers
    mmc: sdhci: Support cap_cmd_during_tfr requests
    mmc: mmc_test: Add tests for sending commands during transfer
    mmc: core: Add support for sending commands during data transfer
    mmc: sdhci-brcmstb: Fix incorrect capability
    ...

    Linus Torvalds
     

27 Sep, 2016

4 commits

  • The core uses it for polling. Give drivers a proper define handle this
    case like for other response types.

    Signed-off-by: Wolfram Sang
    Signed-off-by: Ulf Hansson

    Wolfram Sang
     
  • A host controller driver exposes its capability using caps flag
    MMC_CAP_CMD_DURING_TFR. A driver with that capability can accept requests
    that are marked mrq->cap_cmd_during_tfr = true. Then the driver informs the
    upper layers when the command line is available for further commands by
    calling mmc_command_done(). Because of that, the driver will not then
    automatically send STOP commands, and it is the responsibility of the upper
    layer to send a STOP command if it is required.

    For requests submitted through the mmc_wait_for_req() interface, the caller
    sets mrq->cap_cmd_during_tfr = true which causes mmc_wait_for_req() in fact
    not to wait. The caller can then send commands that do not use the data
    lines. Finally the caller can wait for the transfer to complete by calling
    mmc_wait_for_req_done() which is now exported.

    For requests submitted through the mmc_start_req() interface, the caller
    again sets mrq->cap_cmd_during_tfr = true, but mmc_start_req() anyway does
    not wait. The caller can then send commands that do not use the data
    lines. Finally the caller can wait for the transfer to complete in the
    normal way i.e. calling mmc_start_req() again.

    Irrespective of how a cap_cmd_during_tfr request is started,
    mmc_is_req_done() can be called if the upper layer needs to determine if
    the request is done. However the appropriate waiting function (either
    mmc_wait_for_req_done() or mmc_start_req()) must still be called.

    The implementation consists primarily of a new completion
    mrq->cmd_completion which notifies when the command line is available for
    further commands. That completion is completed by mmc_command_done().
    When there is an ongoing data transfer, calls to mmc_wait_for_req() will
    automatically wait on that completion, so the caller does not have to do
    anything special.

    Note, in the case of errors, the driver may call mmc_request_done() without
    calling mmc_command_done() because mmc_request_done() always calls
    mmc_command_done().

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

    Adrian Hunter
     
  • Dwmmc host controller may in unknown state when entering kernel boot. One
    example is when booting from eMMC, bootloader need initialize MMC host
    controller into some state so it can read. In order to make sure MMC host
    controller in a clean initial state, this reset support is added.

    With this patch, a 'resets' property can be added into dw_mmc device
    tree node. The hardware logic is: dwmmc host controller IP receives a reset
    signal from a 'reset provider' (eg. power management unit). The 'resets'
    property points to this reset signal. So, during dwmmc driver probe,
    it can use this signal to reset itself.

    Refer to [1] for more information.

    [1] Documentation/devicetree/bindings/reset/reset.txt

    Signed-off-by: Guodong Xu
    Signed-off-by: Xinwei Kong
    Signed-off-by: Zhangfei Gao
    Reviewed-by: Shawn Lin
    Signed-off-by: Jaehoon Chung
    Signed-off-by: Ulf Hansson

    Guodong Xu
     
  • The SD Status register contains several important fields related to the
    SD Card proprietary features.
    Those fields may be used by user space applications for vendor specific
    usage.
    None of those fields are exported today by the driver to user space.
    In this patch, we are reading the SD Status register and exporting
    (using MMC_DEV_ATTR) the SD Status register to the user space.

    Signed-off-by: Uri Yanai
    Signed-off-by: Ulf Hansson

    Uri Yanai
     

09 Sep, 2016

1 commit

  • The driver already supports the bcm4339 chipset but only for the variant
    that shares the same modalias as the bcm4335, ie. sdio:c00v02D0d4335.
    It turns out that there are also bcm4339 devices out there that have a
    more distiguishable modalias sdio:c00v02D0d4339.

    Reported-by: Steve deRosier
    Reviewed-by: Hante Meuleman
    Reviewed-by: Pieter-Paul Giesberts
    Reviewed-by: Franky Lin
    Signed-off-by: Arend van Spriel
    Signed-off-by: Kalle Valo

    Arend Van Spriel
     

25 Jul, 2016

6 commits

  • Host drivers which needs to valdiate for non-supported MMC
    commands and returnn error code for such requests.

    To improve and simplify the behaviour, let's invent MMC_CAP2_NO_MMC
    which these host drivers can set to tell the mmc core to skip sending MMC
    commands during card initialization.

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

    Shawn Lin
     
  • Remove the quirks flag. (DW_MCI_QUIRK_BROKEN_DTO)
    For removing this, enabled the dto_timer by defaults.
    It doesn't see any I/O performance degression.
    In future, dwmmc controller should not use the quirks flag.

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

    Jaehoon Chung
     
  • There are host drivers which needs to valdiate for non-supported SD
    commands and returnn error code for such requests.

    To improve and simplify the behaviour, let's invent MMC_CAP2_NO_SD
    which these host drivers can set to tell the mmc core to skip sending SD
    commands during card initialization.

    Signed-off-by: Ulf Hansson

    Ulf Hansson
     
  • Certain Hynix eMMC 4.41 cards might get broken when HPI feature is used
    and hence this patch disables the HPI feature for such buggy cards.

    As some of the other features like BKOPs/Cache/Sanitize are dependent on
    HPI feature, those features would also get disabled if HPI is disabled.

    Signed-off-by: Pratibhasagar V
    Signed-off-by: Subhash Jadavani
    [gdavis: Forward port and cleanup]
    Signed-off-by: George G. Davis
    Signed-off-by: Ulf Hansson

    Pratibhasagar V
     
  • Controllers use data strobe line to latch data from devices
    under hs400 mode, but not for cmd line. So since emmc 5.1, JEDEC
    introduces enhanced strobe mode for latching cmd response from
    emmc devices to host controllers. This new feature is optional,
    so it depends both on device's cap and host's cap to decide
    whether to use it or not.

    Signed-off-by: Shawn Lin

    Reviewed-by: Jaehoon Chung
    Tested-by: Douglas Anderson
    Tested-by: Jaehoon Chung
    Acked-by: Adrian Hunter
    Signed-off-by: Ulf Hansson

    Shawn Lin
     
  • This patch introduce mmc-hs400-enhanced-strobe for platforms
    which want to enable enhanced strobe function from DT if the
    mmc host controller claims to support enhanced strobe.

    Signed-off-by: Shawn Lin

    Reviewed-by: Douglas Anderson
    Tested-by: Jaehoon Chung
    Signed-off-by: Ulf Hansson

    Shawn Lin
     

27 May, 2016

1 commit

  • Pull MMC fixes from Ulf Hansson:
    "Here are some mmc fixes intended for v4.7 rc1. They are based on a
    commit earlier in the merge window and have been tested in linux-next
    for a while.

    MMC core:
    - Prevent re-tuning while serving requests for RPMB partitions
    - Extend timeout for long read time quirk to support more eMMCs

    MMC host:
    - sdhci-acpi: Ensure connected devices are powered when probing
    - sdhci-pci|acpi: Remove unreliable MMC_CAP_BUS_WIDTH_TEST for Intel HWs
    - dw_mmc: Correct the assigning of max_blk_size
    - dw_mmc-rockchip: Allow RPMB partitions to be created
    - dw_mmc-rockchip: Set the drive phase properly"

    * tag 'mmc-v4.7-rc1' of git://git.linaro.org/people/ulf.hansson/mmc:
    mmc: sdhci-acpi: Remove MMC_CAP_BUS_WIDTH_TEST for Intel controllers
    mmc: sdhci-pci: Remove MMC_CAP_BUS_WIDTH_TEST for Intel controllers
    mmc: longer timeout for long read time quirk
    mmc: dw_mmc: rockchip: Set the drive phase properly
    mmc: dw_mmc: fix the wrong max_blk_size
    mmc: dw_mmc-rockchip: add MMC_CAP_CMD23 capabilities
    mmc: sdhci-acpi: Ensure connected devices are powered when probing
    ACPI / PM: Export acpi_device_fix_up_power()
    mmc: block: Pause re-tuning while switched to the RPMB partition
    mmc: block: Always switch back to main area after RPMB access
    mmc: core: Add a facility to "pause" re-tuning

    Linus Torvalds
     

21 May, 2016

1 commit

  • …ub/scm/linux/kernel/git/kvalo/wireless-drivers-next

    Kalle Valo says:

    ====================
    wireless-drivers patches for 4.7

    Major changes:

    iwlwifi

    * remove IWLWIFI_DEBUG_EXPERIMENTAL_UCODE kconfig option
    * work for RX multiqueue continues
    * dynamic queue allocation work continues
    * add Luca as maintainer
    * a bunch of fixes and improvements all over

    brcmfmac

    * add 4356 sdio support

    ath6kl

    * add ability to set debug uart baud rate with a module parameter

    wil6210

    * add debugfs file to configure firmware led functionality
    ====================

    Signed-off-by: David S. Miller <davem@davemloft.net>

    David S. Miller
     

17 May, 2016

1 commit

  • Re-tuning is not possible when switched to the RPMB
    partition. However re-tuning should not be needed
    if re-tuning is done immediately before switching,
    a small set of operations is done, and then we
    immediately switch back to the main partition.

    To ensure that re-tuning can't be done for a short
    while, add a facility to "pause" re-tuning.

    The existing facility to hold / release re-tuning
    is used but it also flags re-tuning as needed to cause
    re-tuning before the next command (which will be the
    switch to RPMB).

    We also need to "unpause" in the recovery path, which
    is catered for by adding it to mmc_retune_disable().

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

    Adrian Hunter
     

12 May, 2016

1 commit


02 May, 2016

6 commits

  • A few SH boards include the file but don't make use of it (no named
    interrupts). The SDHI code removed support for this feature as well.
    So, drop the references and ultimately remove the unneeded file.

    Signed-off-by: Wolfram Sang
    Acked-by: Rich Felker
    Acked-by: Yoshinori Sato
    Signed-off-by: Ulf Hansson

    Wolfram Sang
     
  • There is no reason to have a public and private header file. Merge them
    into a private one, so looking up symbols is less confusing.

    Signed-off-by: Wolfram Sang
    Acked-by: Arnd Bergmann
    Signed-off-by: Ulf Hansson

    Wolfram Sang
     
  • EVENT_XFER_ERROR isn't been used now, so it can be removed.

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

    Shawn Lin
     
  • Try to fix the warning reported by:
    scripts/kernel-doc -man -v include/linux/mmc/dw_mmc.h > /dev/null

    warning: No description found for parameter 'irq_lock'
    warning: No description found for parameter 'stop_abort'
    warning: No description found for parameter 'prev_blksz'
    warning: No description found for parameter 'timing'
    warning: No description found for parameter 'ring_size'
    warning: No description found for parameter 'dms'
    warning: No description found for parameter 'phy_regs'
    warning: No description found for parameter 'fifoth_val'
    warning: No description found for parameter 'vqmmc_enabled'
    warning: No description found for parameter 'cmd11_timer'
    warning: Excess struct/union/enum/typedef member 'card_tasklet'
    description in 'dw_mci'

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

    Shawn Lin
     
  • While here, refactor the comments so that they are before the
    declaration they are referring to.

    Signed-off-by: Wolfram Sang
    Signed-off-by: Ulf Hansson

    Wolfram Sang
     
  • Based on work by Shinobu Uehara and Ben Dooks. This adds the voltage
    switch operation needed for all UHS-I modes, but not the tuning needed
    for SDR-104 which will come later.

    Signed-off-by: Ben Hutchings
    Signed-off-by: Wolfram Sang
    Signed-off-by: Ulf Hansson

    Wolfram Sang
     

29 Feb, 2016

4 commits

  • dw_mmc already use mmc_of_parse to get "broken-cd" property,
    but it considered "broken-cd" to be a quirk in its driver. We
    don't need this quirk here, and just take what we need from
    mmc->caps.

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

    Shawn Lin
     
  • This patch removes struct block_settings since
    it's never used anywhere.

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

    Shawn Lin
     
  • Some of the indentation made the code awful to read. Fix that. Also,
    introduce defines instead of magic hex values. Note that this includes
    one change: We mask out know 0xff instead of 0x1ff. But 0x100 has always
    been the clock enable bit. It doesn't make any sense to set it depending
    on the clock calculation. Update copyright notices, too. I'll be working
    on those files some more in the future.

    Signed-off-by: Wolfram Sang
    Signed-off-by: Ulf Hansson

    Wolfram Sang
     
  • It's not set to MMC_DATA_STREAM anywhere.
    It seems that it had been used with CMD11/CMD20.
    But according to Spec, CMD11/CMD20 are obsolete command.

    Signed-off-by: Jaehoon Chung
    Signed-off-by: Ulf Hansson

    Jaehoon Chung
     

06 Jan, 2016

1 commit


22 Dec, 2015

4 commits

  • The dw_mmc driver stores the physical address of the MMIO registers
    in a pointer, which requires the use of type casts, and is actually
    broken if anyone ever has this device on a 32-bit SoC in registers
    above 4GB. Gcc warns about this possibility when the driver is built
    with ARM LPAE enabled:

    mmc/host/dw_mmc.c: In function 'dw_mci_edmac_start_dma':
    mmc/host/dw_mmc.c:702:17: warning: cast from pointer to integer of different size
    cfg.dst_addr = (dma_addr_t)(host->phy_regs + fifo_offset);
    ^
    mmc/host/dw_mmc-pltfm.c: In function 'dw_mci_pltfm_register':
    mmc/host/dw_mmc-pltfm.c:63:19: warning: cast to pointer from integer of different size
    host->phy_regs = (void *)(regs->start);

    This changes the code to use resource_size_t, which gets rid of the
    warning, the bug and the useless casts.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Jaehoon Chung
    Signed-off-by: Ulf Hansson

    Arnd Bergmann
     
  • This patch introduce a new MMC_CAP2_NO_SDIO cap used to tell the mmc
    core to not send SDIO specific commands.

    Signed-off-by: Carlo Caione
    Signed-off-by: Ulf Hansson

    Carlo Caione
     
  • Instead of checking for "#ifdef" directly in the code, let's invent a pair
    of mmc core functions to deal with register/unregister the MMC PM notifier
    block. Implement stubs for these functions when CONFIG_PM_SLEEP is unset,
    as in that case the PM notifiers isn't used.

    Signed-off-by: Ulf Hansson

    Ulf Hansson
     
  • Signed-off-by: Ulf Hansson

    Ulf Hansson
     

27 Oct, 2015

1 commit

  • The mmc_execute_tuning() has already prepared the opcode,
    there is no need to prepare it again at mmc_send_tuning(),
    and, there is a BUG of mmc_send_tuning() to determine the opcode
    by bus width, assume eMMC was running at HS200, 4bit mode,
    then the mmc_send_tuning() will overwrite the opcode from CMD21
    to CMD19, then got error.

    in addition, extend an argument of "cmd_error" to allow getting
    if there was cmd error when tune response.

    Signed-off-by: Chaotian Jing
    [Ulf: Rebased patch]
    Signed-off-by: Ulf Hansson

    Chaotian Jing
     

26 Oct, 2015

3 commits

  • DesignWare MMC Controller can supports two types of DMA
    mode: external dma and internal dma. We get a RK312x platform
    integrated dw_mmc and ARM pl330 dma controller. This patch add
    edmac ops to support these platforms. I've tested it on RK31xx
    platform with edmac mode and RK3288 platform with idmac mode.

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

    Shawn Lin
     
  • This adds logic to the MMC core to set VQMMC. This is expected to be
    called by MMC drivers like dw_mmc as part of (or instead of) their
    start_signal_voltage_switch() callback.

    A few notes:

    * When setting the signal voltage to 3.3V we do our best to make VQMMC
    and VMMC match. It's been reported that this makes some old cards
    happy since they were tested back in the day before UHS when VQMMC
    and VMMC were provided by the same regulator. A nice side effect of
    this is that we don't end up on the hairy edge of VQMMC (2.7V),
    which some EEs claim is a little too close to the minimum for
    comfort.
    This is done in two steps. At first we try to find a VQMMC within
    a 0.3V tolerance of VMMC and if this is not supported by the
    supplying regulator we try to find a suitable voltage within the
    whole 2.7V-3.6V area of the spec.

    * The two step approach is currently necessary, as the used
    regulator_set_voltage_triplet(min, target, max) uses a simple
    implementation that just tries two basic steps:
    regulator_set_voltage(target, max);
    regulator_set_voltage(min, target);
    So with only one step with 2.7-3.6V borders, if a suitable voltage
    is a bit below VMMC, we would directly get the lowest 2.7V
    which some boards (like Rockchips) don't like at all.

    * When setting the signal voltage to 1.8V or 1.2V we aim for that
    specific voltage instead of picking the lowest one in the range.

    * We very purposely don't print errors in mmc_regulator_set_vqmmc().
    There are cases where the MMC core will try several different
    voltages and we don't want to pollute the logs.

    Signed-off-by: Douglas Anderson
    Signed-off-by: Heiko Stuebner
    Signed-off-by: Ulf Hansson

    Douglas Anderson
     
  • MMC_CLKGATE was once invented to save power by gating the bus clock at
    request inactivity. At that time it served its purpose. The modern way to
    deal with power saving for these scenarios, is by using runtime PM.

    Nowadays, several host drivers have deployed runtime PM, but for those
    that haven't and which still cares power saving at request inactivity,
    it's certainly time to deploy runtime PM as it has been around for several
    years now.

    To simplify code to mmc core and thus decrease maintenance efforts, this
    patch removes all code related to MMC_CLKGATE.

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

    Ulf Hansson