netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net v2 0/2] at86rf230: various fixes
@ 2014-04-14 16:48 Alexander Aring
       [not found] ` <1397494082-9394-1-git-send-email-alex.aring-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2014-04-15  4:08 ` [PATCH net v2 0/2] at86rf230: various fixes David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Alexander Aring @ 2014-04-14 16:48 UTC (permalink / raw)
  To: alex.bluesman.smirnov
  Cc: dbaryshkov, linux-zigbee-devel, netdev, phoebe.buckheister,
	werner, Alexander Aring

Hi,

I currently working on a big cleanup for the at86rf230 and I detect some bugs
in the current implementation. I will send patch stacks if net-next is open
again.

It's funny to find the forgotten shift and mask in the __at86rf230_read_subreg
function but it only makes trouble if csma is activated that's why it still works
before for me.

- Alex

changes since v2:
 - correct a few text corrections (Werner helped me there, thanks!)
 - Add Reviewed by Werner Almesberger

Alexander Aring (2):
  at86rf230: remove check if AVDD settled
  at86rf230: fix __at86rf230_read_subreg function

 drivers/net/ieee802154/at86rf230.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

-- 
1.9.2

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

* [PATCH net v2 1/2] at86rf230: remove check if AVDD settled
       [not found] ` <1397494082-9394-1-git-send-email-alex.aring-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2014-04-14 16:48   ` Alexander Aring
  2014-04-14 16:48   ` [PATCH net v2 2/2] at86rf230: fix __at86rf230_read_subreg function Alexander Aring
  1 sibling, 0 replies; 4+ messages in thread
From: Alexander Aring @ 2014-04-14 16:48 UTC (permalink / raw)
  To: alex.bluesman.smirnov-Re5JQEeQqe8AvxtiuMwx3w
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

The AVDD regulator is only enabled when the RF section is active TX_ON
(PLL_ON) state. Since commit 7dcbd22a97eb0689e6c583ad630ae0e7341e34c1
("ieee802154: ensure that first RF212 state comes from TRX_OFF").
We are in TRX_OFF state at the time at86rf230_hw_init is run.

Note that this test would only fail in case of a severe hardware
malfunction (faulty/shorted power supply, etc.) so it wasn't all that
useful in the first place.

Signed-off-by: Alexander Aring <alex.aring-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Reviewed-by: Werner Almesberger <werner-SEdMjqphH88wryQfseakQg@public.gmane.org>
---
 drivers/net/ieee802154/at86rf230.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
index 430bb0d..e102eef 100644
--- a/drivers/net/ieee802154/at86rf230.c
+++ b/drivers/net/ieee802154/at86rf230.c
@@ -1025,14 +1025,6 @@ static int at86rf230_hw_init(struct at86rf230_local *lp)
 		return -EINVAL;
 	}
 
-	rc = at86rf230_read_subreg(lp, SR_AVDD_OK, &status);
-	if (rc)
-		return rc;
-	if (!status) {
-		dev_err(&lp->spi->dev, "AVDD error\n");
-		return -EINVAL;
-	}
-
 	return 0;
 }
 
-- 
1.9.2


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech

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

* [PATCH net v2 2/2] at86rf230: fix __at86rf230_read_subreg function
       [not found] ` <1397494082-9394-1-git-send-email-alex.aring-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2014-04-14 16:48   ` [PATCH net v2 1/2] at86rf230: remove check if AVDD settled Alexander Aring
@ 2014-04-14 16:48   ` Alexander Aring
  1 sibling, 0 replies; 4+ messages in thread
From: Alexander Aring @ 2014-04-14 16:48 UTC (permalink / raw)
  To: alex.bluesman.smirnov-Re5JQEeQqe8AvxtiuMwx3w
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

The __at86rf230_read_subreg function don't mask and shift register
contents which it should do. This patch adds the necessary masks and
shift operations in this function.

Since we have csma support this can make some trouble on state changes.
Since CSMA support turned on some bits in the TRX_STATUS register that
used to be zero, not masking broke checking of the TRX_STATUS field
after commanding a state change.

Signed-off-by: Alexander Aring <alex.aring-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Reviewed-by: Werner Almesberger <werner-SEdMjqphH88wryQfseakQg@public.gmane.org>
---
 drivers/net/ieee802154/at86rf230.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
index e102eef..e36f194 100644
--- a/drivers/net/ieee802154/at86rf230.c
+++ b/drivers/net/ieee802154/at86rf230.c
@@ -365,7 +365,7 @@ __at86rf230_read_subreg(struct at86rf230_local *lp,
 	dev_vdbg(&lp->spi->dev, "buf[1] = %02x\n", buf[1]);
 
 	if (status == 0)
-		*data = buf[1];
+		*data = (buf[1] & mask) >> shift;
 
 	return status;
 }
-- 
1.9.2


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech

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

* Re: [PATCH net v2 0/2] at86rf230: various fixes
  2014-04-14 16:48 [PATCH net v2 0/2] at86rf230: various fixes Alexander Aring
       [not found] ` <1397494082-9394-1-git-send-email-alex.aring-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2014-04-15  4:08 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2014-04-15  4:08 UTC (permalink / raw)
  To: alex.aring
  Cc: alex.bluesman.smirnov, dbaryshkov, linux-zigbee-devel, netdev,
	phoebe.buckheister, werner

From: Alexander Aring <alex.aring@gmail.com>
Date: Mon, 14 Apr 2014 18:48:00 +0200

> I currently working on a big cleanup for the at86rf230 and I detect some bugs
> in the current implementation. I will send patch stacks if net-next is open
> again.
> 
> It's funny to find the forgotten shift and mask in the __at86rf230_read_subreg
> function but it only makes trouble if csma is activated that's why it still works
> before for me.

Series applied.

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

end of thread, other threads:[~2014-04-15  4:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-14 16:48 [PATCH net v2 0/2] at86rf230: various fixes Alexander Aring
     [not found] ` <1397494082-9394-1-git-send-email-alex.aring-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-04-14 16:48   ` [PATCH net v2 1/2] at86rf230: remove check if AVDD settled Alexander Aring
2014-04-14 16:48   ` [PATCH net v2 2/2] at86rf230: fix __at86rf230_read_subreg function Alexander Aring
2014-04-15  4:08 ` [PATCH net v2 0/2] at86rf230: various fixes David Miller

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).