Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752147AbaB1NPk (ORCPT ); Fri, 28 Feb 2014 08:15:40 -0500 Received: from metis.ext.pengutronix.de ([92.198.50.35]:33328 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751514AbaB1NPj (ORCPT ); Fri, 28 Feb 2014 08:15:39 -0500 Message-ID: <53108BEF.1020308@pengutronix.de> Date: Fri, 28 Feb 2014 14:15:27 +0100 From: Marc Kleine-Budde User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.3.0 MIME-Version: 1.0 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. References: <74d607e9-ac9c-4a9b-ac49-e84ae49d20c2@TX2EHSMHS031.ehs.local> <530D0A9C.5090402@pengutronix.de> <530DEA7C.6010609@pengutronix.de> <678ca296-8687-4e7c-9014-ae69d886a068@CO9EHSMHS014.ehs.local> <530E0B92.5010903@pengutronix.de> <2e3bfd38-37d5-4102-af79-821196c6c732@CH1EHSMHS006.ehs.local> <53104995.4010305@pengutronix.de> <48409965-e214-43b7-8b6a-08bf075707e1@CO9EHSMHS001.ehs.local> <53108798.7090902@pengutronix.de> <4902b8d8-139a-4fd0-9e6e-a30ce7e6683b@CH1EHSMHS019.ehs.local> In-Reply-To: <4902b8d8-139a-4fd0-9e6e-a30ce7e6683b@CH1EHSMHS019.ehs.local> X-Enigmail-Version: 1.6 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="BqccfKe4b5F00xdVAJSqp3LTVQq5PE8IE" X-SA-Exim-Connect-IP: 2001:6f8:1178:4:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: mkl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --BqccfKe4b5F00xdVAJSqp3LTVQq5PE8IE Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 02/28/2014 02:07 PM, Appana Durga Kedareswara Rao wrote: >>>> What happens if the interrupt handler is delayed? For example in a R= T >>>> enabled system the interrupt handler runs as a thread. There might b= e >>>> 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 =3D netdev_priv(ndev); >>> struct net_device_stats *stats =3D &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? >>> isr =3D priv->read_reg(priv, XCAN_ISR_OFFSET); > --> clear Tx OK interrupt. >=20 >>> } >>> netif_wake_queue(ndev); >>> } >>> >>> Are you Ok with this? Were getting there :) Marc --=20 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 | --BqccfKe4b5F00xdVAJSqp3LTVQq5PE8IE Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iEYEARECAAYFAlMQi+8ACgkQjTAFq1RaXHPqFwCgidLsjs4bf60MlQaZsLvSmgvE hugAn1Et9bzUjDb07qlE8dv+dsDEfaV7 =OMGk -----END PGP SIGNATURE----- --BqccfKe4b5F00xdVAJSqp3LTVQq5PE8IE-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/