Commit graph

7630 commits

Author SHA1 Message Date
Wolfram Sang
b71597edfa mmc: core: improve API to make clear mmc_hw_reset is for cards
To make it unambiguous that mmc_hw_reset() is for cards and not for
controllers, we make the function argument mmc_card instead of mmc_host.
Also, all users are converted.

Suggested-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220408080045.6497-2-wsa+renesas@sang-engineering.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2022-04-08 11:00:08 +02:00
Wolfram Sang
03e59b1e2f mmc: renesas_sdhi: don't overwrite TAP settings when HS400 tuning is complete
When HS400 tuning is complete and HS400 is going to be activated, we
have to keep the current number of TAPs and should not overwrite them
with a hardcoded value. This was probably a copy&paste mistake when
upporting HS400 support from the BSP.

Fixes: 26eb2607fa ("mmc: renesas_sdhi: add eMMC HS400 mode support")
Reported-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20220404114902.12175-1-wsa+renesas@sang-engineering.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2022-04-07 12:48:19 +02:00
Wolfram Sang
46d4820f94 mmc: renesas_sdhi: special 4tap settings only apply to HS400
Previous documentation was vague, so we included SDR104 for slow SDnH
clock settings. It turns out now, that it is only needed for HS400.

Fixes: bb6d3fa98a ("clk: renesas: rcar-gen3: Switch to new SD clock handling")
Cc: stable@vger.kernel.org
Reported-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Link: https://lore.kernel.org/r/20220404100508.3209-1-wsa+renesas@sang-engineering.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2022-04-04 13:46:10 +02:00
Michael Wu
08ebf903af mmc: core: Fixup support for writeback-cache for eMMC and SD
During the card initialization process, the mmc core checks whether the
eMMC/SD card supports an internal writeback-cache and then enables it
inside the card.

Unfortunately, this isn't according to what the mmc core reports to the
upper block layer. Instead, the writeback-cache support with REQ_FLUSH and
REQ_FUA, are being enabled depending on whether the host supports the CMD23
(MMC_CAP_CMD23) and whether an eMMC supports the reliable-write command.

This is wrong and it may also sound awkward. In fact, it's a remnant
from when both eMMC/SD cards didn't have dedicated commands/support to
control the internal writeback-cache. In other words, it was the best we
could do at that point in time.

To fix the problem, but also without breaking backwards compatibility,
let's align the REQ_FLUSH support with whether the writeback-cache became
successfully enabled - for both eMMC and SD cards.

Cc: stable@kernel.org
Fixes: 881d1c25f7 ("mmc: core: Add cache control for eMMC4.5 device")
Fixes: 130206a615 ("mmc: core: Add support for cache ctrl for SD cards")
Depends-on: 97fce126e2 ("mmc: block: Issue a cache flush only when it's enabled")
Reviewed-by: Avri Altman <Avri.Altman@wdc.com>
Signed-off-by: Michael Wu <michael@allwinnertech.com>
Link: https://lore.kernel.org/r/20220331073223.106415-1-michael@allwinnertech.com
[Ulf: Re-wrote the commit message]
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2022-04-04 13:27:58 +02:00
Christian Löhle
5d43593337 mmc: block: Check for errors after write on SPI
Introduce a SEND_STATUS check for writes through SPI to not mark
an unsuccessful write as successful.

Since SPI SD/MMC does not have states, after a write, the card will
just hold the line LOW until it is ready again. The driver marks the
write therefore as completed as soon as it reads something other than
all zeroes.
The driver does not distinguish from a card no longer signalling busy
and it being disconnected (and the line being pulled-up by the host).
This lead to writes being marked as successful when disconnecting
a busy card.
Now the card is ensured to be still connected by an additional CMD13,
just like non-SPI is ensured to go back to TRAN state.

While at it and since we already poll for the post-write status anyway,
we might as well check for SPIs error bits (any of them).

The disconnecting card problem is reproducable for me after continuous
write activity and randomly disconnecting, around every 20-50 tries
on SPI DS for some card.

Fixes: 7213d175e3 ("MMC/SD card driver learns SPI")
Cc: stable@vger.kernel.org
Signed-off-by: Christian Loehle <cloehle@hyperstone.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/76f6f5d2b35543bab3dfe438f268609c@hyperstone.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2022-04-04 12:17:46 +02:00
Yann Gautier
0d319dd5a2 mmc: mmci: stm32: correctly check all elements of sg list
Use sg and not data->sg when checking sg list elements. Else only the
first element alignment is checked.
The last element should be checked the same way, for_each_sg already set
sg to sg_next(sg).

Fixes: 46b723dd86 ("mmc: mmci: add stm32 sdmmc variant")
Cc: stable@vger.kernel.org
Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Link: https://lore.kernel.org/r/20220317111944.116148-2-yann.gautier@foss.st.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2022-04-04 12:17:46 +02:00
Pali Rohár
7e2646ed47 Revert "mmc: sdhci-xenon: fix annoying 1.8V regulator warning"
This reverts commit bb32e1987b.

Commit 1a3ed0dc35 ("mmc: sdhci-xenon: fix 1.8v regulator stabilization")
contains proper fix for the issue described in commit bb32e1987b ("mmc:
sdhci-xenon: fix annoying 1.8V regulator warning").

Fixes: 8d876bf472 ("mmc: sdhci-xenon: wait 5ms after set 1.8V signal enable")
Cc: stable@vger.kernel.org # 1a3ed0dc35 ("mmc: sdhci-xenon: fix 1.8v regulator stabilization")
Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Marcin Wojtas <mw@semihalf.com>
Link: https://lore.kernel.org/r/20220318141441.32329-1-pali@kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2022-04-04 12:17:46 +02:00
Linus Torvalds
7203062171 TTY/Serial driver changes for 5.18-rc1
Here are the big set of tty and serial driver changes for 5.18-rc1.
 
 Nothing major, some more good cleanups from Jiri and 2 new serial
 drivers.  Highlights include:
 	- termbits cleanups
 	- export symbol cleanups and other core cleanups from Jiri Slaby
 	- new sunplus and mvebu uart drivers (amazing that people are
 	  still creating new uarts...)
 	- samsung serial driver cleanups
 	- ldisc 29 is now "reserved" for experimental/development line
 	  disciplines
 	- lots of other tiny fixes and cleanups to serial drivers and
 	  bindings
 
 All of these have been in linux-next for a while with no reported
 issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCYkGznQ8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ymnFwCgwGD/syV+BH2krgY6cRixZz72vPsAn2RSnicd
 2YUwSNCHoL+B7hvQMtDG
 =A3X9
 -----END PGP SIGNATURE-----

Merge tag 'tty-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty

Pull tty/serial driver updates from Greg KH:
 "Here are the big set of tty and serial driver changes for 5.18-rc1.

  Nothing major, some more good cleanups from Jiri and 2 new serial
  drivers. Highlights include:

   - termbits cleanups

   - export symbol cleanups and other core cleanups from Jiri Slaby

   - new sunplus and mvebu uart drivers (amazing that people are still
     creating new uarts...)

   - samsung serial driver cleanups

   - ldisc 29 is now "reserved" for experimental/development line
     disciplines

   - lots of other tiny fixes and cleanups to serial drivers and
     bindings

  All of these have been in linux-next for a while with no reported
  issues"

* tag 'tty-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (104 commits)
  vt_ioctl: fix potential spectre v1 in VT_DISALLOCATE
  serial: 8250: fix XOFF/XON sending when DMA is used
  tty: serial: samsung: Add ARTPEC-8 support
  dt-bindings: serial: samsung: Add ARTPEC-8 UART
  serial: sc16is7xx: Clear RS485 bits in the shutdown
  tty: serial: samsung: simplify getting OF match data
  tty: serial: samsung: constify variables and pointers
  tty: serial: samsung: constify s3c24xx_serial_drv_data members
  tty: serial: samsung: constify UART name
  tty: serial: samsung: constify s3c24xx_serial_drv_data
  tty: serial: samsung: reduce number of casts
  tty: serial: samsung: embed s3c2410_uartcfg in parent structure
  tty: serial: samsung: embed s3c24xx_uart_info in parent structure
  serial: 8250_tegra: mark acpi_device_id as unused with !ACPI
  tty: serial: bcm63xx: use more precise Kconfig symbol
  serial: SERIAL_SUNPLUS should depend on ARCH_SUNPLUS
  tty: serial: jsm: fix two assignments in if conditions
  tty: serial: jsm: remove redundant assignments to variable linestatus
  serial: 8250_mtk: make two read-only arrays static const
  serial: samsung_tty: do not unlock port->lock for uart_write_wakeup()
  ...
2022-03-28 13:00:51 -07:00
Linus Torvalds
dfdc1de642 Staging driver update for 5.18-rc1
Here is the big set of staging driver updates for 5.18-rc1.
 
 Loads of tiny cleanups for almost all staging drivers in here, nothing
 major at all.  Highlights include:
 	- remove the ashmem Android driver.  It is long-dead and if
 	  there are any legacy userspace applications still using it,
 	  the Android kernel images will maintain it, the community
 	  shouldn't care about it anymore
 	- wfx wifi driver major cleanups.  Should be ready to merge out
 	  of staging soon, and will coordinate with the wifi maintainers
 	  after -rc1 is out
 	- major cleanups and unwinding of the layers of the r8188eu
 	  driver.  It's amazing just how many unneeded layers of
 	  abstraction is in there, just when we think it's done, another
 	  is found...
 	- lots of tiny coding style cleanups in many other staging
 	  drivers.
 
 There will be merge conflict with a fbtft change and the spi driver
 changes in your tree, but it's pretty obvious what to do (the function
 shouldn't return anything.)
 
 All have been in linux-next for a while with no reported problems.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCYkG1cA8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ylndwCfVhxKnbTYKtOs6UEr5pgPCoQCioUAn0Y2i0TG
 4aFeeKUyL8VGdAitL+tp
 =E6v7
 -----END PGP SIGNATURE-----

Merge tag 'staging-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging driver updates from Greg KH:
 "Here is the big set of staging driver updates for 5.18-rc1.

  Loads of tiny cleanups for almost all staging drivers in here, nothing
  major at all. Highlights include:

   - remove the ashmem Android driver. It is long-dead and if there are
     any legacy userspace applications still using it, the Android
     kernel images will maintain it, the community shouldn't care about
     it anymore

   - wfx wifi driver major cleanups. Should be ready to merge out of
     staging soon, and will coordinate with the wifi maintainers after
     -rc1 is out

   - major cleanups and unwinding of the layers of the r8188eu driver.
     It's amazing just how many unneeded layers of abstraction is in
     there, just when we think it's done, another is found...

   - lots of tiny coding style cleanups in many other staging drivers.

  All have been in linux-next for a while with no reported problems"

* tag 'staging-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (455 commits)
  staging: r8188eu: remove unnecessary memset in r8188eu
  staging: greybus: introduce pwm_ops::apply
  staging: rts5208: Resolve checkpatch.pl issues.
  staging: sm750fb: fix naming style
  staging: fbtft: Consider type of init sequence values in fbtft_init_display()
  staging: fbtft: Constify buf parameter in fbtft_dbg_hex()
  staging: mmal-vchiq: clear redundant item named bulk_scratch
  mips: dts: ralink: add MT7621 SoC
  staging: r8188eu: remove some unused local ieee80211 macros
  staging: r8188eu: make rtl8188e_process_phy_info static
  staging: r8188eu: remove unused function prototype
  staging: r8188eu: remove three unused receive defines
  staging: r8188eu: remove unnecessary initializations
  staging: rtl8192e: Fix spelling mistake "RESQUEST" -> "REQUEST"
  MAINTAINERS: remove the obsolete file entry for staging in ANDROID DRIVERS
  staging: r8188eu: proper error handling in rtw_init_drv_sw
  staging: r8188eu: call _cancel_timer_ex from _rtw_free_recv_priv
  staging: vt6656: Removed unused variable vt3342_vnt_threshold
  staging: vt6656: Removed unused variable bb_vga_0
  staging: remove ashmem
  ...
2022-03-28 12:50:50 -07:00
Linus Torvalds
02e2af20f4 Char/Misc and other driver updates for 5.18-rc1
Here is the big set of char/misc and other small driver subsystem
 updates for 5.18-rc1.
 
 Included in here are merges from driver subsystems which contain:
 	- iio driver updates and new drivers
 	- fsi driver updates
 	- fpga driver updates
 	- habanalabs driver updates and support for new hardware
 	- soundwire driver updates and new drivers
 	- phy driver updates and new drivers
 	- coresight driver updates
 	- icc driver updates
 
 Individual changes include:
 	- mei driver updates
 	- interconnect driver updates
 	- new PECI driver subsystem added
 	- vmci driver updates
 	- lots of tiny misc/char driver updates
 
 There will be two merge conflicts with your tree, one in MAINTAINERS
 which is obvious to fix up, and one in drivers/phy/freescale/Kconfig
 which also should be easy to resolve.
 
 All of these have been in linux-next for a while with no reported
 problems.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCYkG3fQ8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ykNEgCfaRG8CRxewDXOO4+GSeA3NGK+AIoAnR89donC
 R4bgCjfg8BWIBcVVXg3/
 =WWXC
 -----END PGP SIGNATURE-----

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

Pull char/misc and other driver updates from Greg KH:
 "Here is the big set of char/misc and other small driver subsystem
  updates for 5.18-rc1.

  Included in here are merges from driver subsystems which contain:

   - iio driver updates and new drivers

   - fsi driver updates

   - fpga driver updates

   - habanalabs driver updates and support for new hardware

   - soundwire driver updates and new drivers

   - phy driver updates and new drivers

   - coresight driver updates

   - icc driver updates

  Individual changes include:

   - mei driver updates

   - interconnect driver updates

   - new PECI driver subsystem added

   - vmci driver updates

   - lots of tiny misc/char driver updates

  All of these have been in linux-next for a while with no reported
  problems"

* tag 'char-misc-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (556 commits)
  firmware: google: Properly state IOMEM dependency
  kgdbts: fix return value of __setup handler
  firmware: sysfb: fix platform-device leak in error path
  firmware: stratix10-svc: add missing callback parameter on RSU
  arm64: dts: qcom: add non-secure domain property to fastrpc nodes
  misc: fastrpc: Add dma handle implementation
  misc: fastrpc: Add fdlist implementation
  misc: fastrpc: Add helper function to get list and page
  misc: fastrpc: Add support to secure memory map
  dt-bindings: misc: add fastrpc domain vmid property
  misc: fastrpc: check before loading process to the DSP
  misc: fastrpc: add secure domain support
  dt-bindings: misc: add property to support non-secure DSP
  misc: fastrpc: Add support to get DSP capabilities
  misc: fastrpc: add support for FASTRPC_IOCTL_MEM_MAP/UNMAP
  misc: fastrpc: separate fastrpc device from channel context
  dt-bindings: nvmem: brcm,nvram: add basic NVMEM cells
  dt-bindings: nvmem: make "reg" property optional
  nvmem: brcm_nvram: parse NVRAM content into NVMEM cells
  nvmem: dt-bindings: Fix the error of dt-bindings check
  ...
2022-03-28 12:27:35 -07:00
Linus Torvalds
5bebe2c9ae MMC core:
- Convert to sysfs_emit() in favor of sprintf()
  - Improve fallback to speed modes if eMMC HS200 fails
 
 MMC host:
  - dw_mmc: Allow variants to set minimal supported clock rate
  - dw-mmc-rockchip: Fix problems with invalid clock rates
  - litex_mmc: Add new DT based driver for the LiteX's LiteSDCard interface
  - litex_mmc: Add Gabriel Somlo and Joel Stanley as co-maintainers for LiteX
  - mtk-sd: Add support for the Mediatek MT8186 variant
  - renesas_sdhi: Add support for RZ/G2UL variant
  - renesas_sdhi: Add support for RZ/V2L variant
  - rtsx_pci: Adjust power-on sequence to conform to the SD spec
  - sdhci-am654: Add support for TI's AM62 variant
  - sdhci_am654: Fixup support for TI's AM64 variant
  - sdhci-esdhc-imx: Add support for the imx93 variant
  - sdhci-msm: Add support for the msm8953 variant
  - sdhci-pci-gli: Add support for runtime PM for the GL9763E variant
  - sdhci-pci-gli: Adjustments of the SSC function for the GL975x variants
  - sdhci-tegra: Add support for wake on SD card event
  - sunxi-mmc: Add support for Allwinner's F1c100s variant
  - sunxi-mmc: Add support for D1 MMC variant
 -----BEGIN PGP SIGNATURE-----
 
 iQJLBAABCgA1FiEEugLDXPmKSktSkQsV/iaEJXNYjCkFAmI5tGgXHHVsZi5oYW5z
 c29uQGxpbmFyby5vcmcACgkQ/iaEJXNYjCkL/xAAzzuygSlI/H/jEaA5qCDUCYvf
 Q44uAMmwnj45r4Y3Y1SUFcP1L0k24SbDj4CHalat45qolo0v3ELCGUpavT2+tSmy
 6SVnhE2GYLBOF2RfaZEEJPuc51K1f+7E3R0kw70JsFRyMHlpnzvD58DlqLiC3HYa
 mPmsxmN6bo7TJIZMIKgVyWiWgnm5E0jVIk9gDQKaaCtMB10G0XwiQffZ43Vq5Rj/
 ncjy/4s8m9MTwriFHDZUtKIYaGX6GMyOUvp9p48tduGnzBRJV+zReZACUaSIUYlj
 jrzDe1xxeeUs6hk7QBXhDNubbDkNjD/hnaNGAM20VRuqPQ81UEV3UYDK5lnISl/8
 CJwnYo3Ws7GVofItQxJyiQhAfs+1AME7xcKMbyKy+prZTQ61MEhGPIKHdevrFR7j
 5V1WKcAj48bWhzdt4Ee/J8aGcdTg+z24lpDDC3q7nVgTptkcCTvy82bR9Qijp7fj
 D2ynqhBuywAjsn/kq0RGJ/aG1pv5bKj6y1fQbI0CmfWRAsyLSH5d9N5AFGGn+Y0y
 /9Y2GcZXdCGgB9/IGDvrA9zPx7cFDvjdNiGOtUJxH/WwH1qfMOtGZ1SLYVAf3lcg
 dZKXtCvwqrnQABWyUNKbLXdCU3omnA18OCum1vx5LtDzQVJkm7SxEobVGSftFKmC
 sK3Sl7vZ3j92seTDvZU=
 =1Iot
 -----END PGP SIGNATURE-----

Merge tag 'mmc-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc

Pull MMC updates from Ulf Hansson:
 "MMC core:
   - Convert to sysfs_emit() in favor of sprintf()

   - Improve fallback to speed modes if eMMC HS200 fails

  MMC host:
   - dw_mmc: Allow variants to set minimal supported clock rate

   - dw-mmc-rockchip: Fix problems with invalid clock rates

   - litex_mmc: Add new DT based driver for the LiteX's LiteSDCard
     interface

   - litex_mmc: Add Gabriel Somlo and Joel Stanley as co-maintainers for
     LiteX

   - mtk-sd: Add support for the Mediatek MT8186 variant

   - renesas_sdhi: Add support for RZ/G2UL variant

   - renesas_sdhi: Add support for RZ/V2L variant

   - rtsx_pci: Adjust power-on sequence to conform to the SD spec

   - sdhci-am654: Add support for TI's AM62 variant

   - sdhci_am654: Fixup support for TI's AM64 variant

   - sdhci-esdhc-imx: Add support for the imx93 variant

   - sdhci-msm: Add support for the msm8953 variant

   - sdhci-pci-gli: Add support for runtime PM for the GL9763E variant

   - sdhci-pci-gli: Adjustments of the SSC function for the GL975x
     variants

   - sdhci-tegra: Add support for wake on SD card event

   - sunxi-mmc: Add support for Allwinner's F1c100s variant

   - sunxi-mmc: Add support for D1 MMC variant"

* tag 'mmc-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: (37 commits)
  dt-bindings: mmc: renesas,sdhi: Document RZ/G2UL SoC
  mmc: tmio: remove outdated members from host struct
  mmc: mtk-sd: Silence delay phase calculation debug log
  mmc: davinci_mmc: Handle error for clk_enable
  mmc: sdhci-pci-gli: Add runtime PM for GL9763E
  mmc: core: Drop HS400 caps unless 8-bit bus is supported too
  mmc: host: Return an error when ->enable_sdio_irq() ops is missing
  mmc: core: Improve fallback to speed modes if eMMC HS200 fails
  dt-bindings: mmc: sunxi: add Allwinner F1c100s compatible
  mmc: dw-mmc-rockchip: Fix handling invalid clock rates
  mmc: dw_mmc: Support setting f_min from host drivers
  mmc: host: Drop commas after SoC match table sentinels
  mmc: rtsx: add 74 Clocks in power on flow
  dt-bindings: mmc: renesas,sdhi: Document RZ/V2L SoC
  mmc: sh_mmcif: Simplify division/shift logic
  mmc: sdhci_am654: Add Support for TI's AM62 SoC
  dt-bindings: mmc: imx-esdhc: Add imx93 compatible string
  dt-bindings: mmc: sdhci-am654: Add compatible string for AM62 SoC
  mmc: sdhci_am654: Fix the driver data of AM64 SoC
  mmc: core: use sysfs_emit() instead of sprintf()
  ...
2022-03-23 14:39:51 -07:00
Linus Torvalds
ad9c6ee642 spi: Updates for v5.18
The overwhelming bulk of this pull request is a change from Uwe
 Kleine-König which changes the return type of the remove() function to
 void as part of some wider work he's doing to do this for all bus types,
 causing updates to most SPI device drivers.  The branch with that on has
 been cross merged with a couple of other trees which added new SPI
 drivers this cycle, I'm not expecting any build issues resulting from
 the change.
 
 Otherwise it's been a relatively quiet release with some new device
 support, a few minor features and the welcome completion of the
 conversion of the subsystem to use GPIO descriptors rather than numbers:
 
  - Change return type of remove() to void.
  - Completion of the conversion of SPI controller drivers to use GPIO
    descriptors rather than numbers.
  - Quite a few DT schema conversions.
  - Support for multiple SPI devices on a bus in ACPI systems.
  - Big overhaul of the PXA2xx SPI driver.
  - Support for AMD AMDI0062, Intel Raptor Lake, Mediatek MT7986 and
    MT8186, nVidia Tegra210 and Tegra234, Renesas RZ/V2L, Tesla FSD and
    Sunplus SP7021.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmI4b+8ACgkQJNaLcl1U
 h9AB+Qf/WhPzDSCdhK1repnSmEpRNs/J6hItmY2H6pTQaWALpfTB0+p1Nb5tAotg
 fHbu6a2AsiiwWt+tDal44GFYhS0CDSOT4hqgLV8msyDDPPJqqr7A2dbu7YrCjTVI
 TgNZNwxW7c2LgqBXR9GV7NPWYoxYxveoYh+L+05MSuSQxSOvPl6LUZiZPnPufQM6
 dCpEh19atrtasFg3rFnslWBd2C3h8hb6YT7vUZs9gxhg3FvSgpYQwzz5SfFgHXK6
 Rg07m8fDTSjf2qo1C4pc/d1Ni1xBe7aHKMtjtR3jJ4q8QqiawfCcvvOep/Iaec1+
 s3qnDthohWMJoF1W6ERf3HiAgNIfhg==
 =4tlR
 -----END PGP SIGNATURE-----

Merge tag 'spi-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi updates from Mark Brown:
 "The overwhelming bulk of this pull request is a change from Uwe
  Kleine-König which changes the return type of the remove() function to
  void as part of some wider work he's doing to do this for all bus
  types, causing updates to most SPI device drivers. The branch with
  that on has been cross merged with a couple of other trees which added
  new SPI drivers this cycle, I'm not expecting any build issues
  resulting from the change.

  Otherwise it's been a relatively quiet release with some new device
  support, a few minor features and the welcome completion of the
  conversion of the subsystem to use GPIO descriptors rather than
  numbers:

   - Change return type of remove() to void.

   - Completion of the conversion of SPI controller drivers to use GPIO
     descriptors rather than numbers.

   - Quite a few DT schema conversions.

   - Support for multiple SPI devices on a bus in ACPI systems.

   - Big overhaul of the PXA2xx SPI driver.

   - Support for AMD AMDI0062, Intel Raptor Lake, Mediatek MT7986 and
     MT8186, nVidia Tegra210 and Tegra234, Renesas RZ/V2L, Tesla FSD and
     Sunplus SP7021"

[ And this is obviously where that spi change that snuck into the
  regulator tree _should_ have been :^]

* tag 'spi-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: (124 commits)
  spi: fsi: Implement a timeout for polling status
  spi: Fix erroneous sgs value with min_t()
  spi: tegra20: Use of_device_get_match_data()
  spi: mediatek: add ipm design support for MT7986
  spi: Add compatible for MT7986
  spi: sun4i: fix typos in comments
  spi: mediatek: support tick_delay without enhance_timing
  spi: Update clock-names property for arm pl022
  spi: rockchip-sfc: fix platform_get_irq.cocci warning
  spi: s3c64xx: Add spi port configuration for Tesla FSD SoC
  spi: dt-bindings: samsung: Add fsd spi compatible
  spi: topcliff-pch: Prevent usage of potentially stale DMA device
  spi: tegra210-quad: combined sequence mode
  spi: tegra210-quad: add acpi support
  spi: npcm-fiu: Fix typo ("npxm")
  spi: Fix Tegra QSPI example
  spi: qup: replace spin_lock_irqsave by spin_lock in hard IRQ
  spi: cadence: fix platform_get_irq.cocci warning
  spi: Update NXP Flexspi maintainer details
  dt-bindings: mfd: maxim,max77802: Convert to dtschema
  ...
2022-03-21 18:33:57 -07:00
Wolfram Sang
11b51bff0a mmc: tmio: remove outdated members from host struct
The wrappers are gone for two years now but they have still pointers
reserved in the tmio_mmc_host struct. Remove them.

Reported-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Fixes: f22084b662 ("mmc: tmio: remove superfluous callback wrappers")
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20220311140542.5407-1-wsa+renesas@sang-engineering.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2022-03-15 10:31:24 +01:00
Alexandre Bailon
33106d78b4 mmc: mtk-sd: Silence delay phase calculation debug log
The driver prints the following log everytime data is written to RPMB:
mtk-msdc 11230000.mmc: phase: [map:ffffffff] [maxlen:32] [final:10]

dev_info is used to print that log but it seems that log is only
useful for debbuging. Use dev_dbg instead of dev_info.

Signed-off-by: Alexandre Bailon <abailon@baylibre.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20220311103320.3072171-1-abailon@baylibre.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2022-03-15 10:31:07 +01:00
Jiasheng Jiang
09e7af76db mmc: davinci_mmc: Handle error for clk_enable
As the potential failure of the clk_enable(),
it should be better to check it and return error
if fails.

Fixes: bbce5802af ("davinci: mmc: updates to suspend/resume implementation")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Link: https://lore.kernel.org/r/20220308071415.1093393-1-jiasheng@iscas.ac.cn
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2022-03-15 10:29:53 +01:00
Ben Chuang
d607667bb8 mmc: sdhci-pci-gli: Add runtime PM for GL9763E
Add runtime PM for GL9763E and disable PLL in runtime suspend. So power
gated of upstream port can be enabled. GL9763E has an auxiliary power
so it keep states in runtime suspend. In runtime resume, PLL is enabled
and waits for it to stabilize.

Signed-off-by: Ben Chuang <ben.chuang@genesyslogic.com.tw>
Tested-by: Kevin Chang <kevin.chang@lcfuturecenter.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20220307090009.1386876-1-benchuanggli@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2022-03-15 10:27:49 +01:00
Ulf Hansson
23e1b8c15b mmc: core: Drop HS400 caps unless 8-bit bus is supported too
When mmc_select_hs400es() tries to switch to the HS400 ES mode, it may bail
out early if the host doesn't support an 8-bit buswidth, as it's required
for the HS400 mode.

To improve the situation, let's instead drop the HS400 bits from the
capability field if the 8-bit bus isn't supported. In this way, we allow
the mmc initialization to continue by trying a lower speed mode.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Link: https://lore.kernel.org/r/20220303165151.129806-1-ulf.hansson@linaro.org
2022-03-15 10:25:21 +01:00
Ulf Hansson
d6c9219ca1 mmc: host: Return an error when ->enable_sdio_irq() ops is missing
Even if the current WARN() notifies the user that something is severely
wrong, we can still end up in a PANIC() when trying to invoke the missing
->enable_sdio_irq() ops. Therefore, let's also return an error code and
prevent the host from being added.

While at it, move the code into a separate function to prepare for
subsequent changes and for further host caps validations.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Link: https://lore.kernel.org/r/20220303165142.129745-1-ulf.hansson@linaro.org
2022-03-15 10:25:21 +01:00
Ulf Hansson
3b6c472822 mmc: core: Improve fallback to speed modes if eMMC HS200 fails
In the error path of mmc_select_hs200() we are trying our best to restore
the card/host into a valid state. This makes sense, especially if we
encounter a simple switch error (-EBADMSG). However, rather than then
continue with using the legacy speed mode, let's try the other better speed
modes first. Additionally, let's update the card->mmc_avail_type to avoid
us from trying a broken HS200 mode again.

In an Amlogic S905W based TV box where the switch to HS200 mode fails for
the eMMC, this allows us to use the eMMC in DDR mode in favor of the legacy
mode, which greatly improves the performance.

Suggested-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Tested-by: Heiner Kallweit <hkallweit1@gmail.com>
Link: https://lore.kernel.org/r/20220303164522.129583-1-ulf.hansson@linaro.org
2022-03-15 10:24:55 +01:00
Greg Kroah-Hartman
4cc893176c Merge 5.17-rc8 into staging-next
We need the staging fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-03-14 15:06:38 +01:00
Peter Geis
52c92286b7 mmc: dw-mmc-rockchip: Fix handling invalid clock rates
The Rockchip rk356x ciu clock cannot be set as low as the dw-mmc
hardware supports. This leads to a situation during card initialization
where the clock is set lower than the clock driver can support. The
dw-mmc-rockchip driver spews errors when this happens.
For normal operation this only happens a few times during boot, but when
cd-broken is enabled (in cases such as the SoQuartz module) this fires
multiple times each poll cycle.

Fix this by testing the lowest possible frequency that the clock driver
can support which is within the mmc specification. Divide that rate by
the internal divider and set f_min to this.

Signed-off-by: Peter Geis <pgwipeout@gmail.com>
Link: https://lore.kernel.org/r/20220305215835.2210388-3-pgwipeout@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2022-03-07 12:56:48 +01:00
Peter Geis
c4313e7500 mmc: dw_mmc: Support setting f_min from host drivers
Host drivers may not be able to support frequencies as low as dw-mmc
supports. Unfortunately f_min isn't available when the drv_data->init
function is called, as the mmc_host struct hasn't been set up yet.

Support the host drivers saving the requested minimum frequency, so we
can later set f_min when it is available.

Signed-off-by: Peter Geis <pgwipeout@gmail.com>
Link: https://lore.kernel.org/r/20220305215835.2210388-2-pgwipeout@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2022-03-07 12:56:38 +01:00
Geert Uytterhoeven
0ffd498db1 mmc: host: Drop commas after SoC match table sentinels
It does not make sense to have a comma after a sentinel, as any new
elements must be added before the sentinel.

Add comments to clarify the purpose of the empty elements.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/9050fa278eaaa9e6ec719a3b158a2fad285560d0.1646311673.git.geert+renesas@glider.be
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2022-03-07 12:54:31 +01:00
Ulf Hansson
7a9f778c7f Merge branch 'fixes' into next 2022-03-07 12:53:29 +01:00
Ulf Hansson
1760fdb6fe mmc: core: Restore (almost) the busy polling for MMC_SEND_OP_COND
Commit 76bfc7ccc2 ("mmc: core: adjust polling interval for CMD1"),
significantly decreased the polling period from ~10-12ms into just a couple
of us. The purpose was to decrease the total time spent in the busy polling
loop, but unfortunate it has lead to problems, that causes eMMC cards to
never gets out busy and thus fails to be initialized.

To fix the problem, but also to try to keep some of the new improved
behaviour, let's start by using a polling period of 1-2ms, which then
increases for each loop, according to common polling loop in
__mmc_poll_for_busy().

Reported-by: Jean Rene Dawin <jdawin@math.uni-bielefeld.de>
Reported-by: H. Nikolaus Schaller <hns@goldelico.com>
Cc: Huijin Park <huijin.park@samsung.com>
Fixes: 76bfc7ccc2 ("mmc: core: adjust polling interval for CMD1")
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Tested-by: Jean Rene Dawin <jdawin@math.uni-bielefeld.de>
Tested-by: H. Nikolaus Schaller <hns@goldelico.com>
Link: https://lore.kernel.org/r/20220304105656.149281-1-ulf.hansson@linaro.org
2022-03-07 11:47:39 +01:00
Ricky WU
1f311c94aa mmc: rtsx: add 74 Clocks in power on flow
SD spec definition:
"Host provides at least 74 Clocks before issuing first command"
After 1ms for the voltage stable then start issuing the Clock signals

if POWER STATE is
MMC_POWER_OFF to MMC_POWER_UP to issue Clock signal to card
MMC_POWER_UP to MMC_POWER_ON to stop issuing signal to card

Signed-off-by: Ricky Wu <ricky_wu@realtek.com>
Link: https://lore.kernel.org/r/1badf10aba764191a1a752edcbf90389@realtek.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2022-03-02 11:38:28 +01:00
Ulf Hansson
3dd9a926ec mmc: rtsx: Fix build errors/warnings for unused variable
The struct device *dev, is no longer needed at various functions, let's
therefore drop it to fix the build errors/warnings.

Fixes: 7570fb41e4 ("mmc: rtsx: Let MMC core handle runtime PM")
Cc: Kai-Heng Feng <kai.heng.feng@canonical.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Link: https://lore.kernel.org/r/20220301115300.64332-1-ulf.hansson@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-03-01 22:25:58 +01:00
Jiri Slaby
834119f576 sdio_uart: make use of UART_LCR_WLEN() + tty_get_char_size()
Having a generic UART_LCR_WLEN() macro and the tty_get_char_size()
helper, we can remove all those repeated switch-cases in drivers.

Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: linux-mmc@vger.kernel.org
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20220224095558.30929-4-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-28 22:17:21 +01:00
Ulf Hansson
8427577535 Merge branch 'fixes' into next 2022-02-28 18:04:27 +01:00
Geert Uytterhoeven
bee1549199 mmc: sh_mmcif: Simplify division/shift logic
"a / (1 << b)" == "a >> b".

No change in generated code.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/68d689c39c769d298b53ee8cb9de0e594a2999b2.1645460780.git.geert+renesas@glider.be
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2022-02-28 16:11:47 +01:00
Aswath Govindraju
02538e45c6 mmc: sdhci_am654: Add Support for TI's AM62 SoC
Add support for the controller present on the AM62x SoC.

There are instances:
sdhci0: 8bit bus width, max 200 MBps
sdhci1: 4bit bus width, max 100 MBps
sdhci2: 4bit bus width, max 100 MBps

The PHY used for 8 bit instance is same as the PHY for the 4 bit instance.
Therefore, introduce a new bus width independent compatible for AM62 SoC
that uses the driver data required for 4 bit instance.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
Link: https://lore.kernel.org/r/20220218072840.5629-1-a-govindraju@ti.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2022-02-28 13:23:51 +01:00
Rong Chen
f0d2f15362 mmc: meson: Fix usage of meson_mmc_post_req()
Currently meson_mmc_post_req() is called in meson_mmc_request() right
after meson_mmc_start_cmd(). This could lead to DMA unmapping before the request
is actually finished.

To fix, don't call meson_mmc_post_req() until meson_mmc_request_done().

Signed-off-by: Rong Chen <rong.chen@amlogic.com>
Reviewed-by: Kevin Hilman <khilman@baylibre.com>
Fixes: 79ed05e329 ("mmc: meson-gx: add support for descriptor chain mode")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20220216124239.4007667-1-rong.chen@amlogic.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2022-02-28 13:18:12 +01:00
Aswath Govindraju
3b7340f1c8 mmc: sdhci_am654: Fix the driver data of AM64 SoC
The MMCSD IPs used in AM64 are the same as the ones used in J721E.
Therefore, fix this by using the driver data from J721E for AM64 too, for
both 8 and 4 bit instances.

Fixes: 754b7f2f7d ("mmc: sdhci_am654: Add Support for TI's AM64 SoC")
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
Link: https://lore.kernel.org/r/20220211075056.26179-1-a-govindraju@ti.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2022-02-28 13:06:23 +01:00
Sergey Shtylyov
f5d8a5fe77 mmc: core: use sysfs_emit() instead of sprintf()
sprintf() (still used in the MMC core for the sysfs output) is vulnerable
to the buffer overflow.  Use the new-fangled sysfs_emit() instead.

Found by Linux Verification Center (linuxtesting.org) with the SVACE static
analysis tool.

Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/717729b2-d65b-c72e-9fac-471d28d00b5a@omp.ru
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2022-02-28 13:06:23 +01:00
Samuel Holland
75a2f412d0 mmc: sunxi-mmc: Add D1 MMC variant
D1's MMC controllers are unique in that they have the DMA address shift
(like A100) with a 13-bit descriptor size field (like sun4i). Add the
compatible and parameters for this new variant.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Acked-by: Maxime Ripard <maxime@cerno.tech>
Link: https://lore.kernel.org/r/20220203015112.12008-2-samuel@sholland.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2022-02-28 13:06:23 +01:00
Andy Shevchenko
43fa33aaf0 mmc: dw_mmc: Use device_property_string_array_count()
Use device_property_string_array_count() to get number of strings
in a string array property.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220202182450.54925-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2022-02-28 13:06:22 +01:00
Bean Huo
a25ebe4e59 mmc: davinci: Use of_device_get_match_data() helper
Only the device data is needed, not the entire struct of_device_id.
Use of_device_get_match_data() instead of of_match_device().

Signed-off-by: Bean Huo <beanhuo@micron.com>
Link: https://lore.kernel.org/r/20220202180648.1252154-6-huobean@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2022-02-28 13:06:22 +01:00
Bean Huo
685e013bef mmc: sdhci-of-at91: Use of_device_get_match_data() helper
Only the device data is needed, not the entire struct of_device_id.
Use of_device_get_match_data() instead of open coding of_match_device().

Signed-off-by: Bean Huo <beanhuo@micron.com>
Link: https://lore.kernel.org/r/20220202180648.1252154-5-huobean@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2022-02-28 13:06:22 +01:00
Bean Huo
dfbaaec993 mmc: sdhci-tegra: Use of_device_get_match_data() helper
Only the device data is needed,not the whole struct of_device_id.
Use of_device_get_match_data() instead of open coding of of_match_device().

Signed-off-by: Bean Huo <beanhuo@micron.com>
Link: https://lore.kernel.org/r/20220202180648.1252154-3-huobean@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2022-02-28 13:06:22 +01:00
Bean Huo
1b3eebf17c mmc: wmt-sdmmc: Use of_device_get_match_data() helper
Only the device data is needed, not the whole struct of_device_id.
Use of_device_get_match_data() instead of open coding of of_match_device().

Signed-off-by: Bean Huo <beanhuo@micron.com>
Link: https://lore.kernel.org/r/20220202180648.1252154-2-huobean@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2022-02-28 13:06:22 +01:00
Ben Chuang
08df1a5021 mmc: sdhci-pci-gli: Add a switch to enable/disable SSC for GL9750 and GL9755
Add a vendor-specific bit at the bit26 of GL9750's register 878h and
GL9755's register 78h to decide whether to disable SSC function. If
this bit is set, the SSC function will be disabled.

Signed-off-by: Ben Chuang <ben.chuang@genesyslogic.com.tw>
Link: https://lore.kernel.org/r/20220119075406.36321-1-benchuanggli@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2022-02-28 13:06:22 +01:00
Ben Chuang
d3c6bdb656 mmc: sdhci-pci-gli: Enable SSC at 50MHz and 100MHz for GL9750 and GL9755
Enable SSC function at 50MHz and 100MHz for GL9750 and GL9755.

Signed-off-by: Ben Chuang <ben.chuang@genesyslogic.com.tw>
Link: https://lore.kernel.org/r/20220119075339.36281-1-benchuanggli@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2022-02-28 13:06:21 +01:00
Ben Chuang
d0ba932a9a mmc: sdhci-pci-gli: Reduce the SSC value at 205MHz for GL9750 and GL9755
The SSC value is 0xFFE7 at 205MHz and may be saturated. Reduce the SSC
value to 0x5A1D at 205MHz to reduce this situation for GL9750 and GL9755.

Signed-off-by: Ben Chuang <ben.chuang@genesyslogic.com.tw>
Link: https://lore.kernel.org/r/20220119075306.36262-1-benchuanggli@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2022-02-28 13:06:21 +01:00
Gabriel Somlo
92e0991047 mmc: Add driver for LiteX's LiteSDCard interface
LiteX (https://github.com/enjoy-digital/litex) is a SoC framework
that targets FPGAs. LiteSDCard is a small footprint, configurable
SDCard core commonly used in LiteX designs.

The driver was first written in May 2020 and has been maintained
cooperatively by the LiteX community. Thanks to all contributors!

Co-developed-by: Kamil Rakoczy <krakoczy@antmicro.com>
Signed-off-by: Kamil Rakoczy <krakoczy@antmicro.com>
Co-developed-by: Maciej Dudek <mdudek@internships.antmicro.com>
Signed-off-by: Maciej Dudek <mdudek@internships.antmicro.com>
Co-developed-by: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Gabriel Somlo <gsomlo@gmail.com>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220113170300.3555651-4-gsomlo@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2022-02-28 13:06:21 +01:00
Aniruddha Rao
48f6daf188 mmc: sdhci-tegra: Enable wake on SD card event
Enable GPIO wake source on SD card detect line. Physical card
insertion/removal event should wake the system from suspend.

Signed-off-by: Aniruddha Rao <anrao@nvidia.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/1642050969-21152-1-git-send-email-anrao@nvidia.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2022-02-28 13:06:21 +01:00
Wen Zhiwei
4a835afd80 mmc: dw_mmc: Fix potential null pointer risk
we previously assumed 'host->slot' could be null,
null pointer judgment should be added

Signed-off-by: Wen Zhiwei <wenzhiwei@kylinos.cn>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Link: https://lore.kernel.org/r/20211229023814.53372-1-wenzhiwei@kylinos.cn
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2022-02-28 13:06:20 +01:00
Greg Kroah-Hartman
dbbe23c319 Merge 5.17-rc6 into staging-next
We need the staging fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-28 08:44:22 +01:00
Greg Kroah-Hartman
085686fb84 Merge 5.17-rc6 into char-misc-next
We need the char-misc fixes in here.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-28 07:30:32 +01:00
Kai-Heng Feng
7570fb41e4 mmc: rtsx: Let MMC core handle runtime PM
Since MMC core handles runtime PM reference counting, we can avoid doing
redundant runtime PM work in the driver. That means the only thing
commit 5b4258f672 ("misc: rtsx: rts5249 support runtime PM") misses is
to always enable runtime PM, to let its parent driver enable ASPM in the
runtime idle routine.

Fixes: 7499b529d9 ("mmc: rtsx: Use pm_runtime_{get,put}() to handle runtime PM")
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Link: https://lore.kernel.org/r/20220216055435.2335297-1-kai.heng.feng@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-22 08:41:06 +01:00
Jérôme Pouiller
96e0cbca1c staging: wfx: apply the necessary SDIO quirks for the Silabs WF200
Until now, the SDIO quirks are applied directly from the driver.
However, it is better to apply the quirks before driver probing. So,
this patch relocate the quirks in the MMC framework.

Note that the WF200 has no valid SDIO VID/PID. Therefore, we match DT
rather than on the SDIO VID/PID.

Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220216093112.92469-3-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-17 15:58:48 +01:00