linux-mediatek.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
To: sean.wang@mediatek.com
Cc: nbd@nbd.name, Soul.Huang@mediatek.com, YN.Chen@mediatek.com,
	Leon.Yen@mediatek.com, Eric-SY.Chang@mediatek.com,
	Deren.Wu@mediatek.com, km.lin@mediatek.com,
	robin.chiu@mediatek.com, Eddie.Chen@mediatek.com,
	ch.yeh@mediatek.com, posh.sun@mediatek.com,
	ted.huang@mediatek.com, Eric.Liang@mediatek.com,
	Stella.Chang@mediatek.com, steve.lee@mediatek.com,
	jemele@google.com, shawnku@google.com,
	linux-wireless@vger.kernel.org,
	linux-mediatek@lists.infradead.org
Subject: Re: [PATCH v1 09/16] mt76: mt7921: make all event parser resuable between mt7921s and mt7921e
Date: Wed, 15 Sep 2021 15:24:14 +0200	[thread overview]
Message-ID: <YUHz/gbfzmFszods@lore-desk> (raw)
In-Reply-To: <764759a9a2befe09000863f04676287665675555.1631667941.git.objelf@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1447 bytes --]

> From: Sean Wang <sean.wang@mediatek.com>
> 
> The longer event such as the event for mcu_get_nic_capability would hold
> the data in paged fragment skb for the SDIO device so we turn the skb to
> be linearized skb before accessing it to reuse the same event parser
> betweem mt7921s and mt7921e.
> 
> Tested-by: Deren Wu <deren.wu@mediatek.com>
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> ---
>  drivers/net/wireless/mediatek/mt76/mt7921/mcu.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
> index f5a8f7fa4244..8e49df20a8cb 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
> @@ -458,7 +458,14 @@ mt7921_mcu_rx_unsolicited_event(struct mt7921_dev *dev, struct sk_buff *skb)
>  
>  void mt7921_mcu_rx_event(struct mt7921_dev *dev, struct sk_buff *skb)
>  {
> -	struct mt7921_mcu_rxd *rxd = (struct mt7921_mcu_rxd *)skb->data;
> +	struct mt7921_mcu_rxd *rxd;
> +	int ret;
> +
> +	ret = skb_linearize(skb);

is it true for sdio only? if so what about doing something like:

if (mt76_is_sdio() && skb_linearize(skb))
	return;

> +	if (ret)
> +		return;
> +
> +	rxd = (struct mt7921_mcu_rxd *)skb->data;
>  
>  	if (rxd->eid == 0x6) {
>  		mt76_mcu_rx_event(&dev->mt76, skb);
> -- 
> 2.25.1
> 

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

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

  reply	other threads:[~2021-09-15 13:24 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-15  1:14 [PATCH v1 00/16] Add MT7921 SDIO support sean.wang
2021-09-15  1:14 ` [PATCH v1 01/16] mt76: mt7921: refactor mac.c to be bus independent sean.wang
2021-09-15 13:01   ` Lorenzo Bianconi
2021-09-15  1:14 ` [PATCH v1 02/16] mt76: mt7921: refactor dma.c to be pcie specific sean.wang
2021-09-15 13:03   ` Lorenzo Bianconi
2021-09-15  1:14 ` [PATCH v1 03/16] mt76: mt7921: refactor mcu.c to be bus independent sean.wang
2021-09-15 13:08   ` Lorenzo Bianconi
2021-09-15  1:14 ` [PATCH v1 04/16] mt76: mt7921: refactor init.c " sean.wang
2021-09-15 13:14   ` Lorenzo Bianconi
2021-09-15  1:14 ` [PATCH v1 05/16] mt76: mt7921: add MT7921_COMMON module sean.wang
2021-09-15  1:14 ` [PATCH v1 06/16] mt76: connac: move mcu reg access utility routines in mt76_connac_lib module sean.wang
2021-09-15  1:14 ` [PATCH v1 07/16] mt76: connac: move sdio utility routines in mt76_connac_sdio module sean.wang
2021-09-15 13:20   ` Lorenzo Bianconi
2021-09-15 14:30     ` Lorenzo Bianconi
2021-09-15  1:14 ` [PATCH v1 08/16] mt76: mt7663s: rely on mt76_connac_sdio common library sean.wang
2021-09-15  1:14 ` [PATCH v1 09/16] mt76: mt7921: make all event parser resuable between mt7921s and mt7921e sean.wang
2021-09-15 13:24   ` Lorenzo Bianconi [this message]
2021-09-15 13:31     ` Lorenzo Bianconi
2021-09-15  1:14 ` [PATCH v1 10/16] mt76: mt7921: use physical addr to unify register access sean.wang
2021-09-15 13:26   ` Lorenzo Bianconi
2021-09-15  1:14 ` [PATCH v1 11/16] mt76: connac: extend mt76_connac_sdio module to support CONNAC2 sean.wang
2021-09-15  1:14 ` [PATCH v1 12/16] mt76: connac: extend mcu_get_nic_capability sean.wang
2021-09-15  1:14 ` [PATCH v1 13/16] mt76: mt7921: rely on mcu_get_nic_capability sean.wang
2021-09-15  1:14 ` [PATCH v1 14/16] mt76: mt7921: refactor mt7921_mcu_send_message sean.wang
2021-09-15  1:14 ` [PATCH v1 15/16] mt76: mt7921: introduce mt7921s support sean.wang
2021-09-15  1:14 ` [PATCH v1 16/16] mt76: mt7921s: add reset support sean.wang

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=YUHz/gbfzmFszods@lore-desk \
    --to=lorenzo.bianconi@redhat.com \
    --cc=Deren.Wu@mediatek.com \
    --cc=Eddie.Chen@mediatek.com \
    --cc=Eric-SY.Chang@mediatek.com \
    --cc=Eric.Liang@mediatek.com \
    --cc=Leon.Yen@mediatek.com \
    --cc=Soul.Huang@mediatek.com \
    --cc=Stella.Chang@mediatek.com \
    --cc=YN.Chen@mediatek.com \
    --cc=ch.yeh@mediatek.com \
    --cc=jemele@google.com \
    --cc=km.lin@mediatek.com \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=nbd@nbd.name \
    --cc=posh.sun@mediatek.com \
    --cc=robin.chiu@mediatek.com \
    --cc=sean.wang@mediatek.com \
    --cc=shawnku@google.com \
    --cc=steve.lee@mediatek.com \
    --cc=ted.huang@mediatek.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).