Skip to contentSkip to conversation

PCI devices with no PCI_CACHE_LINE_SIZE implemented

DISCUSSION Matt Domsch 2 participants 5 messages Apr 29, 2004 – May 5, 2004

lore
Share & tools
lore
#0 lore raw

Greg,

Some PCI device functions, such as the EHCI portion of Intel ICH5 and ICH6 chips, do not implement the PCI_CACHE_LINE_SIZE register (which is legal to not implement per PCI spec as it is a busmaster that cannot issue a MWI). However, for each of these, the kernel tries to set the value, fails, and prints a KERN_WARNING message about it.

a) need this be a warning, wouldn't KERN_DEBUG suffice, if a message is needed at all? This is printed in pci_generic_prep_mwi().

b) How might you prefer to handle such devices?

Per the PCI 2.3 spec, reading a value of 0 may mean several things:
1) setting the register at all isn't supported
- this is what pci.c assumes now and returns -EINVAL.
2) setting the register to the value you tried isn't supported, but you can try again with another value until you find the right one.
- but there are no hints as to what the right value for a device might be.

Personally, I'd be happy if the printk were gone completely, but that's your call. With the prints there, our support organization is concerned it can cause tech support calls for (in this case) a non-issue.

Thanks,
Matt

Signature · 4 lines
Matt Domsch
Sr. Software Engineer, Lead Engineer
Dell Linux Solutions linux.dell.com & www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com
#1 lore raw
Quoted 10 lines · Matt Domsch

Greg,

Some PCI device functions, such as the EHCI portion of Intel ICH5 and ICH6 chips, do not implement the PCI_CACHE_LINE_SIZE register (which is legal to not implement per PCI spec as it is a busmaster that cannot issue a MWI). However, for each of these, the kernel tries to set the value, fails, and prints a KERN_WARNING message about it.

a) need this be a warning, wouldn't KERN_DEBUG suffice, if a message is needed at all? This is printed in pci_generic_prep_mwi().

Yes, we should make that KERN_DEBUG. I don't have a problem with that. Care to make a patch?

Quoted 9 lines

b) How might you prefer to handle such devices?

Per the PCI 2.3 spec, reading a value of 0 may mean several things:
1) setting the register at all isn't supported
- this is what pci.c assumes now and returns -EINVAL.
2) setting the register to the value you tried isn't supported, but you can try again with another value until you find the right one.
- but there are no hints as to what the right value for a device might be.

I think we need to stick with 1, unless we get more info on what the "proper" value should be.

thanks,

greg k-h

#2 lore raw
Quoted 6 lines · Greg KH
Quoted 2 lines · Matt Domsch

a) need this be a warning, wouldn't KERN_DEBUG suffice, if a message is needed at all? This is printed in pci_generic_prep_mwi().

Yes, we should make that KERN_DEBUG. I don't have a problem with that. Care to make a patch?

Appended for 2.6.6-rc3. I'll send a 2.4.x patch separately.

Thanks,
Matt

Signature · 17 lines
Matt Domsch
Sr. Software Engineer, Lead Engineer
Dell Linux Solutions linux.dell.com & www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com

===== drivers/pci/pci.c 1.65 vs edited =====
--- 1.65/drivers/pci/pci.c	Fri Mar 26 10:58:01 2004
+++ edited/drivers/pci/pci.c	Wed May  5 17:39:08 2004
@@ -640,7 +640,7 @@
 	if (cacheline_size == pci_cache_line_size)
 		return 0;
 
-	printk(KERN_WARNING "PCI: cache line size of %d is not supported "
+	printk(KERN_DEBUG "PCI: cache line size of %d is not supported "
 	       "by device %s\n", pci_cache_line_size << 2, pci_name(dev));
 
 	return -EINVAL;
#3 lore raw
Quoted 9 lines · Matt Domsch
Quoted 6 lines · Greg KH
Quoted 2 lines · Matt Domsch

a) need this be a warning, wouldn't KERN_DEBUG suffice, if a message is needed at all? This is printed in pci_generic_prep_mwi().

Yes, we should make that KERN_DEBUG. I don't have a problem with that. Care to make a patch?

Appended for 2.6.6-rc3. I'll send a 2.4.x patch separately.

I've applied this for 2.6. I'm not the 2.4 pci maintainer, so I can't help you out there, sorry.

greg k-h

#4 lore raw
In reply to Greg KH
Quoted 6 lines · Greg KH
Quoted 2 lines · Matt Domsch

a) need this be a warning, wouldn't KERN_DEBUG suffice, if a message is needed at all? This is printed in pci_generic_prep_mwi().

Yes, we should make that KERN_DEBUG. I don't have a problem with that. Care to make a patch?

Patch for 2.4.27-pre1 appended.

Thanks,
Matt

Signature · 17 lines
Matt Domsch
Sr. Software Engineer, Lead Engineer
Dell Linux Solutions linux.dell.com & www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com

===== drivers/pci/pci.c 1.47 vs edited =====
--- 1.47/drivers/pci/pci.c	Mon Sep 22 07:27:35 2003
+++ edited/drivers/pci/pci.c	Wed May  5 17:49:13 2004
@@ -943,7 +943,7 @@
 	if (cacheline_size == pci_cache_line_size)
 		return 0;
 
-	printk(KERN_WARNING "PCI: cache line size of %d is not supported "
+	printk(KERN_DEBUG "PCI: cache line size of %d is not supported "
 	       "by device %s\n", pci_cache_line_size << 2, dev->slot_name);
 
 	return -EINVAL;