On 20.07.2011 16:32, Marc Kleine-Budde wrote:
> On 07/20/2011 04:27 PM, Mike Brown wrote:
>> On 07/19/2011 04:40 PM, Oliver Hartkopp wrote:
>>> Sorry Marc, i was probably wrong with my assumption below:
>>>
>>> There IS a significant difference in the flexcan_chip_start() function
>>> of the
>>> 'freescale modified' flexcan driver posted by Mike:
>>>
>>> The FLEXCAN_MCR_SRX_DIS bit is set there, which means:
>>>
>>> ---8<---
>>> This bit defines whether FlexCAN is allowed to receive frames
>>> transmitted by
>>> itself. If this bit is set to 1, frames transmitted by the module are not
>>> stored in any message buffer, regardless if the message buffer is
>>> programmed
>>> with an ID that matches the transmitted frame, and no interrupt flag or
>>> interrupt signal is generated due to the frame reception.
>>> 0 Self reception enabled
>>> 1 Self reception disabled
>>> ---8<---
>>>
>>> See the diff here:
>>>
>>> --- flexcan     2011-07-19 23:30:55.411117151 +0200
>>> +++ net-next-2.6/drivers/net/can/flexcan.c      2011-06-21
>>> 15:20:23.220000347 +0200
>>> @@ -540,12 +675,12 @@
>>>           * choose format C
>>>           *
>>>           */
>>> -       reg_mcr = flexcan_cb->read(&regs->mcr);
>>> +       reg_mcr = readl(&regs->mcr);
>>>          reg_mcr |= FLEXCAN_MCR_FRZ | FLEXCAN_MCR_FEN |
>>> FLEXCAN_MCR_HALT |
>>> -               FLEXCAN_MCR_SUPV | FLEXCAN_MCR_WRN_EN |
>>> FLEXCAN_MCR_IDAM_C |
>>> -               FLEXCAN_MCR_SRX_DIS;
>>> +               FLEXCAN_MCR_SUPV | FLEXCAN_MCR_WRN_EN |
>>> +               FLEXCAN_MCR_IDAM_C;
>>>          dev_dbg(dev->dev.parent, "%s: writing mcr=0x%08x", __func__,
>>> reg_mcr);
>>> -       flexcan_cb->write(reg_mcr,&regs->mcr);
>>> +       writel(reg_mcr,&regs->mcr);
>>>
>>>          /*
>>>           * CTRL
>>>
>>>
>>> Mike, please check if removing the FLEXCAN_MCR_SRX_DIS bit in reg_mcr
>>> fixes the
>>> problem, when 'dev->flags |= IFF_ECHO' is enabled again.
>> All of my test cases appear to work with IFF_ECHO set, and
>> FLEXCAN_MCR_SRC_DIS clear.
> 
> \o/
> 

Indeed :-)

Thanks for testing, Mike.

So you have the echo of sent CAN frames on driver level again.
Which is much better than the workaround in the af_can.c without IFF_ECHO.

Marc, would you like to give these guys some feedback about the regression due
to their modification?

> Signed-off-by: Bhaskar Upadhaya <bhaskar.upadhaya at freescale.com>
> Acked-By: Scott Wood <scottwood at freescale.com>

Probably they did not understand, why the 'echo' functionality has been
introduced. Making modifications for a new device binding is fine - but
changing the mainline code, so that people get unusual behaviour is bad.

Regards,
Oliver
_______________________________________________
Socketcan-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-users

Reply via email to