Andy Shevchenko
edd6021465
mmc: mmc_spi: Make of_mmc_spi.c resource provider agnostic
...
In order to use the same driver on non-OF platforms, make
of_mmc_spi.c resource provider agnostic.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Link: https://lore.kernel.org/r/20210419112459.25241-6-andriy.shevchenko@linux.intel.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-04-23 09:29:49 +02:00
Andy Shevchenko
7240803b2b
mmc: mmc_spi: Use already parsed IRQ
...
SPI core already parses and maps IRQ for us if provided.
Use it instead of double parsing in mmc_spi_get_pdata().
Due to above, change condition, since SPI core can hold
an error pointer as invalid IRQ.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Link: https://lore.kernel.org/r/20210419112459.25241-5-andriy.shevchenko@linux.intel.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-04-23 09:29:49 +02:00
Andy Shevchenko
6738fbc08f
mmc: mmc_spi: Drop unused NO_IRQ definition
...
After the commit 073350f7b5 ("mmc: mmc_spi: Fix return value evaluation of
irq_of_parse_and_map()") the NO_IRQ is not used anymore, drop it for good.
Fixes: 073350f7b5 ("mmc: mmc_spi: Fix return value evaluation of irq_of_parse_and_map()")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Link: https://lore.kernel.org/r/20210419112459.25241-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-04-23 09:29:49 +02:00
Andy Shevchenko
6c857ccf4e
mmc: mmc_spi: Set up polling even if voltage-ranges is not present
...
When voltage-ranges property is not present the driver assumes that
it is 3.3v (3.2v..3.4v). But at the same time it disallows polling.
Fix that by dropping the comparison to 0 when no property is provided.
While at it, mark voltage-ranges property optional as it was initially.
Fixes: 9c43df5791 ("mmc_spi: Add support for OpenFirmware bindings")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Link: https://lore.kernel.org/r/20210419112459.25241-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-04-23 09:29:49 +02:00
Andy Shevchenko
6dab809bb5
mmc: core: Convert mmc_of_parse_voltage() to use device property API
...
mmc_of_parse() for a few years has been using device property API.
Convert mmc_of_parse_voltage() as well.
At the same time switch users to new API.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Link: https://lore.kernel.org/r/20210419112459.25241-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-04-23 09:29:49 +02:00
Ulf Hansson
82104edc59
Merge branch 'fixes' into next
2021-04-19 09:52:08 +02:00
Neil Armstrong
7412dee9f1
mmc: meson-gx: replace WARN_ONCE with dev_warn_once about scatterlist size alignment in block mode
...
Since commit e085b51c74 ("mmc: meson-gx: check for scatterlist size alignment in block mode"),
support for SDIO SD_IO_RW_EXTENDED transferts are properly filtered but some driver
like brcmfmac still gives a block sg buffer size not aligned with SDIO block,
triggerring a WARN_ONCE() with scary stacktrace even if the transfer works fine
but with possible degraded performances.
Simply replace with dev_warn_once() to inform user this should be fixed to avoid
degraded performance.
This should be ultimately fixed in brcmfmac, but since it's only a performance issue
the warning should be removed.
Fixes: e085b51c74 ("mmc: meson-gx: check for scatterlist size alignment in block mode")
Reported-by: Marek Szyprowski <m.szyprowski@samsung.com >
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com >
Link: https://lore.kernel.org/r/20210416094347.2015896-1-narmstrong@baylibre.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-04-19 09:49:27 +02:00
Shawn Lin
df4e137299
mmc: dw_mmc-rockchip: Just set default sample value for legacy mode
...
.set_ios() is called from .resume() as well. For SDIO device which sets
keep-power-in-suspend, nothing should be changed after resuming, as well
as sample tuning value, since this value is tuned already. So we should
not overwrite it with the default value.
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com >
Link: https://lore.kernel.org/r/1618539454-182170-1-git-send-email-shawn.lin@rock-chips.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-04-16 15:10:08 +02:00
Krzysztof Kozlowski
e614740a06
mmc: sdhci-s3c: constify uses of driver/match data
...
The driver data (struct sdhci_s3c_drv_data) stored in of_device_id
table is allocated as const and used only in const-way. Skip
unnecessary const-away casts and convert all users to work with pointer
to const. This is both more logical and safer.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com >
Reviewed-by: Sylwester Nawrocki <snawrocki@kernel.org >
Link: https://lore.kernel.org/r/20210415084412.51125-3-krzysztof.kozlowski@canonical.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-04-15 14:00:15 +02:00
Krzysztof Kozlowski
90cdaa84c5
mmc: sdhci-s3c: correct kerneldoc of sdhci_s3c_drv_data
...
Correct the name of sdhci_s3c_drv_data structure in kerneldoc:
drivers/mmc/host/sdhci-s3c.c:143: warning:
expecting prototype for struct sdhci_s3c_driver_data. Prototype was for struct sdhci_s3c_drv_data instead
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com >
Reviewed-by: Sylwester Nawrocki <snawrocki@kernel.org >
Link: https://lore.kernel.org/r/20210415084412.51125-2-krzysztof.kozlowski@canonical.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-04-15 14:00:15 +02:00
Krzysztof Kozlowski
0ab53e498f
mmc: sdhci-s3c: simplify getting of_device_id match data
...
Use of_device_get_match_data() to make the code slightly smaller and to
remove the of_device_id table forward declaration.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com >
Reviewed-by: Sylwester Nawrocki <snawrocki@kernel.org >
Link: https://lore.kernel.org/r/20210415084412.51125-1-krzysztof.kozlowski@canonical.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-04-15 14:00:15 +02:00
Wolfram Sang
0751d56ef1
mmc: tmio: always restore irq register
...
Currently, only SDHI on R-Car Gen2+ reinitializes the irq register
during reset but it should be done on all instances. We can move it from
the SDHI driver to the TMIO core, because we now have the
'sd_irq_mask_all' variable which carries the proper value to use. That
also means we can remove the initialization from tmio_mmc_probe()
because it calls tmio_mmc_reset(), too. We only move that
tmio_mmc_reset() call there a little to ensure 'sd_irq_mask_all' is
properly set.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com >
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se >
Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com >
Tested-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com >
Link: https://lore.kernel.org/r/20210413083137.11171-1-wsa+renesas@sang-engineering.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-04-15 13:59:02 +02:00
Ben Chuang
9751bacc8c
mmc: sdhci-pci-gli: Enlarge ASPM L1 entry delay of GL975x
...
GL975x enters ASPM L1 state after a short idle in default.
Enlarge the idle period to 7.9us for improving the R/W performance.
Signed-off-by: Ben Chuang <benchuanggli@gmail.com >
Link: https://lore.kernel.org/r/20210415032637.5219-1-benchuanggli@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-04-15 13:51:37 +02:00
Rafael J. Wysocki
eed7a17508
Merge branch 'opp/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm
...
Pull OPP (Operating Performance Points) framework updates for v5.13
from Viresh Kumar:
"This adds devm variants for OPP APIs and updates few of the users
as well (Yangtao Li and Dmitry Osipenko)."
* 'opp/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm:
memory: samsung: exynos5422-dmc: Convert to use resource-managed OPP API
drm/panfrost: Convert to use resource-managed OPP API
drm/lima: Convert to use resource-managed OPP API
mmc: sdhci-msm: Convert to use resource-managed OPP API
spi: spi-qcom-qspi: Convert to use resource-managed OPP API
spi: spi-geni-qcom: Convert to use resource-managed OPP API
serial: qcom_geni_serial: Convert to use resource-managed OPP API
opp: Change return type of devm_pm_opp_attach_genpd()
opp: Change return type of devm_pm_opp_register_set_opp_helper()
opp: Add devres wrapper for dev_pm_opp_of_add_table
opp: Add devres wrapper for dev_pm_opp_set_supported_hw
opp: Add devres wrapper for dev_pm_opp_set_regulators
opp: Add devres wrapper for dev_pm_opp_set_clkname
2021-04-12 14:49:31 +02:00
Laibin Qiu
50eae6bada
mmc: sdhci-st: Remove unnecessary error log
...
devm_ioremap_resource() has recorded error log, so it's
unnecessary to record log again.
Reported-by: Hulk Robot <hulkci@huawei.com >
Signed-off-by: Laibin Qiu <qiulaibin@huawei.com >
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com >
Link: https://lore.kernel.org/r/20210409023801.3326572-1-qiulaibin@huawei.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-04-12 13:52:48 +02:00
Jia Yang
ffa4877c0a
mmc: sdhci-msm: Remove unnecessary error log
...
devm_ioremap_resource() has recorded error log, so it's
unnecessary to record log again.
Reported-by: Hulk Robot <hulkci@huawei.com >
Signed-off-by: Jia Yang <jiayang5@huawei.com >
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org >
Link: https://lore.kernel.org/r/20210409015424.3277212-1-jiayang5@huawei.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-04-12 13:52:47 +02:00
Laibin Qiu
489702f450
mmc: owl-mmc: Remove unnecessary error log
...
devm_ioremap_resource() has recorded error log, so it's
unnecessary to record log again.
Reported-by: Hulk Robot <hulkci@huawei.com >
Signed-off-by: Laibin Qiu <qiulaibin@huawei.com >
Reviewed-by: Manivannan Sadhasivam <mani@kernel.org >
Link: https://lore.kernel.org/r/20210409023349.3325907-1-qiulaibin@huawei.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-04-12 13:52:47 +02:00
Wolfram Sang
87e985aea2
mmc: renesas_sdhi: enable WAIT_WHILE_BUSY
...
Now that we got the timeout handling in the driver correct, we can use
this capability to avoid polling via the MMC core.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com >
Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com >
Tested-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com >
Link: https://lore.kernel.org/r/20210409094606.4317-1-wsa+renesas@sang-engineering.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-04-12 13:52:47 +02:00
Aniruddha Tvs Rao
5ec6fa5a6d
mmc: sdhci-tegra: Add required callbacks to set/clear CQE_EN bit
...
CMD8 is not supported with Command Queue Enabled. Add required callback
to clear CQE_EN and CQE_INTR fields in the host controller register
before sending CMD8. Add corresponding callback in the CQHCI resume path
to re-enable CQE_EN and CQE_INTR fields.
Reported-by: Kamal Mostafa <kamal@canonical.com >
Tested-by: Kamal Mostafa <kamal@canonical.com >
Signed-off-by: Aniruddha Tvs Rao <anrao@nvidia.com >
Signed-off-by: Jon Hunter <jonathanh@nvidia.com >
Acked-by: Adrian Hunter <adrian.hunter@intel.com >
Acked-by: Thierry Reding <treding@nvidia.com >
Link: https://lore.kernel.org/r/20210407094617.770495-1-jonathanh@nvidia.com
Cc: stable@vger.kernel.org # v5.10+
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-04-12 13:52:29 +02:00
Ben Chuang
baaaf55d99
mmc: sdhci-pci-gli: Improve GL9763E L1 entry delay to increase battery life
...
For GL9763E, although there is the best performance at the maximum delay.
Change the value to 20us in order to have better power consumption.
This change may reduce the maximum performance by 10%.
Signed-off-by: Ben Chuang <ben.chuang@genesyslogic.com.tw >
Link: https://lore.kernel.org/r/20210407093816.8863-1-benchuanggli@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-04-12 09:09:05 +02:00
Yang Li
ae3519b6ab
mmc: moxart: Remove unused variable 'dma_time' and 'pio_time'
...
Fixes the following W=1 kernel build warning(s):
drivers/mmc/host/moxart-mmc.c:257:7: warning: variable ‘dma_time’ set
but not used
drivers/mmc/host/moxart-mmc.c:395:7: warning: variable ‘pio_time’ set
but not used
Reported-by: Abaci Robot <abaci@linux.alibaba.com >
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com >
Link: https://lore.kernel.org/r/1617357231-93064-1-git-send-email-yang.lee@linux.alibaba.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-04-12 08:54:06 +02:00
Adrian Hunter
2970134b92
mmc: sdhci-pci: Fix initialization of some SD cards for Intel BYT-based controllers
...
Bus power may control card power, but the full reset done by SDHCI at
initialization still may not reset the power, whereas a direct write to
SDHCI_POWER_CONTROL can. That might be needed to initialize correctly, if
the card was left powered on previously.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20210331081752.23621-1-adrian.hunter@intel.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-03-31 14:49:32 +02:00
Hao Fang
47805532eb
mmc: dw_mmc-k3: use the correct HiSilicon copyright
...
s/Hisilicon/HiSilicon/g.
It should use capital S, according to
https://www.hisilicon.com/en/terms-of-use .
Signed-off-by: Hao Fang <fanghao11@huawei.com >
Acked-by: Zhangfei Gao <zhangfei.gao@linaro.org >
Link: https://lore.kernel.org/r/1617086448-51054-1-git-send-email-fanghao11@huawei.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-03-31 14:47:53 +02:00
Shawn Guo
25e8b9eb09
mmc: sdhci-esdhc-imx: separate 100/200 MHz pinctrl states check
...
As indicated by function esdhc_change_pinstate(), SDR50 and DDR50
require pins_100mhz, while SDR104 and HS400 require pins_200mhz. Some
system design may support SDR50 and DDR50 with 100mhz pin state only
(without 200mhz one). Currently the combined 100/200 MHz pinctrl state
check prevents such system from running SDR50 and DDR50. Separate the
check to support such system design.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org >
Reviewed-by: Haibo Chen <haibo.chen@nxp.com >
Link: https://lore.kernel.org/r/20210326110214.28416-1-shawnguo@kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-03-30 12:42:54 +02:00
Al Cooper
f0bdf98fab
mmc: sdhci-brcmstb: Remove CQE quirk
...
Remove the CQHCI_QUIRK_SHORT_TXFR_DESC_SZ quirk because the
latest chips have this fixed and earlier chips have other
CQE problems that prevent the feature from being enabled.
Signed-off-by: Al Cooper <alcooperx@gmail.com >
Acked-by: Florian Fainelli <f.fainelli@gmail.com >
Link: https://lore.kernel.org/r/20210325192834.42955-1-alcooperx@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-03-30 12:42:44 +02:00
Jisheng Zhang
bac53336ca
mmc: sdhci: replace mmc->parent with mmc_dev() for consistency
...
As pointed out by Ulf, "both "mmc->parent" and mmc_dev(mmc) are being
used in the entire c-file". Convert all the mmc->parent usage in all
sdhci host driver to mmc_dev() for consistency.
Suggested-by: Ulf Hansson <ulf.hansson@linaro.org >
Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com >
Link: https://lore.kernel.org/r/20210324155013.1e5faa3c@xhacker.debian
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-03-30 11:42:07 +02:00
Jisheng Zhang
57ac3084f5
mmc: sdhci-of-dwcmshc: set MMC_CAP_WAIT_WHILE_BUSY
...
The host supports HW busy detection of the device busy signaling over
dat0 line. Set MMC_CAP_wAIT_WHILE_BUSY host capability.
Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com >
Link: https://lore.kernel.org/r/20210324154703.69f97fde@xhacker.debian
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-03-30 11:42:07 +02:00
Wei Yongjun
34884c4f64
mmc: sdhci-of-dwcmshc: fix error return code in dwcmshc_probe()
...
Fix to return negative error code -ENOMEM from the error handling
case instead of 0, as done elsewhere in this function.
Fixes: c2c4da37837e ("mmc: sdhci-of-dwcmshc: add rockchip platform support")
Reported-by: Hulk Robot <hulkci@huawei.com >
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com >
Link: https://lore.kernel.org/r/20210323112956.1016884-1-weiyongjun1@huawei.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-03-30 11:42:07 +02:00
Liming Sun
eb81ed5180
mmc: sdhci-of-dwcmshc: add ACPI support for BlueField-3 SoC
...
This commit adds ACPI support in the sdhci-of-dwcmshc driver for
BlueField-3 SoC. It has changes to only use the clock hierarchy
for Deviec Tree since the clk is not supported by ACPI. Instead,
ACPI can define 'clock-frequency' which is parsed by existing
sdhci_get_property(). This clock value will be returned in function
dwcmshc_get_max_clock().
Signed-off-by: Liming Sun <limings@nvidia.com >
Reviewed-by: Khalil Blaiech <kblaiech@nvidia.com >
Link: https://lore.kernel.org/r/1616453211-275165-1-git-send-email-limings@nvidia.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-03-30 11:42:07 +02:00
Adrian Hunter
ee629112be
mmc: sdhci-pci: Add PCI IDs for Intel LKF
...
Add PCI IDs for Intel LKF eMMC and SD card host controllers.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Link: https://lore.kernel.org/r/20210322055356.24923-1-adrian.hunter@intel.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-03-30 11:42:07 +02:00
Wolfram Sang
6e5c951b4c
mmc: tmio: always flag retune when resetting and a card is present
...
After reset, we manually flagged retune in runtime resume, but missed it
in the workqueue. To fix that and avoid the problem in the future, let's
flag retune in the reset handler directly whenever a card is present.
Reported-by: Takeshi Saito <takeshi.saito.xv@renesas.com >
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com >
Link: https://lore.kernel.org/r/20210316085717.7276-3-wsa+renesas@sang-engineering.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-03-30 11:42:06 +02:00
Takeshi Saito
0a446288aa
mmc: tmio: restore bus width when resetting
...
Resetting the IP core will lose the bus width information and not all
code paths recover it. So, make sure the latest bus width gets restored
in the reset routine. For that, tmio_mmc_set_bus_width() is moved, but
not modified.
Signed-off-by: Takeshi Saito <takeshi.saito.xv@renesas.com >
[wsa: reworded commit message]
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com >
Link: https://lore.kernel.org/r/20210316085717.7276-2-wsa+renesas@sang-engineering.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-03-30 11:42:06 +02:00
Bean Huo
6b0e0fce40
mmc: cavium: Use '"%s...", __func__' to print function name
...
Use preferred way '"%s...", __func__' to print function name.
Signed-off-by: Bean Huo <beanhuo@micron.com >
Link: https://lore.kernel.org/r/20210319121357.255176-2-huobean@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-03-30 11:42:06 +02:00
James Young
955047f3c3
mmc: sdhci-acpi: Add device ID for the AMDI0041 variant of the AMD eMMC controller.
...
This variant is present on a Lenovo IdeaPad Slim 1, which uses an AMD Dali/Athlon Silver 3050e.
The Windows AMD SD Host Controller driver also lists this as a valid device ID.
Adding this device ID makes the internal eMMC storage on the Lenovo accessible.
Consequently this makes Linux installable and usable on it as well.
Signed-off-by: James Young <james@pocketfluff.org >
Link: https://lore.kernel.org/r/20210318124025.3002861-1-james@pocketfluff.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-03-30 11:42:06 +02:00
Wolfram Sang
b4d86f37ea
mmc: renesas_sdhi: do hard reset if possible
...
All recent SDHI instances can be reset via the reset controller. If one
is found, use it instead of the open coded reset. This is to get a
future-proof sane reset state.
Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com >
Tested-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com >
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com >
Link: https://lore.kernel.org/r/20210317091622.31890-4-wsa+renesas@sang-engineering.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-03-30 11:42:05 +02:00
Wolfram Sang
0e58701458
mmc: renesas_sdhi: break SCC reset into own function
...
renesas_sdhi_reset used to mainly reset the SCC but is now doing more
and even more will be added. So, factor out SCC reset to have a clear
distinction when we want to reset either SCC or SDHI+SCC.
Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com >
Tested-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com >
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com >
Link: https://lore.kernel.org/r/20210317091622.31890-3-wsa+renesas@sang-engineering.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-03-30 11:42:05 +02:00
Wolfram Sang
ab0cdefec0
mmc: tmio: abort DMA before reset
...
We will soon allow resetting the whole IP core via a reset controller.
For this case, DMA must be terminated before the actual reset. For the
other cases, it is probably better, too.
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se >
Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com >
Tested-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com >
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com >
Link: https://lore.kernel.org/r/20210317091622.31890-2-wsa+renesas@sang-engineering.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-03-30 11:42:05 +02:00
Shawn Lin
08f3dff799
mmc: sdhci-of-dwcmshc: add rockchip platform support
...
sdhci based synopsys MMC IP is also used on some rockchip platforms,
so add a basic support here.
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com >
Link: https://lore.kernel.org/r/1615879102-45919-3-git-send-email-shawn.lin@rock-chips.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-03-30 11:42:05 +02:00
Fabio Estevam
91b3d2e5b7
mmc: sdhci-esdhc-imx: Use device_get_match_data()
...
The retrieval of driver data can be a bit simplified by using
device_get_match_data(), so switch to it.
Signed-off-by: Fabio Estevam <festevam@gmail.com >
Link: https://lore.kernel.org/r/20210314230824.148969-2-festevam@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-03-30 11:42:04 +02:00
Fabio Estevam
ebe9572fd2
mmc: sdhci-esdhc-imx: Remove non-DT stub
...
i.MX has been converted to a devicetree only platform, so remove
the non-DT stub for sdhci_esdhc_imx_probe_dt().
Also, make the driver depend on OF now.
Signed-off-by: Fabio Estevam <festevam@gmail.com >
Link: https://lore.kernel.org/r/20210314230824.148969-1-festevam@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-03-30 11:42:04 +02:00
Jisheng Zhang
d2f025b08e
mmc: sdhci: Use "mmc" directly rather than "host->mmc"
...
Clean up the code to use the "mmc" directly instead of "host->mmc".
If the code sits in hot code path, this clean up also brings trvial
performance improvement. Take the sdhci_post_req() for example:
before the patch:
...
8d0: a9be7bfd stp x29, x30, [sp, #-32]!
8d4: 910003fd mov x29, sp
8d8: f9000bf3 str x19, [sp, #16 ]
8dc: f9400833 ldr x19, [x1, #16 ]
8e0: b9404261 ldr w1, [x19, #64 ]
8e4: 34000161 cbz w1, 910 <sdhci_post_req+0x50>
8e8: f9424400 ldr x0, [x0, #1160 ]
8ec: d2800004 mov x4, #0x0 // #0
8f0: b9401a61 ldr w1, [x19, #24 ]
8f4: b9403262 ldr w2, [x19, #48 ]
8f8: f9400000 ldr x0, [x0]
8fc: f278003f tst x1, #0x100
900: f9401e61 ldr x1, [x19, #56 ]
904: 1a9f17e3 cset w3, eq // eq = none
908: 11000463 add w3, w3, #0x1
90c: 94000000 bl 0 <dma_unmap_sg_attrs>
...
After the patch:
...
8d0: a9be7bfd stp x29, x30, [sp, #-32]!
8d4: 910003fd mov x29, sp
8d8: f9000bf3 str x19, [sp, #16 ]
8dc: f9400833 ldr x19, [x1, #16 ]
8e0: b9404261 ldr w1, [x19, #64 ]
8e4: 34000141 cbz w1, 90c <sdhci_post_req+0x4c>
8e8: b9401a61 ldr w1, [x19, #24 ]
8ec: d2800004 mov x4, #0x0 // #0
8f0: b9403262 ldr w2, [x19, #48 ]
8f4: f9400000 ldr x0, [x0]
8f8: f278003f tst x1, #0x100
8fc: f9401e61 ldr x1, [x19, #56 ]
900: 1a9f17e3 cset w3, eq // eq = none
904: 11000463 add w3, w3, #0x1
908: 94000000 bl 0 <dma_unmap_sg_attrs>
...
We saved one ldr instruction: "ldr x0, [x0, #1160 ]"
Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com >
Acked-by: Adrian Hunter <adrian.hunter@intel.com >
Link: https://lore.kernel.org/r/20210311174046.597d1951@xhacker.debian
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-03-30 11:42:03 +02:00
Jisheng Zhang
ba8734dfbe
mmc: sdhci-pci: Avoid comma separated statements
...
Use semicolons.
Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com >
Acked-by: Adrian Hunter <adrian.hunter@intel.com >
Link: https://lore.kernel.org/r/20210311181432.6385cd2b@xhacker.debian
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-03-30 11:42:03 +02:00
Yang Li
3a75283a6b
mmc: via-sdmmc: remove unneeded variable 'ret'
...
Fix the following coccicheck warning:
./drivers/mmc/host/via-sdmmc.c:1274:5-8: Unneeded variable: "ret".
Return "0" on line 1295
Reported-by: Abaci Robot <abaci@linux.alibaba.com >
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com >
Link: https://lore.kernel.org/r/1615272478-52458-1-git-send-email-yang.lee@linux.alibaba.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-03-30 11:42:03 +02:00
Philipp Zabel
baf6fe4036
mmc: dw_mmc: simplify optional reset handling
...
As of commit bb475230b8 ("reset: make optional functions really
optional"), the reset framework API calls use NULL pointers to describe
optional, non-present reset controls.
This allows to return errors from devm_reset_control_get_optional and to
call reset_control_(de)assert unconditionally.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de >
Link: https://lore.kernel.org/r/20210305090724.18832-1-p.zabel@pengutronix.de
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-03-30 11:42:02 +02:00
Philipp Zabel
95211a98e3
mmc: sdhci-st: simplify optional reset handling
...
As of commit bb475230b8 ("reset: make optional functions really
optional"), the reset framework API calls use NULL pointers to describe
optional, non-present reset controls.
This allows to return errors from devm_reset_control_get_optional and to
call reset_control_(de)assert unconditionally.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de >
Link: https://lore.kernel.org/r/20210305090827.19124-1-p.zabel@pengutronix.de
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-03-30 11:42:02 +02:00
Wolfram Sang
9f12cac1bb
mmc: renesas_sdhi: use custom mask for TMIO_MASK_ALL
...
Populate the new member for custom mask values to make sure this value
is applied whenever needed. Also, rename the define holding the value
because this is not only about initialization anymore.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com >
Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com >
Tested-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com >
Link: https://lore.kernel.org/r/20210304092903.8534-1-wsa+renesas@sang-engineering.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-03-30 11:42:01 +02:00
Pradeep P V K
21e35e898a
mmc: sdhci: Check for reset prior to DMA address unmap
...
For data read commands, SDHC may initiate data transfers even before it
completely process the command response. In case command itself fails,
driver un-maps the memory associated with data transfer but this memory
can still be accessed by SDHC for the already initiated data transfer.
This scenario can lead to un-mapped memory access error.
To avoid this scenario, reset SDHC (when command fails) prior to
un-mapping memory. Resetting SDHC ensures that all in-flight data
transfers are either aborted or completed. So we don't run into this
scenario.
Swap the reset, un-map steps sequence in sdhci_request_done().
Suggested-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org >
Signed-off-by: Pradeep P V K <pragalla@codeaurora.org >
Acked-by: Adrian Hunter <adrian.hunter@intel.com >
Link: https://lore.kernel.org/r/1614760331-43499-1-git-send-email-pragalla@qti.qualcomm.com
Cc: stable@vger.kernel.org # v4.9+
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-03-30 11:42:01 +02:00
Dinghao Liu
d599005afd
mmc: sdhci-pci-o2micro: Add missing checks in sdhci_pci_o2_probe
...
It's odd to adopt different error handling on failure of
pci_read_config_dword(). Check the return value and terminate
execution flow on failure of all pci_read_config_dword() calls
in this function.
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn >
Link: https://lore.kernel.org/r/20210226084146.29095-1-dinghao.liu@zju.edu.cn
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-03-30 11:42:00 +02:00
Renius Chen
f46b54cc72
mmc: sdhci-pci-gli: Enable short circuit protection mechanism of GL9755
...
Short circuit protection mechanism of GL9755 is disabled by HW default
setting. Enable short circuit protection to prevent GL9755 from being
damaged by short circuit or over current.
Signed-off-by: Renius Chen <reniuschengl@gmail.com >
Link: https://lore.kernel.org/r/20210225111307.62975-1-reniuschengl@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-03-30 11:42:00 +02:00
Peng Fan
f410ee0aa2
mmc: sdhci-esdhc-imx: validate pinctrl before use it
...
When imx_data->pinctrl is not a valid pointer, pinctrl_lookup_state
will trigger kernel panic.
When we boot Dual OS on Jailhouse hypervisor, we let the 1st Linux to
configure pinmux ready for the 2nd OS, so the 2nd OS not have pinctrl
settings.
Similar to this commit b62eee9f80 ("mmc: sdhci-esdhc-imx: no fail when no pinctrl available").
Reviewed-by: Bough Chen <haobo.chen@nxp.com >
Reviewed-by: Alice Guo <alice.guo@nxp.com >
Signed-off-by: Peng Fan <peng.fan@nxp.com >
Link: https://lore.kernel.org/r/1614222604-27066-6-git-send-email-peng.fan@oss.nxp.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org >
2021-03-30 11:42:00 +02:00