Commit graph

1154733 commits

Author SHA1 Message Date
Shawn Lin b75a52b0dd mmc: sdhci-of-dwcmshc: Update DLL and pre-change delay for rockchip platform
For Rockchip platform, DLL bypass bit and start bit need to be set if
DLL is not locked. And adjust pre-change delay to 0x3 for better signal
test result.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Link: https://lore.kernel.org/r/1675298118-64243-2-git-send-email-shawn.lin@rock-chips.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-02-14 00:34:57 +01:00
Paul Cercueil 152b5245e3 mmc: jz4740: Add support for vqmmc power supply
Support enabling / disabling the vqmmc power supply if it was provided
by the firmware.

Provide the .start_signal_voltage_switch callback to change the voltage
of the external vqmmc power supply.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20230131210229.68129-2-paul@crapouillou.net
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-02-14 00:27:13 +01:00
Ulf Hansson fe3e137c6d mmc: Merge branch fixes into next
Merge the mmc fixes for v6.2-rc[n] into the next branch, to allow them to
get tested together with the new mmc changes that are targeted for v6.3.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-02-14 00:19:41 +01:00
Paul Cercueil 3f18c5046e mmc: jz4740: Work around bug on JZ4760(B)
On JZ4760 and JZ4760B, SD cards fail to run if the maximum clock
rate is set to 50 MHz, even though the controller officially does
support it.

Until the actual bug is found and fixed, limit the maximum clock rate to
24 MHz.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20230131210229.68129-1-paul@crapouillou.net
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-02-14 00:14:05 +01:00
Yang Yingliang cf4c9d2ac1 mmc: mmc_spi: fix error handling in mmc_spi_probe()
If mmc_add_host() fails, it doesn't need to call mmc_remove_host(),
or it will cause null-ptr-deref, because of deleting a not added
device in mmc_remove_host().

To fix this, goto label 'fail_glue_init', if mmc_add_host() fails,
and change the label 'fail_add_host' to 'fail_gpiod_request'.

Fixes: 15a0580ced ("mmc_spi host driver")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Cc:stable@vger.kernel.org
Link: https://lore.kernel.org/r/20230131013835.3564011-1-yangyingliang@huawei.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-02-14 00:09:17 +01:00
Yang Yingliang 605d9fb955 mmc: sdio: fix possible resource leaks in some error paths
If sdio_add_func() or sdio_init_func() fails, sdio_remove_func() can
not release the resources, because the sdio function is not presented
in these two cases, it won't call of_node_put() or put_device().

To fix these leaks, make sdio_func_present() only control whether
device_del() needs to be called or not, then always call of_node_put()
and put_device().

In error case in sdio_init_func(), the reference of 'card->dev' is
not get, to avoid redundant put in sdio_free_func_cis(), move the
get_device() to sdio_alloc_func() and put_device() to sdio_release_func(),
it can keep the get/put function be balanced.

Without this patch, while doing fault inject test, it can get the
following leak reports, after this fix, the leak is gone.

unreferenced object 0xffff888112514000 (size 2048):
  comm "kworker/3:2", pid 65, jiffies 4294741614 (age 124.774s)
  hex dump (first 32 bytes):
    00 e0 6f 12 81 88 ff ff 60 58 8d 06 81 88 ff ff  ..o.....`X......
    10 40 51 12 81 88 ff ff 10 40 51 12 81 88 ff ff  .@Q......@Q.....
  backtrace:
    [<000000009e5931da>] kmalloc_trace+0x21/0x110
    [<000000002f839ccb>] mmc_alloc_card+0x38/0xb0 [mmc_core]
    [<0000000004adcbf6>] mmc_sdio_init_card+0xde/0x170 [mmc_core]
    [<000000007538fea0>] mmc_attach_sdio+0xcb/0x1b0 [mmc_core]
    [<00000000d4fdeba7>] mmc_rescan+0x54a/0x640 [mmc_core]

unreferenced object 0xffff888112511000 (size 2048):
  comm "kworker/3:2", pid 65, jiffies 4294741623 (age 124.766s)
  hex dump (first 32 bytes):
    00 40 51 12 81 88 ff ff e0 58 8d 06 81 88 ff ff  .@Q......X......
    10 10 51 12 81 88 ff ff 10 10 51 12 81 88 ff ff  ..Q.......Q.....
  backtrace:
    [<000000009e5931da>] kmalloc_trace+0x21/0x110
    [<00000000fcbe706c>] sdio_alloc_func+0x35/0x100 [mmc_core]
    [<00000000c68f4b50>] mmc_attach_sdio.cold.18+0xb1/0x395 [mmc_core]
    [<00000000d4fdeba7>] mmc_rescan+0x54a/0x640 [mmc_core]

Fixes: 3d10a1ba0d ("sdio: fix reference counting in sdio_remove_func()")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20230130125808.3471254-1-yangyingliang@huawei.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-02-14 00:06:22 +01:00
Jonathan Neuschäfer 565e468424 dt-bindings: mmc: fsl-imx-esdhc: Improve grammar and fix a typo
This makes the text read a little better.

Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230129130059.1322858-1-j.neuschaefer@gmx.net
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-02-14 00:01:30 +01:00
Heiner Kallweit 6ea6b95a7e mmc: meson-gx: fix SDIO mode if cap_sdio_irq isn't set
Some SDIO WiFi modules stopped working after SDIO interrupt mode
was added if cap_sdio_irq isn't set in device tree. This patch was
confirmed to fix the issue.

Fixes: 066ecde6d8 ("mmc: meson-gx: add SDIO interrupt support")
Reported-by: Geraldo Nascimento <geraldogabriel@gmail.com>
Tested-by: Geraldo Nascimento <geraldogabriel@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Link: https://lore.kernel.org/r/816cba9f-ff92-31a2-60f0-aca542d1d13e@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-02-13 23:58:43 +01:00
Heiner Kallweit 418f7c2de1 mmc: meson-gx: use devm_mmc_alloc_host
Use new function devm_mmc_alloc_host() to simplify the code.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Link: https://lore.kernel.org/r/728f159b-885f-c78a-1a3d-f55c245250e1@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-02-13 23:55:44 +01:00
Heiner Kallweit 80df83c2c5 mmc: core: add devm_mmc_alloc_host
Add a device-managed version of mmc_alloc_host().

The argument order is reversed compared to mmc_alloc_host() because
device-managed functions typically have the device argument first.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Link: https://lore.kernel.org/r/6d8f9fdc-7c9e-8e4f-e6ef-5470b971c74e@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-02-13 23:55:43 +01:00
Linus Walleij 56f34e8ddc memstick: core: Imply IOSCHED_BFQ
If we enable the memory stick block layer, use Kconfig to imply
the BFQ I/O scheduler.

As all memstick devices are single-queue, this is the scheduler that
users want so let's be helpful and make sure it gets
default-selected into a manual kernel configuration. It will still
need to be enabled at runtime (usually with udev scripts).

Cc: linux-block@vger.kernel.org
Cc: Paolo Valente <paolo.valente@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230131085220.1038241-1-linus.walleij@linaro.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-02-02 16:02:06 +01:00
Linus Walleij 1444fed25b mmc: core: Imply IOSCHED_BFQ
If we enable the MMC/SD block layer, use Kconfig to imply the BFQ
I/O scheduler.

As all MMC/SD devices are single-queue, this is the scheduler that
users want so let's be helpful and make sure it gets
default-selected into a manual kernel configuration. It will still
need to be enabled at runtime (usually with udev scripts).

Cc: linux-block@vger.kernel.org
Cc: Paolo Valente <paolo.valente@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230131084742.1038135-1-linus.walleij@linaro.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-02-02 16:02:02 +01:00
Kunihiko Hayashi 2cda1de0cb mmc: uniphier-sd: Add control to switch UHS speed
SD interface logic has the register to switch UHS speed.
The default is up to SDR25 and to support SDR50 or faster,
add uniphier_sd_speed_switch() function to switch the speed mode.

Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Link: https://lore.kernel.org/r/20230125010201.28246-4-hayashi.kunihiko@socionext.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-01-27 11:55:50 +01:00
Kunihiko Hayashi 1c325ed9f9 mmc: uniphier-sd: Add control of UHS mode using SD interface logic
Transition of UHS mode needs to control the register in SD interface
logic. Add access to the register in the logic using the regmap from
"socionext,syscon-uhs-mode" property.

Define the start_signal_voltage_switch function only if UHS mode is
available.

Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Link: https://lore.kernel.org/r/20230125010201.28246-3-hayashi.kunihiko@socionext.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-01-27 11:55:50 +01:00
Kunihiko Hayashi 388dcd9505 dt-bindings: mmc: uniphier-sd: Add socionext,syscon-uhs-mode property
UHS mode control is included in the interface logic represented
by syscon. To refer this, add new property "socionext,syscon-uhs-mode".

Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230125010201.28246-2-hayashi.kunihiko@socionext.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-01-27 11:55:32 +01:00
Tobias Schramm eca5bd666b mmc: atmel-mci: fix race between stop command and start of next command
This commit fixes a race between completion of stop command and start of a
new command.
Previously the command ready interrupt was enabled before stop command
was written to the command register. This caused the command ready
interrupt to fire immediately since the CMDRDY flag is asserted constantly
while there is no command in progress.
Consequently the command state machine will immediately advance to the
next state when the tasklet function is executed again, no matter
actual completion state of the stop command.
Thus a new command can then be dispatched immediately, interrupting and
corrupting the stop command on the CMD line.
Fix that by dropping the command ready interrupt enable before calling
atmci_send_stop_cmd. atmci_send_stop_cmd does already enable the
command ready interrupt, no further writes to ATMCI_IER are necessary.

Signed-off-by: Tobias Schramm <t.schramm@manjaro.org>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Link: https://lore.kernel.org/r/20221230194315.809903-2-t.schramm@manjaro.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-01-27 11:35:17 +01:00
Kathiravan T d5d4a2bc5f dt-bindings: mmc: sdhci-msm: add IPQ5332 compatible
The IPQ5332 supports eMMC with an SDHCI controller. Add the appropriate
compatible to the documentation.

Signed-off-by: Kathiravan T <quic_kathirav@quicinc.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230125104520.89684-9-quic_kathirav@quicinc.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-01-27 11:22:23 +01:00
devi priya 124a4c13a8 dt-bindings: mmc: sdhci-msm: Document the IPQ9574 compatible
Document the compatible for SDHCI on IPQ9574.

Signed-off-by: devi priya <quic_devipriy@quicinc.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230124141541.8290-7-quic_devipriy@quicinc.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-01-27 11:15:22 +01:00
Neil Armstrong b1d908e6c7 dt-bindings: mmc: convert amlogic,meson-gx.txt to dt-schema
Convert the Amlogic SD / eMMC controller for S905/GXBB family SoCs
to dt-schema.

Take in account the used variant with amlogic,meson-gx-mmc.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20221117-b4-amlogic-bindings-convert-v3-6-e28dd31e3bed@linaro.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-01-24 13:33:55 +01:00
Krzysztof Kozlowski bb065c6fe6 dt-bindings: mmc: correct pwrseq node names
Node names should be generic and should not contain underscores.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/r/20230120085722.171965-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-01-24 13:31:28 +01:00
Krzysztof Kozlowski 1e52a7e679 dt-bindings: mmc: drop unneeded quotes
Cleanup by removing unneeded quotes from refs and redundant blank lines.
No functional impact except adjusting to preferred coding style.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com> # for Renesas controllers
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230120085722.171965-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-01-24 13:30:30 +01:00
Doug Brown c6ecb0f849 dt-bindings: mmc: sdhci-pxa: add pxav1
Add a compatible for the pxav1 controller in the PXA168, along with
optional pinctrl properties to use for an errata workaround.

Signed-off-by: Doug Brown <doug@schmorgal.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230116194401.20372-9-doug@schmorgal.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-01-24 11:56:41 +01:00
Doug Brown f35ca22388 mmc: sdhci-pxav2: add optional pinctrl for SDIO IRQ workaround
The PXA168 errata recommends that the CMD signal should be detached from
the SD bus while performing the dummy CMD0 to restart the clock.
Implement this using pinctrl states.

Signed-off-by: Doug Brown <doug@schmorgal.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20230116194401.20372-8-doug@schmorgal.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-01-24 11:56:41 +01:00
Doug Brown 24552ccb4f mmc: sdhci-pxav2: add SDIO card IRQ workaround for PXA168 V1 controller
The PXA168 has a documented silicon bug that causes SDIO card IRQs to be
missed. Implement the first half of the suggested workaround, which
involves resetting the data port logic and issuing a dummy CMD0 to
restart the clock.

Signed-off-by: Doug Brown <doug@schmorgal.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20230116194401.20372-7-doug@schmorgal.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-01-24 11:56:41 +01:00
Doug Brown e41c48b4bc mmc: sdhci-pxav2: add optional core clock
Add ability to have an optional core clock just like the pxav3 driver.
The PXA168 needs this because its SDHC controllers have separate core
and io clocks that both need to be enabled. This also correctly matches
the documented devicetree bindings for this driver.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Doug Brown <doug@schmorgal.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20230116194401.20372-6-doug@schmorgal.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-01-24 11:56:41 +01:00
Doug Brown c7c60bf628 mmc: sdhci-pxav2: change clock name to match DT bindings
The devicetree bindings for this driver specify that the two allowed
clock names are io and core. Change this driver to look for io, but
allow any name if it fails for backwards compatibility. Follow the same
pattern used in sdhci-pxav3, but add support for EPROBE_DEFER.

Get rid of an unnecessary pdev->dev while we're at it.

Signed-off-by: Doug Brown <doug@schmorgal.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20230116194401.20372-5-doug@schmorgal.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-01-24 11:56:41 +01:00
Doug Brown 7f7a201ad1 mmc: sdhci-pxav2: add register workaround for PXA168 silicon bug
The PXA168 has a documented silicon bug that results in a data abort
exception when accessing the SDHCI_HOST_VERSION register on SDH2 and
SDH4 through a 16-bit read. Implement the workaround described in the
errata, which performs a 32-bit read from a lower address instead. This
is safe to use on all four SDH peripherals.

Signed-off-by: Doug Brown <doug@schmorgal.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20230116194401.20372-4-doug@schmorgal.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-01-24 11:56:41 +01:00
Doug Brown e764395080 mmc: sdhci-pxav2: enable CONFIG_MMC_SDHCI_IO_ACCESSORS
Enable CONFIG_MMC_SDHCI_IO_ACCESSORS for the pxav2 driver. The read_w
callback is needed for a silicon bug workaround in the PXA168.

Signed-off-by: Doug Brown <doug@schmorgal.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20230116194401.20372-3-doug@schmorgal.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-01-24 11:56:40 +01:00
Doug Brown dfe9746aed mmc: sdhci-pxav2: add initial support for PXA168 V1 controller
Add a new compatible string for the version 1 controller used in the
PXA168, along with necessary quirks. Use a separate ops struct in
preparation for a silicon bug workaround only necessary on V1.

Signed-off-by: Doug Brown <doug@schmorgal.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20230116194401.20372-2-doug@schmorgal.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-01-24 11:56:40 +01:00
Lukas Wunner 05f0430f92 mmc: pwrseq_sd8787: Allow being built-in irrespective of dependencies
pwrseq_sd8787 is forced to be built as a module if its dependencies are.

That's unnecessary, it's perfectly fine for it to be built-in even
though the wireless drivers that need it are modules.

Relax the depends definition in Kconfig accordingly.

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Cc: Matt Ranostay <matt@ranostay.consulting>
Cc: Lubomir Rintel <lkundrak@v3.sk>
Cc: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/8bb3d7c3a36985e030ba40e853c57578de8fb303.1673866725.git.lukas@wunner.de
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-01-23 15:51:39 +01:00
Andreas Kemnade 671112068a dt-bindings: mmc: fsl-imx-esdhc: Add some compatible fallbacks
Currently make dtbs_check shows lots of errors because imx*.dtsi does
not use single compatibles but combinations of them.

Add fallbacks for imx6sll/ull which are useful for U-Boot.

This will significantly reduce noise on make dtbs_check.

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230115195212.2530087-1-andreas@kemnade.info
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-01-23 15:51:39 +01:00
Geert Uytterhoeven 883e5ac6ee dt-bindings: mmc: renesas,sdhi: Fix RZ/V2M clock description
The SD Card/MMC interface on the Renesas RZ/V2M SoC uses 4 clocks, like
on RZ/G2L SoCs.

The current description specifies 3 clocks, like on R-Car Gen3, which
will lead to "make dtbs_check" failures:

    arch/arm64/boot/dts/renesas/r9a09g011-v2mevk2.dtb: mmc@85000000: clocks: [[3, 1, 18], [3, 1, 20], [3, 1, 19], [3, 1, 17]] is too long
	    From schema: Documentation/devicetree/bindings/mmc/renesas,sdhi.yaml

Fixes: c8dbdf2a1044951b ("dt-bindings: mmc: renesas,sdhi: Document RZ/V2M support")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Fabrizio Castro <fabrizio.castro.jz@renesas.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/054c9f4dbb0bb1525f780d1e85c724436465c20c.1673270716.git.geert+renesas@glider.be
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-01-23 15:51:39 +01:00
Liming Sun 95921151e0 mmc: sdhci-of-dwcmshc: enable host V4 support for BlueField-3 SoC
This commit enables SDHCI Host V4 support on Bluefield-3 SoC to be
consistent with the default setting in firmware(UEFI).

Reviewed-by: David Woods <davwoods@nvidia.com>
Signed-off-by: Liming Sun <limings@nvidia.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/990885f566c32ac8e6888ad6b434fb70d1a5d7af.1673460632.git.limings@nvidia.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-01-23 15:51:39 +01:00
Adrian Hunter 681b9596ed mmc: sdhci: Remove SDHCI_QUIRK_MISSING_CAPS
Now that it is no longer used, remove SDHCI_QUIRK_MISSING_CAPS.

Note, from now on, __sdhci_read_caps() should be used to provide missing
capability flags.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20230113110011.129835-7-adrian.hunter@intel.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-01-23 15:51:38 +01:00
Adrian Hunter f3200164b4 mmc: sdhci-iproc: Replace SDHCI_QUIRK_MISSING_CAPS
SDHCI_QUIRK_MISSING_CAPS is not needed because __sdhci_read_caps() can be
called instead.

In preparation to get rid of SDHCI_QUIRK_MISSING_CAPS, replace
SDHCI_QUIRK_MISSING_CAPS with __sdhci_read_caps().

__sdhci_read_caps() is also called from sdhci_setup_host() via
sdhci_read_caps(), however only the first call to __sdhci_read_caps() does
anything because after that host->read_caps has been set to true.

Note, __sdhci_read_caps() does more than just set host->caps, such as do a
reset, so calling __sdhci_read_caps() earlier could have unforeseen
side-effects. However the code flow has been reviewed with that in mind.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Scott Branden <scott.branden@broadcom.com>
Link: https://lore.kernel.org/r/20230113110011.129835-6-adrian.hunter@intel.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-01-23 15:51:38 +01:00
Adrian Hunter 4f1896ddf6 mmc: sdhci-pxav3: Replace SDHCI_QUIRK_MISSING_CAPS
SDHCI_QUIRK_MISSING_CAPS is not needed because sdhci_read_caps() can be
called instead.

In preparation to get rid of SDHCI_QUIRK_MISSING_CAPS, replace
SDHCI_QUIRK_MISSING_CAPS with sdhci_read_caps().

__sdhci_read_caps() is also called from sdhci_setup_host() via
sdhci_read_caps(), however only the first call to __sdhci_read_caps() does
anything because after that host->read_caps has been set to true.

Note, __sdhci_read_caps() does more than just set host->caps, such as do a
reset, so calling __sdhci_read_caps() earlier could have unforeseen
side-effects. However the code flow has been reviewed with that in mind.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Jisheng Zhang <jszhang@kernel.org>
Link: https://lore.kernel.org/r/20230113110011.129835-5-adrian.hunter@intel.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-01-23 15:51:38 +01:00
Adrian Hunter 924ea310a5 mmc: sdhci-sprd: Replace SDHCI_QUIRK_MISSING_CAPS
SDHCI_QUIRK_MISSING_CAPS is not needed because sdhci_read_caps() can be
called instead.

In preparation to get rid of SDHCI_QUIRK_MISSING_CAPS, replace
SDHCI_QUIRK_MISSING_CAPS with sdhci_read_caps().

__sdhci_read_caps() is also called from sdhci_setup_host() via
sdhci_read_caps(), however only the first call to __sdhci_read_caps() does
anything because after that host->read_caps has been set to true.

Note, __sdhci_read_caps() does more than just set host->caps, such as do a
reset, so calling __sdhci_read_caps() earlier could have unforeseen
side-effects. However the code flow has been reviewed with that in mind.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Chunyan Zhang <zhang.lyra@gmail.com>
Link: https://lore.kernel.org/r/20230113110011.129835-4-adrian.hunter@intel.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-01-23 15:51:38 +01:00
Adrian Hunter 759329ed7a mmc: sdhci-brcmstb: Replace SDHCI_QUIRK_MISSING_CAPS
SDHCI_QUIRK_MISSING_CAPS is not needed because sdhci_read_caps() can be
called instead.

In preparation to get rid of SDHCI_QUIRK_MISSING_CAPS, replace
SDHCI_QUIRK_MISSING_CAPS with sdhci_read_caps().

__sdhci_read_caps() is also called from sdhci_setup_host() via
sdhci_read_caps(), however only the first call to __sdhci_read_caps() does
anything because after that host->read_caps has been set to true.

Note, __sdhci_read_caps() does more than just set host->caps, such as do a
reset, so calling __sdhci_read_caps() earlier could have unforeseen
side-effects. However the code flow has been reviewed with that in mind.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20230113110011.129835-3-adrian.hunter@intel.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-01-23 15:51:38 +01:00
Adrian Hunter 8e0ec111c6 mmc: sdhci-pci: Replace SDHCI_QUIRK_MISSING_CAPS for Ricoh controller
SDHCI_QUIRK_MISSING_CAPS is not needed because __sdhci_read_caps() can be
called instead.

In preparation to get rid of SDHCI_QUIRK_MISSING_CAPS, replace
SDHCI_QUIRK_MISSING_CAPS with __sdhci_read_caps() for Ricoh SDHCI
controller.

__sdhci_read_caps() is also called from sdhci_setup_host() via
sdhci_read_caps(), however only the first call to __sdhci_read_caps() does
anything because after that host->read_caps has been set to true.

Note, __sdhci_read_caps() does more than just set host->caps, such as do a
reset, so calling __sdhci_read_caps() earlier could have unforeseen
side-effects. However the code flow has been reviewed with that in mind.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20230113110011.129835-2-adrian.hunter@intel.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-01-23 15:51:38 +01:00
Geert Uytterhoeven 930ba0cb7d mmc: sdio: Spelling s/compement/complement/
Fix a misspelling of "complement".

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/a650c8b930a30f5902f4fcfe23877314d098abde.1672763862.git.geert+renesas@glider.be
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-01-23 15:51:38 +01:00
Tom Fitzhenry b0197e47a5 mmc: pwrseq_simple: include deferred probe reasons
This adds a reason to /sys/kernel/debug/devices_deferred, which makes
it easier to debug deferred probes such as [0].

0. https://lore.kernel.org/all/20221228140708.26431-1-tom@tom-fitzhenry.me.uk/

Signed-off-by: Tom Fitzhenry <tom@tom-fitzhenry.me.uk>
Link: https://lore.kernel.org/r/20221228142354.28454-1-tom@tom-fitzhenry.me.uk
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-01-23 15:51:38 +01:00
Peng Fan 90ca969f42 dt-bindings: mmc: fsl-imx-esdhc: update binding for i.MX50 and i.MX7D
i.MX50 eSDHC is compatible with i.MX53. i.MX7D uSDHC is compatible with
i.MX6SL. So update for them.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20221223030347.17093-1-peng.fan@oss.nxp.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-01-23 15:51:38 +01:00
Haibo Chen 52e4c32bae mmc: sdhci-esdhc-imx: only enable DAT[0] and CMD line auto tuning for SDIO device
USDHC IP has one limitation: the tuning circuit can't handle the async
sdio device interrupt correctly. When sdio device use 4 data lines,
async sdio interrupt will use the shared DAT[1], if enable auto tuning
circuit to check these 4 data lines, include the DAT[1], this circuit
will detect this interrupt, take this as data on DAT[1], and adjust the
delay cell wrongly, finally will cause the DATA/CMD CRC error.
So for SDIO device, only enable DAT[0] and CMD line for auto tuning.
To distinguish the card type during card init, involve init_card().

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20221223025022.1893102-3-haibo.chen@nxp.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-01-23 15:51:38 +01:00
Haibo Chen c8c49a5a0b mmc: sdhci-esdhc-imx: simplify the auto tuning logic
Clear auto tuning bit when reset tuning, and enable auto tuning
only after tuning done successfully for both standard tuning and
manual tuning.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20221223025022.1893102-2-haibo.chen@nxp.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-01-23 15:51:38 +01:00
Fabrizio Castro 08e03039e0 mmc: renesas_sdhi: Add RZ/V2M compatible string
The SDHI/eMMC IPs found with the RZ/V2M (a.k.a. r9a09g011), are
very similar to the ones found in R-Car Gen3, but they are not
exactly the same, and as a result need an SoC specific compatible
string for fine tuning driver support.

Signed-off-by: Fabrizio Castro <fabrizio.castro.jz@renesas.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20221213230129.549968-4-fabrizio.castro.jz@renesas.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-01-23 15:51:37 +01:00
Fabrizio Castro c9dc89944b dt-bindings: mmc: renesas,sdhi: Document RZ/V2M support
Document support for the SD Card/MMC interface on the Renesas
RZ/V2M (a.k.a. r9a09g011) SoC.

Signed-off-by: Fabrizio Castro <fabrizio.castro.jz@renesas.com>
Acked-by: Rob Herring <robh@kernel.org>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20221213230129.549968-3-fabrizio.castro.jz@renesas.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-01-23 15:51:37 +01:00
Linus Torvalds 2241ab53cb Linux 6.2-rc5 2023-01-21 16:27:01 -08:00
Linus Torvalds 95f184d0e1 io_uring-6.2-2023-01-21
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEEwPw5LcreJtl1+l5K99NY+ylx4KYFAmPMUNsQHGF4Ym9lQGtl
 cm5lbC5kawAKCRD301j7KXHgpnvcD/wNdwcUhKbTffXBbOY4ma1m/onW0fiIjiT4
 b5fQodwI+zaEvhdW4qy8L00mHQFeIag5/EfsQbM8zrrwcmXISaqJkdgG7/KPFlYJ
 UkuXi9XU3hR4/LKmXZKNRSs+HYWjARAuSTIaI03B9JKkNnDqkqQg8173lA/ejhkq
 J2tdZbRoOFhBtW1RgpuCHG0WRfrAo4NM97kR/Rr5CuPSPtQ1gGssmdUdTRn9ryVV
 i7SPzn0gfkOp9JS9wJx4WFG6uvHPOlONwbCMZEpoHuXZCbOKj0aYx97GcOt1AwCL
 pwaBTpS76So8nACcsdhwh7hgtbNwlkEChWS5dwe0j7TEmtzVUYRduWekcHYvSQ+2
 SjxWg1lmdRBYOmxw6XzJcsaz1SG396RxU7uek/OSpw1kze48ZyjlKzlu4UTnVhvA
 lwMPwOcWG2VwFroWP9QQJ6xLv+qCQkHAIPBczqRbuoAuF8Q8JfvH4gezGm2c3Zcp
 jz2hYG7gg5/2Ci3//5i5R5CeiS0aVnyycFMEJ+ITkj9xFnzzrr1HOXl9w4KFZakH
 3thMaGcK0CC+uWGnZmKgXh7CZ//IMQqbhXmeTMUakgrL4M9llhgPse1QfCRP5OQR
 1Vfuvc4s6fMVRChb9Fu4masRhN4tQzafH1haM5q1onWeRvzAkRdri7c2micmsUiJ
 xFNvPmFBXA==
 =1c2L
 -----END PGP SIGNATURE-----

Merge tag 'io_uring-6.2-2023-01-21' of git://git.kernel.dk/linux

Pull another io_uring fix from Jens Axboe:
 "Just a single fix for a regression that happened in this release due
  to a poll change. Normally I would've just deferred it to next week,
  but since the original fix got picked up by stable, I think it's
  better to just send this one off separately.

  The issue is around the poll race fix, and how it mistakenly also got
  applied to multishot polling. Those don't need the race fix, and we
  should not be doing any reissues for that case. Exhaustive test cases
  were written and committed to the liburing regression suite for the
  reported issue, and additions for similar issues"

* tag 'io_uring-6.2-2023-01-21' of git://git.kernel.dk/linux:
  io_uring/poll: don't reissue in case of poll race on multishot request
2023-01-21 16:21:56 -08:00
Linus Torvalds f671440228 Char/Misc driver fixes for 6.2-rc5
Here are some small char/misc and other subsystem driver fixes for
 6.2-rc5 to resolve a few reported issues.  They include:
   - long time pending fastrpc fixes (should have gone into 6.1, my
     fault.)
   - mei driver/bus fixes and new device ids
   - interconnect driver fixes for reported problems
   - vmci bugfix
   - w1 driver bugfixes for reported problems
 
 Almost all of these have been in linux-next with no reported problems,
 the rest have all passed 0-day bot testing in my tree and on the mailing
 lists where they have sat too long due to me taking a long time to catch
 up on my pending patch queue.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCY8wBNA8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+yk30QCgrdhgSnL4s2o/y0L/nkB4ubg9spkAoJtmRHe4
 EYj/RIm7VYef65aIElVT
 =Cj+i
 -----END PGP SIGNATURE-----

Merge tag 'char-misc-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull char/misc driver fixes from Greg KH:
 "Here are some small char/misc and other subsystem driver fixes for
  6.2-rc5 to resolve a few reported issues. They include:

   - long time pending fastrpc fixes (should have gone into 6.1, my
     fault)

   - mei driver/bus fixes and new device ids

   - interconnect driver fixes for reported problems

   - vmci bugfix

   - w1 driver bugfixes for reported problems

  Almost all of these have been in linux-next with no reported problems,
  the rest have all passed 0-day bot testing in my tree and on the
  mailing lists where they have sat too long due to me taking a long
  time to catch up on my pending patch queue"

* tag 'char-misc-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
  VMCI: Use threaded irqs instead of tasklets
  misc: fastrpc: Pass bitfield into qcom_scm_assign_mem
  gsmi: fix null-deref in gsmi_get_variable
  misc: fastrpc: Fix use-after-free race condition for maps
  misc: fastrpc: Don't remove map on creater_process and device_release
  misc: fastrpc: Fix use-after-free and race in fastrpc_map_find
  misc: fastrpc: fix error code in fastrpc_req_mmap()
  mei: me: add meteor lake point M DID
  mei: bus: fix unlink on bus in error path
  w1: fix WARNING after calling w1_process()
  w1: fix deadloop in __w1_remove_master_device()
  comedi: adv_pci1760: Fix PWM instruction handling
  interconnect: qcom: rpm: Use _optional func for provider clocks
  interconnect: qcom: msm8996: Fix regmap max_register values
  interconnect: qcom: msm8996: Provide UFS clocks to A2NoC
  dt-bindings: interconnect: Add UFS clocks to MSM8996 A2NoC
2023-01-21 11:20:55 -08:00
Linus Torvalds c88a311470 Driver core fixes for 6.2-rc5
Here are 3 small driver and kernel core fixes for 6.2-rc5.  They
 include:
   - potential gadget fixup in do_prlimit
   - device property refcount leak fix
   - test_async_probe bugfix for reported problem.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCY8wB5g8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+yl+5ACfbXPXK7nokMtxvs/9ybhH+IM63X0AmwYXZ5mK
 3dCNVFru/lAZzS7HaR5F
 =4fuA
 -----END PGP SIGNATURE-----

Merge tag 'driver-core-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core

Pull driver core fixes from Greg KH:
 "Here are three small driver and kernel core fixes for 6.2-rc5. They
  include:

   - potential gadget fixup in do_prlimit

   - device property refcount leak fix

   - test_async_probe bugfix for reported problem"

* tag 'driver-core-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
  prlimit: do_prlimit needs to have a speculation check
  driver core: Fix test_async_probe_init saves device in wrong array
  device property: fix of node refcount leak in fwnode_graph_get_next_endpoint()
2023-01-21 11:17:23 -08:00