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] [day] [month] [year] [list]
Message-ID: <5qafqlqdcm5jsynyqumzfhzqpkaog55muytcdwqlhebcnt5rgg@oxdv6yfid42a>
Date: Wed, 11 Sep 2024 11:19:47 +0200
From: Andi Shyti <andi.shyti@...nel.org>
To: Aryan Srivastava <aryan.srivastava@...iedtelesis.co.nz>
Cc: Markus Elfring <Markus.Elfring@....de>, linux-i2c@...r.kernel.org, 
	linux-kernel@...r.kernel.org, Robert Richter <rric@...nel.org>
Subject: Re: [PATCH v7 1/2] i2c: octeon: refactor common i2c operations

Hi Aryan,

...

> +/* Construct and send i2c transaction core cmd for read ops */
> +static int octeon_i2c_hlc_read_cmd(struct octeon_i2c *i2c, struct i2c_msg msg, u64 cmd)
> +{
> +	u64 ext = 0;
> +
> +	if (octeon_i2c_hlc_ext(i2c, msg, &cmd, &ext))
> +		octeon_i2c_writeq_flush(ext, i2c->twsi_base + SW_TWSI_EXT(i2c));
> +

What I meant last time is that there is still a change here. I
understand the common parts you addressed in my previous review,
but you're still missing this...

> +	return octeon_i2c_hlc_cmd_send(i2c, cmd);
> +}
> +
>  /* high-level-controller composite write+read, msg0=addr, msg1=data */
>  static int octeon_i2c_hlc_comp_read(struct octeon_i2c *i2c, struct i2c_msg *msgs)
>  {
> @@ -499,26 +543,8 @@ static int octeon_i2c_hlc_comp_read(struct octeon_i2c *i2c, struct i2c_msg *msgs
>  	/* A */
>  	cmd |= (u64)(msgs[0].addr & 0x7full) << SW_TWSI_ADDR_SHIFT;
>  
> -	if (msgs[0].flags & I2C_M_TEN)
> -		cmd |= SW_TWSI_OP_10_IA;
> -	else
> -		cmd |= SW_TWSI_OP_7_IA;
> -
> -	if (msgs[0].len == 2) {
> -		u64 ext = 0;
> -
> -		cmd |= SW_TWSI_EIA;
> -		ext = (u64)msgs[0].buf[0] << SW_TWSI_IA_SHIFT;
> -		cmd |= (u64)msgs[0].buf[1] << SW_TWSI_IA_SHIFT;
> -		octeon_i2c_writeq_flush(ext, i2c->twsi_base + SW_TWSI_EXT(i2c));
> -	} else {
> -		cmd |= (u64)msgs[0].buf[0] << SW_TWSI_IA_SHIFT;
> -	}
> -
> -	octeon_i2c_hlc_int_clear(i2c);
> -	octeon_i2c_writeq_flush(cmd, i2c->twsi_base + SW_TWSI(i2c));

... this! While I don’t know the hardware internals, this is a
logical change that requires justification, especially when
compared to what you’ve described in the commit message.

Andi

> -	ret = octeon_i2c_hlc_wait(i2c);
> +	/* Send core command */
> +	ret = octeon_i2c_hlc_read_cmd(i2c, msgs[0], cmd);
>  	if (ret)
>  		goto err;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ