linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jernej Škrabec" <jernej.skrabec@gmail.com>
To: Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	Larry Finger <Larry.Finger@lwfinger.net>
Cc: linux-wireless <linux-wireless@vger.kernel.org>
Subject: Re: rtw88: Problem with sdio.c
Date: Wed, 24 May 2023 21:18:12 +0200	[thread overview]
Message-ID: <2681990.mvXUDI8C0e@jernej-laptop> (raw)
In-Reply-To: <1027342a-97dd-83cd-f363-43cff49967e2@lwfinger.net>

Dne sreda, 24. maj 2023 ob 20:51:53 CEST je Larry Finger napisal(a):
> Martin,
> 
> When I applied your latest changes to my rtw88 repo, the driver for 8723ds 
> broke. The dmesg log first showed things like:
> 
> [    3.603884] rtw_8723ds mmc1:0001:1: Firmware version 48.0.0, H2C version 0
> [    3.615430] sunxi-mmc 4021000.mmc: unaligned scatterlist: os e80 length 2
> [    3.622248] sunxi-mmc 4021000.mmc: map DMA failed
> [    3.626974] rtw_8723ds mmc1:0001:1: sdio read16 failed (0x10040): -22
> [    3.633435] sunxi-mmc 4021000.mmc: unaligned scatterlist: os e80 length 2
> [    3.640236] sunxi-mmc 4021000.mmc: map DMA failed
> 
> There were similar messages for write16 operations.

This was fixed in:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cb0ddaaa5db09d7d216fcbf0e68779be223a1128

Best regards,
Jernej

> 
> I was able to "fix" the problem by turning off rea16/write16 operations for the 
> RTW8723DS with the following patch that uses the rtw_chip_wcpu_11n() function:
> 
> diff --git a/sdio.c b/sdio.c
> index 1647cdc..2051c30 100644
> --- a/sdio.c
> +++ b/sdio.c
> @@ -87,7 +87,7 @@ static void rtw_sdio_writew(struct rtw_dev *rtwdev, u16 val, 
> u32 addr,
>          u8 buf[2];
>          int i;
> 
> -       if (rtw_sdio_use_memcpy_io(rtwdev, addr, 2)) {
> +       if (rtw_sdio_use_memcpy_io(rtwdev, addr, 2) && !rtw_chip_wcpu_11n(rtwdev)) {
>                  sdio_writew(rtwsdio->sdio_func, val, addr, err_ret);
>                  return;
>          }
> @@ -125,7 +125,7 @@ static u16 rtw_sdio_readw(struct rtw_dev *rtwdev, u32 addr, 
> int *err_ret)
>          u8 buf[2];
>          int i;
> 
> -       if (rtw_sdio_use_memcpy_io(rtwdev, addr, 2))
> +       if (rtw_sdio_use_memcpy_io(rtwdev, addr, 2) && !rtw_chip_wcpu_11n(rtwdev))
>                  return sdio_readw(rtwsdio->sdio_func, addr, err_ret);
> 
>          for (i = 0; i < 2; i++) {
> 
> This leaves 16-bit reads and write enabled for the other chips. Alternatives 
> would be to detect when this particular SDIO controller is in use, or last of 
> all, add a module parameter.
> 
> Larry
> 





  reply	other threads:[~2023-05-24 19:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-24 18:51 rtw88: Problem with sdio.c Larry Finger
2023-05-24 19:18 ` Jernej Škrabec [this message]
2023-05-24 20:31   ` Larry Finger
2023-05-27  7:15     ` Kalle Valo

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=2681990.mvXUDI8C0e@jernej-laptop \
    --to=jernej.skrabec@gmail.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=linux-wireless@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 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).