linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Naga Sureshkumar Relli <nagasure@xilinx.com>
To: Srinivas Neeli <sneeli@xilinx.com>,
	"wg@grandegger.com" <wg@grandegger.com>,
	"mkl@pengutronix.de" <mkl@pengutronix.de>,
	"davem@davemloft.net" <davem@davemloft.net>,
	Michal Simek <michals@xilinx.com>,
	Appana Durga Kedareswara Rao <appanad@xilinx.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Srinivas Neeli <sneeli@xilinx.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-can@vger.kernel.org" <linux-can@vger.kernel.org>,
	git <git@xilinx.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: RE: [PATCH V2] can: xilinx_can: Fix missing Rx can packets on CANFD2.0
Date: Wed, 4 Dec 2019 03:59:38 +0000	[thread overview]
Message-ID: <MN2PR02MB5727E5E2BF394AC2898D5E1FAF5D0@MN2PR02MB5727.namprd02.prod.outlook.com> (raw)
In-Reply-To: <1575375396-3403-1-git-send-email-srinivas.neeli@xilinx.com>

Reviewed-by: Naga Sureshkumar Relli	<naga.sureshkumar.relli@xilinx.com>

> -----Original Message-----
> From: Srinivas Neeli <srinivas.neeli@xilinx.com>
> Sent: Tuesday, December 3, 2019 5:47 PM
> To: wg@grandegger.com; mkl@pengutronix.de; davem@davemloft.net; Michal Simek
> <michals@xilinx.com>; Appana Durga Kedareswara Rao <appanad@xilinx.com>
> Cc: linux-can@vger.kernel.org; netdev@vger.kernel.org; linux-arm-
> kernel@lists.infradead.org; linux-kernel@vger.kernel.org; git <git@xilinx.com>; Naga
> Sureshkumar Relli <nagasure@xilinx.com>; Srinivas Neeli <sneeli@xilinx.com>
> Subject: [PATCH V2] can: xilinx_can: Fix missing Rx can packets on CANFD2.0
> 
> CANFD2.0 core uses BRAM for storing acceptance filter ID(AFID) and MASK
> (AFMASK)registers. So by default AFID and AFMASK registers contain random data. Due to
> random data, we are not able to receive all CAN ids.
> 
> Initializing AFID and AFMASK registers with Zero before enabling acceptance filter to
> receive all packets irrespective of ID and Mask.
> 
> Fixes: 0db9071353a0 ("can: xilinx: add can 2.0 support")
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> Signed-off-by: Srinivas Neeli <srinivas.neeli@xilinx.com>
> ---
>  drivers/net/can/xilinx_can.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/net/can/xilinx_can.c b/drivers/net/can/xilinx_can.c index
> 464af939cd8a..c1dbab8c896d 100644
> --- a/drivers/net/can/xilinx_can.c
> +++ b/drivers/net/can/xilinx_can.c
> @@ -60,6 +60,8 @@ enum xcan_reg {
>  	XCAN_TXMSG_BASE_OFFSET	= 0x0100, /* TX Message Space */
>  	XCAN_RXMSG_BASE_OFFSET	= 0x1100, /* RX Message Space */
>  	XCAN_RXMSG_2_BASE_OFFSET	= 0x2100, /* RX Message Space */
> +	XCAN_AFR_2_MASK_OFFSET	= 0x0A00, /* Acceptance Filter MASK */
> +	XCAN_AFR_2_ID_OFFSET	= 0x0A04, /* Acceptance Filter ID */
>  };
> 
>  #define XCAN_FRAME_ID_OFFSET(frame_base)	((frame_base) + 0x00)
> @@ -1809,6 +1811,11 @@ static int xcan_probe(struct platform_device *pdev)
> 
>  	pm_runtime_put(&pdev->dev);
> 
> +	if (priv->devtype.flags & XCAN_FLAG_CANFD_2) {
> +		priv->write_reg(priv, XCAN_AFR_2_ID_OFFSET, 0x00000000);
> +		priv->write_reg(priv, XCAN_AFR_2_MASK_OFFSET, 0x00000000);
> +	}
> +
>  	netdev_dbg(ndev, "reg_base=0x%p irq=%d clock=%d, tx buffers: actual %d, using
> %d\n",
>  		   priv->reg_base, ndev->irq, priv->can.clock.freq,
>  		   hw_tx_max, priv->tx_max);
> --
> 2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-12-04  3:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-03 12:16 [PATCH V2] can: xilinx_can: Fix missing Rx can packets on CANFD2.0 Srinivas Neeli
2019-12-04  3:59 ` Naga Sureshkumar Relli [this message]
2019-12-04  7:52   ` Marc Kleine-Budde

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=MN2PR02MB5727E5E2BF394AC2898D5E1FAF5D0@MN2PR02MB5727.namprd02.prod.outlook.com \
    --to=nagasure@xilinx.com \
    --cc=appanad@xilinx.com \
    --cc=davem@davemloft.net \
    --cc=git@xilinx.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michals@xilinx.com \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=sneeli@xilinx.com \
    --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).