Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1458642

Re: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller driver

From Wolfgang Grandegger <wg@grandegger.com>
Newsgroups linux.kernel
Subject Re: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller driver
Date 2016-08-09 14:00 +0200
Message-ID <s4dRo-752-13@gated-at.bofh.it> (permalink)
References (2 earlier) <s3Re9-Tb-5@gated-at.bofh.it> <s3RQR-1ls-13@gated-at.bofh.it> <s3TpD-2p3-19@gated-at.bofh.it> <s3TSF-2yD-25@gated-at.bofh.it> <s48yl-3Q0-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Am 09.08.2016 um 08:10 schrieb Andreas Werner:
> On Mon, Aug 08, 2016 at 04:35:34PM +0200, Wolfgang Grandegger wrote:
>> Am 08.08.2016 um 16:05 schrieb Andreas Werner:
>>> On Mon, Aug 08, 2016 at 02:28:39PM +0200, Wolfgang Grandegger wrote:

---snip---

>>>>>>> +
>>>>>>> +	ndev = alloc_candev(sizeof(struct men_z192), 1);
>>>>>>
>>>>>> You specify here one echo_skb but it's not used anywhere. Local loopback
>>>>>> seems not to be implemented.
>>>>>>
>>>>>
>>>>> Agree with you, will set it to "0".
>>>>
>>>> No, the local loopback is mandetory!
>>>>
>>>
>>> Hm ok, but if i check alloc_candev() in drivers/net/can/dev.c
>>> it is not mandatory. In the Documentation/networking/can.txt
>>> there is also a "should" and a fallback mechnism if the driver
>>> does not support the local loopback.
>>
>> Well, s/driver/hardware/ ! Local loopback is the preferred mechanism.
>>
>
> Sure...
>
>>> I'm currently ok with this fallback mechanism.
>>>
>>> Anyway I am not sure that the driver can handle the echo skb correctly.
>>> If i understand it correctly, the can_get_echo_skb() is normally called
>>> on a "TX done IRQ" to get the skb and loop it back.
>>> I do not have such a "TX done IRQ" and have not implemented implemented
>>> and added the local looback.
>>
>> What does "MEN_Z192_TFLG_TXIF" signal?
>>
>
> It is not a "TX Done" IRQ, it is the tx buffer level IRQ.
> The IRQ is triggered when the number of available tx buffer entries is as
> configured with txlvl. (after the buffer was full)
>
> Example:
> txlvl = 0
> tx buffer has 255 entries.
>
> -> The IRQ is triggered as soon as 1 frame got transmitted (254 entries).
>
> ---
>
> txlvl = 254
> tx buffer has 255 entries.
>
> -> The IRQ is triggered as soon as the buffer has one entry and it got transmitted
>
>
>>> May be I can put and get the echo skb within the xmit function?
>>> Does this make sense?
>>
>> It only makes sense if the driver knows when one or more transfers are done.
>>
>
> Then i do not think that I can use the txlvl IRQ in this case and need to use
> the fallback mechanism.


You could store "MEN_Z192_TX_BUF_CNT(readl(&regs->rx_tx_sts))" in the 
start_xmit function and check again in the isr function to find out how 
much transfers have been transmitted in the meantime. Does it make sense?

Wolfgang.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller  driver Andreas Werner <andreas.werner@men.de> - 2016-07-26 11:20 +0200
  Re: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller  driver Benjamin Poirier <benjamin.poirier@gmail.com> - 2016-08-08 06:00 +0200
    Re: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller  driver Andreas Werner <andreas.werner@men.de> - 2016-08-08 09:40 +0200
      Re: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller  driver Benjamin Poirier <benjamin.poirier@gmail.com> - 2016-08-09 05:30 +0200
        Re: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller  driver Andreas Werner <andreas.werner@men.de> - 2016-08-09 08:20 +0200
  Re: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller  driver Wolfgang Grandegger <wg@grandegger.com> - 2016-08-08 11:40 +0200
    Re: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller  driver Andreas Werner <andreas.werner@men.de> - 2016-08-08 13:50 +0200
      Re: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller  driver Wolfgang Grandegger <wg@grandegger.com> - 2016-08-08 14:30 +0200
        Re: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller  driver Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be> - 2016-08-08 15:30 +0200
          Re: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller  driver Andreas Werner <andreas.werner@men.de> - 2016-08-08 16:20 +0200
        Re: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller  driver Andreas Werner <andreas.werner@men.de> - 2016-08-08 16:10 +0200
          Re: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller  driver Wolfgang Grandegger <wg@grandegger.com> - 2016-08-08 16:40 +0200
            Re: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller  driver Andreas Werner <andreas.werner@men.de> - 2016-08-09 08:20 +0200
              Re: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller  driver Wolfgang Grandegger <wg@grandegger.com> - 2016-08-09 14:00 +0200
              Re: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller  driver Oliver Hartkopp <socketcan@hartkopp.net> - 2016-08-10 22:30 +0200
  RE: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller  driver Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com> - 2016-08-09 11:40 +0200

csiph-web