* pci cacheline size / latency oddness.
@ 2005-08-01 23:35 Dave Jones
2005-08-02 0:05 ` Jeff Garzik
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Dave Jones @ 2005-08-01 23:35 UTC (permalink / raw)
To: linux-kernel; +Cc: ak
During boot of todays -git, I noticed this..
PCI: Setting latency timer of device 0000:00:1d.7 to 64
after boot, lspci shows..
00:1d.7 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB2 EHCI Controller (rev 02) (prog-if 20 [EHCI])
Subsystem: Dell: Unknown device 0169
Flags: bus master, medium devsel, latency 0, IRQ 201
^^
It also complains about..
PCI: cache line size of 128 is not supported by device 0000:00:1d.7
x86-64 doesn't have an arch override for pci_cache_line_size, so
it ends up at L1_CACHE_BYTES >> 2, which is 128 if you build
x86-64 kernels with CONFIG_GENERIC_CPU or CONFIG_MPSC
This means we will do the wrong thing on AMD machines which have
64 byte cachelines. I saw this problem however on an em64t box.
Would it make sense to shift >> once more if it fails, and retry
with a smaller size perhaps ?
Dave
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: pci cacheline size / latency oddness.
2005-08-01 23:35 pci cacheline size / latency oddness Dave Jones
@ 2005-08-02 0:05 ` Jeff Garzik
2005-08-02 0:41 ` Parag Warudkar
2005-08-03 10:58 ` Andi Kleen
2 siblings, 0 replies; 5+ messages in thread
From: Jeff Garzik @ 2005-08-02 0:05 UTC (permalink / raw)
To: Dave Jones; +Cc: linux-kernel, ak
Dave Jones wrote:
> During boot of todays -git, I noticed this..
>
> PCI: Setting latency timer of device 0000:00:1d.7 to 64
>
> after boot, lspci shows..
>
> 00:1d.7 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB2 EHCI Controller (rev 02) (prog-if 20 [EHCI])
> Subsystem: Dell: Unknown device 0169
> Flags: bus master, medium devsel, latency 0, IRQ 201
> ^^
Probably the hardware doesn't want you to set it, similar to what I
describe in the following:
> It also complains about..
>
> PCI: cache line size of 128 is not supported by device 0000:00:1d.7
This message means that it couldn't set the cacheline size at all. Most
likely it is either zero, or hardcoded in the silicon. Has very little
to do with the platform, and more to do with the device.
> x86-64 doesn't have an arch override for pci_cache_line_size, so
> it ends up at L1_CACHE_BYTES >> 2, which is 128 if you build
> x86-64 kernels with CONFIG_GENERIC_CPU or CONFIG_MPSC
> This means we will do the wrong thing on AMD machines which have
> 64 byte cachelines. I saw this problem however on an em64t box.
> Would it make sense to shift >> once more if it fails, and retry
> with a smaller size perhaps ?
Too big is far better than too small.
Jeff
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: pci cacheline size / latency oddness.
2005-08-01 23:35 pci cacheline size / latency oddness Dave Jones
2005-08-02 0:05 ` Jeff Garzik
@ 2005-08-02 0:41 ` Parag Warudkar
2005-08-03 13:20 ` Andi Kleen
2005-08-03 10:58 ` Andi Kleen
2 siblings, 1 reply; 5+ messages in thread
From: Parag Warudkar @ 2005-08-02 0:41 UTC (permalink / raw)
To: Dave Jones; +Cc: linux-kernel, ak
On Mon, 2005-08-01 at 19:35 -0400, Dave Jones wrote:
> This means we will do the wrong thing on AMD machines which have
> 64 byte cachelines.
pcibios_init (in i386/pci/common.c, which is linked in by X86_64 PCI
code) seems to do this
if (c->x86 >= 6 && c->x86_vendor == X86_VENDOR_AMD)
pci_cache_line_size = 64 >> 2; /* K7 & K8 */
Is it correct to expect all AMD k7/8 machines to have 16 as cache line
size - I thought 64 was more appropriate?
On my Athlon64 laptop, all PCI devices end up having 0 latency.
> x86-64 doesn't have an arch override for pci_cache_line_size
I am trying to fix it up - What's the right way to override it in x86_64
code? Just initialize it to 64 may be?
Parag
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: pci cacheline size / latency oddness.
2005-08-01 23:35 pci cacheline size / latency oddness Dave Jones
2005-08-02 0:05 ` Jeff Garzik
2005-08-02 0:41 ` Parag Warudkar
@ 2005-08-03 10:58 ` Andi Kleen
2 siblings, 0 replies; 5+ messages in thread
From: Andi Kleen @ 2005-08-03 10:58 UTC (permalink / raw)
To: Dave Jones, linux-kernel, ak
On Mon, Aug 01, 2005 at 07:35:17PM -0400, Dave Jones wrote:
> During boot of todays -git, I noticed this..
>
> PCI: Setting latency timer of device 0000:00:1d.7 to 64
>
> after boot, lspci shows..
>
> 00:1d.7 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB2 EHCI Controller (rev 02) (prog-if 20 [EHCI])
> Subsystem: Dell: Unknown device 0169
> Flags: bus master, medium devsel, latency 0, IRQ 201
> ^^
>
> It also complains about..
>
> PCI: cache line size of 128 is not supported by device 0000:00:1d.7
>
> x86-64 doesn't have an arch override for pci_cache_line_size, so
> it ends up at L1_CACHE_BYTES >> 2, which is 128 if you build
> x86-64 kernels with CONFIG_GENERIC_CPU or CONFIG_MPSC
> This means we will do the wrong thing on AMD machines which have
> 64 byte cachelines. I saw this problem however on an em64t box.
We should be running arch/i386/pci/common.c:pcibios_init
As far as I can see that should do the right thing on x86-64 too.
> Would it make sense to shift >> once more if it fails, and retry
> with a smaller size perhaps ?
Not sure how much sense it makes to configure a PCI device
to a smaller cache line size than true. Best probably to leave
it alone in this case.
-Andi
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: pci cacheline size / latency oddness.
2005-08-02 0:41 ` Parag Warudkar
@ 2005-08-03 13:20 ` Andi Kleen
0 siblings, 0 replies; 5+ messages in thread
From: Andi Kleen @ 2005-08-03 13:20 UTC (permalink / raw)
To: Parag Warudkar; +Cc: Dave Jones, linux-kernel, ak
On Mon, Aug 01, 2005 at 08:41:49PM -0400, Parag Warudkar wrote:
> On Mon, 2005-08-01 at 19:35 -0400, Dave Jones wrote:
> > This means we will do the wrong thing on AMD machines which have
> > 64 byte cachelines.
>
> pcibios_init (in i386/pci/common.c, which is linked in by X86_64 PCI
> code) seems to do this
>
> if (c->x86 >= 6 && c->x86_vendor == X86_VENDOR_AMD)
> pci_cache_line_size = 64 >> 2; /* K7 & K8 */
>
> Is it correct to expect all AMD k7/8 machines to have 16 as cache line
> size - I thought 64 was more appropriate?
iirc the pci cache line register takes a value shifted left by 2 bits.
And yes all K7/K8 machines have 64byte cache lines.
> On my Athlon64 laptop, all PCI devices end up having 0 latency.
That has nothing to do with the cache line size.
>
> > x86-64 doesn't have an arch override for pci_cache_line_size
>
> I am trying to fix it up - What's the right way to override it in x86_64
> code? Just initialize it to 64 may be?
I don't think there is anything to fix.
-Andi
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2005-08-03 13:20 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-01 23:35 pci cacheline size / latency oddness Dave Jones
2005-08-02 0:05 ` Jeff Garzik
2005-08-02 0:41 ` Parag Warudkar
2005-08-03 13:20 ` Andi Kleen
2005-08-03 10:58 ` Andi Kleen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox