All of lore.kernel.org
 help / color / mirror / Atom feed
From: "lorenzo@kernel.org" <lorenzo@kernel.org>
To: Roy Luo <roychl666@gmail.com>
Cc: "Ryder Lee" <Ryder.Lee@mediatek.com>,
	"Shayne Chen (陳軒丞)" <Shayne.Chen@mediatek.com>,
	"nbd@nbd.name" <nbd@nbd.name>,
	"Roy-CH Luo" <Roy-CH.Luo@mediatek.com>,
	"Chui-hao Chiu (邱垂浩)" <Chui-hao.Chiu@mediatek.com>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"Sean Wang" <Sean.Wang@mediatek.com>,
	"Bo Jiao (焦波)" <Bo.Jiao@mediatek.com>,
	"linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>,
	"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v2] wifi: mt76: mt7996: fix reading zeroed info->control.flags after mt76_tx_status_skb_add()
Date: Tue, 2 Jun 2026 08:43:27 +0200	[thread overview]
Message-ID: <ah57j_SwdVZTc0GR@lore-rh-laptop> (raw)
In-Reply-To: <CAHoxoj+N3AtJgFD8vGP+uDpj6anKMgPBtZGejLDgAz0ZyisSHg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2352 bytes --]

On Jun 01, Roy Luo wrote:
> > > I mean the link_id is only corresponds to one specific flags bit of
> > > mac80211_tx_control_flags. But there are other bits that aren't
> > > handled. Wouldn't u32 flags make it more cleaner?
> >
> > Yes, I got your point, but my concern is if we need to sync link_id between
> > mt7996_tx_prepare_skb() and mt7996_mac_write_txwi(). If so, I guess it is
> > much better to pass link_id explicitly to mt7996_mac_write_txwi() since it
> > does not just depended on mac80211_tx_control_flags and I think we should
> > not duplicate the logic in mt7996_mac_write_txwi(). Got my point?
> > If in the future (not required now) we need to pass mac80211_tx_control_flags
> > to mt7996_mac_write_txwi(), we will do it easily.
> >
> > Regards,
> > Lorenzo
> >
> > >
> > > Ryder
> > >
> > >
> 
> Lorenzo,

Hi Roy,

> 
> I got your point and IIUC the problem being addressed in this patch is that
> the link id assignment has unnecessary duplicated logic across different
> places. However, the commit tile "fix reading zeroed info->control.flags"
> seems a bit misleading to me - this patch does not fully address the problem
> where the info->control.flags is cleared by memset in tx path when its
> value might still be referenced, the field is still zeroed after
> mt76_tx_status_skb_add() and whoever reads it afterward would get
> incorrect value. With this patch, we avoid using the incorrect value for
> link id, but the root cause remains.

This patch is actually fixing both of the issues since now do not have any
leftover access to info->control.flags after running mt76_tx_status_skb_add()
in the mt7996 tx path and it is not required (according to the current mt7996
codebase) to pass the flags cached value to mt7996_mac_write_txwi(). However,
if in the future this will be necessary, I am completely fine with that.

Regards,
Lorenzo

> 
> The issue that Ryder tries to address in
> https://lore.kernel.org/all/5ecac6a9b7d29526e8438dea105b58f5487c93aa.1778521232.git.ryder.lee@mediatek.com/
> concerns the overlapping use of info->control and info->status in tx path,
> and it remains valid even with this link id fix applied. We have to be
> cautious when dealing with info->control in mt7996 tx path until the issue
> is fully resolved.
> 
> Regards,
> Roy

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

      reply	other threads:[~2026-06-02  6:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-31  8:55 [PATCH v2] wifi: mt76: mt7996: fix reading zeroed info->control.flags after mt76_tx_status_skb_add() Lorenzo Bianconi
2026-05-31 10:23 ` Ryder Lee
2026-05-31 12:11   ` lorenzo
2026-05-31 12:28     ` Ryder Lee
2026-05-31 13:12       ` lorenzo
2026-05-31 19:52         ` Ryder Lee
2026-06-01  5:56           ` lorenzo
2026-06-01 18:14             ` Roy Luo
2026-06-02  6:43               ` lorenzo [this message]

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=ah57j_SwdVZTc0GR@lore-rh-laptop \
    --to=lorenzo@kernel.org \
    --cc=Bo.Jiao@mediatek.com \
    --cc=Chui-hao.Chiu@mediatek.com \
    --cc=Roy-CH.Luo@mediatek.com \
    --cc=Ryder.Lee@mediatek.com \
    --cc=Sean.Wang@mediatek.com \
    --cc=Shayne.Chen@mediatek.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --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=matthias.bgg@gmail.com \
    --cc=nbd@nbd.name \
    --cc=roychl666@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.