mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Arun Muthusamy <arun.muthusamy@gaisler.com>
Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
	 mailhol@kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,  linux-can@vger.kernel.org,
	Daniel Hellstrom <daniel@gaisler.com>
Subject: Re: [PATCH 07/10] can: grcan: set DMA mask for GRCAN and GRCANFD to 32-bit
Date: Fri, 21 Nov 2025 13:46:46 +0100	[thread overview]
Message-ID: <20251121-smart-angelic-dormouse-e4b53f-mkl@pengutronix.de> (raw)
In-Reply-To: <20251118092115.3455-8-arun.muthusamy@gaisler.com>

[-- Attachment #1: Type: text/plain, Size: 1487 bytes --]

On 18.11.2025 10:21:12, Arun Muthusamy wrote:
> From: Daniel Hellstrom <daniel@gaisler.com>
>
> Sets the DMA mask for GRCAN and GRCANFD devices to 32-bit.
> Setting the DMA mask and coherent DMA mask to 32-bit ensures proper
> memory addressing during DMA operations
>
> Signed-off-by: Arun Muthusamy <arun.muthusamy@gaisler.com>
> Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
> ---
>  drivers/net/can/grcan.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/drivers/net/can/grcan.c b/drivers/net/can/grcan.c
> index e367581faa57..51a10fae2faf 100644
> --- a/drivers/net/can/grcan.c
> +++ b/drivers/net/can/grcan.c
> @@ -1074,6 +1074,12 @@ static int grcan_allocate_dma_buffers(struct net_device *dev,
>
>  	/* Extra GRCAN_BUFFER_ALIGNMENT to allow for alignment */
>  	dma->base_size = lsize + ssize + GRCAN_BUFFER_ALIGNMENT;
> +
> +	/* On 64-bit systems.. GRCAN and GRCANFD can only address 32-bit */
> +	if (dma_set_mask_and_coherent(priv->ofdev_dev, DMA_BIT_MASK(32))) {
> +		netdev_warn(dev, "No suitable DMA available\n");
> +		return -ENOMEM;

Please move this to probe(), return the error code, and use
dev_err_probe() for the error message.

regards,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde          |
Embedded Linux                   | https://www.pengutronix.de |
Vertretung Nürnberg              | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-9   |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2025-11-21 12:47 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-18  9:21 [PATCH 00/10] can: grcan: Enhance driver with CANFD Support and Improvements Arun Muthusamy
2025-11-18  9:21 ` [PATCH 01/10] dt-bindings: Add vendor prefix for Frontgrade Gaisler AB Arun Muthusamy
2025-11-18 10:56   ` Krzysztof Kozlowski
2025-11-18  9:21 ` [PATCH 02/10] dt-bindings: net: can: grcan: Convert GRCAN CAN controllers binding from txt to YAML Arun Muthusamy
2025-11-18 11:01   ` Krzysztof Kozlowski
2025-11-24  9:37     ` Arun Muthusamy
2025-11-24 11:28       ` Krzysztof Kozlowski
2025-12-11 10:11     ` Arun Muthusamy
2025-12-18 10:12       ` Krzysztof Kozlowski
     [not found]     ` <0c4a38e1-29e9-4892-ad99-539dd889d4a8@gaisler.com>
2025-12-18 10:10       ` Krzysztof Kozlowski
2025-11-18  9:21 ` [PATCH 03/10] MAINTAINERS: Add entry for GRCAN CAN network driver Arun Muthusamy
2025-11-18  9:21 ` [PATCH 04/10] can: grcan: Add clock handling Arun Muthusamy
2025-11-18 11:01   ` Krzysztof Kozlowski
2025-11-24  9:46     ` Arun Muthusamy
2025-11-24 11:10       ` Krzysztof Kozlowski
2025-11-18  9:21 ` [PATCH 05/10] can: grcan: add FD capability detection and nominal bit-timing Arun Muthusamy
2025-11-21 10:52   ` Marc Kleine-Budde
2025-11-18  9:21 ` [PATCH 06/10] can: grcan: optimize DMA by 32-bit accesses Arun Muthusamy
2025-11-21 11:00   ` Marc Kleine-Budde
2025-11-18  9:21 ` [PATCH 07/10] can: grcan: set DMA mask for GRCAN and GRCANFD to 32-bit Arun Muthusamy
2025-11-21 12:46   ` Marc Kleine-Budde [this message]
2025-11-18  9:21 ` [PATCH 08/10] can: grcan: Add saving and restoring of CAN FD baud-rate registers Arun Muthusamy
2025-11-21 12:50   ` Marc Kleine-Budde
2025-12-11  9:13     ` Arun Muthusamy
2025-12-11 11:37       ` Marc Kleine-Budde
2025-11-18  9:21 ` [PATCH 09/10] can: grcan: Reserve space between cap and next register to align with address layout Arun Muthusamy
2025-11-18  9:21 ` [PATCH 10/10] can: grcan: Add CANFD support alongside legacy CAN Arun Muthusamy
2025-11-21 13:03   ` 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=20251121-smart-angelic-dormouse-e4b53f-mkl@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=arun.muthusamy@gaisler.com \
    --cc=conor+dt@kernel.org \
    --cc=daniel@gaisler.com \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mailhol@kernel.org \
    --cc=robh@kernel.org \
    /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

all inboxes | Powered by JetHome®