public inbox for linux-mediatek@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] wifi: mt76: mt7925: ensure 4-byte alignment for suspend & wow command
@ 2024-03-07 11:08 Mingyen Hsieh
  2024-03-07 11:17 ` Lorenzo Bianconi
  2024-04-17 22:21 ` Sean Wang
  0 siblings, 2 replies; 5+ messages in thread
From: Mingyen Hsieh @ 2024-03-07 11:08 UTC (permalink / raw)
  To: nbd, lorenzo
  Cc: deren.wu, Sean.Wang, Soul.Huang, Leon.Yen, Eric-SY.Chang, km.lin,
	robin.chiu, ch.yeh, posh.sun, Quan.Zhou, Ryder.Lee, Shayne.Chen,
	linux-wireless, linux-mediatek, Ming Yen Hsieh

From: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>

Before sending suspend & wow command to FW, its length should be
4-bytes alignd.

Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
---
 drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c | 1 +
 drivers/net/wireless/mediatek/mt76/mt7925/mcu.h      | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
index af0c2b2aacb0..ef29d093f9c3 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
@@ -2527,6 +2527,7 @@ int mt76_connac_mcu_set_hif_suspend(struct mt76_dev *dev, bool suspend)
 			__le16 tag;
 			__le16 len;
 			u8 suspend;
+			u8 pad[7];
 		} __packed hif_suspend;
 	} req = {
 		.hif_suspend = {
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h
index 2a0bbfe7bfa5..b8315a89f4a9 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h
@@ -535,7 +535,7 @@ struct mt7925_wow_pattern_tlv {
 	u8 offset;
 	u8 mask[MT76_CONNAC_WOW_MASK_MAX_LEN];
 	u8 pattern[MT76_CONNAC_WOW_PATTEN_MAX_LEN];
-	u8 rsv[4];
+	u8 rsv[7];
 } __packed;
 
 static inline enum connac3_mcu_cipher_type
-- 
2.18.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] wifi: mt76: mt7925: ensure 4-byte alignment for suspend & wow command
  2024-03-07 11:08 [PATCH] wifi: mt76: mt7925: ensure 4-byte alignment for suspend & wow command Mingyen Hsieh
@ 2024-03-07 11:17 ` Lorenzo Bianconi
  2024-03-08  5:06   ` Mingyen Hsieh (謝明諺)
  2024-04-17 22:21 ` Sean Wang
  1 sibling, 1 reply; 5+ messages in thread
From: Lorenzo Bianconi @ 2024-03-07 11:17 UTC (permalink / raw)
  To: Mingyen Hsieh
  Cc: nbd, deren.wu, Sean.Wang, Soul.Huang, Leon.Yen, Eric-SY.Chang,
	km.lin, robin.chiu, ch.yeh, posh.sun, Quan.Zhou, Ryder.Lee,
	Shayne.Chen, linux-wireless, linux-mediatek

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

> From: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
> 
> Before sending suspend & wow command to FW, its length should be
> 4-bytes alignd.
> 
> Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
> ---
>  drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c | 1 +
>  drivers/net/wireless/mediatek/mt76/mt7925/mcu.h      | 2 +-
>  2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
> index af0c2b2aacb0..ef29d093f9c3 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
> @@ -2527,6 +2527,7 @@ int mt76_connac_mcu_set_hif_suspend(struct mt76_dev *dev, bool suspend)
>  			__le16 tag;
>  			__le16 len;
>  			u8 suspend;
> +			u8 pad[7];

mt76_connac_mcu_set_hif_suspend() is used even by other drv (e.g. mt7615). Is
this change backward compatible?

Regards,
Lorenzo

>  		} __packed hif_suspend;
>  	} req = {
>  		.hif_suspend = {
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h
> index 2a0bbfe7bfa5..b8315a89f4a9 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h
> +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h
> @@ -535,7 +535,7 @@ struct mt7925_wow_pattern_tlv {
>  	u8 offset;
>  	u8 mask[MT76_CONNAC_WOW_MASK_MAX_LEN];
>  	u8 pattern[MT76_CONNAC_WOW_PATTEN_MAX_LEN];
> -	u8 rsv[4];
> +	u8 rsv[7];
>  } __packed;
>  
>  static inline enum connac3_mcu_cipher_type
> -- 
> 2.18.0
> 

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] wifi: mt76: mt7925: ensure 4-byte alignment for suspend & wow command
  2024-03-07 11:17 ` Lorenzo Bianconi
@ 2024-03-08  5:06   ` Mingyen Hsieh (謝明諺)
  0 siblings, 0 replies; 5+ messages in thread
From: Mingyen Hsieh (謝明諺) @ 2024-03-08  5:06 UTC (permalink / raw)
  To: lorenzo@kernel.org
  Cc: linux-mediatek@lists.infradead.org,
	Leon Yen (顏良儒),
	Deren Wu (武德仁),
	Shayne Chen (陳軒丞), nbd@nbd.name,
	Quan Zhou (周全), Sean Wang,
	KM Lin (林昆民),
	Soul Huang (黃至昶),
	Posh Sun (孫瑞廷),
	Eric-SY Chang (張書源),
	CH Yeh (葉志豪),
	Robin Chiu (邱國濱), Ryder Lee,
	linux-wireless@vger.kernel.org

On Thu, 2024-03-07 at 12:17 +0100, Lorenzo Bianconi wrote:
> > From: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
> > 
> > Before sending suspend & wow command to FW, its length should be
> > 4-bytes alignd.
> > 
> > Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
> > ---
> >  drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c | 1 +
> >  drivers/net/wireless/mediatek/mt76/mt7925/mcu.h      | 2 +-
> >  2 files changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
> > b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
> > index af0c2b2aacb0..ef29d093f9c3 100644
> > --- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
> > +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
> > @@ -2527,6 +2527,7 @@ int mt76_connac_mcu_set_hif_suspend(struct
> > mt76_dev *dev, bool suspend)
> >  			__le16 tag;
> >  			__le16 len;
> >  			u8 suspend;
> > +			u8 pad[7];
> 
> mt76_connac_mcu_set_hif_suspend() is used even by other drv (e.g.
> mt7615). Is
> this change backward compatible?
> 
> Regards,
> Lorenzo
> 

Hi Lorenzo,

Yes, it is backward compatible.

Best Regards,
Yen.

> >  		} __packed hif_suspend;
> >  	} req = {
> >  		.hif_suspend = {
> > diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h
> > b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h
> > index 2a0bbfe7bfa5..b8315a89f4a9 100644
> > --- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h
> > +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h
> > @@ -535,7 +535,7 @@ struct mt7925_wow_pattern_tlv {
> >  	u8 offset;
> >  	u8 mask[MT76_CONNAC_WOW_MASK_MAX_LEN];
> >  	u8 pattern[MT76_CONNAC_WOW_PATTEN_MAX_LEN];
> > -	u8 rsv[4];
> > +	u8 rsv[7];
> >  } __packed;
> >  
> >  static inline enum connac3_mcu_cipher_type
> > -- 
> > 2.18.0
> > 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] wifi: mt76: mt7925: ensure 4-byte alignment for suspend & wow command
  2024-03-07 11:08 [PATCH] wifi: mt76: mt7925: ensure 4-byte alignment for suspend & wow command Mingyen Hsieh
  2024-03-07 11:17 ` Lorenzo Bianconi
@ 2024-04-17 22:21 ` Sean Wang
  2024-04-19  7:42   ` Felix Fietkau
  1 sibling, 1 reply; 5+ messages in thread
From: Sean Wang @ 2024-04-17 22:21 UTC (permalink / raw)
  To: Mingyen Hsieh, Felix Fietkau
  Cc: lorenzo, deren.wu, Sean.Wang, Soul.Huang, Leon.Yen, Eric-SY.Chang,
	km.lin, robin.chiu, ch.yeh, posh.sun, Quan.Zhou, Ryder.Lee,
	Shayne.Chen, linux-wireless, linux-mediatek

Hi nbd,

I'm aware that the patch has been merged into the mt76 tree though.
Could you assist in updating the commit message for the patch in the
mt76 tree by including the appropriate "Fixes" tag and CC to the
stable tree? like Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add
Mediatek Wi-Fi7 driver for mt7925 chips")  Otherwise, the mt7925
cannot operate correctly.
      Sean

On Thu, Mar 7, 2024 at 3:08 AM Mingyen Hsieh <mingyen.hsieh@mediatek.com> wrote:
>
> From: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
>
> Before sending suspend & wow command to FW, its length should be
> 4-bytes alignd.
>
> Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
> ---
>  drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c | 1 +
>  drivers/net/wireless/mediatek/mt76/mt7925/mcu.h      | 2 +-
>  2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
> index af0c2b2aacb0..ef29d093f9c3 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
> @@ -2527,6 +2527,7 @@ int mt76_connac_mcu_set_hif_suspend(struct mt76_dev *dev, bool suspend)
>                         __le16 tag;
>                         __le16 len;
>                         u8 suspend;
> +                       u8 pad[7];
>                 } __packed hif_suspend;
>         } req = {
>                 .hif_suspend = {
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h
> index 2a0bbfe7bfa5..b8315a89f4a9 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h
> +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.h
> @@ -535,7 +535,7 @@ struct mt7925_wow_pattern_tlv {
>         u8 offset;
>         u8 mask[MT76_CONNAC_WOW_MASK_MAX_LEN];
>         u8 pattern[MT76_CONNAC_WOW_PATTEN_MAX_LEN];
> -       u8 rsv[4];
> +       u8 rsv[7];
>  } __packed;
>
>  static inline enum connac3_mcu_cipher_type
> --
> 2.18.0
>
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] wifi: mt76: mt7925: ensure 4-byte alignment for suspend & wow command
  2024-04-17 22:21 ` Sean Wang
@ 2024-04-19  7:42   ` Felix Fietkau
  0 siblings, 0 replies; 5+ messages in thread
From: Felix Fietkau @ 2024-04-19  7:42 UTC (permalink / raw)
  To: Sean Wang, Mingyen Hsieh
  Cc: lorenzo, deren.wu, Sean.Wang, Soul.Huang, Leon.Yen, Eric-SY.Chang,
	km.lin, robin.chiu, ch.yeh, posh.sun, Quan.Zhou, Ryder.Lee,
	Shayne.Chen, linux-wireless, linux-mediatek

On 18.04.24 00:21, Sean Wang wrote:
> Hi nbd,
> 
> I'm aware that the patch has been merged into the mt76 tree though.
> Could you assist in updating the commit message for the patch in the
> mt76 tree by including the appropriate "Fixes" tag and CC to the
> stable tree? like Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add
> Mediatek Wi-Fi7 driver for mt7925 chips")  Otherwise, the mt7925
> cannot operate correctly.
>        Sean

Sure, no problem. It's updated in my tree now.

- Felix



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-04-19  7:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-07 11:08 [PATCH] wifi: mt76: mt7925: ensure 4-byte alignment for suspend & wow command Mingyen Hsieh
2024-03-07 11:17 ` Lorenzo Bianconi
2024-03-08  5:06   ` Mingyen Hsieh (謝明諺)
2024-04-17 22:21 ` Sean Wang
2024-04-19  7:42   ` Felix Fietkau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox