Skip to contentSkip to conversation

i2c-sis630 driver (fixed)

DISCUSSION Alexander Malysh 2 participants 5 messages May 19, 2005

lore
Share & tools
lore
#0 lore raw

Hi again,

the bug is fixed now... I do not know how to close the tikets.

Quoted 20 lines · Alexander Malysh

Hi Jean,

this problem occurs only if ACPI enabled. this is because i2c register are in ACPI io space. I have a test version here with acpi running, but it is tooo ugly now. I will do cleanup of module and commit it within next 2 weeks... Sorry but I am to busy now with my job.

Thanks...

Am Mittwoch, 30. Juli 2003 17:09 schrieb Jean Delvare:

Quoted 10 lines

Hi folks,

We have been having two tickets about i2c-sis630 driver not working anymore since 2.8.0.

http://secure.netroedge.com/~lm78/readticket.cgi?ticket50
http://secure.netroedge.com/~lm78/readticket.cgi?ticket51

Could you please take a look? The reports are complete but I don't know where to look at (I don't know much about bus drivers).

Signature · 3 lines
Best regards,
Dipl.-Ing.
Alexander Malysh
#1 lore raw

Hi Alex:

Quoted 3 lines · Alexander Malysh

Hi again,

the bug is fixed now... I do not know how to close the tikets.

It still has a bug: the pci system will associate the 630 or 730 device with your driver, such that no other driver (if there was one) which might claim that device will work. The thread where this was first mentioned is here:

http://archives.andrew.net.au/lm-sensors/msg03193.html

So how about this patch? (against CVS, compiles, untested)

Regards,

Signature · 57 lines
Mark M. Hoffman
[email protected]

Index: i2c-sis630.c
=================================RCS file: /home/cvs/lm_sensors2/kernel/busses/i2c-sis630.c,v
retrieving revision 1.20
diff -u -r1.20 i2c-sis630.c
--- i2c-sis630.c	30 Jul 2003 20:40:27 -0000	1.20
+++ i2c-sis630.c	30 Jul 2003 22:39:44 -0000
@@ -321,19 +321,21 @@
 		I2C_FUNC_SMBUS_WORD_DATA | I2C_FUNC_SMBUS_PROC_CALL;
 }
 
-int sis630_setup(struct pci_dev *dummy) {
+int sis630_setup(struct pci_dev *sis630_dev) {
 	unsigned char b;
-	struct pci_dev *sis630_dev = NULL;
 
-        /*
-	   We need ISA brigde and not pci device passed in.
-        */
-	if (!(sis630_dev = pci_find_device(PCI_VENDOR_ID_SI,
-                                            PCI_DEVICE_ID_SI_503,
-                                            sis630_dev))) {
-            printk(KERN_ERR "i2c-sis630.o: Error: Can't detect 85C503/5513 ISA bridge!\n");
-            return -ENODEV;
-        }
+	/*
+	   Make sure there is a compatible chipset
+	*/
+	if (!(	pci_find_device(PCI_VENDOR_ID_SI,
+			PCI_DEVICE_ID_SI_630, NULL) ||
+		pci_find_device(PCI_VENDOR_ID_SI,
+			PCI_DEVICE_ID_SI_730, NULL) ))
+	{
+		printk(KERN_ERR "i2c-sis630.o: Error - can't find compatible "
+				"chipset!\n");
+		return -ENODEV;
+	}
 
 	/*
 	   Enable ACPI first , so we can accsess reg 74-75
@@ -392,13 +394,7 @@
 static struct pci_device_id sis630_ids[] __devinitdata = {
 	{
 		.vendor =	PCI_VENDOR_ID_SI,
-		.device =	PCI_DEVICE_ID_SI_630,
-		.subvendor =	PCI_ANY_ID,
-		.subdevice =	PCI_ANY_ID,
-	},
-	{
-		.vendor =	PCI_VENDOR_ID_SI,
-		.device =	PCI_DEVICE_ID_SI_730,
+		.device =	PCI_DEVICE_ID_SI_503,
 		.subvendor =	PCI_ANY_ID,
 		.subdevice =	PCI_ANY_ID,
 	},
#2 lore raw
In reply to Alexander Malysh

Hi Mark,

hmm, now I have undestand the problem... But it is not a right fix too (imo). with your changes i2c-sis630 will claim ISA brigde and block others if they want use it or I missed anything? i2c-sis630 doesn't use isa brigde only for detection of acpi base address.

my proposal is to revert pci changes made by MDS and do the old detection.

Quoted 17 lines · Mark M. Hoffman

Hi Alex:

Quoted 3 lines · Alexander Malysh

Hi again,

the bug is fixed now... I do not know how to close the tikets.

It still has a bug: the pci system will associate the 630 or 730 device with your driver, such that no other driver (if there was one) which might claim that device will work. The thread where this was first mentioned is here:

http://archives.andrew.net.au/lm-sensors/msg03193.html

So how about this patch? (against CVS, compiles, untested)

Regards,

Signature · 3 lines
Best regards,
Dipl.-Ing.
Alexander Malysh
#3 lore raw
In reply to Alexander Malysh
Quoted 6 lines · Alexander Malysh

Hi Mark,

hmm, now I have undestand the problem... But it is not a right fix too (imo). with your changes i2c-sis630 will claim ISA brigde and block others if they want use it or I missed anything? i2c-sis630 doesn't use isa brigde only for detection of acpi base address.

My understanding is this: If you need the resource (base address) from the ISA bridge PCI device, that's a valid reason to claim it. Do you know of some other driver which uses the ACPI base address? Is there some other driver which claims the ISA bridge PCI device? Come to think of it - you have the datasheet for that chipset - is there anything else on there that would need a driver?

You're right: the patch I proposed assumes that it is the one and only driver to claim the ISA bridge device.

*However*, since the resource in question is the "acpi base address" - I don't know how ACPI fits into all this.

Maybe we'll get advice from Greg KH? Or else we could try asking LKML...

Quoted 1 line

my proposal is to revert pci changes made by MDS and do the old detection.

The old way will not get accepted into 2.4.23, which is our goal.

Quoted 8 lines · Mark M. Hoffman
Quoted 7 lines

Hi Alex:

Quoted 3 lines · Alexander Malysh

Hi again,

the bug is fixed now... I do not know how to close the tikets.

Quoted 8 lines
Quoted 8 lines

It still has a bug: the pci system will associate the 630 or 730 device with your driver, such that no other driver (if there was one) which might claim that device will work. The thread where this was first mentioned is here:

http://archives.andrew.net.au/lm-sensors/msg03193.html

So how about this patch? (against CVS, compiles, untested)

Regards,

Signature · 2 lines
Mark M. Hoffman
[email protected]
#4 lore raw
In reply to Alexander Malysh
Quoted 8 lines · Mark M. Hoffman
Quoted 6 lines · Alexander Malysh

Hi Mark,

hmm, now I have undestand the problem... But it is not a right fix too (imo). with your changes i2c-sis630 will claim ISA brigde and block others if they want use it or I missed anything? i2c-sis630 doesn't use isa brigde only for detection of acpi base address.

Quoted 6 lines

My understanding is this: If you need the resource (base address) from the ISA bridge PCI device, that's a valid reason to claim it. Do you know of some other driver which uses the ACPI base address? Is there some other driver which claims the ISA bridge PCI device? Come to think of it - you have the datasheet for that chipset - is there anything else on there that would need a driver?

i2c-sis630 doesn't use (base addr) from the isa brigde pci device, only acpi base addr will be used by the driver and may not play with acpi very well if acpi make use of smbus (e.g.defined in the dsdt).Unfortunately I have not tested it yet, because in dstdt from my laptop is no smbus defined.

Quoted 3 lines

You're right: the patch I proposed assumes that it is the one and only driver to claim the ISA bridge device.

but why should driver claim this device? I can not get really answer , if any other driver claims the isa brigde pci device , but unfortunately I can not undestand why?

Quoted 29 lines

*However*, since the resource in question is the "acpi base address" - I don't know how ACPI fits into all this.

Maybe we'll get advice from Greg KH? Or else we could try asking LKML...

Quoted 2 lines

my proposal is to revert pci changes made by MDS and do the old detection.

The old way will not get accepted into 2.4.23, which is our goal.

Quoted 8 lines · Mark M. Hoffman
Quoted 7 lines

Hi Alex:

Quoted 3 lines · Alexander Malysh

Hi again,

the bug is fixed now... I do not know how to close the tikets.

Quoted 8 lines
Quoted 8 lines

It still has a bug: the pci system will associate the 630 or 730 device with your driver, such that no other driver (if there was one) which might claim that device will work. The thread where this was first mentioned is here:

http://archives.andrew.net.au/lm-sensors/msg03193.html

So how about this patch? (against CVS, compiles, untested)

Regards,

Signature · 3 lines
Best regards,
Dipl.-Ing.
Alexander Malysh