- 19 Oct, 2021 1 commit
-
-
Andy Shevchenko authored
The analogue of the sdhci_get_cd_nogpio() is used in the sdhci-pci-core and sdhci-acpi modules. Deduplicate it by moving to sdhci and exporting. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Link: https://lore.kernel.org/r/20211014132613.27861-2-andriy.shevchenko@linux.intel.comSigned-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
- 14 Oct, 2021 3 commits
-
-
Colin Ian King authored
There are several error return paths that dereference the null pointer host because the pointer has not yet been set to a valid value. Fix this by adding a new out_mmc label and exiting via this label to avoid the host clean up and hence the null pointer dereference. Addresses-Coverity: ("Explicit null dereference") Fixes: 8105c2ab ("mmc: moxart: Fix reference count leaks in moxart_probe") Signed-off-by: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20211013100052.125461-1-colin.king@canonical.comSigned-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
Ulf Hansson authored
-
Andy Shevchenko authored
Intel Merrifield platform had been converted to use ACPI enumeration. However, the driver missed an update to retrieve card detect GPIO. Fix it here. Unfortunately we can't rely on CD GPIO state because there are two different PCB designs in the wild that are using the opposite card detection sense and there is no way to distinguish those platforms, that's why ignore CD GPIO completely and use it only as an event. Fixes: 4590d98f ("sfi: Remove framework for deprecated firmware") BugLink: https://github.com/edison-fw/meta-intel-edison/issues/135Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20211013201723.52212-2-andriy.shevchenko@linux.intel.comSigned-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
- 12 Oct, 2021 36 commits
-
-
Dan Carpenter authored
The "msh" pointer is device managed, meaning that memstick_alloc_host() calls device_initialize() on it. That means that it can't be free using kfree() but must instead be freed with memstick_free_host(). Otherwise it leads to a tiny memory leak of device resources. Fixes: 60fdd931 ("memstick: add support for JMicron jmb38x MemoryStick host controller") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/20211011123912.GD15188@kiliSigned-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
Xin Xiong authored
The issue happens in several error handling paths on two refcounted object related to the object "host" (dma_chan_rx, dma_chan_tx). In these paths, the function forgets to decrement one or both objects' reference count increased earlier by dma_request_chan(), causing reference count leaks. Fix it by balancing the refcounts of both objects in some error handling paths. In correspondence with the changes in moxart_probe(), IS_ERR() is replaced with IS_ERR_OR_NULL() in moxart_remove() as well. Signed-off-by: Xin Xiong <xiongx18@fudan.edu.cn> Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn> Signed-off-by: Xin Tan <tanxin.ctf@gmail.com> Link: https://lore.kernel.org/r/20211009041918.28419-1-xiongx18@fudan.edu.cnSigned-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
Ulf Hansson authored
-
Andy Shevchenko authored
Currently default label of GPIO is assigned to the device name, when no con_id provided. Instead, let's update it to reflect what it's about (use already prepared template). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20210929111757.52625-2-andriy.shevchenko@linux.intel.comSigned-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
Andy Shevchenko authored
Refactor mmc_gpio_alloc() to drop unneeded indentation level and double condition. This increases readability of the code. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20210929111757.52625-1-andriy.shevchenko@linux.intel.comSigned-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
Krzysztof Kozlowski authored
The schema defines dependency only of clock-output-names on #clock-cells. The dependency in opposite direction - requirement of clock-output-names if #clock-cells is defined - should be explicitly included in the bindings. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20211004151646.73599-1-krzysztof.kozlowski@canonical.comSigned-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
Krzysztof Kozlowski authored
The Microchip PolarFire SoC FPGA DTSI uses Cadence SD/SDIO/eMMC Host Controller without any additional vendor compatible: arch/riscv/boot/dts/microchip/microchip-mpfs-icicle-kit.dt.yaml: mmc@20008000: compatible:0: 'cdns,sd4hc' is not one of ['socionext,uniphier-sd4hc'] arch/riscv/boot/dts/microchip/microchip-mpfs-icicle-kit.dt.yaml: mmc@20008000: compatible: ['cdns,sd4hc'] is too short Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20210927125044.20046-1-krzysztof.kozlowski@canonical.comSigned-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
Arnd Bergmann authored
clang-14 complains about a sanity check that always passes when the page size is 64KB or larger: drivers/memstick/core/ms_block.c:1739:21: error: result of comparison of constant 65536 with expression of type 'unsigned short' is always false [-Werror,-Wtautological-constant-out-of-range-compare] if (msb->page_size > PAGE_SIZE) { ~~~~~~~~~~~~~~ ^ ~~~~~~~~~ This is fine, it will still work on all architectures, so just shut up that warning with a cast. Fixes: 0ab30494 ("memstick: add support for legacy memorysticks") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20210927094520.696665-1-arnd@kernel.orgSigned-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
Zhenxiong Lai authored
According to the specification, DLL status has to be locked before using it. Signed-off-by: Zhenxiong Lai <zhenxiong.lai@unisoc.com> Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Link: https://lore.kernel.org/r/20210926092835.146449-1-zhang.lyra@gmail.comSigned-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
Colin Ian King authored
There is a spelling mistake in a pr_info message. Fix it. Also put msi in capital letters. Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Link: https://lore.kernel.org/r/20210924225111.143112-1-colin.king@canonical.comSigned-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
Krzysztof Kozlowski authored
Describe better which driver applies to which SoC, to make configuring kernel for Samsung SoC easier. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Link: https://lore.kernel.org/r/20210924133257.112017-1-krzysztof.kozlowski@canonical.comSigned-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
Tony Lindgren authored
Nowadays the standard non-removable property should be used, but we still need to parse the ti,non-removable too. Let's document it as a deprecated property. Cc: Rob Herring <robh+dt@kernel.org> Cc: devicetree@vger.kernel.org Suggested-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Tony Lindgren <tony@atomide.com> Link: https://lore.kernel.org/r/20210924073441.7835-1-tony@atomide.comSigned-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
Bean Huo authored
Clean up sdhci_calc_timeout() a bit, and let it set too_big to be true only when the timeout value required by the eMMC device exceeds the capability of the host hardware timer. Signed-off-by: Bean Huo <beanhuo@micron.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Link: https://lore.kernel.org/r/20210917172727.26834-2-huobean@gmail.comSigned-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
Linus Walleij authored
Put a small comment before assigning IRQ_WAKE_THREAD telling us what is going on. Cc: Russell King <linux@armlinux.org.uk> Cc: Yann Gautier <yann.gautier@foss.st.com> Cc: Ludovic Barre <ludovic.barre@st.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20210921143359.1738149-1-linus.walleij@linaro.orgSigned-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
Tony Lindgren authored
ADMA is only available on controller instances that are connected to the L3 interconnect and are bus mastering capable. As the MMCHS_HL_HWINFO is in the module registers before omap registers and sdhci registers, and the omap registers and sdhci registers can be at different offsets depending on the SoC, let's read MMCHS_HL_HWINFO directly. Let's also switch to using device_property_present() while at it. Signed-off-by: Tony Lindgren <tony@atomide.com> Link: https://lore.kernel.org/r/20210921110029.21944-6-tony@atomide.comSigned-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
Tony Lindgren authored
We need to support the legacy ti,non-removable property too. Let's warn about the legacy property and mark the device as non-removable. Naturally all the mainline kernel devicetree files will get updated to use the standard non-removable property with the sdhci-omap conversion. But we also have folks updating their kernels with custom devicetree files that we need to consider. Signed-off-by: Tony Lindgren <tony@atomide.com> Link: https://lore.kernel.org/r/20210921110029.21944-5-tony@atomide.comSigned-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
Tony Lindgren authored
The sysconfig register is managed in a generic way by PM runtime for us by the interconnect target module layer code. SDHCI_RESET_ALL also resets the target module configuration, so we need to restore sysconfig after reset. Note that there is no need to save and restore sysconfig during PM runtime, the PM runtime layer will do that for us. Not sure if this issue is a problem with the current configurations, I noticed the issue while adding support for older TI SoCs and testing with wlcore SDIO wlan device. Signed-off-by: Tony Lindgren <tony@atomide.com> Link: https://lore.kernel.org/r/20210921110029.21944-4-tony@atomide.comSigned-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
Tony Lindgren authored
We need to restore context in a specified order with HCTL set in two phases. This is similar to what omap_hsmmc_context_restore() is doing. Otherwise SDIO can stop working on resume. And for PM runtime and SDIO cards, we need to also save SYSCTL, IE and ISE. This should not be a problem currently, and these patches can be applied whenever suitable. Fixes: ee0f3092 ("mmc: sdhci-omap: Add Support for Suspend/Resume") Signed-off-by: Tony Lindgren <tony@atomide.com> Link: https://lore.kernel.org/r/20210921110029.21944-3-tony@atomide.comSigned-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
Tony Lindgren authored
If sdhci-omap is configured for an unused device instance and the device is not set as disabled, we can get a NULL pointer dereference: Unable to handle kernel NULL pointer dereference at virtual address 00000045 ... (regulator_set_voltage) from [<c07d7008>] (mmc_regulator_set_ocr+0x44/0xd0) (mmc_regulator_set_ocr) from [<c07e2d80>] (sdhci_set_ios+0xa4/0x490) (sdhci_set_ios) from [<c07ea690>] (sdhci_omap_set_ios+0x124/0x160) (sdhci_omap_set_ios) from [<c07c8e94>] (mmc_power_up.part.0+0x3c/0x154) (mmc_power_up.part.0) from [<c07c9d20>] (mmc_start_host+0x88/0x9c) (mmc_start_host) from [<c07cad34>] (mmc_add_host+0x58/0x7c) (mmc_add_host) from [<c07e2574>] (__sdhci_add_host+0xf0/0x22c) (__sdhci_add_host) from [<c07eaf68>] (sdhci_omap_probe+0x318/0x72c) (sdhci_omap_probe) from [<c06a39d8>] (platform_probe+0x58/0xb8) AFAIK we are not seeing this with the devices configured in the mainline kernel but this can cause issues for folks bringing up their boards. Fixes: 7d326930 ("mmc: sdhci-omap: Add OMAP SDHCI driver") Signed-off-by: Tony Lindgren <tony@atomide.com> Link: https://lore.kernel.org/r/20210921110029.21944-2-tony@atomide.comSigned-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
Wenbin Mei authored
According to JEDEC Spec, there is no need to do tuning under HS400 mode since the Rx signal is aligned with the DS signal. However, MediaTek's IC need set its "DS delay" internally to ensure it can latch Rx signal correctly. In previous version, We provide an "hs400-ds-delay" in device tree to cover different chipset/PCB design, and it works fine in most cases. But, with the development of process technology and the big VCore voltage scale range(may have 0.7V/0.6V/0.55V), it is difficult to find a suitable "hs400-ds-delay" to cover all of IC corner cases(SSSS/TTTT/FFFF). So that We must have the ability to do hs400 online tuning. Signed-off-by: Wenbin Mei <wenbin.mei@mediatek.com> Reviewed-by: Chaotian Jing <chaotian.jing@mediatek.com> Link: https://lore.kernel.org/r/20210917124803.22871-4-wenbin.mei@mediatek.comSigned-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
Wenbin Mei authored
This adds a ->execute_hs400_tuning() host callback to enable optional support for host specific tuning for eMMC HS400 mode. Additionally, share mmc_get_ext_csd() through the public host headerfile, to allow it to be used by the host drivers, which is needed to support the HS400 tuning. Signed-off-by: Wenbin Mei <wenbin.mei@mediatek.com> Link: https://lore.kernel.org/r/20210917124803.22871-3-wenbin.mei@mediatek.comSigned-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
Wenbin Mei authored
Add hs400 dly3 setting for mtk-sd yaml Signed-off-by: Wenbin Mei <wenbin.mei@mediatek.com> Acked-by: Rob Herring <robh@kernel.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20210917124803.22871-2-wenbin.mei@mediatek.comSigned-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
Krzysztof Kozlowski authored
The MODULE_DEVICE_TABLE already creates proper alias for platform driver. Having another MODULE_ALIAS causes the alias to be duplicated. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsunhg.com> Link: https://lore.kernel.org/r/20210916170511.137915-1-krzysztof.kozlowski@canonical.comSigned-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
Mauro Carvalho Chehab authored
The recent change ("dt-bindings: mmc: Convert MMC Card binding to a schema") renamed: Documentation/devicetree/bindings/mmc/mmc-card.txt to: Documentation/devicetree/bindings/mmc/mmc-card.yaml. Let's update its cross-reference accordingly. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Acked-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/820bb7a1d7e0e51cbea72c9bee6bce806427d1f3.1631785820.git.mchehab+huawei@kernel.orgSigned-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
Christian Löhle authored
Only wait for DRTO on reads, otherwise the driver hangs. The driver prevents sending CMD12 on response errors like CRCs. According to the comment this is because some cards have problems with this during the UHS tuning sequence. Unfortunately this workaround currently also applies for any command with data. On reads this will set the drto timer, which then triggers after a while. On writes this will not set any timer and the tasklet will not be scheduled again. I cannot test for the UHS workarounds need, but even if so, it should at most apply to reads. I have observed many hangs when CMD25 response contained a CRC error. This patch fixes this without touching the actual UHS tuning workaround. Signed-off-by: Christian Loehle <cloehle@hyperstone.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/af8f8b8674ba4fcc9a781019e4aeb72c@hyperstone.comSigned-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
Luca Weiss authored
Add msm8226 SoC specific compatible strings for qcom-sdhci controller. Signed-off-by: Luca Weiss <luca@z3ntu.xyz> Link: https://lore.kernel.org/r/20210911232707.259615-3-luca@z3ntu.xyzSigned-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
Len Baker authored
As noted in the "Deprecated Interfaces, Language Features, Attributes, and Conventions" documentation [1], size calculations (especially multiplication) should not be performed in memory allocator (or similar) function arguments due to the risk of them overflowing. This could lead to values wrapping around and a smaller allocation being made than the caller was expecting. Using those allocations could lead to linear overflows of heap memory and other misbehaviors. So, use the struct_size() helper to do the arithmetic instead of the argument "size + count * size" in the kzalloc() function. [1] https://www.kernel.org/doc/html/v5.14/process/deprecated.html#open-coded-arithmetic-in-allocator-argumentsSigned-off-by: Len Baker <len.baker@gmx.com> Link: https://lore.kernel.org/r/20210911131933.2089-1-len.baker@gmx.comSigned-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
Bean Huo authored
Print task count that has not been completed, this is for the purpose of debugging. Signed-off-by: Bean Huo <beanhuo@micron.com> Link: https://lore.kernel.org/r/20210907151204.118861-2-huobean@gmail.comSigned-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
Rashmi A authored
Intel Thunder Bay SoC eMMC controller is based on Arasan eMMC 5.1 host controller IP Signed-off-by: Rashmi A <rashmi.a@intel.com> Reviewed-by: Adrian Hunter <adrian.hunter@intel.com> Link: https://lore.kernel.org/r/20210829182443.30802-2-rashmi.a@intel.comSigned-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
Rashmi A authored
Add documentation for Arasan SDHCI controller in Thunder Bay SOC. Signed-off-by: Rashmi A <rashmi.a@intel.com> Link: https://lore.kernel.org/r/20210829182443.30802-3-rashmi.a@intel.comSigned-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
Cai Huoqing authored
Use the helper macro SET_RUNTIME_PM_OPS() instead of the verbose operators ".runtime_suspend/.runtime_resume", because the SET_RUNTIME_PM_OPS() is a nice helper macro that could be brought in to make code a little more concise. Signed-off-by: Cai Huoqing <caihuoqing@baidu.com> Link: https://lore.kernel.org/r/20210907025940.1535-1-caihuoqing@baidu.comSigned-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
Luis Chamberlain authored
We never checked for errors on add_disk() as this function returned void. Now that this is fixed, use the shiny new error handling. Contrary to the typical removal which delays the put_disk() until later, since we are failing on a probe we immediately put the disk on failure from add_disk by using blk_cleanup_disk(). Signed-off-by: Luis Chamberlain <mcgrof@kernel.org> Link: https://lore.kernel.org/r/20210902174105.2418771-4-mcgrof@kernel.orgSigned-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
Luis Chamberlain authored
We never checked for errors on add_disk() as this function returned void. Now that this is fixed, use the shiny new error handling. Contrary to the typical removal which delays the put_disk() until later, since we are failing on a probe we immediately put the disk on failure from add_disk by using blk_cleanup_disk(). Signed-off-by: Luis Chamberlain <mcgrof@kernel.org> Link: https://lore.kernel.org/r/20210902174105.2418771-3-mcgrof@kernel.orgSigned-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
Maxime Ripard authored
MMC Cards can have an optional Device Tree binding to add non-discoverable properties. Now that we have the DT validation in place, let's convert the device tree bindings for that driver over to a YAML schema. Some of these properties were already described in the MMC controller binding, even though they are not generic and do not apply to any device, so we took the occasion to fix this. Cc: linux-mmc@vger.kernel.org Cc: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Maxime Ripard <maxime@cerno.tech> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20210901091852.479202-31-maxime@cerno.techSigned-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
Luis Chamberlain authored
We never checked for errors on add_disk() as this function returned void. Now that this is fixed, use the shiny new error handling. The caller only cleanups the disk if we pass on an allocated md but on error we return return ERR_PTR(ret), and so we must do all the unwinding ourselves. Signed-off-by: Luis Chamberlain <mcgrof@kernel.org> Link: https://lore.kernel.org/r/20210830212538.148729-5-mcgrof@kernel.orgSigned-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
ChanWoo Lee authored
Remove unused parameters 1. msdc_start_data() - struct mmc_request *mrq 2. msdc_track_cmd_data() - struct mmc_data *data Signed-off-by: ChanWoo Lee <cw9316.lee@samsung.com> Link: https://lore.kernel.org/r/20210830021749.5947-1-cw9316.lee@samsung.comSigned-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-