linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c: piix4: Add second SMBus for X370/X470/X570
@ 2020-04-13 15:06 Sebastian Reichel
  2020-04-14  7:41 ` Jean Delvare
  0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Reichel @ 2020-04-13 15:06 UTC (permalink / raw)
  To: Jean Delvare; +Cc: linux-i2c, linux-kernel, Sebastian Reichel, Adam Honse

The second interface can be found on X370, X470 and X570 according
to the bugzilla entry. I only tested with X570 on an ASRock X570
Taichi:

$ lspci -nnv -d 1022:790b
00:14.0 SMBus [0c05]: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller [1022:790b] (rev 61)
	Subsystem: ASRock Incorporation FCH SMBus Controller [1849:ffff]
	Flags: 66MHz, medium devsel
	Kernel driver in use: piix4_smbus
	Kernel modules: i2c_piix4, sp5100_tco

Before the patch:

$ i2cdetect -l | grep PIIX4
i2c-1	unknown   	SMBus PIIX4 adapter port 2 at 0b00	N/A
i2c-0	unknown   	SMBus PIIX4 adapter port 0 at 0b00	N/A

After the patch:

$ i2cdetect -l | grep PIIX4
i2c-1	unknown   	SMBus PIIX4 adapter port 2 at 0b00	N/A
i2c-2	unknown   	SMBus PIIX4 adapter port 1 at 0b20	N/A
i2c-0	unknown   	SMBus PIIX4 adapter port 0 at 0b00	N/A

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=202587
Reported-by: Adam Honse <calcprogrammer1@gmail.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
Hi,

The Bugzilla entry contains a second change, which reduces the timeouts
for quicker operation. I did not include that change, since I do not know
if this is a good idea for all devices supported by this driver. In any
case it should be a separate patch. Let's get the interface working for
now.

-- Sebastian
---
 drivers/i2c/busses/i2c-piix4.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
index 30ded6422e7b..3e89143a0ecf 100644
--- a/drivers/i2c/busses/i2c-piix4.c
+++ b/drivers/i2c/busses/i2c-piix4.c
@@ -976,9 +976,11 @@ static int piix4_probe(struct pci_dev *dev, const struct pci_device_id *id)
 		}
 	}
 
-	if (dev->vendor == PCI_VENDOR_ID_AMD &&
-	    dev->device == PCI_DEVICE_ID_AMD_HUDSON2_SMBUS) {
-		retval = piix4_setup_sb800(dev, id, 1);
+	if (dev->vendor == PCI_VENDOR_ID_AMD) {
+		if (dev->device == PCI_DEVICE_ID_AMD_HUDSON2_SMBUS ||
+		    dev->device == PCI_DEVICE_ID_AMD_KERNCZ_SMBUS) {
+			retval = piix4_setup_sb800(dev, id, 1);
+		}
 	}
 
 	if (retval > 0) {
-- 
2.25.1


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

* Re: [PATCH] i2c: piix4: Add second SMBus for X370/X470/X570
  2020-04-13 15:06 [PATCH] i2c: piix4: Add second SMBus for X370/X470/X570 Sebastian Reichel
@ 2020-04-14  7:41 ` Jean Delvare
  2020-04-14 10:43   ` Sebastian Reichel
  0 siblings, 1 reply; 3+ messages in thread
From: Jean Delvare @ 2020-04-14  7:41 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: linux-i2c, linux-kernel, Adam Honse

Hi Sebastian,

On Mon, 13 Apr 2020 17:06:34 +0200, Sebastian Reichel wrote:
> The second interface can be found on X370, X470 and X570 according
> to the bugzilla entry. I only tested with X570 on an ASRock X570
> Taichi:
> 
> $ lspci -nnv -d 1022:790b
> 00:14.0 SMBus [0c05]: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller [1022:790b] (rev 61)
> 	Subsystem: ASRock Incorporation FCH SMBus Controller [1849:ffff]
> 	Flags: 66MHz, medium devsel
> 	Kernel driver in use: piix4_smbus
> 	Kernel modules: i2c_piix4, sp5100_tco
> 
> Before the patch:
> 
> $ i2cdetect -l | grep PIIX4
> i2c-1	unknown   	SMBus PIIX4 adapter port 2 at 0b00	N/A
> i2c-0	unknown   	SMBus PIIX4 adapter port 0 at 0b00	N/A
> 
> After the patch:
> 
> $ i2cdetect -l | grep PIIX4
> i2c-1	unknown   	SMBus PIIX4 adapter port 2 at 0b00	N/A
> i2c-2	unknown   	SMBus PIIX4 adapter port 1 at 0b20	N/A
> i2c-0	unknown   	SMBus PIIX4 adapter port 0 at 0b00	N/A
> 
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=202587
> Reported-by: Adam Honse <calcprogrammer1@gmail.com>
> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
> ---
> Hi,
> 
> The Bugzilla entry contains a second change, which reduces the timeouts
> for quicker operation. I did not include that change, since I do not know
> if this is a good idea for all devices supported by this driver. In any
> case it should be a separate patch. Let's get the interface working for
> now.
> 
> -- Sebastian
> ---
>  drivers/i2c/busses/i2c-piix4.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
> index 30ded6422e7b..3e89143a0ecf 100644
> --- a/drivers/i2c/busses/i2c-piix4.c
> +++ b/drivers/i2c/busses/i2c-piix4.c
> @@ -976,9 +976,11 @@ static int piix4_probe(struct pci_dev *dev, const struct pci_device_id *id)
>  		}
>  	}
>  
> -	if (dev->vendor == PCI_VENDOR_ID_AMD &&
> -	    dev->device == PCI_DEVICE_ID_AMD_HUDSON2_SMBUS) {
> -		retval = piix4_setup_sb800(dev, id, 1);
> +	if (dev->vendor == PCI_VENDOR_ID_AMD) {
> +		if (dev->device == PCI_DEVICE_ID_AMD_HUDSON2_SMBUS ||
> +		    dev->device == PCI_DEVICE_ID_AMD_KERNCZ_SMBUS) {
> +			retval = piix4_setup_sb800(dev, id, 1);
> +		}
>  	}
>  
>  	if (retval > 0) {

Adam just sent pretty much the same patch:

https://patchwork.ozlabs.org/project/linux-i2c/patch/20200410204843.3856-1-calcprogrammer1@gmail.com/

Reviewed-by: Jean Delvare <jdelvare@suse.de>

I'll leave it to Wolfram which one he wants to apply.

-- 
Jean Delvare
SUSE L3 Support

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

* Re: [PATCH] i2c: piix4: Add second SMBus for X370/X470/X570
  2020-04-14  7:41 ` Jean Delvare
@ 2020-04-14 10:43   ` Sebastian Reichel
  0 siblings, 0 replies; 3+ messages in thread
From: Sebastian Reichel @ 2020-04-14 10:43 UTC (permalink / raw)
  To: Jean Delvare, Wolfram Sang; +Cc: linux-i2c, linux-kernel, Adam Honse

[-- Attachment #1: Type: text/plain, Size: 3160 bytes --]

Hi,

On Tue, Apr 14, 2020 at 09:41:58AM +0200, Jean Delvare wrote:
> On Mon, 13 Apr 2020 17:06:34 +0200, Sebastian Reichel wrote:
> > The second interface can be found on X370, X470 and X570 according
> > to the bugzilla entry. I only tested with X570 on an ASRock X570
> > Taichi:
> > 
> > $ lspci -nnv -d 1022:790b
> > 00:14.0 SMBus [0c05]: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller [1022:790b] (rev 61)
> > 	Subsystem: ASRock Incorporation FCH SMBus Controller [1849:ffff]
> > 	Flags: 66MHz, medium devsel
> > 	Kernel driver in use: piix4_smbus
> > 	Kernel modules: i2c_piix4, sp5100_tco
> > 
> > Before the patch:
> > 
> > $ i2cdetect -l | grep PIIX4
> > i2c-1	unknown   	SMBus PIIX4 adapter port 2 at 0b00	N/A
> > i2c-0	unknown   	SMBus PIIX4 adapter port 0 at 0b00	N/A
> > 
> > After the patch:
> > 
> > $ i2cdetect -l | grep PIIX4
> > i2c-1	unknown   	SMBus PIIX4 adapter port 2 at 0b00	N/A
> > i2c-2	unknown   	SMBus PIIX4 adapter port 1 at 0b20	N/A
> > i2c-0	unknown   	SMBus PIIX4 adapter port 0 at 0b00	N/A
> > 
> > Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=202587
> > Reported-by: Adam Honse <calcprogrammer1@gmail.com>
> > Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
> > ---
> > Hi,
> > 
> > The Bugzilla entry contains a second change, which reduces the timeouts
> > for quicker operation. I did not include that change, since I do not know
> > if this is a good idea for all devices supported by this driver. In any
> > case it should be a separate patch. Let's get the interface working for
> > now.
> > 
> > -- Sebastian
> > ---
> >  drivers/i2c/busses/i2c-piix4.c | 8 +++++---
> >  1 file changed, 5 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
> > index 30ded6422e7b..3e89143a0ecf 100644
> > --- a/drivers/i2c/busses/i2c-piix4.c
> > +++ b/drivers/i2c/busses/i2c-piix4.c
> > @@ -976,9 +976,11 @@ static int piix4_probe(struct pci_dev *dev, const struct pci_device_id *id)
> >  		}
> >  	}
> >  
> > -	if (dev->vendor == PCI_VENDOR_ID_AMD &&
> > -	    dev->device == PCI_DEVICE_ID_AMD_HUDSON2_SMBUS) {
> > -		retval = piix4_setup_sb800(dev, id, 1);
> > +	if (dev->vendor == PCI_VENDOR_ID_AMD) {
> > +		if (dev->device == PCI_DEVICE_ID_AMD_HUDSON2_SMBUS ||
> > +		    dev->device == PCI_DEVICE_ID_AMD_KERNCZ_SMBUS) {
> > +			retval = piix4_setup_sb800(dev, id, 1);
> > +		}
> >  	}
> >  
> >  	if (retval > 0) {
> 
> Adam just sent pretty much the same patch:
> 
> https://patchwork.ozlabs.org/project/linux-i2c/patch/20200410204843.3856-1-calcprogrammer1@gmail.com/
> 
> Reviewed-by: Jean Delvare <jdelvare@suse.de>
> 
> I'll leave it to Wolfram which one he wants to apply.

Ok, I wasn't aware of that and thought this patch was forgotten. In
that case Adam should receive all the credits of course. Feel free
to take over anything usable from my commit message. The patch from
Adam is

Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Tested-by: Sebastian Reichel <sebastian.reichel@collabora.com>

Thanks,

-- Sebastian

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2020-04-14 10:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-13 15:06 [PATCH] i2c: piix4: Add second SMBus for X370/X470/X570 Sebastian Reichel
2020-04-14  7:41 ` Jean Delvare
2020-04-14 10:43   ` Sebastian Reichel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).