Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp480102pxb; Wed, 15 Sep 2021 06:32:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOUL5d8L8AIkoFCDLS0YS5RaTCd+FxhiPuw8K95TfMY2eL8pHtofciX+wA8rYxOnAVXA83 X-Received: by 2002:a6b:fd05:: with SMTP id c5mr34774ioi.102.1631712724484; Wed, 15 Sep 2021 06:32:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631712724; cv=none; d=google.com; s=arc-20160816; b=I5a9MYlA8Liy0z3amtQtTyYYfZzTLpyLGMGzftfF1A/4drmSlfYcpvDW6JtK95e4Ag +Fn0GHHIUXrc/306YN4ESnXJ+4q9Ffmf26Z5O7j4d/5XpCdu94B8nYaPlUYJdrB/ONuL NY+1sElnUjqhbEak2M7k+LjUyTdHEoCW00FMZWPevRpZd5MRwPAVi2HqbpIE1MNsTThW QbNAEwy1bU7O0MQycW+ZxfXKZdlLTKSR3ijEc/aoQlO6fgWQi6H+nkyEJg+rFXp/l5Qm d5/BDGndDexqqpTrbPXw6cV5umJAnJNO5e+JY8oRXKT3/prYS3cohFpYoEwlg1/31oIw 5Ckw== 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=/azogsROZACSNc4T7vf4fDs5jXSzRpucSpuRzV2HagU=; b=Adrwg6OCuFbHm2G9PQ13pgOP/jN37/JnIXZMYO9vBzlgVCrC1CFDPSNNH9NnnJX7Av 2dzhgDwCAdpx14YxvX6JGfIZpom+pZXp7efYs5y5INHL6rhAoRwycjMnme3t4puvMLNl QUSz3TO8UeIAUwDrSlhA0uDf2ZUUsVyU7H0h00+QJOBeFF2fVM+tH8lzYyZKQlyOP/ul WSOq59kKqpxuCdQREOFM4g8NETNBnVhtO3PhtpJMWWl9vxnznUvSSS9uvvTY/xHv1oXf 6H40FIUKaNm4UU+ZJHo0LQbQONnUJ71wcDWkX8Aq0VT28yvtmAtaStLXj2iqMWbSByv6 IvkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bTtSX6xo; 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 q22si12436543jae.93.2021.09.15.06.31.50; Wed, 15 Sep 2021 06:32:04 -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=bTtSX6xo; 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 S234337AbhIONdB (ORCPT + 99 others); Wed, 15 Sep 2021 09:33:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:35274 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233429AbhIONdB (ORCPT ); Wed, 15 Sep 2021 09:33:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631712701; 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=/azogsROZACSNc4T7vf4fDs5jXSzRpucSpuRzV2HagU=; b=bTtSX6xogTo3Tahnk2QESCsY9afvzHh9BuZWuL3RAYAacn6Bw6AO228yE9HKXw4Dvr/gd6 Wjnj09r+yNDYJPQj4PFnSTz1jkZJkF2uHn9Q8iqs/dYZsik+Plwv46fa5cfdviA2LXjRLd epyR4WGgGIlG9ETrLMmLuRZnP8ZLNm4= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-517-5co-eSNhOP69XRApHL68vw-1; Wed, 15 Sep 2021 09:31:39 -0400 X-MC-Unique: 5co-eSNhOP69XRApHL68vw-1 Received: by mail-ed1-f71.google.com with SMTP id x14-20020a50ba8e000000b003d5a565de3aso683742ede.18 for ; Wed, 15 Sep 2021 06:31:39 -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=/azogsROZACSNc4T7vf4fDs5jXSzRpucSpuRzV2HagU=; b=Ju8o38Juy3kEn/IJwjHXiTOggQvwXlQIsdLQhlnZs8EY2Fy6e4UHADJHxOh6/7zt4w Yc5D4cMbcfOgfYcopF49iBy9B0SBSLedmlWTF2xO1g9sK163T7wi5sq3vmCbE7vnJGSo s69ZsWJ7kWOERk3/+/uOdBBM9gpnX6nbOAYE9vJvhZy0moGoD+IyuGEoE1rnYQ0EHtQ+ LMHFoXv0208nTQ4fPjR3zymdAhzRqPVRf8rsMoYWeLoAClIS8hxA+2iqmgkxKiJIiPX/ a2i5yn0uYiCdxJRGsE7FH9x/7X7Jo/8eCDBgCBTzs089kX5i96jk4GZalgt1O41u+w+8 h2EQ== X-Gm-Message-State: AOAM531X+/d3tP8oM8w+Oxz8OlBZZLZ6Q/1A34PY348eqlhedMllrCYV k7QxLXs1Uu/TtFWxF8ZTwe19VKr9mPBRJmM2Fr6sGqV/vzsTqPYe55xnvxtb90dETV1BkejtJy0 czEZzxMy3E4ZIq53jECCNmslhshQ= X-Received: by 2002:a17:906:8cd:: with SMTP id o13mr24842808eje.341.1631712698240; Wed, 15 Sep 2021 06:31:38 -0700 (PDT) X-Received: by 2002:a17:906:8cd:: with SMTP id o13mr24842784eje.341.1631712698070; Wed, 15 Sep 2021 06:31:38 -0700 (PDT) Received: from localhost (net-130-25-199-50.cust.vodafonedsl.it. [130.25.199.50]) by smtp.gmail.com with ESMTPSA id n11sm1087754edr.51.2021.09.15.06.31.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Sep 2021 06:31:37 -0700 (PDT) Date: Wed, 15 Sep 2021 15:31:34 +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="pTOOomLTkB8wTJhp" Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org --pTOOomLTkB8wTJhp 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/= 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) > > =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); >=20 > is it true for sdio only? if so what about doing something like: >=20 > if (mt76_is_sdio() && skb_linearize(skb)) > return; please ignore this comment, it is already in skb_linearize() >=20 > > + 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 --pTOOomLTkB8wTJhp Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCYUH1tAAKCRA6cBh0uS2t rMkyAQDUa3R2Xm/43qa/WcpdImu0zoJb2NOBQIPNJicSkJYLFQEAx99u7hzZHeFi rHHCgQlXtyx6c+rtwKLoXbvCzLAlYgg= =BEBo -----END PGP SIGNATURE----- --pTOOomLTkB8wTJhp--