All of lore.kernel.org
 help / color / mirror / Atom feed
* [wpan v3 0/6] ieee802154: A bunch of fixes
@ 2022-01-25 12:14 Miquel Raynal
  2022-01-25 12:14 ` [wpan v3 1/6] net: ieee802154: hwsim: Ensure proper channel selection at probe time Miquel Raynal
                   ` (6 more replies)
  0 siblings, 7 replies; 14+ messages in thread
From: Miquel Raynal @ 2022-01-25 12:14 UTC (permalink / raw)
  To: Alexander Aring, Stefan Schmidt, linux-wpan
  Cc: David S. Miller, Jakub Kicinski, netdev, David Girault,
	Romuald Despres, Frederic Blain, Nicolas Schodet,
	Thomas Petazzoni, Miquel Raynal

In preparation to a wider series, here are a number of small and random
fixes across the subsystem.

Changes in v2:
* Fixed the wrong RCU usage when updating the default channel at probe
  time in hwsim.
* Actually fixed the skb leak fix in the at86rf230 driver as suggested
  by Alexander.
* Also reordered the calls to free the skb then wake the queue
  everywhere else.
* Added a missing Fixes tag (for the meaningful error codes patch).

Miquel Raynal (6):
  net: ieee802154: hwsim: Ensure proper channel selection at probe time
  net: ieee802154: mcr20a: Fix lifs/sifs periods
  net: ieee802154: at86rf230: Stop leaking skb's
  net: ieee802154: ca8210: Stop leaking skb's
  net: ieee802154: Return meaningful error codes from the netlink
    helpers
  MAINTAINERS: Remove Harry Morris bouncing address

 MAINTAINERS                              |  3 +--
 drivers/net/ieee802154/at86rf230.c       | 13 +++++++++++--
 drivers/net/ieee802154/ca8210.c          |  1 +
 drivers/net/ieee802154/mac802154_hwsim.c |  1 +
 drivers/net/ieee802154/mcr20a.c          |  4 ++--
 net/ieee802154/nl802154.c                |  8 ++++----
 6 files changed, 20 insertions(+), 10 deletions(-)

-- 
2.27.0


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

* [wpan v3 1/6] net: ieee802154: hwsim: Ensure proper channel selection at probe time
  2022-01-25 12:14 [wpan v3 0/6] ieee802154: A bunch of fixes Miquel Raynal
@ 2022-01-25 12:14 ` Miquel Raynal
  2022-01-25 14:28   ` Stefan Schmidt
  2022-01-25 12:14 ` [wpan v3 2/6] net: ieee802154: mcr20a: Fix lifs/sifs periods Miquel Raynal
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 14+ messages in thread
From: Miquel Raynal @ 2022-01-25 12:14 UTC (permalink / raw)
  To: Alexander Aring, Stefan Schmidt, linux-wpan
  Cc: David S. Miller, Jakub Kicinski, netdev, David Girault,
	Romuald Despres, Frederic Blain, Nicolas Schodet,
	Thomas Petazzoni, Miquel Raynal

Drivers are expected to set the PHY current_channel and current_page
according to their default state. The hwsim driver is advertising being
configured on channel 13 by default but that is not reflected in its own
internal pib structure. In order to ensure that this driver consider the
current channel as being 13 internally, we at least need to set the
pib->channel field to 13.

Fixes: f25da51fdc38 ("ieee802154: hwsim: add replacement for fakelb")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/net/ieee802154/mac802154_hwsim.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ieee802154/mac802154_hwsim.c b/drivers/net/ieee802154/mac802154_hwsim.c
index 8caa61ec718f..00ec188a3257 100644
--- a/drivers/net/ieee802154/mac802154_hwsim.c
+++ b/drivers/net/ieee802154/mac802154_hwsim.c
@@ -786,6 +786,7 @@ static int hwsim_add_one(struct genl_info *info, struct device *dev,
 		goto err_pib;
 	}
 
+	pib->page = 13;
 	rcu_assign_pointer(phy->pib, pib);
 	phy->idx = idx;
 	INIT_LIST_HEAD(&phy->edges);
-- 
2.27.0


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

* [wpan v3 2/6] net: ieee802154: mcr20a: Fix lifs/sifs periods
  2022-01-25 12:14 [wpan v3 0/6] ieee802154: A bunch of fixes Miquel Raynal
  2022-01-25 12:14 ` [wpan v3 1/6] net: ieee802154: hwsim: Ensure proper channel selection at probe time Miquel Raynal
@ 2022-01-25 12:14 ` Miquel Raynal
  2022-01-25 12:14 ` [wpan v3 3/6] net: ieee802154: at86rf230: Stop leaking skb's Miquel Raynal
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 14+ messages in thread
From: Miquel Raynal @ 2022-01-25 12:14 UTC (permalink / raw)
  To: Alexander Aring, Stefan Schmidt, linux-wpan
  Cc: David S. Miller, Jakub Kicinski, netdev, David Girault,
	Romuald Despres, Frederic Blain, Nicolas Schodet,
	Thomas Petazzoni, Miquel Raynal

These periods are expressed in time units (microseconds) while 40 and 12
are the number of symbol durations these periods will last. We need to
multiply them both with phy->symbol_duration in order to get these
values in microseconds.

Fixes: 8c6ad9cc5157 ("ieee802154: Add NXP MCR20A IEEE 802.15.4 transceiver driver")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/net/ieee802154/mcr20a.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ieee802154/mcr20a.c b/drivers/net/ieee802154/mcr20a.c
index 8dc04e2590b1..383231b85464 100644
--- a/drivers/net/ieee802154/mcr20a.c
+++ b/drivers/net/ieee802154/mcr20a.c
@@ -976,8 +976,8 @@ static void mcr20a_hw_setup(struct mcr20a_local *lp)
 	dev_dbg(printdev(lp), "%s\n", __func__);
 
 	phy->symbol_duration = 16;
-	phy->lifs_period = 40;
-	phy->sifs_period = 12;
+	phy->lifs_period = 40 * phy->symbol_duration;
+	phy->sifs_period = 12 * phy->symbol_duration;
 
 	hw->flags = IEEE802154_HW_TX_OMIT_CKSUM |
 			IEEE802154_HW_AFILT |
-- 
2.27.0


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

* [wpan v3 3/6] net: ieee802154: at86rf230: Stop leaking skb's
  2022-01-25 12:14 [wpan v3 0/6] ieee802154: A bunch of fixes Miquel Raynal
  2022-01-25 12:14 ` [wpan v3 1/6] net: ieee802154: hwsim: Ensure proper channel selection at probe time Miquel Raynal
  2022-01-25 12:14 ` [wpan v3 2/6] net: ieee802154: mcr20a: Fix lifs/sifs periods Miquel Raynal
@ 2022-01-25 12:14 ` Miquel Raynal
  2022-01-25 12:14 ` [wpan v3 4/6] net: ieee802154: ca8210: " Miquel Raynal
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 14+ messages in thread
From: Miquel Raynal @ 2022-01-25 12:14 UTC (permalink / raw)
  To: Alexander Aring, Stefan Schmidt, linux-wpan
  Cc: David S. Miller, Jakub Kicinski, netdev, David Girault,
	Romuald Despres, Frederic Blain, Nicolas Schodet,
	Thomas Petazzoni, Miquel Raynal

Upon error the ieee802154_xmit_complete() helper is not called. Only
ieee802154_wake_queue() is called manually. In the Tx case we then leak
the skb structure.

Free the skb structure upon error before returning when appropriate.

As the 'is_tx = 0' cannot be moved in the complete handler because of a
possible race between the delay in switching to STATE_RX_AACK_ON and a
new interrupt, we introduce an intermediate 'was_tx' boolean just for
this purpose.

There is no Fixes tag applying here, many changes have been made on this
area and the issue kind of always existed.

Suggested-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/net/ieee802154/at86rf230.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
index 7d67f41387f5..4f5ef8a9a9a8 100644
--- a/drivers/net/ieee802154/at86rf230.c
+++ b/drivers/net/ieee802154/at86rf230.c
@@ -100,6 +100,7 @@ struct at86rf230_local {
 	unsigned long cal_timeout;
 	bool is_tx;
 	bool is_tx_from_off;
+	bool was_tx;
 	u8 tx_retry;
 	struct sk_buff *tx_skb;
 	struct at86rf230_state_change tx;
@@ -343,7 +344,11 @@ at86rf230_async_error_recover_complete(void *context)
 	if (ctx->free)
 		kfree(ctx);
 
-	ieee802154_wake_queue(lp->hw);
+	if (lp->was_tx) {
+		lp->was_tx = 0;
+		dev_kfree_skb_any(lp->tx_skb);
+		ieee802154_wake_queue(lp->hw);
+	}
 }
 
 static void
@@ -352,7 +357,11 @@ at86rf230_async_error_recover(void *context)
 	struct at86rf230_state_change *ctx = context;
 	struct at86rf230_local *lp = ctx->lp;
 
-	lp->is_tx = 0;
+	if (lp->is_tx) {
+		lp->was_tx = 1;
+		lp->is_tx = 0;
+	}
+
 	at86rf230_async_state_change(lp, ctx, STATE_RX_AACK_ON,
 				     at86rf230_async_error_recover_complete);
 }
-- 
2.27.0


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

* [wpan v3 4/6] net: ieee802154: ca8210: Stop leaking skb's
  2022-01-25 12:14 [wpan v3 0/6] ieee802154: A bunch of fixes Miquel Raynal
                   ` (2 preceding siblings ...)
  2022-01-25 12:14 ` [wpan v3 3/6] net: ieee802154: at86rf230: Stop leaking skb's Miquel Raynal
@ 2022-01-25 12:14 ` Miquel Raynal
  2022-01-25 12:14 ` [wpan v3 5/6] net: ieee802154: Return meaningful error codes from the netlink helpers Miquel Raynal
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 14+ messages in thread
From: Miquel Raynal @ 2022-01-25 12:14 UTC (permalink / raw)
  To: Alexander Aring, Stefan Schmidt, linux-wpan
  Cc: David S. Miller, Jakub Kicinski, netdev, David Girault,
	Romuald Despres, Frederic Blain, Nicolas Schodet,
	Thomas Petazzoni, Miquel Raynal

Upon error the ieee802154_xmit_complete() helper is not called. Only
ieee802154_wake_queue() is called manually. We then leak the skb
structure.

Free the skb structure upon error before returning.

Fixes: ded845a781a5 ("ieee802154: Add CA8210 IEEE 802.15.4 device driver")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/net/ieee802154/ca8210.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c
index ece6ff6049f6..f3438d3e104a 100644
--- a/drivers/net/ieee802154/ca8210.c
+++ b/drivers/net/ieee802154/ca8210.c
@@ -1771,6 +1771,7 @@ static int ca8210_async_xmit_complete(
 			status
 		);
 		if (status != MAC_TRANSACTION_OVERFLOW) {
+			dev_kfree_skb_any(priv->tx_skb);
 			ieee802154_wake_queue(priv->hw);
 			return 0;
 		}
-- 
2.27.0


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

* [wpan v3 5/6] net: ieee802154: Return meaningful error codes from the netlink helpers
  2022-01-25 12:14 [wpan v3 0/6] ieee802154: A bunch of fixes Miquel Raynal
                   ` (3 preceding siblings ...)
  2022-01-25 12:14 ` [wpan v3 4/6] net: ieee802154: ca8210: " Miquel Raynal
@ 2022-01-25 12:14 ` Miquel Raynal
  2022-01-25 12:14 ` [wpan v3 6/6] MAINTAINERS: Remove Harry Morris bouncing address Miquel Raynal
  2022-01-27  7:33 ` [wpan v3 0/6] ieee802154: A bunch of fixes Stefan Schmidt
  6 siblings, 0 replies; 14+ messages in thread
From: Miquel Raynal @ 2022-01-25 12:14 UTC (permalink / raw)
  To: Alexander Aring, Stefan Schmidt, linux-wpan
  Cc: David S. Miller, Jakub Kicinski, netdev, David Girault,
	Romuald Despres, Frederic Blain, Nicolas Schodet,
	Thomas Petazzoni, Miquel Raynal

Returning -1 does not indicate anything useful.

Use a standard and meaningful error code instead.

Fixes: a26c5fd7622d ("nl802154: add support for security layer")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 net/ieee802154/nl802154.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c
index 277124f206e0..e0b072aecf0f 100644
--- a/net/ieee802154/nl802154.c
+++ b/net/ieee802154/nl802154.c
@@ -1441,7 +1441,7 @@ static int nl802154_send_key(struct sk_buff *msg, u32 cmd, u32 portid,
 
 	hdr = nl802154hdr_put(msg, portid, seq, flags, cmd);
 	if (!hdr)
-		return -1;
+		return -ENOBUFS;
 
 	if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex))
 		goto nla_put_failure;
@@ -1634,7 +1634,7 @@ static int nl802154_send_device(struct sk_buff *msg, u32 cmd, u32 portid,
 
 	hdr = nl802154hdr_put(msg, portid, seq, flags, cmd);
 	if (!hdr)
-		return -1;
+		return -ENOBUFS;
 
 	if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex))
 		goto nla_put_failure;
@@ -1812,7 +1812,7 @@ static int nl802154_send_devkey(struct sk_buff *msg, u32 cmd, u32 portid,
 
 	hdr = nl802154hdr_put(msg, portid, seq, flags, cmd);
 	if (!hdr)
-		return -1;
+		return -ENOBUFS;
 
 	if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex))
 		goto nla_put_failure;
@@ -1988,7 +1988,7 @@ static int nl802154_send_seclevel(struct sk_buff *msg, u32 cmd, u32 portid,
 
 	hdr = nl802154hdr_put(msg, portid, seq, flags, cmd);
 	if (!hdr)
-		return -1;
+		return -ENOBUFS;
 
 	if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex))
 		goto nla_put_failure;
-- 
2.27.0


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

* [wpan v3 6/6] MAINTAINERS: Remove Harry Morris bouncing address
  2022-01-25 12:14 [wpan v3 0/6] ieee802154: A bunch of fixes Miquel Raynal
                   ` (4 preceding siblings ...)
  2022-01-25 12:14 ` [wpan v3 5/6] net: ieee802154: Return meaningful error codes from the netlink helpers Miquel Raynal
@ 2022-01-25 12:14 ` Miquel Raynal
  2022-01-27  7:33 ` [wpan v3 0/6] ieee802154: A bunch of fixes Stefan Schmidt
  6 siblings, 0 replies; 14+ messages in thread
From: Miquel Raynal @ 2022-01-25 12:14 UTC (permalink / raw)
  To: Alexander Aring, Stefan Schmidt, linux-wpan
  Cc: David S. Miller, Jakub Kicinski, netdev, David Girault,
	Romuald Despres, Frederic Blain, Nicolas Schodet,
	Thomas Petazzoni, Miquel Raynal

Harry's e-mail address from Cascoda bounces, I have not found any
contributions from him since 2018 so let's drop the Maintainer entry
from the CA8210 driver and mark it Orphan.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 MAINTAINERS | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 4d479b554361..ab2b32080b73 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4099,9 +4099,8 @@ N:	csky
 K:	csky
 
 CA8210 IEEE-802.15.4 RADIO DRIVER
-M:	Harry Morris <h.morris@cascoda.com>
 L:	linux-wpan@vger.kernel.org
-S:	Maintained
+S:	Orphan
 W:	https://github.com/Cascoda/ca8210-linux.git
 F:	Documentation/devicetree/bindings/net/ieee802154/ca8210.txt
 F:	drivers/net/ieee802154/ca8210.c
-- 
2.27.0


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

* Re: [wpan v3 1/6] net: ieee802154: hwsim: Ensure proper channel selection at probe time
  2022-01-25 12:14 ` [wpan v3 1/6] net: ieee802154: hwsim: Ensure proper channel selection at probe time Miquel Raynal
@ 2022-01-25 14:28   ` Stefan Schmidt
  2022-01-25 16:48     ` Miquel Raynal
  0 siblings, 1 reply; 14+ messages in thread
From: Stefan Schmidt @ 2022-01-25 14:28 UTC (permalink / raw)
  To: Miquel Raynal, Alexander Aring, linux-wpan
  Cc: David S. Miller, Jakub Kicinski, netdev, David Girault,
	Romuald Despres, Frederic Blain, Nicolas Schodet,
	Thomas Petazzoni


Hello.

On 25.01.22 13:14, Miquel Raynal wrote:
> Drivers are expected to set the PHY current_channel and current_page
> according to their default state. The hwsim driver is advertising being
> configured on channel 13 by default but that is not reflected in its own
> internal pib structure. In order to ensure that this driver consider the
> current channel as being 13 internally, we at least need to set the
> pib->channel field to 13.
> 
> Fixes: f25da51fdc38 ("ieee802154: hwsim: add replacement for fakelb")
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---
>   drivers/net/ieee802154/mac802154_hwsim.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/ieee802154/mac802154_hwsim.c b/drivers/net/ieee802154/mac802154_hwsim.c
> index 8caa61ec718f..00ec188a3257 100644
> --- a/drivers/net/ieee802154/mac802154_hwsim.c
> +++ b/drivers/net/ieee802154/mac802154_hwsim.c
> @@ -786,6 +786,7 @@ static int hwsim_add_one(struct genl_info *info, struct device *dev,
>   		goto err_pib;
>   	}
>   
> +	pib->page = 13;

You want to set channel not page here.

>   	rcu_assign_pointer(phy->pib, pib);
>   	phy->idx = idx;
>   	INIT_LIST_HEAD(&phy->edges);
> 

regards
Stefan Schmidt

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

* Re: [wpan v3 1/6] net: ieee802154: hwsim: Ensure proper channel selection at probe time
  2022-01-25 14:28   ` Stefan Schmidt
@ 2022-01-25 16:48     ` Miquel Raynal
  2022-01-26 13:38       ` Stefan Schmidt
  0 siblings, 1 reply; 14+ messages in thread
From: Miquel Raynal @ 2022-01-25 16:48 UTC (permalink / raw)
  To: Stefan Schmidt
  Cc: Alexander Aring, linux-wpan, David S. Miller, Jakub Kicinski,
	netdev, David Girault, Romuald Despres, Frederic Blain,
	Nicolas Schodet, Thomas Petazzoni

Hi Stefan,

stefan@datenfreihafen.org wrote on Tue, 25 Jan 2022 15:28:11 +0100:

> Hello.
> 
> On 25.01.22 13:14, Miquel Raynal wrote:
> > Drivers are expected to set the PHY current_channel and current_page
> > according to their default state. The hwsim driver is advertising being
> > configured on channel 13 by default but that is not reflected in its own
> > internal pib structure. In order to ensure that this driver consider the
> > current channel as being 13 internally, we at least need to set the
> > pib->channel field to 13.
> > 
> > Fixes: f25da51fdc38 ("ieee802154: hwsim: add replacement for fakelb")
> > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> > ---
> >   drivers/net/ieee802154/mac802154_hwsim.c | 1 +
> >   1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/net/ieee802154/mac802154_hwsim.c b/drivers/net/ieee802154/mac802154_hwsim.c
> > index 8caa61ec718f..00ec188a3257 100644
> > --- a/drivers/net/ieee802154/mac802154_hwsim.c
> > +++ b/drivers/net/ieee802154/mac802154_hwsim.c
> > @@ -786,6 +786,7 @@ static int hwsim_add_one(struct genl_info *info, struct device *dev,
> >   		goto err_pib;
> >   	}  
> >   > +	pib->page = 13;  
> 
> You want to set channel not page here.

Oh crap /o\ I've messed that update badly. Of course I meant
pib->channel here, as it is in the commit log.

I'll wait for Alexander's feedback before re-spinning. Unless the rest
looks good for you both, I don't know if your policy allows you to fix
it when applying, anyhow I'll do what is necessary.

Thanks,
Miquèl

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

* Re: [wpan v3 1/6] net: ieee802154: hwsim: Ensure proper channel selection at probe time
  2022-01-25 16:48     ` Miquel Raynal
@ 2022-01-26 13:38       ` Stefan Schmidt
  2022-01-26 22:54         ` Alexander Aring
  0 siblings, 1 reply; 14+ messages in thread
From: Stefan Schmidt @ 2022-01-26 13:38 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Alexander Aring, linux-wpan, David S. Miller, Jakub Kicinski,
	netdev, David Girault, Romuald Despres, Frederic Blain,
	Nicolas Schodet, Thomas Petazzoni


Hello.

On 25.01.22 17:48, Miquel Raynal wrote:
> Hi Stefan,
> 
> stefan@datenfreihafen.org wrote on Tue, 25 Jan 2022 15:28:11 +0100:
> 
>> Hello.
>>
>> On 25.01.22 13:14, Miquel Raynal wrote:
>>> Drivers are expected to set the PHY current_channel and current_page
>>> according to their default state. The hwsim driver is advertising being
>>> configured on channel 13 by default but that is not reflected in its own
>>> internal pib structure. In order to ensure that this driver consider the
>>> current channel as being 13 internally, we at least need to set the
>>> pib->channel field to 13.
>>>
>>> Fixes: f25da51fdc38 ("ieee802154: hwsim: add replacement for fakelb")
>>> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
>>> ---
>>>    drivers/net/ieee802154/mac802154_hwsim.c | 1 +
>>>    1 file changed, 1 insertion(+)
>>>
>>> diff --git a/drivers/net/ieee802154/mac802154_hwsim.c b/drivers/net/ieee802154/mac802154_hwsim.c
>>> index 8caa61ec718f..00ec188a3257 100644
>>> --- a/drivers/net/ieee802154/mac802154_hwsim.c
>>> +++ b/drivers/net/ieee802154/mac802154_hwsim.c
>>> @@ -786,6 +786,7 @@ static int hwsim_add_one(struct genl_info *info, struct device *dev,
>>>    		goto err_pib;
>>>    	}
>>>    > +	pib->page = 13;
>>
>> You want to set channel not page here.
> 
> Oh crap /o\ I've messed that update badly. Of course I meant
> pib->channel here, as it is in the commit log.
> 
> I'll wait for Alexander's feedback before re-spinning. Unless the rest
> looks good for you both, I don't know if your policy allows you to fix
> it when applying, anyhow I'll do what is necessary.

If Alex has nothing else and there is no re-spin I fix this when 
applying, no worries.

regards
Stefan Schmidt

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

* Re: [wpan v3 1/6] net: ieee802154: hwsim: Ensure proper channel selection at probe time
  2022-01-26 13:38       ` Stefan Schmidt
@ 2022-01-26 22:54         ` Alexander Aring
  2022-01-27  7:33           ` Stefan Schmidt
  0 siblings, 1 reply; 14+ messages in thread
From: Alexander Aring @ 2022-01-26 22:54 UTC (permalink / raw)
  To: Stefan Schmidt
  Cc: Miquel Raynal, linux-wpan - ML, David S. Miller, Jakub Kicinski,
	open list:NETWORKING [GENERAL],
	David Girault, Romuald Despres, Frederic Blain, Nicolas Schodet,
	Thomas Petazzoni

Hi,

On Wed, Jan 26, 2022 at 8:38 AM Stefan Schmidt
<stefan@datenfreihafen.org> wrote:
>
>
> Hello.
>
> On 25.01.22 17:48, Miquel Raynal wrote:
> > Hi Stefan,
> >
> > stefan@datenfreihafen.org wrote on Tue, 25 Jan 2022 15:28:11 +0100:
> >
> >> Hello.
> >>
> >> On 25.01.22 13:14, Miquel Raynal wrote:
> >>> Drivers are expected to set the PHY current_channel and current_page
> >>> according to their default state. The hwsim driver is advertising being
> >>> configured on channel 13 by default but that is not reflected in its own
> >>> internal pib structure. In order to ensure that this driver consider the
> >>> current channel as being 13 internally, we at least need to set the
> >>> pib->channel field to 13.
> >>>
> >>> Fixes: f25da51fdc38 ("ieee802154: hwsim: add replacement for fakelb")
> >>> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> >>> ---
> >>>    drivers/net/ieee802154/mac802154_hwsim.c | 1 +
> >>>    1 file changed, 1 insertion(+)
> >>>
> >>> diff --git a/drivers/net/ieee802154/mac802154_hwsim.c b/drivers/net/ieee802154/mac802154_hwsim.c
> >>> index 8caa61ec718f..00ec188a3257 100644
> >>> --- a/drivers/net/ieee802154/mac802154_hwsim.c
> >>> +++ b/drivers/net/ieee802154/mac802154_hwsim.c
> >>> @@ -786,6 +786,7 @@ static int hwsim_add_one(struct genl_info *info, struct device *dev,
> >>>             goto err_pib;
> >>>     }
> >>>    > +      pib->page = 13;
> >>
> >> You want to set channel not page here.
> >
> > Oh crap /o\ I've messed that update badly. Of course I meant
> > pib->channel here, as it is in the commit log.
> >
> > I'll wait for Alexander's feedback before re-spinning. Unless the rest
> > looks good for you both, I don't know if your policy allows you to fix
> > it when applying, anyhow I'll do what is necessary.
>
> If Alex has nothing else and there is no re-spin I fix this when
> applying, no worries.

Everything is fine.

Acked-by: Alexander Aring <aahringo@redhat.com>

On the whole series. Thanks.

- Alex

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

* Re: [wpan v3 1/6] net: ieee802154: hwsim: Ensure proper channel selection at probe time
  2022-01-26 22:54         ` Alexander Aring
@ 2022-01-27  7:33           ` Stefan Schmidt
  2022-01-27  8:45             ` Miquel Raynal
  0 siblings, 1 reply; 14+ messages in thread
From: Stefan Schmidt @ 2022-01-27  7:33 UTC (permalink / raw)
  To: Alexander Aring
  Cc: Miquel Raynal, linux-wpan - ML, David S. Miller, Jakub Kicinski,
	open list:NETWORKING [GENERAL],
	David Girault, Romuald Despres, Frederic Blain, Nicolas Schodet,
	Thomas Petazzoni

Hello.

On 26.01.22 23:54, Alexander Aring wrote:
> Hi,
> 
> On Wed, Jan 26, 2022 at 8:38 AM Stefan Schmidt
> <stefan@datenfreihafen.org> wrote:
>>
>>
>> Hello.
>>
>> On 25.01.22 17:48, Miquel Raynal wrote:
>>> Hi Stefan,
>>>
>>> stefan@datenfreihafen.org wrote on Tue, 25 Jan 2022 15:28:11 +0100:
>>>
>>>> Hello.
>>>>
>>>> On 25.01.22 13:14, Miquel Raynal wrote:
>>>>> Drivers are expected to set the PHY current_channel and current_page
>>>>> according to their default state. The hwsim driver is advertising being
>>>>> configured on channel 13 by default but that is not reflected in its own
>>>>> internal pib structure. In order to ensure that this driver consider the
>>>>> current channel as being 13 internally, we at least need to set the
>>>>> pib->channel field to 13.
>>>>>
>>>>> Fixes: f25da51fdc38 ("ieee802154: hwsim: add replacement for fakelb")
>>>>> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
>>>>> ---
>>>>>     drivers/net/ieee802154/mac802154_hwsim.c | 1 +
>>>>>     1 file changed, 1 insertion(+)
>>>>>
>>>>> diff --git a/drivers/net/ieee802154/mac802154_hwsim.c b/drivers/net/ieee802154/mac802154_hwsim.c
>>>>> index 8caa61ec718f..00ec188a3257 100644
>>>>> --- a/drivers/net/ieee802154/mac802154_hwsim.c
>>>>> +++ b/drivers/net/ieee802154/mac802154_hwsim.c
>>>>> @@ -786,6 +786,7 @@ static int hwsim_add_one(struct genl_info *info, struct device *dev,
>>>>>              goto err_pib;
>>>>>      }
>>>>>     > +      pib->page = 13;
>>>>
>>>> You want to set channel not page here.
>>>
>>> Oh crap /o\ I've messed that update badly. Of course I meant
>>> pib->channel here, as it is in the commit log.
>>>
>>> I'll wait for Alexander's feedback before re-spinning. Unless the rest
>>> looks good for you both, I don't know if your policy allows you to fix
>>> it when applying, anyhow I'll do what is necessary.
>>
>> If Alex has nothing else and there is no re-spin I fix this when
>> applying, no worries.
> 
> Everything is fine.
> 
> Acked-by: Alexander Aring <aahringo@redhat.com>
> 
> On the whole series. Thanks.

Fixed up this commit and applied the whole patchset.

Next one we should look at would be the 3 split out cleanup patches.

regards
Stefan Schmidt

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

* Re: [wpan v3 0/6] ieee802154: A bunch of fixes
  2022-01-25 12:14 [wpan v3 0/6] ieee802154: A bunch of fixes Miquel Raynal
                   ` (5 preceding siblings ...)
  2022-01-25 12:14 ` [wpan v3 6/6] MAINTAINERS: Remove Harry Morris bouncing address Miquel Raynal
@ 2022-01-27  7:33 ` Stefan Schmidt
  6 siblings, 0 replies; 14+ messages in thread
From: Stefan Schmidt @ 2022-01-27  7:33 UTC (permalink / raw)
  To: Miquel Raynal, Alexander Aring, linux-wpan
  Cc: David S. Miller, Jakub Kicinski, netdev, David Girault,
	Romuald Despres, Frederic Blain, Nicolas Schodet,
	Thomas Petazzoni

Hello.

On 25.01.22 13:14, Miquel Raynal wrote:
> In preparation to a wider series, here are a number of small and random
> fixes across the subsystem.
> 
> Changes in v2:
> * Fixed the wrong RCU usage when updating the default channel at probe
>    time in hwsim.
> * Actually fixed the skb leak fix in the at86rf230 driver as suggested
>    by Alexander.
> * Also reordered the calls to free the skb then wake the queue
>    everywhere else.
> * Added a missing Fixes tag (for the meaningful error codes patch).
> 
> Miquel Raynal (6):
>    net: ieee802154: hwsim: Ensure proper channel selection at probe time
>    net: ieee802154: mcr20a: Fix lifs/sifs periods
>    net: ieee802154: at86rf230: Stop leaking skb's
>    net: ieee802154: ca8210: Stop leaking skb's
>    net: ieee802154: Return meaningful error codes from the netlink
>      helpers
>    MAINTAINERS: Remove Harry Morris bouncing address
> 
>   MAINTAINERS                              |  3 +--
>   drivers/net/ieee802154/at86rf230.c       | 13 +++++++++++--
>   drivers/net/ieee802154/ca8210.c          |  1 +
>   drivers/net/ieee802154/mac802154_hwsim.c |  1 +
>   drivers/net/ieee802154/mcr20a.c          |  4 ++--
>   net/ieee802154/nl802154.c                |  8 ++++----
>   6 files changed, 20 insertions(+), 10 deletions(-)
> 


This series has been applied to the wpan tree and will be
part of the next pull request to net. Thanks!

regards
Stefan Schmidt

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

* Re: [wpan v3 1/6] net: ieee802154: hwsim: Ensure proper channel selection at probe time
  2022-01-27  7:33           ` Stefan Schmidt
@ 2022-01-27  8:45             ` Miquel Raynal
  0 siblings, 0 replies; 14+ messages in thread
From: Miquel Raynal @ 2022-01-27  8:45 UTC (permalink / raw)
  To: Stefan Schmidt
  Cc: Alexander Aring, linux-wpan - ML, David S. Miller,
	Jakub Kicinski, open list:NETWORKING [GENERAL],
	David Girault, Romuald Despres, Frederic Blain, Nicolas Schodet,
	Thomas Petazzoni

Hi Stefan,

stefan@datenfreihafen.org wrote on Thu, 27 Jan 2022 08:33:15 +0100:

> Hello.
> 
> On 26.01.22 23:54, Alexander Aring wrote:
> > Hi,
> > 
> > On Wed, Jan 26, 2022 at 8:38 AM Stefan Schmidt
> > <stefan@datenfreihafen.org> wrote:  
> >>
> >>
> >> Hello.
> >>
> >> On 25.01.22 17:48, Miquel Raynal wrote:  
> >>> Hi Stefan,
> >>>
> >>> stefan@datenfreihafen.org wrote on Tue, 25 Jan 2022 15:28:11 +0100:
> >>>  
> >>>> Hello.
> >>>>
> >>>> On 25.01.22 13:14, Miquel Raynal wrote:  
> >>>>> Drivers are expected to set the PHY current_channel and current_page
> >>>>> according to their default state. The hwsim driver is advertising being
> >>>>> configured on channel 13 by default but that is not reflected in its own
> >>>>> internal pib structure. In order to ensure that this driver consider the
> >>>>> current channel as being 13 internally, we at least need to set the
> >>>>> pib->channel field to 13.
> >>>>>
> >>>>> Fixes: f25da51fdc38 ("ieee802154: hwsim: add replacement for fakelb")
> >>>>> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> >>>>> ---
> >>>>>     drivers/net/ieee802154/mac802154_hwsim.c | 1 +
> >>>>>     1 file changed, 1 insertion(+)
> >>>>>
> >>>>> diff --git a/drivers/net/ieee802154/mac802154_hwsim.c b/drivers/net/ieee802154/mac802154_hwsim.c
> >>>>> index 8caa61ec718f..00ec188a3257 100644
> >>>>> --- a/drivers/net/ieee802154/mac802154_hwsim.c
> >>>>> +++ b/drivers/net/ieee802154/mac802154_hwsim.c
> >>>>> @@ -786,6 +786,7 @@ static int hwsim_add_one(struct genl_info *info, struct device *dev,
> >>>>>              goto err_pib;
> >>>>>      }  
> >>>>>     > +      pib->page = 13;  
> >>>>
> >>>> You want to set channel not page here.  
> >>>
> >>> Oh crap /o\ I've messed that update badly. Of course I meant
> >>> pib->channel here, as it is in the commit log.
> >>>
> >>> I'll wait for Alexander's feedback before re-spinning. Unless the rest
> >>> looks good for you both, I don't know if your policy allows you to fix
> >>> it when applying, anyhow I'll do what is necessary.  
> >>
> >> If Alex has nothing else and there is no re-spin I fix this when
> >> applying, no worries.  
> > 
> > Everything is fine.
> > 
> > Acked-by: Alexander Aring <aahringo@redhat.com>
> > 
> > On the whole series. Thanks.  
> 
> Fixed up this commit and applied the whole patchset.
> 
> Next one we should look at would be the 3 split out cleanup patches.

Great!

Thanks,
Miquèl

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

end of thread, other threads:[~2022-01-27  8:45 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-25 12:14 [wpan v3 0/6] ieee802154: A bunch of fixes Miquel Raynal
2022-01-25 12:14 ` [wpan v3 1/6] net: ieee802154: hwsim: Ensure proper channel selection at probe time Miquel Raynal
2022-01-25 14:28   ` Stefan Schmidt
2022-01-25 16:48     ` Miquel Raynal
2022-01-26 13:38       ` Stefan Schmidt
2022-01-26 22:54         ` Alexander Aring
2022-01-27  7:33           ` Stefan Schmidt
2022-01-27  8:45             ` Miquel Raynal
2022-01-25 12:14 ` [wpan v3 2/6] net: ieee802154: mcr20a: Fix lifs/sifs periods Miquel Raynal
2022-01-25 12:14 ` [wpan v3 3/6] net: ieee802154: at86rf230: Stop leaking skb's Miquel Raynal
2022-01-25 12:14 ` [wpan v3 4/6] net: ieee802154: ca8210: " Miquel Raynal
2022-01-25 12:14 ` [wpan v3 5/6] net: ieee802154: Return meaningful error codes from the netlink helpers Miquel Raynal
2022-01-25 12:14 ` [wpan v3 6/6] MAINTAINERS: Remove Harry Morris bouncing address Miquel Raynal
2022-01-27  7:33 ` [wpan v3 0/6] ieee802154: A bunch of fixes Stefan Schmidt

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.