1. 20 2月, 2019 1 次提交
  2. 13 2月, 2019 7 次提交
  3. 07 2月, 2019 3 次提交
  4. 31 1月, 2019 2 次提交
  5. 26 1月, 2019 1 次提交
    • J
      mmc: atmel-mci: do not assume idle after atmci_request_end · c21991ed
      Jonas Danielsson 提交于
      [ Upstream commit ae460c115b7aa50c9a36cf78fced07b27962c9d0 ]
      
      On our AT91SAM9260 board we use the same sdio bus for wifi and for the
      sd card slot. This caused the atmel-mci to give the following splat on
      the serial console:
      
        ------------[ cut here ]------------
        WARNING: CPU: 0 PID: 538 at drivers/mmc/host/atmel-mci.c:859 atmci_send_command+0x24/0x44
        Modules linked in:
        CPU: 0 PID: 538 Comm: mmcqd/0 Not tainted 4.14.76 #14
        Hardware name: Atmel AT91SAM9
        [<c000fccc>] (unwind_backtrace) from [<c000d3dc>] (show_stack+0x10/0x14)
        [<c000d3dc>] (show_stack) from [<c0017644>] (__warn+0xd8/0xf4)
        [<c0017644>] (__warn) from [<c0017704>] (warn_slowpath_null+0x1c/0x24)
        [<c0017704>] (warn_slowpath_null) from [<c033bb9c>] (atmci_send_command+0x24/0x44)
        [<c033bb9c>] (atmci_send_command) from [<c033e984>] (atmci_start_request+0x1f4/0x2dc)
        [<c033e984>] (atmci_start_request) from [<c033f3b4>] (atmci_request+0xf0/0x164)
        [<c033f3b4>] (atmci_request) from [<c0327108>] (mmc_start_request+0x280/0x2d0)
        [<c0327108>] (mmc_start_request) from [<c032800c>] (mmc_start_areq+0x230/0x330)
        [<c032800c>] (mmc_start_areq) from [<c03366f8>] (mmc_blk_issue_rw_rq+0xc4/0x310)
        [<c03366f8>] (mmc_blk_issue_rw_rq) from [<c03372c4>] (mmc_blk_issue_rq+0x118/0x5ac)
        [<c03372c4>] (mmc_blk_issue_rq) from [<c033781c>] (mmc_queue_thread+0xc4/0x118)
        [<c033781c>] (mmc_queue_thread) from [<c002daf8>] (kthread+0x100/0x118)
        [<c002daf8>] (kthread) from [<c000a580>] (ret_from_fork+0x14/0x34)
        ---[ end trace 594371ddfa284bd6 ]---
      
      This is:
        WARN_ON(host->cmd);
      
      This was fixed on our board by letting atmci_request_end determine what
      state we are in. Instead of unconditionally setting it to STATE_IDLE on
      STATE_END_REQUEST.
      Signed-off-by: NJonas Danielsson <jonas@orbital-systems.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      c21991ed
  6. 23 1月, 2019 1 次提交
  7. 29 12月, 2018 1 次提交
    • R
      mmc: omap_hsmmc: fix DMA API warning · 0867cfaa
      Russell King 提交于
      commit 0b479790 upstream.
      
      While booting with rootfs on MMC, the following warning is encountered
      on OMAP4430:
      
      omap-dma-engine 4a056000.dma-controller: DMA-API: mapping sg segment longer than device claims to support [len=69632] [max=65536]
      
      This is because the DMA engine has a default maximum segment size of 64K
      but HSMMC sets:
      
              mmc->max_blk_size = 512;       /* Block Length at max can be 1024 */
              mmc->max_blk_count = 0xFFFF;    /* No. of Blocks is 16 bits */
              mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count;
              mmc->max_seg_size = mmc->max_req_size;
      
      which ends up telling the block layer that we support a maximum segment
      size of 65535*512, which exceeds the advertised DMA engine capabilities.
      
      Fix this by clamping the maximum segment size to the lower of the
      maximum request size and of the DMA engine device used for either DMA
      channel.
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0867cfaa
  8. 20 12月, 2018 3 次提交
    • A
      mmc: sdhci: fix the timeout check window for clock and reset · 113fe99d
      Alek Du 提交于
      commit b704441e upstream.
      
      We observed some premature timeouts on a virtualization platform, the log
      is like this:
      
      case 1:
      [159525.255629] mmc1: Internal clock never stabilised.
      [159525.255818] mmc1: sdhci: ============ SDHCI REGISTER DUMP ===========
      [159525.256049] mmc1: sdhci: Sys addr:  0x00000000 | Version:  0x00001002
      ...
      [159525.257205] mmc1: sdhci: Wake-up:   0x00000000 | Clock:    0x0000fa03
      From the clock control register dump, we are pretty sure the clock was
      stablized.
      
      case 2:
      [  914.550127] mmc1: Reset 0x2 never completed.
      [  914.550321] mmc1: sdhci: ============ SDHCI REGISTER DUMP ===========
      [  914.550608] mmc1: sdhci: Sys addr:  0x00000010 | Version:  0x00001002
      
      After checking the sdhci code, we found the timeout check actually has a
      little window that the CPU can be scheduled out and when it comes back,
      the original time set or check is not valid.
      
      Fixes: 5a436cc0 ("mmc: sdhci: Optimize delay loops")
      Cc: stable@vger.kernel.org      # v4.12+
      Signed-off-by: NAlek Du <alek.du@intel.com>
      Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      113fe99d
    • F
      mmc: sdhci-omap: Fix DCRC error handling during tuning · 661feb2f
      Faiz Abbas 提交于
      commit db2039fc upstream.
      
      Commit 7d33c358 ("mmc: sdhci-omap: Workaround for Errata i802")
      disabled DCRC interrupts during tuning. This write to the interrupt
      enable register gets overwritten in sdhci_prepare_data() and the
      interrupt is not in fact disabled. Fix this by disabling the interrupt
      in the host->ier variable.
      
      Fixes: 7d33c358 ("mmc: sdhci-omap: Workaround for Errata i802")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NFaiz Abbas <faiz_abbas@ti.com>
      Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      661feb2f
    • A
      MMC: OMAP: fix broken MMC on OMAP15XX/OMAP5910/OMAP310 · e1e99fea
      Aaro Koskinen 提交于
      commit e8cde625 upstream.
      
      Since v2.6.22 or so there has been reports [1] about OMAP MMC being
      broken on OMAP15XX based hardware (OMAP5910 and OMAP310). The breakage
      seems to have been caused by commit 46a6730e ("mmc-omap: Fix
      omap to use MMC_POWER_ON") that changed clock enabling to be done
      on MMC_POWER_ON. This can happen multiple times in a row, and on 15XX
      the hardware doesn't seem to like it and the MMC just stops responding.
      Fix by memorizing the power mode and do the init only when necessary.
      
      Before the patch (on Palm TE):
      
      	mmc0: new SD card at address b368
      	mmcblk0: mmc0:b368 SDC   977 MiB
      	mmci-omap mmci-omap.0: command timeout (CMD18)
      	mmci-omap mmci-omap.0: command timeout (CMD13)
      	mmci-omap mmci-omap.0: command timeout (CMD13)
      	mmci-omap mmci-omap.0: command timeout (CMD12) [x 6]
      	mmci-omap mmci-omap.0: command timeout (CMD13) [x 6]
      	mmcblk0: error -110 requesting status
      	mmci-omap mmci-omap.0: command timeout (CMD8)
      	mmci-omap mmci-omap.0: command timeout (CMD18)
      	mmci-omap mmci-omap.0: command timeout (CMD13)
      	mmci-omap mmci-omap.0: command timeout (CMD13)
      	mmci-omap mmci-omap.0: command timeout (CMD12) [x 6]
      	mmci-omap mmci-omap.0: command timeout (CMD13) [x 6]
      	mmcblk0: error -110 requesting status
      	mmcblk0: recovery failed!
      	print_req_error: 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
      
      After the patch:
      
      	mmc0: new SD card at address b368
      	mmcblk0: mmc0:b368 SDC   977 MiB
      	 mmcblk0: p1
      
      The patch is based on a fix and analysis done by Ladislav Michl.
      
      Tested on OMAP15XX/OMAP310 (Palm TE), OMAP1710 (Nokia 770)
      and OMAP2420 (Nokia N810).
      
      [1] https://marc.info/?t=123175197000003&r=1&w=2
      
      Fixes: 46a6730e ("mmc-omap: Fix omap to use MMC_POWER_ON")
      Reported-by: NLadislav Michl <ladis@linux-mips.org>
      Reported-by: NAndrzej Zaborowski <balrogg@gmail.com>
      Tested-by: NLadislav Michl <ladis@linux-mips.org>
      Acked-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NAaro Koskinen <aaro.koskinen@iki.fi>
      Cc: stable@vger.kernel.org
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e1e99fea
  9. 01 12月, 2018 2 次提交
    • A
      mmc: sdhci-pci: Workaround GLK firmware failing to restore the tuning value · 6d24302a
      Adrian Hunter 提交于
      commit 5305ec6a upstream.
      
      GLK firmware can indicate that the tuning value will be restored after
      runtime suspend, but not actually do that. Add a workaround that detects
      such cases, and lets the driver do re-tuning instead.
      Reported-by: NAnisse Astier <anisse@astier.eu>
      Tested-by: NAnisse Astier <anisse@astier.eu>
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6d24302a
    • R
      mmc: sdhci-pci: Try "cd" for card-detect lookup before using NULL · 52f40362
      Rajat Jain 提交于
      commit cdcefe6b upstream.
      
      Problem:
      
      The card detect IRQ does not work with modern BIOS (that want
      to use _DSD to provide the card detect GPIO to the driver).
      
      Details:
      
      The mmc core provides the mmc_gpiod_request_cd() API to let host drivers
      request the gpio descriptor for the "card detect" pin.
      This pin is specified in the ACPI for the SDHC device:
      
       * Either as a resource using _CRS. This is a method used by legacy BIOS.
         (The driver needs to tell which resource index).
      
       * Or as a named property ("cd-gpios"/"cd-gpio") in _DSD (which internally
         points to an entry in _CRS). This way, the driver can lookup using a
         string. This is what modern BIOS prefer to use.
      
      This API finally results in a call to the following code:
      
      struct gpio_desc *acpi_find_gpio(..., const char *con_id,...)
      {
      ...
         /* Lookup gpio (using "<con_id>-gpio") in the _DSD */
      ...
         if (!acpi_can_fallback_to_crs(adev, con_id))
                return ERR_PTR(-ENOENT);
      ...
         /* Falling back to _CRS is allowed, Lookup gpio in the _CRS */
      ...
      }
      
      Note that this means that if the ACPI has _DSD properties, the kernel
      will never use _CRS for the lookup (Because acpi_can_fallback_to_crs()
      will always be false for any device hat has _DSD entries).
      
      The SDHCI driver is thus currently broken on a modern BIOS, even if
      BIOS provides both _CRS (for index based lookup) and _DSD entries (for
      string based lookup). Ironically, none of these will be used for the
      lookup currently because:
      
      * Since the con_id is NULL, acpi_find_gpio() does not find a matching
        entry in DSDT. (The _DSDT entry has the property name = "cd-gpios")
      
      * Because ACPI contains DSDT entries, thus acpi_can_fallback_to_crs()
        returns false (because device properties have been populated from
        _DSD), thus the _CRS is never used for the lookup.
      
      Fix:
      
      Try "cd" for lookup in the _DSD before falling back to using NULL so
      as to try looking up in the _CRS.
      
      I've tested this patch successfully with both Legacy BIOS (that
      provide only _CRS method) as well as modern BIOS (that provide both
      _CRS and _DSD). Also the use of "cd" appears to be fairly consistent
      across other users of this API (other MMC host controller drivers).
      
      Link: https://lkml.org/lkml/2018/9/25/1113Signed-off-by: NRajat Jain <rajatja@google.com>
      Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
      Fixes: f10e4bf6 ("gpio: acpi: Even more tighten up ACPI GPIO lookups")
      Cc: stable@vger.kernel.org
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      52f40362
  10. 14 11月, 2018 2 次提交
  11. 18 9月, 2018 1 次提交
  12. 05 9月, 2018 1 次提交
    • J
      mmc: meson-mx-sdio: fix OF child-node lookup · c483a5cc
      Johan Hovold 提交于
      Use the new of_get_compatible_child() helper to lookup the slot child
      node instead of using of_find_compatible_node(), which searches the
      entire tree from a given start node and thus can return an unrelated
      (i.e. non-child) node.
      
      This also addresses a potential use-after-free (e.g. after probe
      deferral) as the tree-wide helper drops a reference to its first
      argument (i.e. the node of the device being probed).
      
      While at it, also fix up the related slot-node reference leak.
      
      Fixes: ed80a13b ("mmc: meson-mx-sdio: Add a driver for the Amlogic Meson8 and Meson8b SoCs")
      Cc: stable <stable@vger.kernel.org>     # 4.15
      Cc: Carlo Caione <carlo@endlessm.com>
      Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
      Cc: Ulf Hansson <ulf.hansson@linaro.org>
      Acked-by: NMartin Blumenstingl <martin.blumenstingl@googlemail.com>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      c483a5cc
  13. 04 9月, 2018 1 次提交
    • A
      mmc: omap_hsmmc: fix wakeirq handling on removal · 3c398f3c
      Andreas Kemnade 提交于
      after unbinding mmc I get things like this:
      [  185.294067] mmc1: card 0001 removed
      [  185.305206] omap_hsmmc 480b4000.mmc: wake IRQ with no resume: -13
      
      The wakeirq stays in /proc-interrupts
      
      rebinding shows this:
      [  289.795959] genirq: Flags mismatch irq 112. 0000200a (480b4000.mmc:wakeup) vs. 0000200a (480b4000.mmc:wakeup)
      [  289.808959] omap_hsmmc 480b4000.mmc: Unable to request wake IRQ
      [  289.815338] omap_hsmmc 480b4000.mmc: no SDIO IRQ support, falling back to polling
      
      That bug seems to be introduced by switching from devm_request_irq()
      to generic wakeirq handling.
      
      So let us cleanup at removal.
      Signed-off-by: NAndreas Kemnade <andreas@kemnade.info>
      Fixes: 5b83b223 ("mmc: omap_hsmmc: Change wake-up interrupt to use generic wakeirq")
      Cc: stable@vger.kernel.org # v4.2+
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      3c398f3c
  14. 23 8月, 2018 2 次提交
  15. 21 8月, 2018 2 次提交
  16. 01 8月, 2018 6 次提交
  17. 30 7月, 2018 4 次提交