From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Stephane Grosjean <s.grosjean@peak-system.com>,
linux-can Mailing List <linux-can@vger.kernel.org>
Subject: Re: [PATCH] can/peak_pci: fix FPGA potential frame loss issue
Date: Wed, 20 Jan 2016 15:11:20 +0100 [thread overview]
Message-ID: <569F9588.2090809@pengutronix.de> (raw)
In-Reply-To: <1453288532-15034-1-git-send-email-s.grosjean@peak-system.com>
[-- Attachment #1: Type: text/plain, Size: 2487 bytes --]
On 01/20/2016 12:15 PM, Stephane Grosjean wrote:
> This patch installs a workaround when the driver detects one of the
> following PEAK-System CAN interfaces, running a firmware < v1.3.0:
Is the problem fixed on FW >= 1.3.0? Is it possible to update the
firmware? If so, what about printing a warning message about known
problem with the firmware?
> PCAN-PCI Express 1/2/4 CAN; DeviceID 0x0003
> PCAN-PCI/104 Express 1/2/4 CAN; DeviceID 0x0007
> PCAN-miniPCIe 1/2 CAN; DeviceID 0x0008
> PCAN-PCI Express OEM 1/2/4 CAN; DeviceID 0x0009
> PCAN-ExpressCard 34 1 CAN; DeviceID 0x000A
>
> This fixes potential loss of one tx frame in Linux SMP when some other
> task does another Command Register write (e.g. Release Receive Buffer)
> in between the triggering Tx Request and the next Sample Point.
>
> This workaround is useless thus *NOT* installed when the firmware
> has been upgraded to v1.3.0 or higher, nor if the CAN interface is equipped
> with true SJA1000 controller(s).
>
> Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com>
> ---
> drivers/net/can/sja1000/peak_pci.c | 34 +++++++++++++++++++++++++++++++++-
> 1 file changed, 33 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/can/sja1000/peak_pci.c b/drivers/net/can/sja1000/peak_pci.c
> index 131026f..84f7d3a 100644
> --- a/drivers/net/can/sja1000/peak_pci.c
> +++ b/drivers/net/can/sja1000/peak_pci.c
> @@ -30,6 +30,15 @@
>
> #include "sja1000.h"
>
> +#define VERSION_REG1 0x40
> +#define VERSION_REG2 0x44
> +
> +#define VERSION_REG2_MASK 0xfff0
Nitpick:
Please add PCAN_ prefixes to the defines.
> +#define PCAN_PCI_FW(x, y, z) ((((u16 )(x) & 0xf) << 12) | \
> + (((u16 )(y) & 0xf) << 8) | \
> + (( (z) & 0xf) << 4))
> +#define PCAN_PCI_FW_VER(v) ((v) & VERSION_REG2_MASK)
> +
> MODULE_AUTHOR("Stephane Grosjean <s.grosjean@peak-system.com>");
> MODULE_DESCRIPTION("Socket-CAN driver for PEAK PCAN PCI family cards");
> MODULE_SUPPORTED_DEVICE("PEAK PCAN PCI/PCIe/PCIeC miniPCI CAN cards");
> @@ -540,6 +549,19 @@ static void peak_pci_write_reg(const struct sja1000_priv *priv,
> writeb(val, priv->reg_base + (port << 2));
> }
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 --]
next prev parent reply other threads:[~2016-01-20 14:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-20 11:15 [PATCH] can/peak_pci: fix FPGA potential frame loss issue Stephane Grosjean
2016-01-20 14:11 ` Marc Kleine-Budde [this message]
2016-01-20 14:29 ` Stephane Grosjean
2016-01-20 14:33 ` Marc Kleine-Budde
2016-01-21 17:51 ` Oliver Hartkopp
2016-01-22 9:10 ` Stephane Grosjean
2016-04-08 5:36 ` Oliver Hartkopp
2016-01-20 14:51 ` Andri Yngvason
2016-02-23 16:53 ` Andri Yngvason
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=569F9588.2090809@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=linux-can@vger.kernel.org \
--cc=s.grosjean@peak-system.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).