An error occurred fetching the project authors.
  1. 24 Mar, 2020 9 commits
  2. 18 Dec, 2019 2 commits
  3. 16 Dec, 2019 1 commit
  4. 11 Sep, 2019 1 commit
    • Ulf Hansson's avatar
      mmc: sdhci: Drop redundant code for SDIO IRQs · af5d2b7b
      Ulf Hansson authored
      Nowadays sdhci prevents runtime suspend when SDIO IRQs are enabled.
      
      However, some variants such as sdhci-esdhc-imx's, tries to allow runtime
      suspend while having the SDIO IRQs enabled, but without supporting remote
      wakeups. This support is a bit questionable, especially if the host device
      have a PM domain attached that can be power gated, but more importantly,
      the code have also become redundant (which was not the case when it was
      introduced).
      
      Rather than keeping the redundant code around, let's drop it and leave this
      to be revisited later on.
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      af5d2b7b
  5. 06 Aug, 2019 1 commit
    • Baolin Wang's avatar
      mmc: sdhci-sprd: Fix the incorrect soft reset operation when runtime resuming · c6303c5d
      Baolin Wang authored
      The SD host controller specification defines 3 types software reset:
      software reset for data line, software reset for command line and software
      reset for all. Software reset for all means this reset affects the entire
      Host controller except for the card detection circuit.
      
      In sdhci_runtime_resume_host() we always do a software "reset for all",
      which causes the Spreadtrum variant controller to work abnormally after
      resuming. To fix the problem, let's do a software reset for the data and
      the command part, rather than "for all".
      
      However, as sdhci_runtime_resume() is a common sdhci function and we don't
      want to change the behaviour for other variants, let's introduce a new
      in-parameter for it. This enables the caller to decide if a "reset for all"
      shall be done or not.
      Signed-off-by: default avatarBaolin Wang <baolin.wang@linaro.org>
      Fixes: fb8bd90f ("mmc: sdhci-sprd: Add Spreadtrum's initial host controller")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      c6303c5d
  6. 06 May, 2019 2 commits
  7. 28 Feb, 2019 2 commits
    • BOUGH CHEN's avatar
      mmc: sdhci-esdhc-imx: correct the fix of ERR004536 · e30be063
      BOUGH CHEN authored
      Commit 18094430 ("mmc: sdhci-esdhc-imx: add ADMA Length
      Mismatch errata fix") involve the fix of ERR004536, but the
      fix is incorrect. Double confirm with IC, need to clear the
      bit 7 of register 0x6c rather than set this bit 7.
      Here is the definition of bit 7 of 0x6c:
          0: enable the new IC fix for ERR004536
          1: do not use the IC fix, keep the same as before
      
      Find this issue on i.MX845s-evk board when enable CMDQ, and
      let system in heavy loading.
      
      root@imx8mmevk:~# dd if=/dev/mmcblk2 of=/dev/null bs=1M &
      root@imx8mmevk:~# memtester 1000M > /dev/zero &
      root@imx8mmevk:~# [  139.897220] mmc2: cqhci: timeout for tag 16
      [  139.901417] mmc2: cqhci: ============ CQHCI REGISTER DUMP ===========
      [  139.907862] mmc2: cqhci: Caps:      0x0000310a | Version:  0x00000510
      [  139.914311] mmc2: cqhci: Config:    0x00001001 | Control:  0x00000000
      [  139.920753] mmc2: cqhci: Int stat:  0x00000000 | Int enab: 0x00000006
      [  139.927193] mmc2: cqhci: Int sig:   0x00000006 | Int Coal: 0x00000000
      [  139.933634] mmc2: cqhci: TDL base:  0x7809c000 | TDL up32: 0x00000000
      [  139.940073] mmc2: cqhci: Doorbell:  0x00030000 | TCN:      0x00000000
      [  139.946518] mmc2: cqhci: Dev queue: 0x00010000 | Dev Pend: 0x00010000
      [  139.952967] mmc2: cqhci: Task clr:  0x00000000 | SSC1:     0x00011000
      [  139.959411] mmc2: cqhci: SSC2:      0x00000001 | DCMD rsp: 0x00000000
      [  139.965857] mmc2: cqhci: RED mask:  0xfdf9a080 | TERRI:    0x00000000
      [  139.972308] mmc2: cqhci: Resp idx:  0x0000002e | Resp arg: 0x00000900
      [  139.978761] mmc2: sdhci: ============ SDHCI REGISTER DUMP ===========
      [  139.985214] mmc2: sdhci: Sys addr:  0xb2c19000 | Version:  0x00000002
      [  139.991669] mmc2: sdhci: Blk size:  0x00000200 | Blk cnt:  0x00000400
      [  139.998127] mmc2: sdhci: Argument:  0x40110400 | Trn mode: 0x00000033
      [  140.004618] mmc2: sdhci: Present:   0x01088a8f | Host ctl: 0x00000030
      [  140.011113] mmc2: sdhci: Power:     0x00000002 | Blk gap:  0x00000080
      [  140.017583] mmc2: sdhci: Wake-up:   0x00000008 | Clock:    0x0000000f
      [  140.024039] mmc2: sdhci: Timeout:   0x0000008f | Int stat: 0x00000000
      [  140.030497] mmc2: sdhci: Int enab:  0x107f4000 | Sig enab: 0x107f4000
      [  140.036972] mmc2: sdhci: AC12 err:  0x00000000 | Slot int: 0x00000502
      [  140.043426] mmc2: sdhci: Caps:      0x07eb0000 | Caps_1:   0x8000b407
      [  140.049867] mmc2: sdhci: Cmd:       0x00002c1a | Max curr: 0x00ffffff
      [  140.056314] mmc2: sdhci: Resp[0]:   0x00000900 | Resp[1]:  0xffffffff
      [  140.062755] mmc2: sdhci: Resp[2]:   0x328f5903 | Resp[3]:  0x00d00f00
      [  140.069195] mmc2: sdhci: Host ctl2: 0x00000008
      [  140.073640] mmc2: sdhci: ADMA Err:  0x00000007 | ADMA Ptr: 0x7809c108
      [  140.080079] mmc2: sdhci: ============================================
      [  140.086662] mmc2: running CQE recovery
      
      Fixes: 18094430 ("mmc: sdhci-esdhc-imx: add ADMA Length Mismatch errata fix")
      Signed-off-by: default avatarHaibo Chen <haibo.chen@nxp.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      e30be063
    • BOUGH CHEN's avatar
      mmc: sdhci-esdhc-imx: clear the HALT bit when enable CQE · 85236d2b
      BOUGH CHEN authored
      After system suspend, CQE is in cqhci_off state, which set the HALT bit, make
      CQE in HALT state. If the SoC do not power down the USDHC module, then when
      system resume back, this bit keep the same, still set. Though there is a
      sdhci reset during sdhci_resume_host(), but this reset do not impact the
      CQE part, so need to clear this bit when enable CQE, otherwise CQE will
      stuck in the first CMDQ request after system resume back.
      
      Find this issue on NXP i.MX845s-mek board
      
      [  105.919862] mmc2: cqhci: timeout for tag 6
      [  105.923965] mmc2: cqhci: ============ CQHCI REGISTER DUMP ===========
      [  105.930407] mmc2: cqhci: Caps:      0x0000310a | Version:  0x00000510
      [  105.936847] mmc2: cqhci: Config:    0x00001001 | Control:  0x00000001
      [  105.943286] mmc2: cqhci: Int stat:  0x00000000 | Int enab: 0x00000006
      [  105.949725] mmc2: cqhci: Int sig:   0x00000006 | Int Coal: 0x00000000
      [  105.956164] mmc2: cqhci: TDL base:  0x7809b000 | TDL up32: 0x00000000
      [  105.962604] mmc2: cqhci: Doorbell:  0x00000040 | TCN:      0x00000000
      [  105.969043] mmc2: cqhci: Dev queue: 0x00000000 | Dev Pend: 0x00000000
      [  105.975483] mmc2: cqhci: Task clr:  0x00000000 | SSC1:     0x00011000
      [  105.981922] mmc2: cqhci: SSC2:      0x00000001 | DCMD rsp: 0x00000000
      [  105.988362] mmc2: cqhci: RED mask:  0xfdf9a080 | TERRI:    0x00000000
      [  105.994801] mmc2: cqhci: Resp idx:  0x00000000 | Resp arg: 0x00000000
      [  106.001240] mmc2: sdhci: ============ SDHCI REGISTER DUMP ===========
      [  106.007680] mmc2: sdhci: Sys addr:  0xb2b37800 | Version:  0x00000002
      [  106.014120] mmc2: sdhci: Blk size:  0x00000200 | Blk cnt:  0x00000001
      [  106.020560] mmc2: sdhci: Argument:  0x00010000 | Trn mode: 0x00000013
      [  106.026999] mmc2: sdhci: Present:   0x01f88008 | Host ctl: 0x00000030
      [  106.033439] mmc2: sdhci: Power:     0x00000002 | Blk gap:  0x00000080
      [  106.039878] mmc2: sdhci: Wake-up:   0x00000008 | Clock:    0x0000000f
      [  106.046318] mmc2: sdhci: Timeout:   0x0000008f | Int stat: 0x00000000
      [  106.052757] mmc2: sdhci: Int enab:  0x107f4000 | Sig enab: 0x107f4000
      [  106.059196] mmc2: sdhci: AC12 err:  0x00000000 | Slot int: 0x00000502
      [  106.065635] mmc2: sdhci: Caps:      0x07eb0000 | Caps_1:   0x8000b407
      [  106.072075] mmc2: sdhci: Cmd:       0x00000d1a | Max curr: 0x00ffffff
      [  106.078514] mmc2: sdhci: Resp[0]:   0x00000900 | Resp[1]:  0x31360181
      [  106.084954] mmc2: sdhci: Resp[2]:   0x44473430 | Resp[3]:  0x00450100
      [  106.091392] mmc2: sdhci: Host ctl2: 0x00000008
      [  106.095836] mmc2: sdhci: ADMA Err:  0x00000000 | ADMA Ptr: 0x7804b208
      [  106.102274] mmc2: sdhci: ============================================
      [  106.108785] mmc2: running CQE recovery
      Signed-off-by: default avatarHaibo Chen <haibo.chen@nxp.com>
      Acked-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      85236d2b
  8. 25 Feb, 2019 12 commits
  9. 17 Dec, 2018 2 commits
  10. 16 Jul, 2018 5 commits
  11. 09 Jul, 2018 1 commit
    • Stefan Agner's avatar
      mmc: sdhci-esdhc-imx: allow 1.8V modes without 100/200MHz pinctrl states · 92748bea
      Stefan Agner authored
      If pinctrl nodes for 100/200MHz are missing, the controller should
      not select any mode which need signal frequencies 100MHz or higher.
      To prevent such speed modes the driver currently uses the quirk flag
      SDHCI_QUIRK2_NO_1_8_V. This works nicely for SD cards since 1.8V
      signaling is required for all faster modes and slower modes use 3.3V
      signaling only.
      
      However, there are eMMC modes which use 1.8V signaling and run below
      100MHz, e.g. DDR52 at 1.8V. With using SDHCI_QUIRK2_NO_1_8_V this
      mode is prevented. When using a fixed 1.8V regulator as vqmmc-supply
      the stack has no valid mode to use. In this tenuous situation the
      kernel continuously prints voltage switching errors:
        mmc1: Switching to 3.3V signalling voltage failed
      
      Avoid using SDHCI_QUIRK2_NO_1_8_V and prevent faster modes by
      altering the SDHCI capability register. With that the stack is able
      to select 1.8V modes even if no faster pinctrl states are available:
        # cat /sys/kernel/debug/mmc1/ios
        ...
        timing spec:    8 (mmc DDR52)
        signal voltage: 1 (1.80 V)
        ...
      
      Link: http://lkml.kernel.org/r/20180628081331.13051-1-stefan@agner.chSigned-off-by: default avatarStefan Agner <stefan@agner.ch>
      Fixes: ad93220d ("mmc: sdhci-esdhc-imx: change pinctrl state according
      to uhs mode")
      Cc: <stable@vger.kernel.org> # v4.13+
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      92748bea
  12. 02 May, 2018 1 commit
    • Andrew Gabbasov's avatar
      mmc: sdhci-esdhc-imx: Set maximum watermark levels for PIO access · 3fbd4322
      Andrew Gabbasov authored
      While performing R/W access in PIO mode, the common SDHCI driver checks
      the buffer ready status once per whole block processing. That is, after
      getting an appropriate interrupt, or checking an appropriate status bit,
      the driver makes buffer accesses for the whole block size (e.g. 128 reads
      for 512 bytes block). This is done in accordance with SD Host Controller
      Specification.
      
      At the same time, the Ultra Secured Digital Host Controller (uSDHC), used
      in i.MX6 (and, probably, earlier i.MX series too), uses a separate
      Watermark Levels register, controlling the amount of data or space
      available when raising status bit or interrupt. For default watermark
      setting of 16 words, the controller expects (and guarantees) no more
      than 16 buffer accesses after raising buffer ready status bit and
      generating an appropriate interrupt. If the driver tries to access the
      whole block size, it will get incorrect data at the end, and a new
      interrupt will appear later, when the driver already doesn't expect it.
      This happens sometimes, more likely on low frequencies, e.g. when
      reading EXT_CSD at MMC card initialization phase
      (which makes that initialization fail).
      
      Such behavior of i.MX uSDHC seems to be non-compliant
      to SDHCI Specification, but this is the way it works now.
      
      In order not to rewrite the SDHCI driver PIO mode access logic,
      the IMX specific driver can just set the watermark level to default
      block size (128 words or 512 bytes), so that the controller behavior
      will be consistent to generic specification. This patch does this
      for PIO mode accesses only, restoring default values for DMA accesses
      to avoid any possible side effects from performance point of view.
      Signed-off-by: default avatarAndrew Gabbasov <andrew_gabbasov@mentor.com>
      Signed-off-by: default avatarHarish Jenny K N <harish_kandiga@mentor.com>
      Acked-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      3fbd4322
  13. 15 Jan, 2018 1 commit
    • Benoît Thébaudeau's avatar
      mmc: sdhci-esdhc-imx: Fix i.MX53 eSDHCv3 clock · 499ed50f
      Benoît Thébaudeau authored
      Commit 5143c953 ("mmc: sdhci-esdhc-imx: Allow all supported
      prescaler values") made it possible to set SYSCTL.SDCLKFS to 0 in SDR
      mode, thus bypassing the SD clock frequency prescaler, in order to be
      able to get higher SD clock frequencies in some contexts. However, that
      commit missed the fact that this value is illegal on the eSDHCv3
      instance of the i.MX53. This seems to be the only exception on i.MX,
      this value being legal even for the eSDHCv2 instances of the i.MX53.
      
      Fix this issue by changing the minimum prescaler value if the i.MX53
      eSDHCv3 is detected. According to the i.MX53 reference manual, if
      DLLCTRL[10] can be set, then the controller is eSDHCv3, else it is
      eSDHCv2.
      
      This commit fixes the following issue, which was preventing the i.MX53
      Loco (IMX53QSB) board from booting Linux 4.15.0-rc5:
      [    1.882668] mmcblk1: error -84 transferring data, sector 2048, nr 8, cmd response 0x900, card status 0xc00
      [    2.002255] mmcblk1: error -84 transferring data, sector 2050, nr 6, cmd response 0x900, card status 0xc00
      [   12.645056] mmc1: Timeout waiting for hardware interrupt.
      [   12.650473] mmc1: sdhci: ============ SDHCI REGISTER DUMP ===========
      [   12.656921] mmc1: sdhci: Sys addr:  0x00000000 | Version:  0x00001201
      [   12.663366] mmc1: sdhci: Blk size:  0x00000004 | Blk cnt:  0x00000000
      [   12.669813] mmc1: sdhci: Argument:  0x00000000 | Trn mode: 0x00000013
      [   12.676258] mmc1: sdhci: Present:   0x01f8028f | Host ctl: 0x00000013
      [   12.682703] mmc1: sdhci: Power:     0x00000002 | Blk gap:  0x00000000
      [   12.689148] mmc1: sdhci: Wake-up:   0x00000000 | Clock:    0x0000003f
      [   12.695594] mmc1: sdhci: Timeout:   0x0000008e | Int stat: 0x00000000
      [   12.702039] mmc1: sdhci: Int enab:  0x107f004b | Sig enab: 0x107f004b
      [   12.708485] mmc1: sdhci: AC12 err:  0x00000000 | Slot int: 0x00001201
      [   12.714930] mmc1: sdhci: Caps:      0x07eb0000 | Caps_1:   0x08100810
      [   12.721375] mmc1: sdhci: Cmd:       0x0000163a | Max curr: 0x00000000
      [   12.727821] mmc1: sdhci: Resp[0]:   0x00000920 | Resp[1]:  0x00000000
      [   12.734265] mmc1: sdhci: Resp[2]:   0x00000000 | Resp[3]:  0x00000000
      [   12.740709] mmc1: sdhci: Host ctl2: 0x00000000
      [   12.745157] mmc1: sdhci: ADMA Err:  0x00000001 | ADMA Ptr: 0xc8049200
      [   12.751601] mmc1: sdhci: ============================================
      [   12.758110] print_req_error: I/O error, dev mmcblk1, sector 2050
      [   12.764135] Buffer I/O error on dev mmcblk1p1, logical block 0, lost sync page write
      [   12.775163] EXT4-fs (mmcblk1p1): mounted filesystem without journal. Opts: (null)
      [   12.782746] VFS: Mounted root (ext4 filesystem) on device 179:9.
      [   12.789151] mmcblk1: response CRC error sending SET_BLOCK_COUNT command, card status 0x900
      Signed-off-by: default avatarBenoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
      Reported-by: default avatarWladimir J. van der Laan <laanwj@gmail.com>
      Tested-by: default avatarWladimir J. van der Laan <laanwj@gmail.com>
      Fixes: 5143c953 ("mmc: sdhci-esdhc-imx: Allow all supported prescaler values")
      Cc: <stable@vger.kernel.org> # v4.13+
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      499ed50f