Re: [RFC PATCH 14/35] i2c/busses: Change PCIBIOS_SUCCESSFUL to 0

Saheed Bolarinwa
2020-07-18T20:04:48Z

On 7/17/20 4:58 PM, Jean Delvare wrote:

> Which PCI specification are you talking about here. In my "PCI Local
> Bus Revision 2.3" specification (March 29, 2002), chapter 2 is about
> Signal Definition and has nothing to do with the BIOS.
http://read.pudn.com/downloads211/doc/comm/994029/pcifw_r3_0_updated.pdf
>> Change all PCIBIOS_SUCCESSFUL to 0
>>
>> Signed-off-by: "Saheed O. Bolarinwa" <refactormyself@gmail.com>
>> ---
>> drivers/i2c/busses/i2c-ali15x3.c | 4 ++--
>> drivers/i2c/busses/i2c-nforce2.c | 2 +-
>> drivers/i2c/busses/i2c-sis5595.c | 10 +++++-----
>> 3 files changed, 8 insertions(+), 8 deletions(-)
> Hmmm. That seems to be a lot of changes to solve an essentially
> theoretical problem (if a problem at all). I am not familiar enough
> with the PCI subsystem to claim that it is fundamentally wrong, but
> enough to say I'm skeptical.
>
> PCI is a cross-architecture standard, and we can't possibly have the
> return value of core functions such as pci_write_config_word follow
> different conventions depending on the architecture, can we? Does
> pci_write_config_word() currently return PCIBIOS_SUCCESSFUL on success
> on x86 and 0 on success on other architectures? What about errors, do
> we return positive, "PCIBIOS-specific" error codes on x86 and negative,
> unix-like error codes on other architectures?

Unfortunately, the cover letter did not go through. I have resent it now:

https://lore.kernel.org/linux-i2c/20200718184558.110942-1-refactormyself@gmail.com/T/#u

Here is a discussion thread on it:

https://lore.kernel.org/linux-pci/fb40545a8de8df8914df40d7d6167752c5244ce6.camel@kernel.crashing.org/T/#t

>> diff --git a/drivers/i2c/busses/i2c-ali15x3.c b/drivers/i2c/busses/i2c-ali15x3.c
>> index 02185a1cfa77..359ee3e0864a 100644
>> --- a/drivers/i2c/busses/i2c-ali15x3.c
>> +++ b/drivers/i2c/busses/i2c-ali15x3.c
>> @@ -167,11 +167,11 @@ static int ali15x3_setup(struct pci_dev *ALI15X3_dev)
>> if(force_addr) {
>> dev_info(&ALI15X3_dev->dev, "forcing ISA address 0x%04X\n",
>> ali15x3_smba);
>> - if (PCIBIOS_SUCCESSFUL != pci_write_config_word(ALI15X3_dev,
>> + if (0 != pci_write_config_word(ALI15X3_dev,
>> SMBBA,
>> ali15x3_smba))
>> goto error;
> This leaves the code horribly aligned.

Sorry about that, lessons learnt.

Thank you for the review.

- Saheed