2009-10-14 00:06:15

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: manual merge of the pci tree with Linus' tree

Hi Jesse,

Today's linux-next merge of the pci tree got a conflict in
drivers/pci/pci.c between commit 8d86fb2c80ec376b35ae64ac858d406ae1d42a3f
("Rename pci_init() to pci_apply_final_quirks(), move it to quirks.c")
from Linus' tree and commit b20dd110d21aac94b3f4063cffbcf9718656ce51
("PCI: determine CLS more intelligently") from the pci tree.

I fixed it up by removing the bits of pci_init() that had been moved and
leaving the newly added bits where they are. Hopefully this will be ok
since the moved bits are actually run earlier now. Obviously, there is
probably a better fix ...
--
Cheers,
Stephen Rothwell [email protected]

diff --cc drivers/pci/pci.c
index 4e4c295,a6e22fd..0000000
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@@ -2723,6 -2724,45 +2724,45 @@@ int __attribute__ ((weak)) pci_ext_cfg_
return 1;
}

+ static int __devinit pci_init(void)
+ {
+ struct pci_dev *dev = NULL;
+ u8 cls = 0;
+ u8 tmp;
+
+ if (pci_cache_line_size)
+ printk(KERN_DEBUG "PCI: CLS %u bytes\n",
+ pci_cache_line_size << 2);
+
+ while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
- pci_fixup_device(pci_fixup_final, dev);
+ /*
+ * If arch hasn't set it explicitly yet, use the CLS
+ * value shared by all PCI devices. If there's a
+ * mismatch, fall back to the default value.
+ */
+ if (!pci_cache_line_size) {
+ pci_read_config_byte(dev, PCI_CACHE_LINE_SIZE, &tmp);
+ if (!cls)
+ cls = tmp;
+ if (!tmp || cls == tmp)
+ continue;
+
+ printk(KERN_DEBUG "PCI: CLS mismatch (%u != %u), "
+ "using %u bytes\n", cls << 2, tmp << 2,
+ pci_dfl_cache_line_size << 2);
+ pci_cache_line_size = pci_dfl_cache_line_size;
+ }
+ }
+ 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;
+ }
+
+ return 0;
+ }
++device_initcall(pci_init);
+
static int __init pci_setup(char *str)
{
while (str) {


2009-10-14 00:39:44

by Jesse Barnes

[permalink] [raw]
Subject: Re: linux-next: manual merge of the pci tree with Linus' tree

On Wed, 14 Oct 2009 11:05:32 +1100
Stephen Rothwell <[email protected]> wrote:

> Hi Jesse,
>
> Today's linux-next merge of the pci tree got a conflict in
> drivers/pci/pci.c between commit
> 8d86fb2c80ec376b35ae64ac858d406ae1d42a3f ("Rename pci_init() to
> pci_apply_final_quirks(), move it to quirks.c") from Linus' tree and
> commit b20dd110d21aac94b3f4063cffbcf9718656ce51 ("PCI: determine CLS
> more intelligently") from the pci tree.
>
> I fixed it up by removing the bits of pci_init() that had been moved
> and leaving the newly added bits where they are. Hopefully this will
> be ok since the moved bits are actually run earlier now. Obviously,
> there is probably a better fix ...

Ah, thanks. I'll check it out and update my linux-next branch.

--
Jesse Barnes, Intel Open Source Technology Center

2009-10-14 02:11:17

by Stephen Rothwell

[permalink] [raw]
Subject: Re: linux-next: manual merge of the pci tree with Linus' tree

Hi Jesse,

On Tue, 13 Oct 2009 17:38:42 -0700 Jesse Barnes <[email protected]> wrote:
>
> Ah, thanks. I'll check it out and update my linux-next branch.

Excellent, thanks.

--
Cheers,
Stephen Rothwell [email protected]
http://www.canb.auug.org.au/~sfr/


Attachments:
(No filename) (285.00 B)
(No filename) (198.00 B)
Download all attachments

2009-10-14 07:42:27

by Woodhouse, David

[permalink] [raw]
Subject: Re: linux-next: manual merge of the pci tree with Linus' tree

On Wed, 2009-10-14 at 01:05 +0100, Stephen Rothwell wrote:
> ++device_initcall(pci_init);

That puts it _after_ some device drivers have already started up.
Possibly not what was intended?

--
David Woodhouse Open Source Technology Centre
[email protected] Intel Corporation