All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert+renesas@glider.be>
To: Wolfgang Grandegger <wg@grandegger.com>,
	Marc Kleine-Budde <mkl@pengutronix.de>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Fabrizio Castro <fabrizio.castro.jz@renesas.com>
Cc: Philipp Zabel <p.zabel@pengutronix.de>,
	Ulrich Hecht <uli+renesas@fpond.eu>,
	linux-can@vger.kernel.org, netdev@vger.kernel.org,
	devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	Geert Uytterhoeven <geert+renesas@glider.be>
Subject: [PATCH 05/12] can: rcar_canfd: Fix R-Car V3U GAFLCFG field accesses
Date: Mon, 23 Jan 2023 19:56:07 +0100	[thread overview]
Message-ID: <36bcf0ffb96d6aaed970751f9546b901af638bcf.1674499048.git.geert+renesas@glider.be> (raw)
In-Reply-To: <cover.1674499048.git.geert+renesas@glider.be>

Each Global Acceptance Filter List Configuration Register (GAFLCFG)
contains two fields, and stores the number of channel rules for one
channel pair.

As R-Car V3U and later can have more than 2 channels, the field
selection should be based on the LSB (even or odd) of the channel
number, instead of on the full channel number.

Fixes: 45721c406dcf50d4 ("can: rcar_canfd: Add support for r8a779a0 SoC")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/net/can/rcar/rcar_canfd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/can/rcar/rcar_canfd.c b/drivers/net/can/rcar/rcar_canfd.c
index 88de17d0bd79d627..77b21c82faf38ee1 100644
--- a/drivers/net/can/rcar/rcar_canfd.c
+++ b/drivers/net/can/rcar/rcar_canfd.c
@@ -92,10 +92,10 @@
 /* RSCFDnCFDGAFLCFG0 / RSCFDnGAFLCFG0 */
 #define RCANFD_GAFLCFG_SETRNC(gpriv, n, x) \
 	(((x) & reg_v3u(gpriv, 0x1ff, 0xff)) << \
-	 (reg_v3u(gpriv, 16, 24) - (n) * reg_v3u(gpriv, 16, 8)))
+	 (reg_v3u(gpriv, 16, 24) - ((n) & 1) * reg_v3u(gpriv, 16, 8)))
 
 #define RCANFD_GAFLCFG_GETRNC(gpriv, n, x) \
-	(((x) >> (reg_v3u(gpriv, 16, 24) - (n) * reg_v3u(gpriv, 16, 8))) & \
+	(((x) >> (reg_v3u(gpriv, 16, 24) - ((n) & 1) * reg_v3u(gpriv, 16, 8))) & \
 	 reg_v3u(gpriv, 0x1ff, 0xff))
 
 /* RSCFDnCFDGAFLECTR / RSCFDnGAFLECTR */
-- 
2.34.1


  parent reply	other threads:[~2023-01-23 18:57 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-23 18:56 [PATCH 00/12] can: rcar_canfd: Add support for R-Car V4H systems Geert Uytterhoeven
2023-01-23 18:56 ` [PATCH 01/12] dt-bindings: can: renesas,rcar-canfd: R-Car V3U is R-Car Gen4 Geert Uytterhoeven
2023-01-31 17:17   ` Rob Herring
2023-01-23 18:56 ` [PATCH 02/12] dt-bindings: can: renesas,rcar-canfd: Document R-Car V4H support Geert Uytterhoeven
2023-01-31 17:18   ` Rob Herring
2023-01-23 18:56 ` [PATCH 03/12] dt-bindings: can: renesas,rcar-canfd: Add transceiver support Geert Uytterhoeven
2023-01-31 17:18   ` Rob Herring
2023-01-23 18:56 ` [PATCH 04/12] can: rcar_canfd: Fix R-Car V3U CAN mode selection Geert Uytterhoeven
2023-01-23 18:56 ` Geert Uytterhoeven [this message]
2023-01-23 18:56 ` [PATCH 06/12] can: rcar_canfd: Abstract out DCFG address differences Geert Uytterhoeven
2023-01-23 18:56 ` [PATCH 07/12] can: rcar_canfd: Add support for R-Car Gen4 Geert Uytterhoeven
2023-01-23 18:56 ` [PATCH 08/12] can: rcar_canfd: Fix R-Car Gen4 DCFG.DSJW field width Geert Uytterhoeven
2023-01-23 18:56 ` [PATCH 09/12] can: rcar_canfd: Fix R-Car Gen4 CFCC.CFTML " Geert Uytterhoeven
2023-01-23 18:56 ` [PATCH 10/12] can: rcar_canfd: Sort included header files Geert Uytterhoeven
2023-01-23 18:56 ` [PATCH 11/12] can: rcar_canfd: Add helper variable dev Geert Uytterhoeven
2023-01-23 18:56 ` [PATCH 12/12] can: rcar_canfd: Add transceiver support Geert Uytterhoeven
2023-01-23 21:25   ` kernel test robot
2023-01-24 18:41   ` Geert Uytterhoeven
2023-02-02 14:40     ` Marc Kleine-Budde
2023-02-02 14:53       ` Geert Uytterhoeven
2023-02-02 15:06         ` Marc Kleine-Budde
2023-02-03 10:24           ` Geert Uytterhoeven
2023-02-07 19:20             ` Marc Kleine-Budde
2023-01-25  6:34   ` kernel test robot
2023-01-23 19:28 ` [PATCH 00/12] can: rcar_canfd: Add support for R-Car V4H systems Wolfram Sang
2023-01-23 19:37   ` Geert Uytterhoeven
2023-01-24 11:02 ` Simon Horman
2023-01-25 19:15 ` [PATCH 01/12] dt-bindings: can: renesas,rcar-canfd: R-Car V3U is R-Car Gen4 Rob Herring
2023-01-25 19:15 ` [PATCH 02/12] dt-bindings: can: renesas,rcar-canfd: Document R-Car V4H support Rob Herring
2023-01-25 19:16 ` [PATCH 03/12] dt-bindings: can: renesas,rcar-canfd: Add transceiver support Rob Herring

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=36bcf0ffb96d6aaed970751f9546b901af638bcf.1674499048.git.geert+renesas@glider.be \
    --to=geert+renesas@glider.be \
    --cc=devicetree@vger.kernel.org \
    --cc=fabrizio.castro.jz@renesas.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=robh+dt@kernel.org \
    --cc=uli+renesas@fpond.eu \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.