From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Appana Durga Kedareswara Rao <appana.durga.rao@xilinx.com>,
"wg@grandegger.com" <wg@grandegger.com>,
Michal Simek <michals@xilinx.com>,
"grant.likely@linaro.org" <grant.likely@linaro.org>,
"robh+dt@kernel.org" <robh+dt@kernel.org>,
"linux-can@vger.kernel.org" <linux-can@vger.kernel.org>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: Re: [PATCH v4] can: xilinx CAN controller support.
Date: Fri, 28 Feb 2014 14:32:22 +0100 [thread overview]
Message-ID: <53108FE6.80405@pengutronix.de> (raw)
In-Reply-To: <f7b303dd-bf23-40f2-bbd4-4594cba8f345@CO9EHSMHS026.ehs.local>
[-- Attachment #1: Type: text/plain, Size: 2801 bytes --]
On 02/28/2014 02:27 PM, Appana Durga Kedareswara Rao wrote:
>> -----Original Message-----
>> From: Marc Kleine-Budde [mailto:mkl@pengutronix.de]
>> Sent: Friday, February 28, 2014 6:45 PM
>> To: Appana Durga Kedareswara Rao; wg@grandegger.com; Michal Simek;
>> grant.likely@linaro.org; robh+dt@kernel.org; linux-can@vger.kernel.org
>> Cc: netdev@vger.kernel.org; linux-arm-kernel@lists.infradead.org; linux-
>> kernel@vger.kernel.org; devicetree@vger.kernel.org
>> Subject: Re: [PATCH v4] can: xilinx CAN controller support.
>>
>> On 02/28/2014 02:07 PM, Appana Durga Kedareswara Rao wrote:
>>>>>> What happens if the interrupt handler is delayed? For example in a
>>>>>> RT enabled system the interrupt handler runs as a thread. There
>>>>>> might be other threads with higher priority. The hardware will
>>>>>> probably send all CAN frames in the FIFO, so you want to reduce the
>>>>>> overhead and loop in the tx complete handler.
>>>>>>
>>>>> Yes I agree with your comment.
>>>>> It will be good to have a loop in the Tx interrupt handler I am
>>>>> modifying the Tx interrupt handler like below.
>>>>>
>>>>> static void xcan_tx_interrupt(struct net_device *ndev, u32 isr) {
>>>>> struct xcan_priv *priv = netdev_priv(ndev);
>>>>> struct net_device_stats *stats = &ndev->stats;
>>>>>
>>>>> while (priv->tx_head - priv->tx_tail > 0) {
>>>>> if (!(isr & XCAN_IXR_TXOK_MASK)) {
>>>>> break;
>>>>> }
>>>>> can_get_echo_skb(ndev, priv->tx_tail %
>>>>> priv->xcan_echo_skb_max_tx);
>>>>> priv->tx_tail++;
>>>>> stats->tx_packets++;
>>>>> can_led_event(ndev, CAN_LED_EVENT_TX);
>>
>> Probably first clear the interrupt, because you've just handled it, then check
>> if it's still present. The question is, do you have to clear the IRQ for each
>> transmitted frame, or does one clean of the interrupt clear the bit for more
>> then one transmitted frame?
>>
>
> We already were clearing it in the interrupt routine
> (xcan_interrupt). That's why clearing it at the end of the loop. We
> have to clear the IRQ (TXOK) for each transmitted frame.
Please move the clear into the loop. Then it's all in one place. Good
that you have to clear the bit for each transmitted frame. I think,
we're almost done :) When I'm okay with the driver, let Wolfgang have a
look at the error handling.
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 |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 242 bytes --]
prev parent reply other threads:[~2014-02-28 13:32 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-24 4:25 [PATCH v4] can: xilinx CAN controller support Kedareswara rao Appana
2014-02-25 21:26 ` Marc Kleine-Budde
2014-02-26 13:07 ` Appana Durga Kedareswara Rao
2014-02-26 13:22 ` Marc Kleine-Budde
[not found] ` <530DEA7C.6010609-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2014-02-26 14:46 ` Appana Durga Kedareswara Rao
2014-02-26 15:43 ` Marc Kleine-Budde
2014-02-28 5:50 ` Appana Durga Kedareswara Rao
2014-02-28 8:32 ` Marc Kleine-Budde
2014-02-28 12:44 ` Appana Durga Kedareswara Rao
2014-02-28 12:56 ` Marc Kleine-Budde
2014-02-28 13:07 ` Appana Durga Kedareswara Rao
2014-02-28 13:15 ` Marc Kleine-Budde
[not found] ` <53108BEF.1020308-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2014-02-28 13:27 ` Appana Durga Kedareswara Rao
2014-02-28 13:32 ` Marc Kleine-Budde [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53108FE6.80405@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=appana.durga.rao@xilinx.com \
--cc=devicetree@vger.kernel.org \
--cc=grant.likely@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-can@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michals@xilinx.com \
--cc=netdev@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=wg@grandegger.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).