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: <Z4fFRJfgwSCcmrbd@kekkonen.localdomain>
Date: Wed, 15 Jan 2025 14:25:08 +0000
From: Sakari Ailus <sakari.ailus@...ux.intel.com>
To: Tomi Valkeinen <tomi.valkeinen@...asonboard.com>
Cc: Mauro Carvalho Chehab <mchehab@...nel.org>, linux-media@...r.kernel.org,
	linux-kernel@...r.kernel.org, Devarsh Thakkar <devarsht@...com>,
	Jai Luthra <jai.luthra@...asonboard.com>
Subject: Re: [PATCH 13/19] media: i2c: ds90ub960: Move all RX port init code
 into ub960_init_rx_ports()

Moi,

On Fri, Jan 10, 2025 at 11:14:13AM +0200, Tomi Valkeinen wrote:
> We have some code in probe() which is related to RX port initialization,
> and should be in ub960_init_rx_ports(). Move the code there.
> 
> We also move ub960_reset() so that it is accessible from
> ub960_init_rx_ports().
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@...asonboard.com>
> ---
>  drivers/media/i2c/ds90ub960.c | 115 ++++++++++++++++++++++--------------------
>  1 file changed, 59 insertions(+), 56 deletions(-)
> 
> diff --git a/drivers/media/i2c/ds90ub960.c b/drivers/media/i2c/ds90ub960.c
> index 02e22ae813fa..cc944d737524 100644
> --- a/drivers/media/i2c/ds90ub960.c
> +++ b/drivers/media/i2c/ds90ub960.c
> @@ -1225,6 +1225,33 @@ static int ub960_ind_update_bits(struct ub960_data *priv, u8 block, u8 reg,
>  	return ret;
>  }
>  
> +static int ub960_reset(struct ub960_data *priv, bool reset_regs)
> +{
> +	struct device *dev = &priv->client->dev;
> +	unsigned int v;
> +	int ret;
> +	u8 bit;
> +
> +	bit = reset_regs ? UB960_SR_RESET_DIGITAL_RESET1 :
> +			   UB960_SR_RESET_DIGITAL_RESET0;
> +
> +	ret = ub960_write(priv, UB960_SR_RESET, bit, NULL);
> +	if (ret)
> +		return ret;

Not related to the patch but if you're serialising things below, why aren't
you doing that here?

> +
> +	mutex_lock(&priv->reg_lock);
> +
> +	ret = regmap_read_poll_timeout(priv->regmap, UB960_SR_RESET, v,
> +				       (v & bit) == 0, 2000, 100000);
> +
> +	mutex_unlock(&priv->reg_lock);
> +
> +	if (ret)
> +		dev_err(dev, "reset failed: %d\n", ret);
> +
> +	return ret;
> +}

-- 
Terveisin,

Sakari Ailus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ