* [PATCH 1/1] PCI: Handle case when no pci device can provide cache line size hint
@ 2009-12-15 12:25 Csaba Henk
2009-12-16 1:48 ` Tejun Heo
2009-12-16 19:22 ` Jesse Barnes
0 siblings, 2 replies; 3+ messages in thread
From: Csaba Henk @ 2009-12-15 12:25 UTC (permalink / raw)
To: Tejun Heo; +Cc: Jesse Barnes, linux-kernel
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).
Signed-off-by: Csaba Henk <csaba@gluster.com>
---
drivers/pci/quirks.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 7cfa7c3..f70f4e2 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -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;
--
1.6.5.6
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] PCI: Handle case when no pci device can provide cache line size hint
2009-12-15 12:25 [PATCH 1/1] PCI: Handle case when no pci device can provide cache line size hint Csaba Henk
@ 2009-12-16 1:48 ` Tejun Heo
2009-12-16 19:22 ` Jesse Barnes
1 sibling, 0 replies; 3+ messages in thread
From: Tejun Heo @ 2009-12-16 1:48 UTC (permalink / raw)
To: Csaba Henk; +Cc: Jesse Barnes, linux-kernel
Hello,
On 12/15/2009 09:25 PM, Csaba Henk wrote:
> 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).
>
> Signed-off-by: Csaba Henk <csaba@gluster.com>
> ---
> drivers/pci/quirks.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index 7cfa7c3..f70f4e2 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -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;
Oh, so, all CLS values are zero? I've never thought of that.
Acked-by: Tejun Heo <tj@kernel.org>
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] PCI: Handle case when no pci device can provide cache line size hint
2009-12-15 12:25 [PATCH 1/1] PCI: Handle case when no pci device can provide cache line size hint Csaba Henk
2009-12-16 1:48 ` Tejun Heo
@ 2009-12-16 19:22 ` Jesse Barnes
1 sibling, 0 replies; 3+ messages in thread
From: Jesse Barnes @ 2009-12-16 19:22 UTC (permalink / raw)
To: Csaba Henk; +Cc: Tejun Heo, linux-kernel
On Tue, 15 Dec 2009 17:55:25 +0530
Csaba Henk <csaba@gluster.com> wrote:
> 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).
>
> Signed-off-by: Csaba Henk <csaba@gluster.com>
> ---
> drivers/pci/quirks.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index 7cfa7c3..f70f4e2 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -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;
Applied, thanks.
--
Jesse Barnes, Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-12-16 19:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-15 12:25 [PATCH 1/1] PCI: Handle case when no pci device can provide cache line size hint Csaba Henk
2009-12-16 1:48 ` Tejun Heo
2009-12-16 19:22 ` Jesse Barnes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox