Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp474347pxb; Wed, 15 Sep 2021 06:24:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZAouRJL+S++zYHQxUvdZrCrMJAdSYj/sZs0gOs84neO/E1Ek2oKUvEiT4WuKGyszWtAnB X-Received: by 2002:a05:6638:1347:: with SMTP id u7mr11302jad.34.1631712289850; Wed, 15 Sep 2021 06:24:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631712289; cv=none; d=google.com; s=arc-20160816; b=WcuaMtjjb8yQcswEm6h/jxQw4bq+BuaKJTS+KOvLwta2i1H0CiNhtg5eyaYTqt9ZCm odh6NGd/Vn1nAuuEyefd4NKYtDI8dwBa9KPOQv+d9UZDMXvxuAI/HZXHaesJmJGQqX5y 4vzTwzagZPvEf9VxN9Ki3/dFQA8FqGceSACaVZFZ2KZ00161e6Qjx6AdxJouvvm0VBL7 VBvYl+KNYJrDpyH+kTsvUFvQxxhkObxERl3c/R3atHx3PL/tsBSz22lGLDp+z65+8Hn8 aY5tvGdUjFf8nlRLBt2qOno+SuMfg8PaSdZhgSVS1lRlIGngjJs6I6J2mKBXKxmD5x3D gaIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=+EQHPW1j/nr8yBB9ckR7pNX7dfQl5K4J9lCzHHL/teg=; b=J3Q0lxDxGflq8QaNyMKD/hv+nPDU8pECinklnJiTUi2ec7mrgf3koFxFK28aRDDTPB uP16O/0ycZdxwWoDGOxknlQJ39j3MgLDHDgYdwCqi+3ug/nHLkaAQEvs3EJwXwAOgIGI 7e9Ru87PinCdPs0PXApiA5jj/VD7bZlTGq3UKuRFAFxU5m9sCSkePwL7CggkHzaNr0wP XDyAPVK1ujZcX3oD7hbf/zLX+cFflOKF3LNiCiy1/kJ5gm5eRh5sPsqdi8io1p6xfhS1 0iCDTQGQPlN7w74fpxRORftWbf8N6XDSLvFXqhKst/jZ13Yd2f/31akuxe3nlanLdIyj vQmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UauaoPYN; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k3si12862905ilh.76.2021.09.15.06.24.35; Wed, 15 Sep 2021 06:24:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UauaoPYN; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233516AbhIONZp (ORCPT + 99 others); Wed, 15 Sep 2021 09:25:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:41334 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233395AbhIONZm (ORCPT ); Wed, 15 Sep 2021 09:25:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631712260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+EQHPW1j/nr8yBB9ckR7pNX7dfQl5K4J9lCzHHL/teg=; b=UauaoPYNX66luvSio+g5RSXZ5b2RU/Wo3m9p84p3gxN23jrA0PyPJXE33EFRXPtJmZ7Ql6 i23x0mFPpnpzXv9h6sYnj+ltoJfayvb2w+aM37dCob+Rp58EdOs3ipyf5q59pke5vzfY6z djtUS86zCGiJ2A7zpQsumq1VnvsqLxU= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-15-CUjYet4iM4y28yc1TNWKiw-1; Wed, 15 Sep 2021 09:24:19 -0400 X-MC-Unique: CUjYet4iM4y28yc1TNWKiw-1 Received: by mail-ej1-f71.google.com with SMTP id g4-20020a170906520400b005e7d062772dso1522512ejm.13 for ; Wed, 15 Sep 2021 06:24:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=+EQHPW1j/nr8yBB9ckR7pNX7dfQl5K4J9lCzHHL/teg=; b=FEox9XXSVubIxeJgF2vez5U2ysRcGJgTcshbRKfodJOejDXYn3au+OD5CyZgp3aigS RHUpr2KBaOJLd5l/pUJJvIfEG6SXsIZUJrIG+4yWPSHw6+Of0oFHkS3ru03OAOJdaEdB R+yNlpsP/l7dpwLolEs3gAJ2WLkO8KxMOpMtLJ/pYNnlE0oJ4hpn+NaTo68y+DxXpz4s sgyVfGzkVpBdKCTgcel+AoPz387ZlrhzMEIiwqoSZO3Ld8UUnom/685vPQgOy6Q4SS8O gArgTqzPiZnT7rGh/bCdeZD6836GoqEpS7D28p2DbrmrmADWZYV8iq0uPtFttP+AzPsg TgIQ== X-Gm-Message-State: AOAM5319Cwbo0xtkIUiGdgsNjEdj8UbAT6JvHjK6i6he1NrouBIdjtuQ ZdSOIy+tqiznEzdSH8/j8XdPZwQPHOf9EOX3ufeHdoN7KIqr7akBru39bkv96ISsJhEqeZ9JVTu RLnXwqcY/3sV3lzm44AOQggtUV+Q= X-Received: by 2002:a17:906:4482:: with SMTP id y2mr24782917ejo.484.1631712258473; Wed, 15 Sep 2021 06:24:18 -0700 (PDT) X-Received: by 2002:a17:906:4482:: with SMTP id y2mr24782887ejo.484.1631712258259; Wed, 15 Sep 2021 06:24:18 -0700 (PDT) Received: from localhost (net-130-25-199-50.cust.vodafonedsl.it. [130.25.199.50]) by smtp.gmail.com with ESMTPSA id o15sm6277378ejj.10.2021.09.15.06.24.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Sep 2021 06:24:17 -0700 (PDT) Date: Wed, 15 Sep 2021 15:24:14 +0200 From: Lorenzo Bianconi 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 Message-ID: References: <764759a9a2befe09000863f04676287665675555.1631667941.git.objelf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="gRsDsI6iq8aKspqC" Content-Disposition: inline In-Reply-To: <764759a9a2befe09000863f04676287665675555.1631667941.git.objelf@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org --gRsDsI6iq8aKspqC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > From: Sean Wang >=20 > 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. >=20 > Tested-by: Deren Wu > Signed-off-by: Sean Wang > --- > drivers/net/wireless/mediatek/mt76/mt7921/mcu.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c b/drivers/ne= t/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 *d= ev, struct sk_buff *skb) > =20 > void mt7921_mcu_rx_event(struct mt7921_dev *dev, struct sk_buff *skb) > { > - struct mt7921_mcu_rxd *rxd =3D (struct mt7921_mcu_rxd *)skb->data; > + struct mt7921_mcu_rxd *rxd; > + int ret; > + > + ret =3D 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 =3D (struct mt7921_mcu_rxd *)skb->data; > =20 > if (rxd->eid =3D=3D 0x6) { > mt76_mcu_rx_event(&dev->mt76, skb); > --=20 > 2.25.1 >=20 --gRsDsI6iq8aKspqC Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCYUHz/AAKCRA6cBh0uS2t rOmDAQDa4ZdKxdoFQv8VDOfSAn6PVDgkDaohNhlO8SpBIZjhSwD/cvSbD2ZSHU+V X1YvOeYxx7Ufgvgqszy80u3QzBjQ5wA= =6LSj -----END PGP SIGNATURE----- --gRsDsI6iq8aKspqC--