* RFC: [PATCH] can: c_can: disable one shot mode until driver is fixed
@ 2011-03-24 10:12 Marc Kleine-Budde
[not found] ` <1300961549-28882-1-git-send-email-mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Marc Kleine-Budde @ 2011-03-24 10:12 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>
Cc: Bhupesh Sharma <bhupesh.sharma-qxv4g6HH51o@public.gmane.org>
---
drivers/net/can/c_can/c_can.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c
index 110eda0..2040959 100644
--- a/drivers/net/can/c_can/c_can.c
+++ b/drivers/net/can/c_can/c_can.c
@@ -1112,8 +1112,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] 4+ messages in thread
* Re: RFC: [PATCH] can: c_can: disable one shot mode until driver is fixed
[not found] ` <1300961549-28882-1-git-send-email-mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
@ 2011-03-24 10:28 ` Kurt Van Dijck
[not found] ` <20110324102852.GA339-MxZ6Iy/zr/UdbCeoMzGj59i2O/JbrIOy@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Kurt Van Dijck @ 2011-03-24 10:28 UTC (permalink / raw)
To: Marc Kleine-Budde
Cc: Socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
netdev-u79uwXL29TY76Z2rM5mHXA
On Thu, Mar 24, 2011 at 11:12:29AM +0100, Marc Kleine-Budde wrote:
> This patch disables the one shot mode, until the driver has been fixed and
> tested to support it.
>
isn't this part necessary now (temporarily) to avoid dead code?
diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c
index 1405078..2c3d090 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)) {
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: RFC: [PATCH] can: c_can: disable one shot mode until driver is fixed
[not found] ` <20110324102852.GA339-MxZ6Iy/zr/UdbCeoMzGj59i2O/JbrIOy@public.gmane.org>
@ 2011-03-24 10:44 ` Marc Kleine-Budde
[not found] ` <4D8B209E.5010907-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Marc Kleine-Budde @ 2011-03-24 10:44 UTC (permalink / raw)
To: netdev-u79uwXL29TY76Z2rM5mHXA,
Socketcan-core-0fE9KPoRgkgATYTw5x5z8w
[-- Attachment #1.1: Type: text/plain, Size: 1823 bytes --]
On 03/24/2011 11:28 AM, Kurt Van Dijck wrote:
> On Thu, Mar 24, 2011 at 11:12:29AM +0100, Marc Kleine-Budde wrote:
>> This patch disables the one shot mode, until the driver has been fixed and
>> tested to support it.
>>
> isn't this part necessary now (temporarily) to avoid dead code?
It's not necessary, the driver should still work. But it's dead code. If
someone fixes the driver she/he can easily revert the patch.
Can I fold your patch and add your S-o-b?
Marc
>
> diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c
> index 1405078..2c3d090 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)) {
>
> _______________________________________________
> Socketcan-core mailing list
> Socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org
> https://lists.berlios.de/mailman/listinfo/socketcan-core
--
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 #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
[-- Attachment #2: Type: text/plain, Size: 188 bytes --]
_______________________________________________
Socketcan-core mailing list
Socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org
https://lists.berlios.de/mailman/listinfo/socketcan-core
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: RFC: [PATCH] can: c_can: disable one shot mode until driver is fixed
[not found] ` <4D8B209E.5010907-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
@ 2011-03-24 10:52 ` Kurt Van Dijck
0 siblings, 0 replies; 4+ messages in thread
From: Kurt Van Dijck @ 2011-03-24 10:52 UTC (permalink / raw)
To: Marc Kleine-Budde
Cc: Socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
netdev-u79uwXL29TY76Z2rM5mHXA
On Thu, Mar 24, 2011 at 11:44:46AM +0100, Marc Kleine-Budde wrote:
> On 03/24/2011 11:28 AM, Kurt Van Dijck wrote:
> > On Thu, Mar 24, 2011 at 11:12:29AM +0100, Marc Kleine-Budde wrote:
> >> This patch disables the one shot mode, until the driver has been fixed and
> >> tested to support it.
> >>
> > isn't this part necessary now (temporarily) to avoid dead code?
>
> It's not necessary, the driver should still work.
Yep, I saw that.
> But it's dead code. If
> someone fixes the driver she/he can easily revert the patch.
>
> Can I fold your patch and add your S-o-b?
Yes.
>
Kurt
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-03-24 10:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-24 10:12 RFC: [PATCH] can: c_can: disable one shot mode until driver is fixed Marc Kleine-Budde
[not found] ` <1300961549-28882-1-git-send-email-mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2011-03-24 10:28 ` Kurt Van Dijck
[not found] ` <20110324102852.GA339-MxZ6Iy/zr/UdbCeoMzGj59i2O/JbrIOy@public.gmane.org>
2011-03-24 10:44 ` Marc Kleine-Budde
[not found] ` <4D8B209E.5010907-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2011-03-24 10:52 ` Kurt Van Dijck
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).