From: Marc Kleine-Budde <mkl@pengutronix.de> Date: 2012-06-03 22:21:56
Hello David,
here is a series of patches intended for v3.5, targeting net/master.
The first three patches are by AnilKumar Ch and fix problems in the c_can
driver. While extending the c_can driver for the Bosch's d_can hardware
he found three problems in the existing driver: first a race condition in
the open() function, second a interrupt thrashing issue and third a
off-by-one when looking for transmitted packets.
The fourth patch is by Joe Perches, it fixes a misuse of | for & in the
cc770 driver.
regards, Marc
---
The following changes since commit 9ca3cc6f3026946ba655e863ca2096339e667639:
fec_mpc52xx: fix timestamp filtering (2012-06-02 17:09:08 -0400)
are available in the git repository at:
git@gitorious.org:linux-can/linux-can.git master
AnilKumar Ch (3):
can: c_can: fix "BUG! echo_skb is occupied!" during transmit
can: c_can: fix an interrupt thrash issue with c_can driver
can: c_can: fix race condition in c_can_open()
Joe Perches (1):
can: cc770: Fix likely misuse of | for &
drivers/net/can/c_can/c_can.c | 16 +++++++++-------
drivers/net/can/c_can/c_can.h | 1 +
drivers/net/can/cc770/cc770_platform.c | 2 +-
3 files changed, 11 insertions(+), 8 deletions(-)
From: Marc Kleine-Budde <mkl@pengutronix.de> Date: 2012-06-03 22:21:57
From: AnilKumar Ch <redacted>
This patch fixes an issue with transmit routine, which causes
"can_put_echo_skb: BUG! echo_skb is occupied!" message when
using "cansequence -p" on D_CAN controller.
In c_can driver, while transmitting packets tx_echo flag holds
the no of can frames put for transmission into the hardware.
As the comment above c_can_do_tx() indicates, if we find any packet
which is not transmitted then we should stop looking for more.
In the current implementation this is not taken care of causing the
said message.
Also, fix the condition used to find if the packet is transmitted
or not. Current code skips the first tx message object and ends up
checking one extra invalid object.
While at it, fix the comment on top of c_can_do_tx() to use the
terminology "packet" instead of "package" since it is more
standard.
Cc: stable@kernel.org # 2.6.39+
Signed-off-by: AnilKumar Ch <redacted>
Acked-by: Wolfgang Grandegger <redacted>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
drivers/net/can/c_can/c_can.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
From: Marc Kleine-Budde <mkl@pengutronix.de> Date: 2012-06-03 22:21:58
From: AnilKumar Ch <redacted>
This patch fixes an interrupt thrash issue with c_can driver.
In c_can_isr() function interrupts are disabled and enabled only in
c_can_poll() function. c_can_isr() & c_can_poll() both read the
irqstatus flag. However, irqstatus is always read as 0 in c_can_poll()
because all C_CAN interrupts are disabled in c_can_isr(). This causes
all interrupts to be re-enabled in c_can_poll() which in turn causes
another interrupt since the event is not really handled. This keeps
happening causing a flood of interrupts.
To fix this, read the irqstatus register in isr and use the same cached
value in the poll function.
Cc: stable@kernel.org # 2.6.39+
Signed-off-by: AnilKumar Ch <redacted>
Acked-by: Wolfgang Grandegger <redacted>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
drivers/net/can/c_can/c_can.c | 7 +++----
drivers/net/can/c_can/c_can.h | 1 +
2 files changed, 4 insertions(+), 4 deletions(-)
@@ -952,7 +952,7 @@ static int c_can_poll(struct napi_struct *napi, int quota)structnet_device*dev=napi->dev;structc_can_priv*priv=netdev_priv(dev);-irqstatus=priv->read_reg(priv,&priv->regs->interrupt);+irqstatus=priv->irqstatus;if(!irqstatus)gotoend;
@@ -1030,12 +1030,11 @@ end:staticirqreturn_tc_can_isr(intirq,void*dev_id){-u16irqstatus;structnet_device*dev=(structnet_device*)dev_id;structc_can_priv*priv=netdev_priv(dev);-irqstatus=priv->read_reg(priv,&priv->regs->interrupt);-if(!irqstatus)+priv->irqstatus=priv->read_reg(priv,&priv->regs->interrupt);+if(!priv->irqstatus)returnIRQ_NONE;/* disable all interrupts and schedule the NAPI */
From: Marc Kleine-Budde <mkl@pengutronix.de> Date: 2012-06-03 22:22:18
From: AnilKumar Ch <redacted>
Fix the issue of C_CAN interrupts getting disabled forever when canconfig
utility is used multiple times. According to NAPI usage we disable all
the hardware interrupts in ISR and re-enable them in poll(). Current
implementation calls napi_enable() after hardware interrupts are enabled.
If we get any interrupts between these two steps then we do not process
those interrupts because napi is not enabled. Mostly these interrupts
come because of STATUS is not 0x7 or ERROR interrupts. If napi_enable()
happens before HW interrupts enabled then c_can_poll() function will be
called eventual re-enabling.
This patch moves the napi_enable() call before interrupts enabled.
Cc: stable@kernel.org # 2.6.39+
Signed-off-by: AnilKumar Ch <redacted>
Acked-by: Wolfgang Grandegger <redacted>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
drivers/net/can/c_can/c_can.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
From: Marc Kleine-Budde <mkl@pengutronix.de> Date: 2012-06-03 22:22:22
From: Joe Perches <joe@perches.com>
Using | with a constant is always true.
Likely this should have be &.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
drivers/net/can/cc770/cc770_platform.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
From: David Miller <davem@davemloft.net> Date: 2012-06-04 15:44:43
From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Mon, 4 Jun 2012 00:21:56 +0200
git@gitorious.org:linux-can/linux-can.git master
I can't pull from that tree.
[davem@bql net]$ git pull git@gitorious.org:linux-can/linux-can.git master
The authenticity of host 'gitorious.org (87.238.52.168)' can't be established.
RSA key fingerprint is 7e:af:8d:ec:f0:39:5e:ba:52:16:ce:19:fa:d4:b8:7d.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'gitorious.org,87.238.52.168' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
From: Marc Kleine-Budde <mkl@pengutronix.de> Date: 2012-06-04 15:47:15
On 06/04/2012 05:44 PM, David Miller wrote:
From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Mon, 4 Jun 2012 00:21:56 +0200
quoted
git@gitorious.org:linux-can/linux-can.git master
I can't pull from that tree.
[davem@bql net]$ git pull git@gitorious.org:linux-can/linux-can.git master
The authenticity of host 'gitorious.org (87.238.52.168)' can't be established.
RSA key fingerprint is 7e:af:8d:ec:f0:39:5e:ba:52:16:ce:19:fa:d4:b8:7d.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'gitorious.org,87.238.52.168' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
Doh,
git://gitorious.org/linux-can/linux-can.git master
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 |
From: David Miller <davem@davemloft.net> Date: 2012-06-04 15:51:47
From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Mon, 04 Jun 2012 17:46:55 +0200
On 06/04/2012 05:44 PM, David Miller wrote:
quoted
From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Mon, 4 Jun 2012 00:21:56 +0200
quoted
git@gitorious.org:linux-can/linux-can.git master
I can't pull from that tree.
[davem@bql net]$ git pull git@gitorious.org:linux-can/linux-can.git master
The authenticity of host 'gitorious.org (87.238.52.168)' can't be established.
RSA key fingerprint is 7e:af:8d:ec:f0:39:5e:ba:52:16:ce:19:fa:d4:b8:7d.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'gitorious.org,87.238.52.168' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: The remote end hung up unexpectedly