linux-mediatek.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Golle <daniel@makrotopia.org>
To: Simon Horman <simon.horman@corigine.com>
Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
	linux-mediatek@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Felix Fietkau <nbd@nbd.name>,
	Lorenzo Bianconi <lorenzo@kernel.org>,
	Ryder Lee <ryder.lee@mediatek.com>,
	Shayne Chen <shayne.chen@mediatek.com>,
	Sean Wang <sean.wang@mediatek.com>, Kalle Valo <kvalo@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	Alexander Couzens <lynxis@fe80.eu>,
	Sujuan Chen <sujuan.chen@mediatek.com>,
	Bo Jiao <bo.jiao@mediatek.com>,
	Nicolas Cavallari <nicolas.cavallari@green-communications.fr>,
	Howard Hsu <howard-yh.hsu@mediatek.com>,
	MeiChia Chiu <MeiChia.Chiu@mediatek.com>,
	Peter Chiu <chui-hao.chiu@mediatek.com>,
	Johannes Berg <johannes.berg@intel.com>,
	Wang Yufen <wangyufen@huawei.com>, Lorenz Brun <lorenz@brun.one>
Subject: Re: [PATCH] wifi: mt76: mt7915: add support for MT7981
Date: Sun, 14 May 2023 18:32:15 +0200	[thread overview]
Message-ID: <ZGENDwGXkuhrCGFY@pidgin.makrotopia.org> (raw)
In-Reply-To: <ZGD192iDcUqoUwo3@corigine.com>

Hi Simon,

thank you for reviewing!

On Sun, May 14, 2023 at 04:53:43PM +0200, Simon Horman wrote:
> On Sat, May 13, 2023 at 03:35:51PM +0200, Daniel Golle wrote:
> > From: Alexander Couzens <lynxis@fe80.eu>
> > 
> > Add support for the MediaTek MT7981 SoC which is similar to the MT7986
> > but with a newer IP cores and only 2x ARM Cortex-A53 instead of 4x.
> > Unlike MT7986 the MT7981 can only connect a single wireless frontend,
> > usually MT7976 is used for DBDC.
> > 
> > Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
> > Signed-off-by: Daniel Golle <daniel@makrotopia.org>
> 
> ...
> 
> > @@ -489,7 +516,10 @@ static int mt7986_wmac_adie_patch_7976(struct mt7915_dev *dev, u8 adie)
> >  		rg_xo_01 = 0x1d59080f;
> >  		rg_xo_03 = 0x34c00fe0;
> >  	} else {
> > -		rg_xo_01 = 0x1959f80f;
> > +		if (is_mt7981(&dev->mt76))
> > +			rg_xo_01 = 0x1959c80f;
> > +		else if (is_mt7986(&dev->mt76))
> > +			rg_xo_01 = 0x1959f80f;
> 
> Hi Daniel,
> 
> 		rg_xo_01 will be used uninitialised below if we get here
> 		and neither of the conditions above are true.
> 
> 		Can this occur?

No, it cannot occur. Either of is_mt7981() or is_mt7986() will return
true, as the driver is bound via one of the two compatibles
'mediatek,mt7986-wmac' or newly added 'mediatek,mt7981-wmac'.
Based on that the match_data is either 0x7986 or 0x7981, which is then
used as chip_id, which is used by the is_mt7981() and is_mt7986()
functions.

> 
> >  		rg_xo_03 = 0x34d00fe0;
> >  	}
> >  
> 
> ...
> 


  reply	other threads:[~2023-05-14 16:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-13 13:35 [PATCH] wifi: mt76: mt7915: add support for MT7981 Daniel Golle
2023-05-14 14:53 ` Simon Horman
2023-05-14 16:32   ` Daniel Golle [this message]
2023-05-15 11:08     ` Kalle Valo
2023-05-15 11:26       ` Simon Horman

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=ZGENDwGXkuhrCGFY@pidgin.makrotopia.org \
    --to=daniel@makrotopia.org \
    --cc=MeiChia.Chiu@mediatek.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=bo.jiao@mediatek.com \
    --cc=chui-hao.chiu@mediatek.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=howard-yh.hsu@mediatek.com \
    --cc=johannes.berg@intel.com \
    --cc=kuba@kernel.org \
    --cc=kvalo@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenz@brun.one \
    --cc=lorenzo@kernel.org \
    --cc=lynxis@fe80.eu \
    --cc=matthias.bgg@gmail.com \
    --cc=nbd@nbd.name \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.cavallari@green-communications.fr \
    --cc=pabeni@redhat.com \
    --cc=ryder.lee@mediatek.com \
    --cc=sean.wang@mediatek.com \
    --cc=shayne.chen@mediatek.com \
    --cc=simon.horman@corigine.com \
    --cc=sujuan.chen@mediatek.com \
    --cc=wangyufen@huawei.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).