Re: [PATCH] net: ieee802154: adf7242: Fix erroneous RX enable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05.07.2018 11:30, Stefan Schmidt wrote:
Hello.

[Just back from a a few weeks leave and catching up]

On 25.06.2018 15:49, Alexandru Ardelean wrote:
From: Michael Hennerich <michael.hennerich@xxxxxxxxxx>

Only enable RX mode if the netdev is opened.

Signed-off-by: Michael Hennerich <michael.hennerich@xxxxxxxxxx>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@xxxxxxxxxx>
---
  drivers/net/ieee802154/adf7242.c | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ieee802154/adf7242.c b/drivers/net/ieee802154/adf7242.c
index 3e85e9500233..0a240a3f7817 100644
--- a/drivers/net/ieee802154/adf7242.c
+++ b/drivers/net/ieee802154/adf7242.c
@@ -739,7 +739,10 @@ static int adf7242_channel(struct ieee802154_hw *hw, u8 page, u8 channel)
  	adf7242_write_reg(lp, REG_CH_FREQ1, freq >> 8);
  	adf7242_write_reg(lp, REG_CH_FREQ2, freq >> 16);
- return adf7242_cmd(lp, CMD_RC_RX);
+	if (test_bit(FLAG_START, &lp->flags))
+		return adf7242_cmd_rx(lp);
+	else
+		return adf7242_cmd(lp, CMD_RC_PHY_RDY);

What is the difference between the CMD_RC_PHY_RDY and the CMD_RC_RX
command here. From the commit log I would have expected the if check but
not a change in the issued command?


The device must be in PHY_RDY state while changing the channel.
The difference is that in CMD_RC_RX the device is in RX mode,
and it will generate receive interrupts. The issue was that the device erroneously entered this state even when the netdev was stopped. This patch makes sure that the device stays in PHY_RDY state if the device isn't started.



--
Greetings,
Michael

--
Analog Devices GmbH      Otl-Aicher Strasse 60-64      80807 München
Sitz der Gesellschaft München, Registergericht München HRB 40368,
Geschäftsführer: Peter Kolberg, Ali Raza Husain, Eileen Wynne
--
To unsubscribe from this list: send the line "unsubscribe linux-wpan" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux