lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251121-smart-angelic-dormouse-e4b53f-mkl@pengutronix.de>
Date: Fri, 21 Nov 2025 13:46:46 +0100
From: Marc Kleine-Budde <mkl@...gutronix.de>
To: Arun Muthusamy <arun.muthusamy@...sler.com>
Cc: robh@...nel.org, krzk+dt@...nel.org, conor+dt@...nel.org, 
	mailhol@...nel.org, devicetree@...r.kernel.org, linux-kernel@...r.kernel.org, 
	linux-can@...r.kernel.org, Daniel Hellstrom <daniel@...sler.com>
Subject: Re: [PATCH 07/10] can: grcan: set DMA mask for GRCAN and GRCANFD to
 32-bit

On 18.11.2025 10:21:12, Arun Muthusamy wrote:
> From: Daniel Hellstrom <daniel@...sler.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@...sler.com>
> Signed-off-by: Daniel Hellstrom <daniel@...sler.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   |

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ