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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9886bdc0-31be-4153-9b19-6dc53b0b8b5b@lunn.ch>
Date:   Mon, 12 Jun 2023 16:22:14 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     Sarath Babu Naidu Gaddam <sarath.babu.naidu.gaddam@....com>
Cc:     richardcochran@...il.com, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, vincent.cheng.xh@...esas.com,
        harini.katakam@....com, git@....com
Subject: Re: [PATCH] ptp: clockmatrix: Add Defer probe if firmware load fails

On Mon, Jun 12, 2023 at 03:30:44PM +0530, Sarath Babu Naidu Gaddam wrote:
> Clock matrix driver can be probed before the rootfs containing
> firmware/initialization .bin is available. The current driver
> throws a warning and proceeds to execute probe even when firmware
> is not ready. Instead, defer probe and wait for the .bin file to
> be available.
> 
> Signed-off-by: Sarath Babu Naidu Gaddam <sarath.babu.naidu.gaddam@....com>
> ---
>  drivers/ptp/ptp_clockmatrix.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/ptp/ptp_clockmatrix.c b/drivers/ptp/ptp_clockmatrix.c
> index c9d451bf89e2..96328dfb7e55 100644
> --- a/drivers/ptp/ptp_clockmatrix.c
> +++ b/drivers/ptp/ptp_clockmatrix.c
> @@ -2424,9 +2424,13 @@ static int idtcm_probe(struct platform_device *pdev)
>  
>  	err = idtcm_load_firmware(idtcm, &pdev->dev);
>  
> -	if (err)
> +	if (err) {
>  		dev_warn(idtcm->dev, "loading firmware failed with %d", err);
>  
> +		if (err == -ENOENT)
> +			return -EPROBE_DEFER;
> +	}

Maybe move the dev_warn() after the test so you don't spam the logs
with failures which are not yet real failures?

     Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ