22 Mar, 2016

1 commit

  • Pull MMC updates from Ulf Hansson:
    "MMC core:
    - Fix ABI regression of MMC BLK ioctl
    - Remove the unused MMC_DATA_STREAM flag
    - Enable asynchronous system PM for the host device
    - Minor fixes and clean-ups

    SDHCI host:
    Throughout the years, the numbers of SDHCI variants have increased
    and so has also the numbers of SDHCI callbacks/quirks. The purpose
    of these callbacks/quirks were to enable SDHCI to deal with variant
    specific requirements, but unfortunate this method didn't scale.
    Instead we have ended up with a mess. Not only did the code become
    suboptimal but also highly fragile.

    Lately many discussions of how to move forward with SDHCI has taken
    place at the MMC mailing list. Step by step, we aim to turn
    SDHCI's common code into a set of library functions. This will
    enable for optimizations and allow some of the existing callbacks
    and quirks to be removed, which also should help to make the code
    less fragile.

    Therefore I am also really pleased to announce that Adrian Hunter
    (Intel) has volunteered to step in as the maintainer for SDHCI.

    Future wise, I hope the community around SDHCI will continue to
    grow and that this release cycle can be the starting point of
    moving SDHCI into a better shape. As a matter of fact, already in
    this cycle the re-factoring has begun, but of course there are also
    fixes and new features included. Some highlights:

    - sdhci-iproc: Add support for Broadcom's BCM2835 eMMC IP
    - sdhci-acpi: Add support for QCOM controllers
    - sdhci-pic32: Add new SDHCI variant for PIC32MZDA

    Other hosts:
    - atmel-mci: Fix a NULL pointer dereference
    - mediatek: Add SD write-protect support
    - mmc_spi: Fix card detect in GPIO case
    - tmio/sdhi: Add r8a7795 support
    - tmio/sdhi: Some fixes and clean-ups
    - dw_mmc: Add HW reset support
    - dw_mmc: Some fixes and clean-ups
    - sunxi: Add support for MMC DDR52 mode"

    * tag 'mmc-v4.6' of git://git.linaro.org/people/ulf.hansson/mmc: (123 commits)
    mmc: sdhci-of-at91: fix wake-up issue when using runtime pm
    mmc: sdhci-pci: Do not set DMA mask in enable_dma()
    mmc: sdhci-acpi: Remove enable_dma() hook
    mmc: sdhci: Set DMA mask when adding host
    mmc: block: fix ABI regression of mmc_blk_ioctl
    mmc: atmel-mci: Check pdata for NULL before dereferencing it at DMA config
    mmc: core: remove redundant memset of sdio_read_cccr
    mmc: core: remove redundant memset of mmc_decode_cid
    mmc: of_mmc_spi: fix unused warning
    mmc: sdhci-of-arasan: add phy support for sdhci-of-arasan
    mmc: sdhci-of-arasan: fix missing sdhci_pltfm_free for err handling
    mmc: sdhci-of-arasan: remove disable clk_ahb from sdhci_arasan_resume
    Documentation: bindings: add description of phy for sdhci-of-arasan
    mmc: sdhci: Fix override of timeout clk wrt max_busy_timeout
    mmc: mmci: Remove unnecessary header file
    mmc: sdhci-acpi: add QCOM controllers
    mmc: tegra: implement memcomp pad calibration
    mmc: mediatek: Use mmc_regulator_set_vqmmc in start_signal_voltage_switch
    mmc: mediatek: Change signal voltage error to dev_dbg()
    mmc: sh_mmcif, tmio: Use ARCH_RENESAS
    ...

    Linus Torvalds
     

18 Mar, 2016

5 commits

  • It is impossible to wake-up on card detect event because when sdhci
    controller is runtime suspended, it is assumed that all clocks are
    disabled so we can't get irqs.
    If the device is removable and there is no gpio to manage the card
    detection then polling is used. It doesn't mean card detection is broken.
    It is curently we only way to wake-up on card event if using runtime pm.

    Signed-off-by: Ludovic Desroches
    Acked-by: Adrian Hunter
    Signed-off-by: Ulf Hansson

    ludovic.desroches@atmel.com
     
  • DMA mask will already be set by sdhci_set_dma_mask(), which
    is equivalent to the removed code since pci_set_dma_mask()
    expands to its DMA-API counterpart.

    There should also be no reason to set the DMA mask after probe.

    Signed-off-by: Alexandre Courbot
    Acked-by: Arnd Bergmann
    Acked-by: Adrian Hunter
    Signed-off-by: Ulf Hansson

    Alexandre Courbot
     
  • This hook was solely used to set the DMA mask, which is now done
    by the newly-added sdhci_set_dma_mask() function.

    The use of a flag to ensure the mask is only set once is a strong hint
    that it should not have been done there anyway.

    Signed-off-by: Alexandre Courbot
    Acked-by: Arnd Bergmann
    Acked-by: Adrian Hunter
    Signed-off-by: Ulf Hansson

    Alexandre Courbot
     
  • Set the DMA mask in sdhci_add_host() after we determined the
    capabilities of the device. 64-bit devices in particular are given the
    proper mask that ensures bounce buffers are not used.

    Also disable DMA if no proper DMA mask can be set, as the DMA-API
    documentation specifies.

    Signed-off-by: Alexandre Courbot
    Acked-by: Adrian Hunter
    Signed-off-by: Ulf Hansson

    Alexandre Courbot
     
  • Pull tty/serial updates from Greg KH:
    "Here's the big tty/serial driver pull request for 4.6-rc1.

    Lots of changes in here, Peter has been on a tear again, with lots of
    refactoring and bugs fixes, many thanks to the great work he has been
    doing. Lots of driver updates and fixes as well, full details in the
    shortlog.

    All have been in linux-next for a while with no reported issues"

    * tag 'tty-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (220 commits)
    serial: 8250: describe CONFIG_SERIAL_8250_RSA
    serial: samsung: optimize UART rx fifo access routine
    serial: pl011: add mark/space parity support
    serial: sa1100: make sa1100_register_uart_fns a function
    tty: serial: 8250: add MOXA Smartio MUE boards support
    serial: 8250: convert drivers to use up_to_u8250p()
    serial: 8250/mediatek: fix building with SERIAL_8250=m
    serial: 8250/ingenic: fix building with SERIAL_8250=m
    serial: 8250/uniphier: fix modular build
    Revert "drivers/tty/serial: make 8250/8250_ingenic.c explicitly non-modular"
    Revert "drivers/tty/serial: make 8250/8250_mtk.c explicitly non-modular"
    serial: mvebu-uart: initial support for Armada-3700 serial port
    serial: mctrl_gpio: Add missing module license
    serial: ifx6x60: avoid uninitialized variable use
    tty/serial: at91: fix bad offset for UART timeout register
    tty/serial: at91: restore dynamic driver binding
    serial: 8250: Add hardware dependency to RT288X option
    TTY, devpts: document pty count limiting
    tty: goldfish: support platform_device with id -1
    drivers: tty: goldfish: Add device tree bindings
    ...

    Linus Torvalds
     

17 Mar, 2016

16 commits

  • 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: a5f5774c55a2 ("mmc: block: Add new ioctl to send multi commands")
    Cc: stable@vger.kernel.org
    Signed-off-by: Shawn Lin
    Signed-off-by: Ulf Hansson

    Shawn Lin
     
  • Using an at91sam9g20ek development board with DTS configuration may trigger
    a kernel panic because of a NULL pointer dereference exception, while
    configuring DMA. Let's fix this by adding a check for pdata before
    dereferencing it.

    Signed-off-by: Brent Taylor
    Cc: stable@vger.kernel.org
    Signed-off-by: Ulf Hansson

    Brent Taylor
     
  • When initializing sdio card, we get struct mmc_card
    from mmc_alloc_card which allocates it by kzalloc. So we
    don't need another memset while reading cccr.

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

    Shawn Lin
     
  • When initializing sd or sdio card, we get struct mmc_card
    from mmc_alloc_card which allocates it by kzalloc. So we don't
    need another memset while decoding cid.

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

    Shawn Lin
     
  • drivers/mmc/host/of_mmc_spi.c: In function 'mmc_spi_get_pdata':
    drivers/mmc/host/of_mmc_spi.c:77:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
    int ret = -EINVAL;
    ^

    Signed-off-by: Brian Norris
    Signed-off-by: Ulf Hansson

    Brian Norris
     
  • This patch adds Generic PHY access for sdhci-of-arasan. Driver
    can get PHY handler from dt-binding, and power-on/init the PHY.
    Currently, it's just mandatory for arasan,sdhci-5.1.

    Signed-off-by: Shawn Lin
    Acked-by: Adrian Hunter
    Signed-off-by: Ulf Hansson

    Shawn Lin
     
  • Currently, some err handling of sdhci_arasan_probe return directly
    without calling sdhci_pltfm_free. This patch fixes them.

    Signed-off-by: Shawn Lin
    Acked-by: Adrian Hunter
    Signed-off-by: Ulf Hansson

    Shawn Lin
     
  • We don't really need disable clk_ahb when failing to resume. Otherwise
    we may take risk of bus error for accessing register without clk_ahb.

    Signed-off-by: Shawn Lin
    Acked-by: Adrian Hunter
    Signed-off-by: Ulf Hansson

    Shawn Lin
     
  • Normally the timeout clock frequency is read from the capabilities
    register. It is also possible to set the value prior to calling
    sdhci_add_host() in which case that value will override the
    capabilities register value. However that was being done after
    calculating max_busy_timeout so that max_busy_timeout was being
    calculated using the wrong value of timeout_clk.

    Fix that by moving the override before max_busy_timeout is
    calculated.

    The result is that the max_busy_timeout and max_discard
    increase for BSW devices so that, for example, the time for
    mkfs.ext4 on a 64GB eMMC drops from about 1 minute 40 seconds
    to about 20 seconds.

    Note, in the future, the capabilities setting will be tidied up
    and this override won't be used anymore. However this fix is
    needed for stable.

    Signed-off-by: Adrian Hunter
    Cc: stable@vger.kernel.org # v3.18+
    Signed-off-by: Ulf Hansson

    Adrian Hunter
     
  • The header file asm/sizes.h is unnecessary, let's remove it.
    This also allows to compile under X86 arch.

    Signed-off-by: Wang Hongcheng
    Signed-off-by: Ulf Hansson

    Wang Hongcheng
     
  • This adds the HIDs for Qualcomm Technologies Inc SDHC
    controllers:
    QCOM8051: non-removable device that does not support 1.8v
    QCOM8052: non-removable device that does support 1.8v

    Signed-off-by: Philip Elcan
    Acked-by: Adrian Hunter
    Signed-off-by: Ulf Hansson

    Philip Elcan
     
  • The Tegra30+ SDMMC module has memcomp pads that are used to
    automatically find and set the correct drive strength settings to
    the sdmmc pads. The calibration needs to be manually kicked off
    when the card signal voltage is changed, after the card clock is
    supplied again.

    Signed-off-by: Lucas Stach
    Acked-by: Adrian Hunter
    [Ulf: Rebased to fix a trivial compile error]
    Signed-off-by: Ulf Hansson

    Lucas Stach
     
  • We've introduced a new helper in the MMC core:
    mmc_regulator_set_vqmmc(). Let's use this in mtk-sd. Using this new
    helper has some advantages:

    1. We get the mmc_regulator_set_vqmmc() behavior of trying to match
    VQMMC and VMMC when the signal voltage is 3.3V. This ensures max
    compatibility.

    2. We get rid of a few more warnings when probing unsupported
    voltages.

    3. We get rid of some non-mediatek specific code in mtk-sd.

    Signed-off-by: Nicolas Boichat
    Reviewed-by: Douglas Anderson
    Signed-off-by: Ulf Hansson

    Nicolas Boichat
     
  • In commit ceae98f20e36 ("mmc: core: Try other signal levels
    during power up") we can see that there are times when it's
    valid to try several signal voltages. Don't print an ugly
    error in the logs when that happens.

    Signed-off-by: Nicolas Boichat
    Reviewed-by: Douglas Anderson
    Signed-off-by: Ulf Hansson

    Nicolas Boichat
     
  • Make use of ARCH_RENESAS in place of ARCH_SHMOBILE.

    This is part of an ongoing process to migrate from ARCH_SHMOBILE to
    ARCH_RENESAS the motivation for which being that RENESAS seems to be a more
    appropriate name than SHMOBILE for the majority of Renesas ARM based SoCs.

    Signed-off-by: Simon Horman
    Acked-by: Geert Uytterhoeven
    Signed-off-by: Ulf Hansson

    Simon Horman
     
  • The new code to do the clock rate setting externally to the SDMMC
    module has a shortcut to not propagate changes with a 0 rate to
    the CAR by simply bailing out. This breaks proper cutting of the
    card clock. Fix it by directly calling the correct sdhci function.

    Fixes: a8e326a911d3 "mmc: tegra: implement module external clock change"
    Signed-off-by: Lucas Stach
    Acked-by: Adrian Hunter
    Cc: stable@vger.kernel.org
    Signed-off-by: Ulf Hansson

    Lucas Stach
     

16 Mar, 2016

2 commits

  • This patch fixes the MMC SPI driver from doing polling card detect when a
    CD GPIO that supports interrupts is specified using the gpios DT property.

    Without this patch the DT node below results in the following output:

    spi_gpio: spi-gpio { /* SD2 @ CN12 */
    compatible = "spi-gpio";
    #address-cells = ;
    #size-cells = ;
    gpio-sck = ;
    gpio-mosi = ;
    gpio-miso = ;
    num-chipselects = ;
    cs-gpios = ;
    status = "okay";

    spi@0 {
    compatible = "mmc-spi-slot";
    reg = ;
    voltage-ranges = ;
    spi-max-frequency = ;
    gpios = ; /* CD */
    };
    };

    # dmesg | grep mmc
    mmc_spi spi32766.0: SD/MMC host mmc0, no WP, no poweroff, cd polling
    mmc0: host does not support reading read-only switch, assuming write-enable
    mmc0: new SDHC card on SPI
    mmcblk0: mmc0:0000 SU04G 3.69 GiB
    mmcblk0: p1

    With this patch applied the "cd polling" portion above disappears.

    Signed-off-by: Magnus Damm
    Cc: stable@vger.kernel.org # v3.18+
    Signed-off-by: Ulf Hansson

    Magnus Damm
     
  • SD card support for Tegra114 started failing after commit a8e326a911d3
    ("mmc: tegra: implement module external clock change") was merged. This
    commit was part of a series to enable UHS-I modes for Tegra. To
    workaround this problem for now, disable UHS-I modes for Tegra114 by
    separating the soc data structures for Tegra114 and Tegra124 so that
    UHS-I is still enabled for Tegra124 but not Tegra114.

    Fixes: a8e326a911d3 ("mmc: tegra: implement module external clock change")
    Signed-off-by: Jon Hunter
    Reviewed-by: Lucas Stach
    Acked-by: Thierry Reding
    Acked-by: Adrian Hunter
    Cc: stable@vger.kernel.org
    Signed-off-by: Ulf Hansson

    Jon Hunter
     

29 Feb, 2016

16 commits