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]
Date:	Mon, 9 Jun 2008 21:05:46 +0200
From:	Jean Delvare <khali@...ux-fr.org>
To:	Ben Hutchings <bhutchings@...arflare.com>
Cc:	Jeff Garzik <jgarzik@...ox.com>, netdev@...r.kernel.org,
	linux-net-drivers@...arflare.com
Subject: Re: [PATCH] sfc: I2C adapter initialisation fixes

Hi Ben,

On Mon, 9 Jun 2008 19:25:10 +0100, Ben Hutchings wrote:
> As recommended by Jean Delvare:
> - Increase timeout to 50 ms
> - Leave adapter class clear so that unwanted drivers do not probe our bus
> - Use strlcpy() for name initialisation
> 
> Signed-off-by: Ben Hutchings <bhutchings@...arflare.com>
> ---
>  drivers/net/sfc/falcon.c |   12 +++---------
>  1 files changed, 3 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c
> index 630406e..e086100 100644
> --- a/drivers/net/sfc/falcon.c
> +++ b/drivers/net/sfc/falcon.c
> @@ -223,13 +223,8 @@ static struct i2c_algo_bit_data falcon_i2c_bit_operations = {
>  	.getsda		= falcon_getsda,
>  	.getscl		= falcon_getscl,
>  	.udelay		= 5,
> -	/*
> -	 * This is the number of system clock ticks after which
> -	 * i2c-algo-bit gives up waiting for SCL to become high.
> -	 * It must be at least 2 since the first tick can happen
> -	 * immediately after it starts waiting.
> -	 */
> -	.timeout	= 2,
> +	/* Wait up to 50 ms to begin command */

The timeout value affects every bit sent on the wire, it doesn't have
much to do with "begin command". The first half of the previous comment
was IMHO better.

> +	.timeout	= DIV_ROUND_UP(HZ, 20),
>  };
>  
>  /**************************************************************************
> @@ -2479,12 +2474,11 @@ int falcon_probe_nic(struct efx_nic *efx)
>  
>  	/* Initialise I2C adapter */
>   	efx->i2c_adap.owner = THIS_MODULE;
> - 	efx->i2c_adap.class = I2C_CLASS_HWMON;
>  	nic_data->i2c_data = falcon_i2c_bit_operations;
>  	nic_data->i2c_data.data = efx;
>   	efx->i2c_adap.algo_data = &nic_data->i2c_data;
>  	efx->i2c_adap.dev.parent = &efx->pci_dev->dev;
> -	strcpy(efx->i2c_adap.name, "SFC4000 GPIO");
> +	strlcpy(efx->i2c_adap.name, "SFC4000 GPIO", sizeof(efx->i2c_adap.name));
>  	rc = i2c_bit_add_bus(&efx->i2c_adap);
>  	if (rc)
>  		goto fail5;
> 

But other than that, patch looks good, thanks.

-- 
Jean Delvare
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists