summaryrefslogtreecommitdiff
path: root/drivers/mmc
AgeCommit message (Collapse)AuthorFilesLines
2023-02-27Merge tag 'soc-drivers-6.3' of ↵Linus Torvalds1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC driver updates from Arnd Bergmann: "As usual, there are lots of minor driver changes across SoC platforms from NXP, Amlogic, AMD Zynq, Mediatek, Qualcomm, Apple and Samsung. These usually add support for additional chip variations in existing drivers, but also add features or bugfixes. The SCMI firmware subsystem gains a unified raw userspace interface through debugfs, which can be used for validation purposes. Newly added drivers include: - New power management drivers for StarFive JH7110, Allwinner D1 and Renesas RZ/V2M - A driver for Qualcomm battery and power supply status - A SoC device driver for identifying Nuvoton WPCM450 chips - A regulator coupler driver for Mediatek MT81xxv" * tag 'soc-drivers-6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (165 commits) power: supply: Introduce Qualcomm PMIC GLINK power supply soc: apple: rtkit: Do not copy the reg state structure to the stack soc: sunxi: SUN20I_PPU should depend on PM memory: renesas-rpc-if: Remove redundant division of dummy soc: qcom: socinfo: Add IDs for IPQ5332 and its variant dt-bindings: arm: qcom,ids: Add IDs for IPQ5332 and its variant dt-bindings: power: qcom,rpmpd: add RPMH_REGULATOR_LEVEL_LOW_SVS_L1 firmware: qcom_scm: Move qcom_scm.h to include/linux/firmware/qcom/ MAINTAINERS: Update qcom CPR maintainer entry dt-bindings: firmware: document Qualcomm SM8550 SCM dt-bindings: firmware: qcom,scm: add qcom,scm-sa8775p compatible soc: qcom: socinfo: Add Soc IDs for IPQ8064 and variants dt-bindings: arm: qcom,ids: Add Soc IDs for IPQ8064 and variants soc: qcom: socinfo: Add support for new field in revision 17 soc: qcom: smd-rpm: Add IPQ9574 compatible soc: qcom: pmic_glink: remove redundant calculation of svid soc: qcom: stats: Populate all subsystem debugfs files dt-bindings: soc: qcom,rpmh-rsc: Update to allow for generic nodes soc: qcom: pmic_glink: add CONFIG_NET/CONFIG_OF dependencies soc: qcom: pmic_glink: Introduce altmode support ...
2023-02-27Merge tag 'mmc-v6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmcLinus Torvalds26-140/+656
Pull MMC updates from Ulf Hansson: "MMC core: - Extend slot-gpio to be used for host specific card detect interrupts - Align to common busy polling behaviour for mmc ioctls - Suggest the BFQ I/O scheduler to be built along with MMC/SD support - Add devm_mmc_alloc_host() to enable further cleanups in host drivers MMC host: - atmel-mci: Fix race condition when stopping/starting a command - dw_mmc-starfive: Add new driver to support the StarFive JH7110 variant - dw_mmc-rockchip: Add support for the RK3588 variant - jz4740: Add support for the vqmmc power supply - meson-gx: Convert the DT bindings to the dt-schema - meson-gx: Enable the platform interrupt to be used for card detect - moxart: Set the supported maximum request/block/segment sizes - renesas,sdhi: Add support for the RZ/V2M variants - sdhci: Rework code to drop SDHCI_QUIRK_MISSING_CAPS - sdhci-esdhc-imx: Improve tuning logic support - sdhci-msm: Add support for the IPQ5332 and the IPQ9574 variants - sdhci-of-dwcmshc: Add the missing device table IDs for acpi - sdhci-of-dwcmshc: Improve clock support for the Rockchip variant - sdhci-of-dwcmshc: Enable support of V4 host for the BlueField-3 variant - sdhci-pxav2: Add support for the PXA168 V1 variant - sdhci-pxav2: Add support for SDIO IRQs for the PXA168 V1 variant - uniphier-sd: Add support for SD UHS-I speed modes" * tag 'mmc-v6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: (59 commits) mmc: meson-gx: Use devm_platform_get_and_ioremap_resource() mmc: meson-gx: constify member data of struct meson_host mmc: meson-gx: use devm_clk_get_enabled() for core clock mmc: core: fix return value check in devm_mmc_alloc_host() dt-bindings: mmc: meson-gx: fix interrupt binding mmc: meson-gx: support platform interrupt as card detect interrupt dt-bindings: mmc: meson-gx: support specifying cd interrupt mmc: core: support setting card detect interrupt from drivers mmc: starfive: Add sdio/emmc driver support dt-bindings: mmc: Add StarFive MMC module dt-bindings: mmc: sdhci-msm: Allow 1 icc path dt-bindings: mmc: rockchip-dw-mshc: Add RK3588 compatible string mmc: core: Align to common busy polling behaviour for mmc ioctls dt-bindings: mmc: Add resets property to cadence SDHCI binding mmc: meson-gx: remove meson_mmc_get_cd mmc: moxart: set maximum request/block/segment sizes mmc: sdhci-brcmstb: Use devm_platform_get_and_ioremap_resource() mmc: sdhci-of-dwcmshc: add the missing device table IDs for acpi mmc: sdhci-of-dwcmshc: Update DLL and pre-change delay for rockchip platform mmc: jz4740: Add support for vqmmc power supply ...
2023-02-24Merge tag 'driver-core-6.3-rc1' of ↵Linus Torvalds2-4/+4
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core updates from Greg KH: "Here is the large set of driver core changes for 6.3-rc1. There's a lot of changes this development cycle, most of the work falls into two different categories: - fw_devlink fixes and updates. This has gone through numerous review cycles and lots of review and testing by lots of different devices. Hopefully all should be good now, and Saravana will be keeping a watch for any potential regression on odd embedded systems. - driver core changes to work to make struct bus_type able to be moved into read-only memory (i.e. const) The recent work with Rust has pointed out a number of areas in the driver core where we are passing around and working with structures that really do not have to be dynamic at all, and they should be able to be read-only making things safer overall. This is the contuation of that work (started last release with kobject changes) in moving struct bus_type to be constant. We didn't quite make it for this release, but the remaining patches will be finished up for the release after this one, but the groundwork has been laid for this effort. Other than that we have in here: - debugfs memory leak fixes in some subsystems - error path cleanups and fixes for some never-able-to-be-hit codepaths. - cacheinfo rework and fixes - Other tiny fixes, full details are in the shortlog All of these have been in linux-next for a while with no reported problems" [ Geert Uytterhoeven points out that that last sentence isn't true, and that there's a pending report that has a fix that is queued up - Linus ] * tag 'driver-core-6.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (124 commits) debugfs: drop inline constant formatting for ERR_PTR(-ERROR) OPP: fix error checking in opp_migrate_dentry() debugfs: update comment of debugfs_rename() i3c: fix device.h kernel-doc warnings dma-mapping: no need to pass a bus_type into get_arch_dma_ops() driver core: class: move EXPORT_SYMBOL_GPL() lines to the correct place Revert "driver core: add error handling for devtmpfs_create_node()" Revert "devtmpfs: add debug info to handle()" Revert "devtmpfs: remove return value of devtmpfs_delete_node()" driver core: cpu: don't hand-override the uevent bus_type callback. devtmpfs: remove return value of devtmpfs_delete_node() devtmpfs: add debug info to handle() driver core: add error handling for devtmpfs_create_node() driver core: bus: update my copyright notice driver core: bus: add bus_get_dev_root() function driver core: bus: constify bus_unregister() driver core: bus: constify some internal functions driver core: bus: constify bus_get_kset() driver core: bus: constify bus_register/unregister_notifier() driver core: remove private pointer from struct bus_type ...
2023-02-24Merge tag 'tty-6.3-rc1' of ↵Linus Torvalds1-7/+6
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty / serial driver updates from Greg KH: "Here is the big set of serial and tty driver updates for 6.3-rc1. Once again, Jiri and Ilpo have done a number of core vt and tty/serial layer cleanups that were much needed and appreciated. Other than that, it's just a bunch of little tty/serial driver updates: - qcom-geni-serial driver updates - liteuart driver updates - hvcs driver cleanups - n_gsm updates and additions for new features - more 8250 device support added - fpga/dfl update and additions - imx serial driver updates - fsl_lpuart updates - other tiny fixes and updates for serial drivers All of these have been in linux-next for a while with no reported problems" * tag 'tty-6.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (143 commits) tty: n_gsm: add keep alive support serial: imx: remove a redundant check dt-bindings: serial: snps-dw-apb-uart: add dma & dma-names properties soc: qcom: geni-se: Move qcom-geni-se.h to linux/soc/qcom/geni-se.h tty: n_gsm: add TIOCMIWAIT support tty: n_gsm: add RING/CD control support tty: n_gsm: mark unusable ioctl structure fields accordingly serial: imx: get rid of registers shadowing serial: imx: refine local variables in rxint() serial: imx: stop using USR2 in FIFO reading loop serial: imx: remove redundant USR2 read from FIFO reading loop serial: imx: do not break from FIFO reading loop prematurely serial: imx: do not sysrq broken chars serial: imx: work-around for hardware RX flood serial: imx: factor-out common code to imx_uart_soft_reset() serial: 8250_pci1xxxx: Add power management functions to quad-uart driver serial: 8250_pci1xxxx: Add RS485 support to quad-uart driver serial: 8250_pci1xxxx: Add driver for quad-uart support serial: 8250_pci: Add serial8250_pci_setup_port definition in 8250_pcilib.c tty: pcn_uart: fix memory leak with using debugfs_lookup() ...
2023-02-21Merge tag 'arm-boardfile-remove-6.3' of ↵Linus Torvalds6-2261/+2
git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC boardfile updates from Arnd Bergmann "Unused boardfile removal for 6.3 This is a follow-up to the deprecation of most of the old-style board files that was merged in linux-6.0, removing them for good. This branch is almost exclusively dead code removal based on those annotations. Some device driver removals went through separate subsystem trees, but the majority is in the same branch, in order to better handle dependencies between the patches and avoid breaking bisection. Unfortunately that leads to merge conflicts against other changes in the subsystem trees, but they should all be trivial to resolve by removing the files. See commit 7d0d3fa7339e ("Merge tag 'arm-boardfiles-6.0' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc") for the description of which machines were marked unused and are now removed. The only removals that got postponed are Terastation WXL (mv78xx0) and Jornada720 (StrongARM1100), which turned out to still have potential users" * tag 'arm-boardfile-remove-6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (91 commits) mmc: omap: drop TPS65010 dependency ARM: pxa: restore mfp-pxa320.h usb: ohci-omap: avoid unused-variable warning ARM: debug: remove references in DEBUG_UART_8250_SHIFT to removed configs ARM: s3c: remove obsolete s3c-cpu-freq header MAINTAINERS: adjust SAMSUNG SOC CLOCK DRIVERS after s3c24xx support removal MAINTAINERS: update file entries after arm multi-platform rework and mach-pxa removal ARM: remove CONFIG_UNUSED_BOARD_FILES mfd: remove htc-pasic3 driver w1: remove ds1wm driver usb: remove ohci-tmio driver fbdev: remove w100fb driver fbdev: remove tmiofb driver mmc: remove tmio_mmc driver mfd: remove ucb1400 support mfd: remove toshiba tmio drivers rtc: remove v3020 driver power: remove pda_power supply driver ASoC: pxa: remove unused board support pcmcia: remove unused pxa/sa1100 drivers ...
2023-02-17mmc: meson-gx: Use devm_platform_get_and_ioremap_resource()Yang Li1-2/+1
Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Link: https://lore.kernel.org/r/20230217083005.128668-1-yang.lee@linux.alibaba.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-02-17mmc: meson-gx: constify member data of struct meson_hostHeiner Kallweit1-3/+2
Constify member data of struct meson_host. This also allows to remove the cast as of_device_get_match_data() returns a const void *. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Link: https://lore.kernel.org/r/70e5520f-e327-111d-9ea4-824460e41561@gmail.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-02-17mmc: meson-gx: use devm_clk_get_enabled() for core clockHeiner Kallweit1-12/+5
Use devm_clk_get_enabled() to simplify the code. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Link: https://lore.kernel.org/r/b316c6ba-a373-f1d2-27d2-9add5e25a9d2@gmail.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-02-17mmc: core: fix return value check in devm_mmc_alloc_host()Yang Yingliang1-3/+3
mmc_alloc_host() returns NULL pointer not PTR_ERR(), if it fails, so replace the IS_ERR() check with NULL pointer check. In commit 418f7c2de133 ("mmc: meson-gx: use devm_mmc_alloc_host"), it checks NULL pointer not PTR_ERR, if devm_mmc_alloc_host() fails, so make it to return NULL pointer to keep same with mmc_alloc_host(), the drivers don't need to change the error handle when switch to use devm_mmc_alloc_host(). Fixes: 80df83c2c57e ("mmc: core: add devm_mmc_alloc_host") Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Reviewed-by: Heiner Kallweit <hkallweit1@gmail.com> Link: https://lore.kernel.org/r/20230217024333.4018279-1-yangyingliang@huawei.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-02-15mmc: meson-gx: support platform interrupt as card detect interruptHeiner Kallweit1-1/+4
Use a new mmc core feature and support specifying the card detect gpio interrupt in device tree. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Link: https://lore.kernel.org/r/2bb70611-5dea-1144-51bd-93c46b455392@gmail.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-02-15mmc: core: support setting card detect interrupt from driversHeiner Kallweit1-1/+16
On certain platforms like Amlogic Meson gpiod_to_irq() isn't supported due to the design of gpio / interrupt controller. Therefore provide an option for drivers to pass the card detect interrupt number (retrieved e.g. from device tree) to mmc core. Suggested-by refers to the mechanism to pass and store the interrupt. Suggested-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Link: https://lore.kernel.org/r/5777f38b-465f-ce48-a87f-5eb8b3c57b0a@gmail.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-02-15mmc: starfive: Add sdio/emmc driver supportWilliam Qiu3-0/+197
Add sdio/emmc driver support for StarFive JH7110 soc. Tested-by: Conor Dooley <conor.dooley@microchip.com> Signed-off-by: William Qiu <william.qiu@starfivetech.com> Link: https://lore.kernel.org/r/20230215113249.47727-3-william.qiu@starfivetech.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-02-15mmc: core: Align to common busy polling behaviour for mmc ioctlsUlf Hansson2-8/+18
Let's align to the common busy polling behaviour for mmc ioctls, by updating the below two corresponding parts, that comes into play when using an R1B response for a command. *) A command with an R1B response should be prepared by calling mmc_prepare_busy_cmd(), which make us respects the host's busy timeout constraints. **) When an R1B response is being used and the host also supports HW busy detection, we should skip to poll for busy completion. Suggested-by: Christian Loehle <cloehle@hyperstone.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Christian Loehle <cloehle@hyperstone.com> Link: https://lore.kernel.org/r/20230213133707.27857-1-ulf.hansson@linaro.org
2023-02-15mmc: meson-gx: remove meson_mmc_get_cdHeiner Kallweit1-15/+1
MMC core only checks whether return value of .get_cd() equals zero. Therefore -ENOSYS and 1 are effectively the same and the function can be removed. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Link: https://lore.kernel.org/r/16502040-3beb-a3cc-b28d-28184fba0f10@gmail.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-02-15mmc: moxart: set maximum request/block/segment sizesSergei Antonov1-0/+9
Per datasheet: maximum block length is 2048 bytes, data length field is in bits 0-23 of the Data Length Register. Also for DMA mode we have to take into account rx/tx buffers' sizes. In my tests this change doubles SD card I/O performance on big files. Before the change Linux used default request size of 4 KB. Signed-off-by: Sergei Antonov <saproj@gmail.com> Link: https://lore.kernel.org/r/20230210143843.369943-1-saproj@gmail.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-02-15mmc: sdhci-brcmstb: Use devm_platform_get_and_ioremap_resource()Ye Xingchen1-3/+1
Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Ye Xingchen <ye.xingchen@zte.com.cn> Link: https://lore.kernel.org/r/202302101628321403257@zte.com.cn Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-02-14mmc: sdhci-of-dwcmshc: add the missing device table IDs for acpiLiming Sun1-0/+1
This commit adds the missing MODULE_DEVICE_TABLE for acpi, or else it won't be loaded automatically when compiled as a kernel module. Reviewed-by: David Thompson <davthompson@nvidia.com> Signed-off-by: Liming Sun <limings@nvidia.com> Link: https://lore.kernel.org/r/f57ad0f8fdf663465bca74467c344dfa305a3199.1675305696.git.limings@nvidia.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-02-14mmc: sdhci-of-dwcmshc: Update DLL and pre-change delay for rockchip platformShawn Lin1-4/+9
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-14mmc: jz4740: Add support for vqmmc power supplyPaul Cercueil1-1/+37
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-14mmc: Merge branch fixes into nextUlf Hansson5-29/+41
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-14mmc: jz4740: Work around bug on JZ4760(B)Paul Cercueil1-0/+10
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-14mmc: mmc_spi: fix error handling in mmc_spi_probe()Yang Yingliang1-4/+4
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: 15a0580ced08 ("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-14mmc: sdio: fix possible resource leaks in some error pathsYang Yingliang2-15/+14
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: 3d10a1ba0d37 ("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-14mmc: meson-gx: fix SDIO mode if cap_sdio_irq isn't setHeiner Kallweit1-10/+13
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: 066ecde6d826 ("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-14mmc: meson-gx: use devm_mmc_alloc_hostHeiner Kallweit1-35/+17
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-14mmc: core: add devm_mmc_alloc_hostHeiner Kallweit1-0/+26
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-12mmc: omap: drop TPS65010 dependencyArnd Bergmann1-1/+0
The original TPS65010 dependency was only needed for MACH_OMAP_H2, which is now gone, but I messed up the conversion when I removed that symbol. Now the missing TPS65010 causes a boot failure on other machines such as the SX1. Reported-by: Guenter Roeck <linux@roeck-us.net> Fixes: 0d7bb85e9413 ("ARM: omap1: remove unused board files") Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-02-09firmware: qcom_scm: Move qcom_scm.h to include/linux/firmware/qcom/Elliot Berman1-1/+1
Move include/linux/qcom_scm.h to include/linux/firmware/qcom/qcom_scm.h. This removes 1 of a few remaining Qualcomm-specific headers into a more approciate subdirectory under include/. Suggested-by: Bjorn Andersson <andersson@kernel.org> Signed-off-by: Elliot Berman <quic_eberman@quicinc.com> Reviewed-by: Guru Das Srinagesh <quic_gurus@quicinc.com> Acked-by: Mukesh Ojha <quic_mojha@quicinc.com> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/20230203210956.3580811-1-quic_eberman@quicinc.com
2023-02-02mmc: core: Imply IOSCHED_BFQLinus Walleij1-0/+1
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-01mmc: remove tmio_mmc driverArnd Bergmann3-236/+0
With the TMIO MFD support gone, the corresponding MMC host driver can be removed as well. The remaining tmio_mmc_core module however is still used by both the Renesas and Socionext host drivers. Cc: Ian Molton <spyro@f2s.com> Cc: Ulf Hansson <ulf.hansson@linaro.org> Cc: linux-mmc@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org Acked-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-01-27driver core: make struct bus_type.uevent() take a const *Greg Kroah-Hartman2-4/+4
The uevent() callback in struct bus_type should not be modifying the device that is passed into it, so mark it as a const * and propagate the function signature changes out into all relevant subsystems that use this callback. Acked-by: Rafael J. Wysocki <rafael@kernel.org> Acked-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20230111113018.459199-16-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-27mmc: uniphier-sd: Add control to switch UHS speedKunihiko Hayashi1-0/+22
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-27mmc: uniphier-sd: Add control of UHS mode using SD interface logicKunihiko Hayashi1-5/+56
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-27mmc: atmel-mci: fix race between stop command and start of next commandTobias Schramm1-3/+0
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-24mmc: sdhci-pxav2: add optional pinctrl for SDIO IRQ workaroundDoug Brown1-1/+32
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-24mmc: sdhci-pxav2: add SDIO card IRQ workaround for PXA168 V1 controllerDoug Brown1-1/+55
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-24mmc: sdhci-pxav2: add optional core clockDoug Brown1-1/+8
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-24mmc: sdhci-pxav2: change clock name to match DT bindingsDoug Brown1-3/+5
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-24mmc: sdhci-pxav2: add register workaround for PXA168 silicon bugDoug Brown1-0/+10
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-24mmc: sdhci-pxav2: enable CONFIG_MMC_SDHCI_IO_ACCESSORSDoug Brown1-0/+1
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-24mmc: sdhci-pxav2: add initial support for PXA168 V1 controllerDoug Brown1-8/+32
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-23mmc: pwrseq_sd8787: Allow being built-in irrespective of dependenciesLukas Wunner1-1/+1
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-23mmc: sdhci-of-dwcmshc: enable host V4 support for BlueField-3 SoCLiming Sun1-0/+5
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-23mmc: sdhci: Remove SDHCI_QUIRK_MISSING_CAPSAdrian Hunter2-5/+0
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-23mmc: sdhci-iproc: Replace SDHCI_QUIRK_MISSING_CAPSAdrian Hunter1-6/+8
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-23mmc: sdhci-pxav3: Replace SDHCI_QUIRK_MISSING_CAPSAdrian Hunter1-3/+1
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-23mmc: sdhci-sprd: Replace SDHCI_QUIRK_MISSING_CAPSAdrian Hunter1-4/+2
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-23mmc: sdhci-brcmstb: Replace SDHCI_QUIRK_MISSING_CAPSAdrian Hunter1-3/+1
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-23mmc: sdhci-pci: Replace SDHCI_QUIRK_MISSING_CAPS for Ricoh controllerAdrian Hunter1-3/+5
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-23mmc: sdio: Spelling s/compement/complement/Geert Uytterhoeven1-1/+1
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>