linux-wpan.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Alexander Aring <alex.aring@gmail.com>,
	Stefan Schmidt <stefan@datenfreihafen.org>,
	linux-wpan@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org, David Girault <david.girault@qorvo.com>,
	Romuald Despres <romuald.despres@qorvo.com>,
	Frederic Blain <frederic.blain@qorvo.com>,
	Nicolas Schodet <nico@ni.fr.eu.org>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Miquel Raynal <miquel.raynal@bootlin.com>
Subject: [PATCH v5 06/11] net: ieee802154: at86rf230: Rename the asynchronous error helper
Date: Wed,  6 Apr 2022 17:34:36 +0200	[thread overview]
Message-ID: <20220406153441.1667375-7-miquel.raynal@bootlin.com> (raw)
In-Reply-To: <20220406153441.1667375-1-miquel.raynal@bootlin.com>

In theory there are two distinct error path:
- The bus error when forwarding a packet to the transceiver fails.
- The transmitter error, after the transmission has been offloaded.

Right now in this driver only the former situation is properly handled,
so rename the different helpers to reflect this situation before
improving the support of the other path.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/net/ieee802154/at86rf230.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
index 563031ce76f0..cafc786aab57 100644
--- a/drivers/net/ieee802154/at86rf230.c
+++ b/drivers/net/ieee802154/at86rf230.c
@@ -336,7 +336,7 @@ static const struct regmap_config at86rf230_regmap_spi_config = {
 };
 
 static void
-at86rf230_async_error_recover_complete(void *context)
+at86rf230_async_bus_error_recover_complete(void *context)
 {
 	struct at86rf230_state_change *ctx = context;
 	struct at86rf230_local *lp = ctx->lp;
@@ -352,7 +352,7 @@ at86rf230_async_error_recover_complete(void *context)
 }
 
 static void
-at86rf230_async_error_recover(void *context)
+at86rf230_async_bus_error_recover(void *context)
 {
 	struct at86rf230_state_change *ctx = context;
 	struct at86rf230_local *lp = ctx->lp;
@@ -363,17 +363,17 @@ at86rf230_async_error_recover(void *context)
 	}
 
 	at86rf230_async_state_change(lp, ctx, STATE_RX_AACK_ON,
-				     at86rf230_async_error_recover_complete);
+				     at86rf230_async_bus_error_recover_complete);
 }
 
 static inline void
-at86rf230_async_error(struct at86rf230_local *lp,
-		      struct at86rf230_state_change *ctx, int rc)
+at86rf230_async_bus_error(struct at86rf230_local *lp,
+			  struct at86rf230_state_change *ctx, int rc)
 {
 	dev_err(&lp->spi->dev, "spi_async error %d\n", rc);
 
 	at86rf230_async_state_change(lp, ctx, STATE_FORCE_TRX_OFF,
-				     at86rf230_async_error_recover);
+				     at86rf230_async_bus_error_recover);
 }
 
 /* Generic function to get some register value in async mode */
@@ -390,7 +390,7 @@ at86rf230_async_read_reg(struct at86rf230_local *lp, u8 reg,
 	ctx->msg.complete = complete;
 	rc = spi_async(lp->spi, &ctx->msg);
 	if (rc)
-		at86rf230_async_error(lp, ctx, rc);
+		at86rf230_async_bus_error(lp, ctx, rc);
 }
 
 static void
@@ -405,7 +405,7 @@ at86rf230_async_write_reg(struct at86rf230_local *lp, u8 reg, u8 val,
 	ctx->msg.complete = complete;
 	rc = spi_async(lp->spi, &ctx->msg);
 	if (rc)
-		at86rf230_async_error(lp, ctx, rc);
+		at86rf230_async_bus_error(lp, ctx, rc);
 }
 
 static void
@@ -640,7 +640,7 @@ at86rf230_sync_state_change(struct at86rf230_local *lp, unsigned int state)
 	rc = wait_for_completion_timeout(&lp->state_complete,
 					 msecs_to_jiffies(100));
 	if (!rc) {
-		at86rf230_async_error(lp, &lp->state, -ETIMEDOUT);
+		at86rf230_async_bus_error(lp, &lp->state, -ETIMEDOUT);
 		return -ETIMEDOUT;
 	}
 
@@ -762,7 +762,7 @@ at86rf230_rx_trac_check(void *context)
 	rc = spi_async(lp->spi, &ctx->msg);
 	if (rc) {
 		ctx->trx.len = 2;
-		at86rf230_async_error(lp, ctx, rc);
+		at86rf230_async_bus_error(lp, ctx, rc);
 	}
 }
 
@@ -839,7 +839,7 @@ static irqreturn_t at86rf230_isr(int irq, void *data)
 	ctx->msg.complete = at86rf230_irq_status;
 	rc = spi_async(lp->spi, &ctx->msg);
 	if (rc) {
-		at86rf230_async_error(lp, ctx, rc);
+		at86rf230_async_bus_error(lp, ctx, rc);
 		enable_irq(irq);
 		return IRQ_NONE;
 	}
@@ -881,7 +881,7 @@ at86rf230_write_frame(void *context)
 	rc = spi_async(lp->spi, &ctx->msg);
 	if (rc) {
 		ctx->trx.len = 2;
-		at86rf230_async_error(lp, ctx, rc);
+		at86rf230_async_bus_error(lp, ctx, rc);
 	}
 }
 
-- 
2.27.0


  parent reply	other threads:[~2022-04-06 17:29 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-06 15:34 [PATCH v5 00/11] ieee802154: Better Tx error handling Miquel Raynal
2022-04-06 15:34 ` [PATCH v5 01/11] net: ieee802154: Enhance/fix the names of the MLME return codes Miquel Raynal
2022-04-06 15:34 ` [PATCH v5 02/11] net: ieee802154: Fill the list of " Miquel Raynal
2022-04-06 15:34 ` [PATCH v5 03/11] net: mac802154: Save a global error code on transmissions Miquel Raynal
2022-04-06 15:34 ` [PATCH v5 04/11] net: mac802154: Create a transmit error helper Miquel Raynal
2022-04-06 15:34 ` [PATCH v5 05/11] net: mac802154: Create a transmit bus " Miquel Raynal
2022-04-06 21:43   ` Alexander Aring
2022-04-07  7:56     ` Miquel Raynal
2022-04-07 10:02       ` Miquel Raynal
2022-04-06 15:34 ` Miquel Raynal [this message]
2022-04-06 21:57   ` [PATCH v5 06/11] net: ieee802154: at86rf230: Rename the asynchronous " Alexander Aring
2022-04-07  8:05     ` Miquel Raynal
2022-04-25 12:22       ` Alexander Aring
2022-04-06 15:34 ` [PATCH v5 07/11] net: ieee802154: at86rf230: Call _xmit_bus_error() when a bus error occurs Miquel Raynal
2022-04-06 15:34 ` [PATCH v5 08/11] net: ieee802154: at86rf230: Drop debugfs support Miquel Raynal
2022-04-06 15:34 ` [PATCH v5 09/11] net: ieee802154: atusb: Call _xmit_error() when a transmission fails Miquel Raynal
2022-04-06 21:58   ` Alexander Aring
2022-04-07  8:06     ` Miquel Raynal
2022-04-25 12:35       ` Alexander Aring
2022-04-25 13:05         ` Alexander Aring
2022-04-25 13:16           ` Miquel Raynal
2022-04-25 13:43             ` Alexander Aring
2022-04-06 15:34 ` [PATCH v5 10/11] net: ieee802154: ca8210: Use core return codes instead of hardcoding them Miquel Raynal
2022-04-06 15:34 ` [PATCH v5 11/11] net: ieee802154: ca8210: Call _xmit_error() when a transmission fails Miquel Raynal

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=20220406153441.1667375-7-miquel.raynal@bootlin.com \
    --to=miquel.raynal@bootlin.com \
    --cc=alex.aring@gmail.com \
    --cc=davem@davemloft.net \
    --cc=david.girault@qorvo.com \
    --cc=frederic.blain@qorvo.com \
    --cc=kuba@kernel.org \
    --cc=linux-wpan@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nico@ni.fr.eu.org \
    --cc=romuald.despres@qorvo.com \
    --cc=stefan@datenfreihafen.org \
    --cc=thomas.petazzoni@bootlin.com \
    /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 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).