X86 platform drivers
 help / color / mirror / Atom feed
* Re: linux-next: Tree for May 27 (drivers/platform/x86/amd/amd_isp4.c)
       [not found] <20250527203231.3c6c0b9d@canb.auug.org.au>
@ 2025-05-27 18:56 ` Randy Dunlap
  2025-05-27 19:43   ` Hans de Goede
  0 siblings, 1 reply; 6+ messages in thread
From: Randy Dunlap @ 2025-05-27 18:56 UTC (permalink / raw)
  To: Stephen Rothwell, Linux Next Mailing List, Pratap Nirujogi,
	Benjamin Chan
  Cc: Linux Kernel Mailing List,
	open list:AMD HETERO CORE HARDWARE FEEDBACK DRIVER,
	Ilpo Järvinen



On 5/27/25 3:32 AM, Stephen Rothwell wrote:
> Hi all,
> 
> Changes since 20250526:
> 

on x86_64, when
# CONFIG_MODULES is not set

../drivers/platform/x86/amd/amd_isp4.c: In function 'is_isp_i2c_adapter':
../drivers/platform/x86/amd/amd_isp4.c:154:35: error: invalid use of undefined type 'struct module'
  154 |         return !strcmp(adap->owner->name, "i2c_designware_amdisp");
      |                                   ^~


-- 
~Randy


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: linux-next: Tree for May 27 (drivers/platform/x86/amd/amd_isp4.c)
  2025-05-27 18:56 ` linux-next: Tree for May 27 (drivers/platform/x86/amd/amd_isp4.c) Randy Dunlap
@ 2025-05-27 19:43   ` Hans de Goede
  2025-05-27 20:24     ` Nirujogi, Pratap
  0 siblings, 1 reply; 6+ messages in thread
From: Hans de Goede @ 2025-05-27 19:43 UTC (permalink / raw)
  To: Randy Dunlap, Stephen Rothwell, Linux Next Mailing List,
	Pratap Nirujogi, Benjamin Chan
  Cc: Linux Kernel Mailing List,
	open list:AMD HETERO CORE HARDWARE FEEDBACK DRIVER,
	Ilpo Järvinen

Hi,

On 27-May-25 8:56 PM, Randy Dunlap wrote:
> 
> 
> On 5/27/25 3:32 AM, Stephen Rothwell wrote:
>> Hi all,
>>
>> Changes since 20250526:
>>
> 
> on x86_64, when
> # CONFIG_MODULES is not set
> 
> ../drivers/platform/x86/amd/amd_isp4.c: In function 'is_isp_i2c_adapter':
> ../drivers/platform/x86/amd/amd_isp4.c:154:35: error: invalid use of undefined type 'struct module'
>   154 |         return !strcmp(adap->owner->name, "i2c_designware_amdisp");
>       |                                   ^~

Hmm, this should not check the owner->name at all.

Instead the i2c_designware_amdisp should set adap->name to something
unique and then this should check adap->name.

Regards,

Hans




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: linux-next: Tree for May 27 (drivers/platform/x86/amd/amd_isp4.c)
  2025-05-27 19:43   ` Hans de Goede
@ 2025-05-27 20:24     ` Nirujogi, Pratap
  2025-05-30  7:41       ` Ilpo Järvinen
  0 siblings, 1 reply; 6+ messages in thread
From: Nirujogi, Pratap @ 2025-05-27 20:24 UTC (permalink / raw)
  To: Hans de Goede, Randy Dunlap, Stephen Rothwell,
	Linux Next Mailing List, Pratap Nirujogi, Benjamin Chan
  Cc: Linux Kernel Mailing List,
	open list:AMD HETERO CORE HARDWARE FEEDBACK DRIVER,
	Ilpo Järvinen

Hi Hans, Randy

On 5/27/2025 3:43 PM, Hans de Goede wrote:
> Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
> 
> 
> Hi,
> 
> On 27-May-25 8:56 PM, Randy Dunlap wrote:
>>
>>
>> On 5/27/25 3:32 AM, Stephen Rothwell wrote:
>>> Hi all,
>>>
>>> Changes since 20250526:
>>>
>>
>> on x86_64, when
>> # CONFIG_MODULES is not set
>>
>> ../drivers/platform/x86/amd/amd_isp4.c: In function 'is_isp_i2c_adapter':
>> ../drivers/platform/x86/amd/amd_isp4.c:154:35: error: invalid use of undefined type 'struct module'
>>    154 |         return !strcmp(adap->owner->name, "i2c_designware_amdisp");
>>        |                                   ^~
> 
> Hmm, this should not check the owner->name at all.
> 
> Instead the i2c_designware_amdisp should set adap->name to something
> unique and then this should check adap->name.
> 
I noticed the unique name set to "adap->name" in i2c_designware_amdisp 
is getting overwritten to the generic "Synopsys DesignWare I2C adapter" 
name in i2c_dw_probe_master().

https://github.com/torvalds/linux/blob/master/drivers/i2c/busses/i2c-designware-master.c#L1046

Inorder to use unique name to detect the specific adapter without making 
changes in i2c-designware-master.c, I used adap->owner->name.

Since it is causing build issues when CONFIG_MODULES is not set, can I 
make a change in i2c-designware-master.c to initialize the generic 
"Synopsys DesignWare I2C adapter" name only when adap->name is NULL. 
This way I should be able to pass the unique name from 
i2c_designware_amdisp module.

Please suggest if this approach is okay?

Thanks,
Pratap

> Regards,
> 
> Hans
> 
> 
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: linux-next: Tree for May 27 (drivers/platform/x86/amd/amd_isp4.c)
  2025-05-27 20:24     ` Nirujogi, Pratap
@ 2025-05-30  7:41       ` Ilpo Järvinen
  2025-05-30  7:44         ` Hans de Goede
  0 siblings, 1 reply; 6+ messages in thread
From: Ilpo Järvinen @ 2025-05-30  7:41 UTC (permalink / raw)
  To: Nirujogi, Pratap, Hans de Goede
  Cc: Randy Dunlap, Stephen Rothwell, Linux Next Mailing List,
	Pratap Nirujogi, Benjamin Chan, Linux Kernel Mailing List,
	open list:AMD HETERO CORE HARDWARE FEEDBACK DRIVER

On Tue, 27 May 2025, Nirujogi, Pratap wrote:
> On 5/27/2025 3:43 PM, Hans de Goede wrote:
> > Caution: This message originated from an External Source. Use proper caution
> > when opening attachments, clicking links, or responding.
> > 
> > 
> > Hi,
> > 
> > On 27-May-25 8:56 PM, Randy Dunlap wrote:
> > > 
> > > 
> > > On 5/27/25 3:32 AM, Stephen Rothwell wrote:
> > > > Hi all,
> > > > 
> > > > Changes since 20250526:
> > > > 
> > > 
> > > on x86_64, when
> > > # CONFIG_MODULES is not set
> > > 
> > > ../drivers/platform/x86/amd/amd_isp4.c: In function 'is_isp_i2c_adapter':
> > > ../drivers/platform/x86/amd/amd_isp4.c:154:35: error: invalid use of
> > > undefined type 'struct module'
> > >    154 |         return !strcmp(adap->owner->name,
> > > "i2c_designware_amdisp");
> > >        |                                   ^~
> > 
> > Hmm, this should not check the owner->name at all.
> > 
> > Instead the i2c_designware_amdisp should set adap->name to something
> > unique and then this should check adap->name.
> > 
> I noticed the unique name set to "adap->name" in i2c_designware_amdisp is
> getting overwritten to the generic "Synopsys DesignWare I2C adapter" name in
> i2c_dw_probe_master().
> 
> https://github.com/torvalds/linux/blob/master/drivers/i2c/busses/i2c-designware-master.c#L1046
> 
> Inorder to use unique name to detect the specific adapter without making
> changes in i2c-designware-master.c, I used adap->owner->name.
> 
> Since it is causing build issues when CONFIG_MODULES is not set, can I make a
> change in i2c-designware-master.c to initialize the generic "Synopsys
> DesignWare I2C adapter" name only when adap->name is NULL. This way I should
> be able to pass the unique name from i2c_designware_amdisp module.

How can you check that, it's char name[48]; not a pointer???

> Please suggest if this approach is okay?


-- 
 i.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: linux-next: Tree for May 27 (drivers/platform/x86/amd/amd_isp4.c)
  2025-05-30  7:41       ` Ilpo Järvinen
@ 2025-05-30  7:44         ` Hans de Goede
  2025-05-30 15:21           ` Nirujogi, Pratap
  0 siblings, 1 reply; 6+ messages in thread
From: Hans de Goede @ 2025-05-30  7:44 UTC (permalink / raw)
  To: Ilpo Järvinen, Nirujogi, Pratap
  Cc: Randy Dunlap, Stephen Rothwell, Linux Next Mailing List,
	Pratap Nirujogi, Benjamin Chan, Linux Kernel Mailing List,
	open list:AMD HETERO CORE HARDWARE FEEDBACK DRIVER

Hi,

On 30-May-25 9:41 AM, Ilpo Järvinen wrote:
> On Tue, 27 May 2025, Nirujogi, Pratap wrote:
>> On 5/27/2025 3:43 PM, Hans de Goede wrote:
>>> Caution: This message originated from an External Source. Use proper caution
>>> when opening attachments, clicking links, or responding.
>>>
>>>
>>> Hi,
>>>
>>> On 27-May-25 8:56 PM, Randy Dunlap wrote:
>>>>
>>>>
>>>> On 5/27/25 3:32 AM, Stephen Rothwell wrote:
>>>>> Hi all,
>>>>>
>>>>> Changes since 20250526:
>>>>>
>>>>
>>>> on x86_64, when
>>>> # CONFIG_MODULES is not set
>>>>
>>>> ../drivers/platform/x86/amd/amd_isp4.c: In function 'is_isp_i2c_adapter':
>>>> ../drivers/platform/x86/amd/amd_isp4.c:154:35: error: invalid use of
>>>> undefined type 'struct module'
>>>>    154 |         return !strcmp(adap->owner->name,
>>>> "i2c_designware_amdisp");
>>>>        |                                   ^~
>>>
>>> Hmm, this should not check the owner->name at all.
>>>
>>> Instead the i2c_designware_amdisp should set adap->name to something
>>> unique and then this should check adap->name.
>>>
>> I noticed the unique name set to "adap->name" in i2c_designware_amdisp is
>> getting overwritten to the generic "Synopsys DesignWare I2C adapter" name in
>> i2c_dw_probe_master().
>>
>> https://github.com/torvalds/linux/blob/master/drivers/i2c/busses/i2c-designware-master.c#L1046
>>
>> Inorder to use unique name to detect the specific adapter without making
>> changes in i2c-designware-master.c, I used adap->owner->name.
>>
>> Since it is causing build issues when CONFIG_MODULES is not set, can I make a
>> change in i2c-designware-master.c to initialize the generic "Synopsys
>> DesignWare I2C adapter" name only when adap->name is NULL. This way I should
>> be able to pass the unique name from i2c_designware_amdisp module.
> 
> How can you check that, it's char name[48]; not a pointer???

A NULL check indeed will not work, but we can check that (name[0] != 0).

Regards,

Hans



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: linux-next: Tree for May 27 (drivers/platform/x86/amd/amd_isp4.c)
  2025-05-30  7:44         ` Hans de Goede
@ 2025-05-30 15:21           ` Nirujogi, Pratap
  0 siblings, 0 replies; 6+ messages in thread
From: Nirujogi, Pratap @ 2025-05-30 15:21 UTC (permalink / raw)
  To: Hans de Goede, Ilpo Järvinen
  Cc: Randy Dunlap, Stephen Rothwell, Linux Next Mailing List,
	Pratap Nirujogi, Benjamin Chan, Linux Kernel Mailing List,
	open list:AMD HETERO CORE HARDWARE FEEDBACK DRIVER

Hi Ilpo, Hans,

On 5/30/2025 3:44 AM, Hans de Goede wrote:
> Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
> 
> 
> Hi,
> 
> On 30-May-25 9:41 AM, Ilpo Järvinen wrote:
>> On Tue, 27 May 2025, Nirujogi, Pratap wrote:
>>> On 5/27/2025 3:43 PM, Hans de Goede wrote:
>>>> Caution: This message originated from an External Source. Use proper caution
>>>> when opening attachments, clicking links, or responding.
>>>>
>>>>
>>>> Hi,
>>>>
>>>> On 27-May-25 8:56 PM, Randy Dunlap wrote:
>>>>>
>>>>>
>>>>> On 5/27/25 3:32 AM, Stephen Rothwell wrote:
>>>>>> Hi all,
>>>>>>
>>>>>> Changes since 20250526:
>>>>>>
>>>>>
>>>>> on x86_64, when
>>>>> # CONFIG_MODULES is not set
>>>>>
>>>>> ../drivers/platform/x86/amd/amd_isp4.c: In function 'is_isp_i2c_adapter':
>>>>> ../drivers/platform/x86/amd/amd_isp4.c:154:35: error: invalid use of
>>>>> undefined type 'struct module'
>>>>>     154 |         return !strcmp(adap->owner->name,
>>>>> "i2c_designware_amdisp");
>>>>>         |                                   ^~
>>>>
>>>> Hmm, this should not check the owner->name at all.
>>>>
>>>> Instead the i2c_designware_amdisp should set adap->name to something
>>>> unique and then this should check adap->name.
>>>>
>>> I noticed the unique name set to "adap->name" in i2c_designware_amdisp is
>>> getting overwritten to the generic "Synopsys DesignWare I2C adapter" name in
>>> i2c_dw_probe_master().
>>>
>>> https://github.com/torvalds/linux/blob/master/drivers/i2c/busses/i2c-designware-master.c#L1046
>>>
>>> Inorder to use unique name to detect the specific adapter without making
>>> changes in i2c-designware-master.c, I used adap->owner->name.
>>>
>>> Since it is causing build issues when CONFIG_MODULES is not set, can I make a
>>> change in i2c-designware-master.c to initialize the generic "Synopsys
>>> DesignWare I2C adapter" name only when adap->name is NULL. This way I should
>>> be able to pass the unique name from i2c_designware_amdisp module.
>>
>> How can you check that, it's char name[48]; not a pointer???
> 
> A NULL check indeed will not work, but we can check that (name[0] != 0).
> 
Thanks for the feedback and suggestions on the changes. Yes, my intent 
is to check if the name[] is uninitialized before initializing with the 
generic name. I will make the changes and submit both i2c and platform 
driver patches shortly.

Thanks,
Pratap

> Regards,
> 
> Hans
> 
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-05-30 15:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20250527203231.3c6c0b9d@canb.auug.org.au>
2025-05-27 18:56 ` linux-next: Tree for May 27 (drivers/platform/x86/amd/amd_isp4.c) Randy Dunlap
2025-05-27 19:43   ` Hans de Goede
2025-05-27 20:24     ` Nirujogi, Pratap
2025-05-30  7:41       ` Ilpo Järvinen
2025-05-30  7:44         ` Hans de Goede
2025-05-30 15:21           ` Nirujogi, Pratap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox