All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: linux-mmc@vger.kernel.org, linux-amlogic@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 1/2] mmc: meson-mx-sdhc: Set MANUAL_STOP for multi-block SDIO commands
Date: Tue, 21 Dec 2021 14:02:39 +0100	[thread overview]
Message-ID: <CAPDyKFry2L5RKTtxKQ-Qu+xJEsK-hSCNgrgB371MMSGsd4DwZA@mail.gmail.com> (raw)
In-Reply-To: <20211219153442.463863-2-martin.blumenstingl@googlemail.com>

On Sun, 19 Dec 2021 at 16:34, Martin Blumenstingl
<martin.blumenstingl@googlemail.com> wrote:
>
> The vendor driver implements special handling for multi-block
> SD_IO_RW_EXTENDED (and SD_IO_RW_DIRECT) commands which have data
> attached to them. It sets the MANUAL_STOP bit in the MESON_SDHC_MISC
> register for these commands. In all other cases this bit is cleared.
> Here we omit SD_IO_RW_DIRECT since that command never has any data
> attached to it.
>
> This fixes SDIO wifi using the brcmfmac driver which reported the
> following error without this change on a Netxeon S82 board using a
> Meson8 (S802) SoC:
>   brcmf_fw_alloc_request: using brcm/brcmfmac43362-sdio for chip
>                           BCM43362/1
>   brcmf_sdiod_ramrw: membytes transfer failed
>   brcmf_sdio_download_code_file: error -110 on writing 219557 membytes
>                                  at 0x00000000
>   brcmf_sdio_download_firmware: dongle image file download failed
>
> And with this change:
>   brcmf_fw_alloc_request: using brcm/brcmfmac43362-sdio for chip
>                           BCM43362/1
>   brcmf_c_process_clm_blob: no clm_blob available (err=-2), device may
>                             have limited channels available
>   brcmf_c_preinit_dcmds: Firmware: BCM43362/1 wl0: Apr 22 2013 14:50:00
>                          version 5.90.195.89.6 FWID 01-b30a427d
>
> Fixes: e4bf1b0970ef96 ("mmc: host: meson-mx-sdhc: new driver for the Amlogic Meson SDHC host")
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>

Applied for fixes and by adding a stable tag, thanks!

Kind regards
Uffe



> ---
>  drivers/mmc/host/meson-mx-sdhc-mmc.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
>
> diff --git a/drivers/mmc/host/meson-mx-sdhc-mmc.c b/drivers/mmc/host/meson-mx-sdhc-mmc.c
> index 7cd9c0ec2fcf..8fdd0bbbfa21 100644
> --- a/drivers/mmc/host/meson-mx-sdhc-mmc.c
> +++ b/drivers/mmc/host/meson-mx-sdhc-mmc.c
> @@ -135,6 +135,7 @@ static void meson_mx_sdhc_start_cmd(struct mmc_host *mmc,
>                                     struct mmc_command *cmd)
>  {
>         struct meson_mx_sdhc_host *host = mmc_priv(mmc);
> +       bool manual_stop = false;
>         u32 ictl, send;
>         int pack_len;
>
> @@ -172,12 +173,27 @@ static void meson_mx_sdhc_start_cmd(struct mmc_host *mmc,
>                 else
>                         /* software flush: */
>                         ictl |= MESON_SDHC_ICTL_DATA_XFER_OK;
> +
> +               /*
> +                * Mimic the logic from the vendor driver where (only)
> +                * SD_IO_RW_EXTENDED commands with more than one block set the
> +                * MESON_SDHC_MISC_MANUAL_STOP bit. This fixes the firmware
> +                * download in the brcmfmac driver for a BCM43362/1 card.
> +                * Without this sdio_memcpy_toio() (with a size of 219557
> +                * bytes) times out if MESON_SDHC_MISC_MANUAL_STOP is not set.
> +                */
> +               manual_stop = cmd->data->blocks > 1 &&
> +                             cmd->opcode == SD_IO_RW_EXTENDED;
>         } else {
>                 pack_len = 0;
>
>                 ictl |= MESON_SDHC_ICTL_RESP_OK;
>         }
>
> +       regmap_update_bits(host->regmap, MESON_SDHC_MISC,
> +                          MESON_SDHC_MISC_MANUAL_STOP,
> +                          manual_stop ? MESON_SDHC_MISC_MANUAL_STOP : 0);
> +
>         if (cmd->opcode == MMC_STOP_TRANSMISSION)
>                 send |= MESON_SDHC_SEND_DATA_STOP;
>
> --
> 2.34.1
>

WARNING: multiple messages have this Message-ID (diff)
From: Ulf Hansson <ulf.hansson@linaro.org>
To: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: linux-mmc@vger.kernel.org, linux-amlogic@lists.infradead.org,
	 linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 1/2] mmc: meson-mx-sdhc: Set MANUAL_STOP for multi-block SDIO commands
Date: Tue, 21 Dec 2021 14:02:39 +0100	[thread overview]
Message-ID: <CAPDyKFry2L5RKTtxKQ-Qu+xJEsK-hSCNgrgB371MMSGsd4DwZA@mail.gmail.com> (raw)
In-Reply-To: <20211219153442.463863-2-martin.blumenstingl@googlemail.com>

On Sun, 19 Dec 2021 at 16:34, Martin Blumenstingl
<martin.blumenstingl@googlemail.com> wrote:
>
> The vendor driver implements special handling for multi-block
> SD_IO_RW_EXTENDED (and SD_IO_RW_DIRECT) commands which have data
> attached to them. It sets the MANUAL_STOP bit in the MESON_SDHC_MISC
> register for these commands. In all other cases this bit is cleared.
> Here we omit SD_IO_RW_DIRECT since that command never has any data
> attached to it.
>
> This fixes SDIO wifi using the brcmfmac driver which reported the
> following error without this change on a Netxeon S82 board using a
> Meson8 (S802) SoC:
>   brcmf_fw_alloc_request: using brcm/brcmfmac43362-sdio for chip
>                           BCM43362/1
>   brcmf_sdiod_ramrw: membytes transfer failed
>   brcmf_sdio_download_code_file: error -110 on writing 219557 membytes
>                                  at 0x00000000
>   brcmf_sdio_download_firmware: dongle image file download failed
>
> And with this change:
>   brcmf_fw_alloc_request: using brcm/brcmfmac43362-sdio for chip
>                           BCM43362/1
>   brcmf_c_process_clm_blob: no clm_blob available (err=-2), device may
>                             have limited channels available
>   brcmf_c_preinit_dcmds: Firmware: BCM43362/1 wl0: Apr 22 2013 14:50:00
>                          version 5.90.195.89.6 FWID 01-b30a427d
>
> Fixes: e4bf1b0970ef96 ("mmc: host: meson-mx-sdhc: new driver for the Amlogic Meson SDHC host")
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>

Applied for fixes and by adding a stable tag, thanks!

Kind regards
Uffe



> ---
>  drivers/mmc/host/meson-mx-sdhc-mmc.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
>
> diff --git a/drivers/mmc/host/meson-mx-sdhc-mmc.c b/drivers/mmc/host/meson-mx-sdhc-mmc.c
> index 7cd9c0ec2fcf..8fdd0bbbfa21 100644
> --- a/drivers/mmc/host/meson-mx-sdhc-mmc.c
> +++ b/drivers/mmc/host/meson-mx-sdhc-mmc.c
> @@ -135,6 +135,7 @@ static void meson_mx_sdhc_start_cmd(struct mmc_host *mmc,
>                                     struct mmc_command *cmd)
>  {
>         struct meson_mx_sdhc_host *host = mmc_priv(mmc);
> +       bool manual_stop = false;
>         u32 ictl, send;
>         int pack_len;
>
> @@ -172,12 +173,27 @@ static void meson_mx_sdhc_start_cmd(struct mmc_host *mmc,
>                 else
>                         /* software flush: */
>                         ictl |= MESON_SDHC_ICTL_DATA_XFER_OK;
> +
> +               /*
> +                * Mimic the logic from the vendor driver where (only)
> +                * SD_IO_RW_EXTENDED commands with more than one block set the
> +                * MESON_SDHC_MISC_MANUAL_STOP bit. This fixes the firmware
> +                * download in the brcmfmac driver for a BCM43362/1 card.
> +                * Without this sdio_memcpy_toio() (with a size of 219557
> +                * bytes) times out if MESON_SDHC_MISC_MANUAL_STOP is not set.
> +                */
> +               manual_stop = cmd->data->blocks > 1 &&
> +                             cmd->opcode == SD_IO_RW_EXTENDED;
>         } else {
>                 pack_len = 0;
>
>                 ictl |= MESON_SDHC_ICTL_RESP_OK;
>         }
>
> +       regmap_update_bits(host->regmap, MESON_SDHC_MISC,
> +                          MESON_SDHC_MISC_MANUAL_STOP,
> +                          manual_stop ? MESON_SDHC_MISC_MANUAL_STOP : 0);
> +
>         if (cmd->opcode == MMC_STOP_TRANSMISSION)
>                 send |= MESON_SDHC_SEND_DATA_STOP;
>
> --
> 2.34.1
>

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

WARNING: multiple messages have this Message-ID (diff)
From: Ulf Hansson <ulf.hansson@linaro.org>
To: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: linux-mmc@vger.kernel.org, linux-amlogic@lists.infradead.org,
	 linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 1/2] mmc: meson-mx-sdhc: Set MANUAL_STOP for multi-block SDIO commands
Date: Tue, 21 Dec 2021 14:02:39 +0100	[thread overview]
Message-ID: <CAPDyKFry2L5RKTtxKQ-Qu+xJEsK-hSCNgrgB371MMSGsd4DwZA@mail.gmail.com> (raw)
In-Reply-To: <20211219153442.463863-2-martin.blumenstingl@googlemail.com>

On Sun, 19 Dec 2021 at 16:34, Martin Blumenstingl
<martin.blumenstingl@googlemail.com> wrote:
>
> The vendor driver implements special handling for multi-block
> SD_IO_RW_EXTENDED (and SD_IO_RW_DIRECT) commands which have data
> attached to them. It sets the MANUAL_STOP bit in the MESON_SDHC_MISC
> register for these commands. In all other cases this bit is cleared.
> Here we omit SD_IO_RW_DIRECT since that command never has any data
> attached to it.
>
> This fixes SDIO wifi using the brcmfmac driver which reported the
> following error without this change on a Netxeon S82 board using a
> Meson8 (S802) SoC:
>   brcmf_fw_alloc_request: using brcm/brcmfmac43362-sdio for chip
>                           BCM43362/1
>   brcmf_sdiod_ramrw: membytes transfer failed
>   brcmf_sdio_download_code_file: error -110 on writing 219557 membytes
>                                  at 0x00000000
>   brcmf_sdio_download_firmware: dongle image file download failed
>
> And with this change:
>   brcmf_fw_alloc_request: using brcm/brcmfmac43362-sdio for chip
>                           BCM43362/1
>   brcmf_c_process_clm_blob: no clm_blob available (err=-2), device may
>                             have limited channels available
>   brcmf_c_preinit_dcmds: Firmware: BCM43362/1 wl0: Apr 22 2013 14:50:00
>                          version 5.90.195.89.6 FWID 01-b30a427d
>
> Fixes: e4bf1b0970ef96 ("mmc: host: meson-mx-sdhc: new driver for the Amlogic Meson SDHC host")
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>

Applied for fixes and by adding a stable tag, thanks!

Kind regards
Uffe



> ---
>  drivers/mmc/host/meson-mx-sdhc-mmc.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
>
> diff --git a/drivers/mmc/host/meson-mx-sdhc-mmc.c b/drivers/mmc/host/meson-mx-sdhc-mmc.c
> index 7cd9c0ec2fcf..8fdd0bbbfa21 100644
> --- a/drivers/mmc/host/meson-mx-sdhc-mmc.c
> +++ b/drivers/mmc/host/meson-mx-sdhc-mmc.c
> @@ -135,6 +135,7 @@ static void meson_mx_sdhc_start_cmd(struct mmc_host *mmc,
>                                     struct mmc_command *cmd)
>  {
>         struct meson_mx_sdhc_host *host = mmc_priv(mmc);
> +       bool manual_stop = false;
>         u32 ictl, send;
>         int pack_len;
>
> @@ -172,12 +173,27 @@ static void meson_mx_sdhc_start_cmd(struct mmc_host *mmc,
>                 else
>                         /* software flush: */
>                         ictl |= MESON_SDHC_ICTL_DATA_XFER_OK;
> +
> +               /*
> +                * Mimic the logic from the vendor driver where (only)
> +                * SD_IO_RW_EXTENDED commands with more than one block set the
> +                * MESON_SDHC_MISC_MANUAL_STOP bit. This fixes the firmware
> +                * download in the brcmfmac driver for a BCM43362/1 card.
> +                * Without this sdio_memcpy_toio() (with a size of 219557
> +                * bytes) times out if MESON_SDHC_MISC_MANUAL_STOP is not set.
> +                */
> +               manual_stop = cmd->data->blocks > 1 &&
> +                             cmd->opcode == SD_IO_RW_EXTENDED;
>         } else {
>                 pack_len = 0;
>
>                 ictl |= MESON_SDHC_ICTL_RESP_OK;
>         }
>
> +       regmap_update_bits(host->regmap, MESON_SDHC_MISC,
> +                          MESON_SDHC_MISC_MANUAL_STOP,
> +                          manual_stop ? MESON_SDHC_MISC_MANUAL_STOP : 0);
> +
>         if (cmd->opcode == MMC_STOP_TRANSMISSION)
>                 send |= MESON_SDHC_SEND_DATA_STOP;
>
> --
> 2.34.1
>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-12-21 13:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-19 15:34 [PATCH v2 0/2] mmc: meson-mx-sdhc: two fixes Martin Blumenstingl
2021-12-19 15:34 ` Martin Blumenstingl
2021-12-19 15:34 ` Martin Blumenstingl
2021-12-19 15:34 ` [PATCH v2 1/2] mmc: meson-mx-sdhc: Set MANUAL_STOP for multi-block SDIO commands Martin Blumenstingl
2021-12-19 15:34   ` Martin Blumenstingl
2021-12-19 15:34   ` Martin Blumenstingl
2021-12-21 13:02   ` Ulf Hansson [this message]
2021-12-21 13:02     ` Ulf Hansson
2021-12-21 13:02     ` Ulf Hansson
2021-12-19 15:34 ` [PATCH v2 2/2] mmc: meson-mx-sdhc: Drop unused MESON_SDHC_NUM_BUILTIN_CLKS macro Martin Blumenstingl
2021-12-19 15:34   ` Martin Blumenstingl
2021-12-19 15:34   ` Martin Blumenstingl
2021-12-21 13:02   ` Ulf Hansson
2021-12-21 13:02     ` Ulf Hansson
2021-12-21 13:02     ` Ulf Hansson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPDyKFry2L5RKTtxKQ-Qu+xJEsK-hSCNgrgB371MMSGsd4DwZA@mail.gmail.com \
    --to=ulf.hansson@linaro.org \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=martin.blumenstingl@googlemail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.