* [PATCH] can: sja1000: Fix error location forwarding
@ 2016-04-01 16:16 Alexander Gerasiov
2016-04-03 9:32 ` Oliver Hartkopp
2016-04-11 9:19 ` Marc Kleine-Budde
0 siblings, 2 replies; 5+ messages in thread
From: Alexander Gerasiov @ 2016-04-01 16:16 UTC (permalink / raw)
To: linux-can
According to SJA1000 documentation the location of error is available
regardless of an error type. Therefore it should always be forwarded to
SocketCAN.
Signed-off-by: Nikita Edward Baruzdin <nebaruzdin@lvk.cs.msu.su>
Signed-off-by: Alexander GQ Gerasiov <gq@cs.msu.su>
---
drivers/net/can/sja1000/sja1000.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/can/sja1000/sja1000.c b/drivers/net/can/sja1000/sja1000.c
index 8dda3b7..9f10779 100644
--- a/drivers/net/can/sja1000/sja1000.c
+++ b/drivers/net/can/sja1000/sja1000.c
@@ -438,6 +438,7 @@ static int sja1000_err(struct net_device *dev, uint8_t isrc, uint8_t status)
cf->can_id |= CAN_ERR_PROT | CAN_ERR_BUSERROR;
+ /* set error type */
switch (ecc & ECC_MASK) {
case ECC_BIT:
cf->data[2] |= CAN_ERR_PROT_BIT;
@@ -449,9 +450,12 @@ static int sja1000_err(struct net_device *dev, uint8_t isrc, uint8_t status)
cf->data[2] |= CAN_ERR_PROT_STUFF;
break;
default:
- cf->data[3] = ecc & ECC_SEG;
break;
}
+
+ /* set error location */
+ cf->data[3] = ecc & ECC_SEG;
+
/* Error occurred during transmission? */
if ((ecc & ECC_DIR) == 0)
cf->data[2] |= CAN_ERR_PROT_TX;
--
2.1.4
--
Best regards,
Alexander Gerasiov
Contacts:
e-mail: gq@cs.msu.su Homepage: http://gerasiov.net Skype: gerasiov
PGP fingerprint: 04B5 9D90 DF7C C2AB CD49 BAEA CA87 E9E8 2AAC 33F1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] can: sja1000: Fix error location forwarding
2016-04-01 16:16 [PATCH] can: sja1000: Fix error location forwarding Alexander Gerasiov
@ 2016-04-03 9:32 ` Oliver Hartkopp
2016-04-11 9:19 ` Marc Kleine-Budde
1 sibling, 0 replies; 5+ messages in thread
From: Oliver Hartkopp @ 2016-04-03 9:32 UTC (permalink / raw)
To: Alexander Gerasiov, linux-can
Hello Alexander,
you are right. Thanks for the fix.
On 04/01/2016 06:16 PM, Alexander Gerasiov wrote:
> According to SJA1000 documentation the location of error is available
> regardless of an error type. Therefore it should always be forwarded to
> SocketCAN.
>
> Signed-off-by: Nikita Edward Baruzdin <nebaruzdin@lvk.cs.msu.su>
> Signed-off-by: Alexander GQ Gerasiov <gq@cs.msu.su>
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Best regards,
Oliver
> ---
> drivers/net/can/sja1000/sja1000.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/can/sja1000/sja1000.c b/drivers/net/can/sja1000/sja1000.c
> index 8dda3b7..9f10779 100644
> --- a/drivers/net/can/sja1000/sja1000.c
> +++ b/drivers/net/can/sja1000/sja1000.c
> @@ -438,6 +438,7 @@ static int sja1000_err(struct net_device *dev, uint8_t isrc, uint8_t status)
>
> cf->can_id |= CAN_ERR_PROT | CAN_ERR_BUSERROR;
>
> + /* set error type */
> switch (ecc & ECC_MASK) {
> case ECC_BIT:
> cf->data[2] |= CAN_ERR_PROT_BIT;
> @@ -449,9 +450,12 @@ static int sja1000_err(struct net_device *dev, uint8_t isrc, uint8_t status)
> cf->data[2] |= CAN_ERR_PROT_STUFF;
> break;
> default:
> - cf->data[3] = ecc & ECC_SEG;
> break;
> }
> +
> + /* set error location */
> + cf->data[3] = ecc & ECC_SEG;
> +
> /* Error occurred during transmission? */
> if ((ecc & ECC_DIR) == 0)
> cf->data[2] |= CAN_ERR_PROT_TX;
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] can: sja1000: Fix error location forwarding
2016-04-01 16:16 [PATCH] can: sja1000: Fix error location forwarding Alexander Gerasiov
2016-04-03 9:32 ` Oliver Hartkopp
@ 2016-04-11 9:19 ` Marc Kleine-Budde
2016-04-11 17:00 ` Oliver Hartkopp
1 sibling, 1 reply; 5+ messages in thread
From: Marc Kleine-Budde @ 2016-04-11 9:19 UTC (permalink / raw)
To: Alexander Gerasiov, linux-can
[-- Attachment #1.1: Type: text/plain, Size: 747 bytes --]
On 04/01/2016 06:16 PM, Alexander Gerasiov wrote:
> According to SJA1000 documentation the location of error is available
> regardless of an error type. Therefore it should always be forwarded to
> SocketCAN.
>
> Signed-off-by: Nikita Edward Baruzdin <nebaruzdin@lvk.cs.msu.su>
> Signed-off-by: Alexander GQ Gerasiov <gq@cs.msu.su>
Applied to can-next/master. Please use git send-email to send your
patches, your mailer converted tabs to spaces.
Tnx,
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] can: sja1000: Fix error location forwarding
2016-04-11 9:19 ` Marc Kleine-Budde
@ 2016-04-11 17:00 ` Oliver Hartkopp
2016-04-12 10:19 ` Marc Kleine-Budde
0 siblings, 1 reply; 5+ messages in thread
From: Oliver Hartkopp @ 2016-04-11 17:00 UTC (permalink / raw)
To: Marc Kleine-Budde, Alexander Gerasiov, linux-can
Hi Marc,
On 04/11/2016 11:19 AM, Marc Kleine-Budde wrote:
> Applied to can-next/master. Please use git send-email to send your
> patches, your mailer converted tabs to spaces.
can you please push the can[-next] changes so that they become visible.
Tnx,
Oliver
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] can: sja1000: Fix error location forwarding
2016-04-11 17:00 ` Oliver Hartkopp
@ 2016-04-12 10:19 ` Marc Kleine-Budde
0 siblings, 0 replies; 5+ messages in thread
From: Marc Kleine-Budde @ 2016-04-12 10:19 UTC (permalink / raw)
To: Oliver Hartkopp, Alexander Gerasiov, linux-can
[-- Attachment #1.1: Type: text/plain, Size: 660 bytes --]
On 04/11/2016 07:00 PM, Oliver Hartkopp wrote:
> Hi Marc,
>
> On 04/11/2016 11:19 AM, Marc Kleine-Budde wrote:
>
>> Applied to can-next/master. Please use git send-email to send your
>> patches, your mailer converted tabs to spaces.
>
> can you please push the can[-next] changes so that they become visible.
Done. All pending changes are on can-next/testing.
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-04-12 10:19 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-01 16:16 [PATCH] can: sja1000: Fix error location forwarding Alexander Gerasiov
2016-04-03 9:32 ` Oliver Hartkopp
2016-04-11 9:19 ` Marc Kleine-Budde
2016-04-11 17:00 ` Oliver Hartkopp
2016-04-12 10:19 ` Marc Kleine-Budde
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.