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: <1594880123.69588.jingle.wu@emc.com.tw>
Date:   Thu, 16 Jul 2020 14:15:23 +0800 (CST)
From:   "jingle.wu" <jingle.wu@....com.tw>
To:     "Dmitry Torokhov" <dmitry.torokhov@...il.com>
Cc:     "linux-kernel" <linux-kernel@...r.kernel.org>,
        "linux-input" <linux-input@...r.kernel.org>,
        "phoenix" <phoenix@....com.tw>, "josh.chen" <josh.chen@....com.tw>,
        "kai.heng.feng" <kai.heng.feng@...onical.com>
Subject: Re: [PATCH 2/2] Input: elan_i2c - Modify the IAP related functio
        n for page sizes 128, 512 bytes.

HI Dmitry:

Just to confirm, the older devices (I assume that pattern 0 means older)
 have version command that is numerically higher than the one for the
 newer (pattern >= 1) devices?

>> Yes, Pattern 1, 2 are newer devices.

> @@ -324,7 +342,14 @@ static int elan_i2c_get_sm_version(struct i2c_client *client,
>  			return error;
>  		}
>  		*version = val[0];
> -		*ic_type = val[1];
> +
> +		error = elan_i2c_read_cmd(client, ETP_I2C_IAP_VERSION_CMD, val);
> +		if (error) {
> +			dev_err(&client->dev, "failed to get ic type: %d\n",
> +				error);
> +			return error;
> +		}

Could you please tell me why this chunk is needed?
>> Modify the old pattern IC firmware read the correct ic_type.

In the elan_i2c_core.c, move this code to elan_i2c_i2c.c. 
static int elan_query_device_info(struct elan_tp_data *data)
{
	.....
	if (data->pattern == 0x01)
		ic_type = data->ic_type;
	else
		ic_type = data->iap_version;
	.....
	return 0;
}

THANKS

-----Original message-----
From:Dmitry Torokhov <dmitry.torokhov@...il.com>
To:Jingle Wu <jingle.wu@....com.tw>
Cc:linux-kernel@...r.kernel.org,linux-input@...r.kernel.org,phoenix@....com.tw,josh.chen@....com.tw,kai.heng.feng@...onical.com
Date:Thu, 16 Jul 2020 13:39:12
Subject:Re: [PATCH 2/2] Input: elan_i2c - Modify the IAP related function for page sizes 128, 512 bytes.

Hi Jingle,

On Tue, Jul 14, 2020 at 06:56:41AM -0400, Jingle Wu wrote:
> +	if (!iap)
> +		cmd = ETP_I2C_FW_VERSION_CMD;
> +	else if (pattern_ver == 0)
> +		cmd = ETP_I2C_IAP_VERSION_CMD_OLD;

Just to confirm, the older devices (I assume that pattern 0 means older)
have version command that is numerically higher than the one for the
newer (pattern >= 1) devices?

> +	else
> +		cmd = ETP_I2C_IAP_VERSION_CMD;
>  
> -	error = elan_i2c_read_cmd(client,
> -				  iap ? ETP_I2C_IAP_VERSION_CMD :
> -					ETP_I2C_FW_VERSION_CMD,
> -				  val);
> +	error = elan_i2c_read_cmd(client, cmd, val);
>  	if (error) {
>  		dev_err(&client->dev, "failed to get %s version: %d\n",
>  			iap ? "IAP" : "FW", error);
>  		return error;
>  	}
>  
> -	if (pattern_ver == 0x01)
> +	if (pattern_ver >= 0x01)
>  		*version = iap ? val[1] : val[0];
>  	else
>  		*version = val[0];
> @@ -298,7 +316,7 @@ static int elan_i2c_get_sm_version(struct i2c_client *client,
>  		return error;
>  	}
>  
> -	if (pattern_ver == 0x01) {
> +	if (pattern_ver >= 0x01) {
>  		error = elan_i2c_read_cmd(client, ETP_I2C_IC_TYPE_CMD, val);
>  		if (error) {
>  			dev_err(&client->dev, "failed to get ic type: %d\n",
> @@ -324,7 +342,14 @@ static int elan_i2c_get_sm_version(struct i2c_client *client,
>  			return error;
>  		}
>  		*version = val[0];
> -		*ic_type = val[1];
> +
> +		error = elan_i2c_read_cmd(client, ETP_I2C_IAP_VERSION_CMD, val);
> +		if (error) {
> +			dev_err(&client->dev, "failed to get ic type: %d\n",
> +				error);
> +			return error;
> +		}

Could you please tell me why this chunk is needed?

Thanks.

-- 
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ