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: <e3a6d4f5-87cc-4d22-bf3a-f1067fe152e9@nvidia.com>
Date: Wed, 7 Jan 2026 09:40:28 +0530
From: Kartik Rajput <kkartik@...dia.com>
To: Jon Hunter <jonathanh@...dia.com>, ldewangan@...dia.com,
 digetx@...il.com, andi.shyti@...nel.org, thierry.reding@...il.com,
 akhilrajeev@...dia.com, smangipudi@...dia.com, linux-i2c@...r.kernel.org,
 linux-tegra@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 2/4] i2c: tegra: Move variant to tegra_i2c_hw_feature

On 06/01/26 17:04, Jon Hunter wrote:
> 
> On 06/01/2026 11:10, Kartik Rajput wrote:
>> Move the variant field into tegra_i2c_hw_feature and populate it for all
>> SoCs. Add dedicated SoC data for "nvidia,tegra20-i2c-dvc" and
>> "nvidia,tegra210-i2c-vi" compatibles. Drop the compatible-string checks
>> from tegra_i2c_parse_dt to initialize the Tegra I2C variant. Also remove
>> the redundant config checks from IS_VI and IS_DVC macros.
>>
>> Signed-off-by: Kartik Rajput <kkartik@...dia.com>
>> ---
>>   drivers/i2c/busses/i2c-tegra.c | 100 ++++++++++++++++++++++++++-------
>>   1 file changed, 81 insertions(+), 19 deletions(-)
>>
>> diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
>> index 9a09079dcc9c..4ab991a22350 100644
>> --- a/drivers/i2c/busses/i2c-tegra.c
>> +++ b/drivers/i2c/busses/i2c-tegra.c
>> @@ -235,6 +235,7 @@ enum tegra_i2c_variant {
>>    *        timing settings.
>>    * @enable_hs_mode_support: Enable support for high speed (HS) mode transfers.
>>    * @has_mutex: Has mutex register for mutual exclusion with other firmwares or VMs.
>> + * @variant: This represents the I2C controller variant.
>>    */
>>   struct tegra_i2c_hw_feature {
>>       bool has_continue_xfer_support;
>> @@ -266,6 +267,7 @@ struct tegra_i2c_hw_feature {
>>       bool has_interface_timing_reg;
>>       bool enable_hs_mode_support;
>>       bool has_mutex;
>> +    enum tegra_i2c_variant variant;
>>   };
>>   /**
>> @@ -281,7 +283,6 @@ struct tegra_i2c_hw_feature {
>>    * @base_phys: physical base address of the I2C controller
>>    * @cont_id: I2C controller ID, used for packet header
>>    * @irq: IRQ number of transfer complete interrupt
>> - * @variant: This represents the I2C controller variant.
>>    * @msg_complete: transfer completion notifier
>>    * @msg_buf_remaining: size of unsent data in the message buffer
>>    * @msg_len: length of message in current transfer
>> @@ -334,13 +335,10 @@ struct tegra_i2c_dev {
>>       bool atomic_mode;
>>       bool dma_mode;
>>       bool msg_read;
>> -    enum tegra_i2c_variant variant;
>>   };
>> -#define IS_DVC(dev) (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC) && \
>> -             (dev)->variant == TEGRA_I2C_VARIANT_DVC)
>> -#define IS_VI(dev)  (IS_ENABLED(CONFIG_ARCH_TEGRA_210_SOC) && \
>> -             (dev)->variant == TEGRA_I2C_VARIANT_VI)
>> +#define IS_DVC(dev) ((dev)->hw->variant == TEGRA_I2C_VARIANT_DVC)
>> +#define IS_VI(dev)  ((dev)->hw->variant == TEGRA_I2C_VARIANT_VI)
> 
> I was thinking about this and actually, I am wondering if we should leave these checks present because if these are not enabled, then the compiler should be enable to drop all the associated code at compile time. So there could be some value to keeping this as is.
> 
> Jon
> 

Ack.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ