netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] can: c_can: disable one shot mode until driver is fixed
@ 2011-03-24 11:00 Marc Kleine-Budde
       [not found] ` <1300964453-2634-1-git-send-email-mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Marc Kleine-Budde @ 2011-03-24 11:00 UTC (permalink / raw)
  To: netdev-u79uwXL29TY76Z2rM5mHXA
  Cc: Socketcan-core-0fE9KPoRgkgATYTw5x5z8w, Marc Kleine-Budde,
	jan-hfZtesqFncYOwBW4kG4KsQ

This patch disables the one shot mode, until the driver has been fixed and
tested to support it.

> I'm quite sure I've seen a situation where msg_obj 17 "seemed" to be
> pending, while msg_obj 18 and 19 already have been transmitted. But
> in that case, I enabled ONESHOT for the can interface, which enables
> the DA mode (automatic retransmission is disabled).

Reported-by: Jan Altenberg <jan-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
Signed-off-by: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Signed-off-by: Kurt Van Dijck <kurt.van.dijck-/BeEPy95v10@public.gmane.org>
Cc: Bhupesh Sharma <bhupesh.sharma-qxv4g6HH51o@public.gmane.org>
---

Changes since v1:
* remove code to enable CAN_CTRLMODE_ONE_SHOT entirely
  (thanks Kurt)

 drivers/net/can/c_can/c_can.c |   14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c
index 110eda0..d0bffb0 100644
--- a/drivers/net/can/c_can/c_can.c
+++ b/drivers/net/can/c_can/c_can.c
@@ -588,14 +588,9 @@ static void c_can_chip_config(struct net_device *dev)
 {
 	struct c_can_priv *priv = netdev_priv(dev);
 
-	if (priv->can.ctrlmode & CAN_CTRLMODE_ONE_SHOT)
-		/* disable automatic retransmission */
-		priv->write_reg(priv, &priv->regs->control,
-				CONTROL_DISABLE_AR);
-	else
-		/* enable automatic retransmission */
-		priv->write_reg(priv, &priv->regs->control,
-				CONTROL_ENABLE_AR);
+	/* enable automatic retransmission */
+	priv->write_reg(priv, &priv->regs->control,
+			CONTROL_ENABLE_AR);
 
 	if (priv->can.ctrlmode & (CAN_CTRLMODE_LISTENONLY &
 					CAN_CTRLMODE_LOOPBACK)) {
@@ -1112,8 +1107,7 @@ struct net_device *alloc_c_can_dev(void)
 	priv->can.bittiming_const = &c_can_bittiming_const;
 	priv->can.do_set_mode = c_can_set_mode;
 	priv->can.do_get_berr_counter = c_can_get_berr_counter;
-	priv->can.ctrlmode_supported = CAN_CTRLMODE_ONE_SHOT |
-					CAN_CTRLMODE_LOOPBACK |
+	priv->can.ctrlmode_supported = CAN_CTRLMODE_LOOPBACK |
 					CAN_CTRLMODE_LISTENONLY |
 					CAN_CTRLMODE_BERR_REPORTING;
 
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] can: c_can: disable one shot mode until driver is fixed
       [not found] ` <1300964453-2634-1-git-send-email-mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
@ 2011-03-24 11:56   ` Wolfgang Grandegger
       [not found]     ` <4D8B3163.8080706-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Grandegger @ 2011-03-24 11:56 UTC (permalink / raw)
  To: Marc Kleine-Budde
  Cc: Socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
	netdev-u79uwXL29TY76Z2rM5mHXA, jan-hfZtesqFncYOwBW4kG4KsQ

On 03/24/2011 12:00 PM, Marc Kleine-Budde wrote:
> This patch disables the one shot mode, until the driver has been fixed and
> tested to support it.
> 
>> I'm quite sure I've seen a situation where msg_obj 17 "seemed" to be
>> pending, while msg_obj 18 and 19 already have been transmitted. But
>> in that case, I enabled ONESHOT for the can interface, which enables
>> the DA mode (automatic retransmission is disabled).
> 
> Reported-by: Jan Altenberg <jan-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
> Signed-off-by: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> Signed-off-by: Kurt Van Dijck <kurt.van.dijck-/BeEPy95v10@public.gmane.org>
> Cc: Bhupesh Sharma <bhupesh.sharma-qxv4g6HH51o@public.gmane.org>
Acked-by: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>

I agree, ONESHOT mode is tricky and needs more thoughts and testing. I
remember some ugly principle problems with the MCP251x.

Wolfgang.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] can: c_can: disable one shot mode until driver is fixed
       [not found]     ` <4D8B3163.8080706-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
@ 2011-03-28  1:19       ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2011-03-28  1:19 UTC (permalink / raw)
  To: wg-5Yr1BZd7O62+XT7JhA+gdA
  Cc: Socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
	netdev-u79uwXL29TY76Z2rM5mHXA, mkl-bIcnvbaLZ9MEGnE8C9+IrQ,
	jan-hfZtesqFncYOwBW4kG4KsQ

From: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
Date: Thu, 24 Mar 2011 12:56:19 +0100

> On 03/24/2011 12:00 PM, Marc Kleine-Budde wrote:
>> This patch disables the one shot mode, until the driver has been fixed and
>> tested to support it.
>> 
>>> I'm quite sure I've seen a situation where msg_obj 17 "seemed" to be
>>> pending, while msg_obj 18 and 19 already have been transmitted. But
>>> in that case, I enabled ONESHOT for the can interface, which enables
>>> the DA mode (automatic retransmission is disabled).
>> 
>> Reported-by: Jan Altenberg <jan-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
>> Signed-off-by: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
>> Signed-off-by: Kurt Van Dijck <kurt.van.dijck-/BeEPy95v10@public.gmane.org>
>> Cc: Bhupesh Sharma <bhupesh.sharma-qxv4g6HH51o@public.gmane.org>
> Acked-by: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>

Applied, thanks everyone.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-03-28  1:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-24 11:00 [PATCH v2] can: c_can: disable one shot mode until driver is fixed Marc Kleine-Budde
     [not found] ` <1300964453-2634-1-git-send-email-mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2011-03-24 11:56   ` Wolfgang Grandegger
     [not found]     ` <4D8B3163.8080706-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2011-03-28  1:19       ` David Miller

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).