Skip to content

Commit

Permalink
PCI: Handle case when no pci device can provide cache line size hint
Browse files Browse the repository at this point in the history
Prior to this patch, if pci_read_config_byte(dev, PCI_CACHE_LINE_SIZE, ...)
returns 0 for all dev, pci_cache_line_size ends up set to zero
(instead of pci_dfl_cache_line_size).

This patch ensures the pci_cache_line_size = pci_dfl_cache_line_size
setting in the above scenario.

This happens in case of a kvm-88 guest (where, consequently, the rtl8139
NIC failed to initialize).

Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Csaba Henk <csaba@gluster.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
  • Loading branch information
csabahenk authored and jbarnes993 committed Dec 16, 2009
1 parent dc1a94a commit 2820f33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/pci/quirks.c
Expand Up @@ -2629,7 +2629,7 @@ static int __init pci_apply_final_quirks(void)
if (!pci_cache_line_size) {
printk(KERN_DEBUG "PCI: CLS %u bytes, default %u\n",
cls << 2, pci_dfl_cache_line_size << 2);
pci_cache_line_size = cls;
pci_cache_line_size = cls ? cls : pci_dfl_cache_line_size;
}

return 0;
Expand Down

0 comments on commit 2820f33

Please sign in to comment.