All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Aring <aar@pengutronix.de>
To: linux-wpan@vger.kernel.org
Cc: Alexander Aring <aar@pengutronix.de>
Subject: [PATCH bluetooth-next 4/5] at86rf230: fix state change handling on error
Date: Fri, 19 Feb 2016 09:59:13 +0100	[thread overview]
Message-ID: <1455872354-26032-4-git-send-email-aar@pengutronix.de> (raw)
In-Reply-To: <1455872354-26032-1-git-send-email-aar@pengutronix.de>

This patch force always to set "is_tx_from_off", when calibration
timeout was not occurred. In case of error handling the is_tx_from_off
can be inside in an invalid state.

Signed-off-by: Alexander Aring <aar@pengutronix.de>
---
 drivers/net/ieee802154/at86rf230.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
index bf3cfe4..cb9e9fe 100644
--- a/drivers/net/ieee802154/at86rf230.c
+++ b/drivers/net/ieee802154/at86rf230.c
@@ -902,14 +902,12 @@ at86rf230_xmit_start(void *context)
 	struct at86rf230_local *lp = ctx->lp;
 
 	/* check if we change from off state */
-	if (lp->is_tx_from_off) {
-		lp->is_tx_from_off = false;
+	if (lp->is_tx_from_off)
 		at86rf230_async_state_change(lp, ctx, STATE_TX_ARET_ON,
 					     at86rf230_write_frame);
-	} else {
+	else
 		at86rf230_async_state_change(lp, ctx, STATE_TX_ON,
 					     at86rf230_xmit_tx_on);
-	}
 }
 
 static int
@@ -933,6 +931,7 @@ at86rf230_xmit(struct ieee802154_hw *hw, struct sk_buff *skb)
 		at86rf230_async_state_change(lp, ctx, STATE_TRX_OFF,
 					     at86rf230_xmit_start);
 	} else {
+		lp->is_tx_from_off = false;
 		at86rf230_xmit_start(ctx);
 	}
 
-- 
2.7.1


  parent reply	other threads:[~2016-02-19  8:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-19  8:59 [PATCH bluetooth-next 1/5] MAINTAINERS: update 802.15.4 entries Alexander Aring
2016-02-19  8:59 ` [PATCH bluetooth-next 2/5] mac802154: fix mac header length check Alexander Aring
2016-02-19  8:59 ` [PATCH bluetooth-next 3/5] at86rf230: fix race on error handling Alexander Aring
2016-02-19  8:59 ` Alexander Aring [this message]
2016-02-19  8:59 ` [PATCH bluetooth-next 5/5] mrf24j40: add writeable missing reg Alexander Aring
2016-02-21  0:20 ` [PATCH bluetooth-next 1/5] MAINTAINERS: update 802.15.4 entries Marcel Holtmann

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=1455872354-26032-4-git-send-email-aar@pengutronix.de \
    --to=aar@pengutronix.de \
    --cc=linux-wpan@vger.kernel.org \
    /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.