linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] dw_mmc: fix DW MMC cores with 32-bit bus on 64-bit Linux systems
@ 2023-03-11 15:23 Sergey Lisov
  2023-03-11 15:22 ` [PATCH 1/2] devicetree: synopsys-dw-mshc-common: add "fifo-access-32bit" property Sergey Lisov
  2023-03-11 15:22 ` [PATCH 2/2] dw_mmc: add an option to force 32-bit accesses to 64-bit device registers Sergey Lisov
  0 siblings, 2 replies; 10+ messages in thread
From: Sergey Lisov @ 2023-03-11 15:23 UTC (permalink / raw)
  To: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Jaehoon Chung
  Cc: linux-mmc, devicetree, linux-kernel

DesignWare MMC cores have a configurable data bus width of either 16, 32, or 64
bytes. It is possible, and some vendors actually do it, to ship a DW MMC core
configured for 32-bit data bus within a 64-bit SoC. In this case the kernel
will attempt 64-bit (readq) accesses to certain 64-bit MMIO registers, while
the core will expect pairs of 32-bit accesses.

It seems that currently the only register for which the kernel performs 64-bit
accesses is the FIFO. The symptom is that the DW MMC core never receives a read
on the second half of the register, does not register the datum as being read,
and thus not advancing its internal FIFO pointer, breaking further reads. It
also seems that this FIFO is only used for small (less than 16 bytes)
transfers, which probably means that only some SDIO cards are affected.

Sergey Lisov (2):
  devicetree: synopsys-dw-mshc-common: add "fifo-access-32bit" property
  dw_mmc: add an option to force 32-bit accesses to 64-bit device
    registers

 .../bindings/mmc/synopsys-dw-mshc-common.yaml |   6 +
 drivers/mmc/host/dw_mmc.c                     | 125 +++++++++++++++++-
 drivers/mmc/host/dw_mmc.h                     |   2 +
 3 files changed, 131 insertions(+), 2 deletions(-)

-- 
2.38.3



^ permalink raw reply	[flat|nested] 10+ messages in thread
[parent not found: <640cc323.050a0220.8e83b.0e60@mx.google.com>]
[parent not found: <640c80ff.050a0220.2983.0b8d@mx.google.com>]
* [PATCH 1/2] devicetree: synopsys-dw-mshc-common: add "fifo-access-32bit" property
@ 2023-03-11 12:54 Sergey Lisov
  0 siblings, 0 replies; 10+ messages in thread
From: Sergey Lisov @ 2023-03-11 12:54 UTC (permalink / raw)
  To: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Jaehoon Chung
  Cc: linux-mmc, devicetree, linux-kernel

---
 .../devicetree/bindings/mmc/synopsys-dw-mshc-common.yaml    | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc-common.yaml b/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc-common.yaml
index 8dfad89c7..2bc5ac528 100644
--- a/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc-common.yaml
+++ b/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc-common.yaml
@@ -57,6 +57,12 @@ properties:
       force fifo watermark setting accordingly.
     $ref: /schemas/types.yaml#/definitions/flag
 
+  fifo-access-32bit:
+    description:
+      Specifies that this device requires accesses to its 64-bit registers
+      to be done as pairs of 32-bit accesses, even on architectures where
+      readq is available.
+
   dmas:
     maxItems: 1
 
-- 
2.38.3



^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-03-11 18:08 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-11 15:23 [PATCH 0/2] dw_mmc: fix DW MMC cores with 32-bit bus on 64-bit Linux systems Sergey Lisov
2023-03-11 15:22 ` [PATCH 1/2] devicetree: synopsys-dw-mshc-common: add "fifo-access-32bit" property Sergey Lisov
2023-03-11 15:50   ` Krzysztof Kozlowski
2023-03-11 17:40     ` Sergey Lisov
2023-03-11 17:57       ` broken subject? Krzysztof Kozlowski
2023-03-11 17:57         ` [PATCH 1/2] devicetree: synopsys-dw-mshc-common: add "fifo-access-32bit" property Sergey Lisov
2023-03-11 15:22 ` [PATCH 2/2] dw_mmc: add an option to force 32-bit accesses to 64-bit device registers Sergey Lisov
     [not found] <640cc323.050a0220.8e83b.0e60@mx.google.com>
2023-03-11 18:08 ` [PATCH 1/2] devicetree: synopsys-dw-mshc-common: add "fifo-access-32bit" property Krzysztof Kozlowski
     [not found] <640c80ff.050a0220.2983.0b8d@mx.google.com>
2023-03-11 15:58 ` Krzysztof Kozlowski
  -- strict thread matches above, loose matches on Subject: below --
2023-03-11 12:54 Sergey Lisov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).