linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the pci tree with the origin tree
@ 2020-10-21 23:46 Stephen Rothwell
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Rothwell @ 2020-10-21 23:46 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Jon Derrick, Linux Kernel Mailing List, Linux Next Mailing List,
	Lorenzo Pieralisi, Thomas Gleixner

[-- Attachment #1: Type: text/plain, Size: 2824 bytes --]

Hi all,

FIXME: Add owner of second tree to To:
       Add author(s)/SOB of conflicting commits.

Today's linux-next merge of the pci tree got a conflict in:

  drivers/pci/controller/vmd.c

between commit:

  585dfe8abc44 ("PCI: vmd: Dont abuse vector irqomain as parent")

from the origin tree and commit:

  1552b11ba15e ("PCI: vmd: Create IRQ Domain configuration helper")

from the pci tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/pci/controller/vmd.c
index aa1b12bac9a1,c8d46bd01e87..000000000000
--- a/drivers/pci/controller/vmd.c
+++ b/drivers/pci/controller/vmd.c
@@@ -298,6 -298,34 +298,34 @@@ static struct msi_domain_info vmd_msi_d
  	.chip		= &vmd_msi_controller,
  };
  
+ static int vmd_create_irq_domain(struct vmd_dev *vmd)
+ {
+ 	struct fwnode_handle *fn;
+ 
+ 	fn = irq_domain_alloc_named_id_fwnode("VMD-MSI", vmd->sysdata.domain);
+ 	if (!fn)
+ 		return -ENODEV;
+ 
+ 	vmd->irq_domain = pci_msi_create_irq_domain(fn, &vmd_msi_domain_info,
 -						    x86_vector_domain);
++						    NULL);
+ 	if (!vmd->irq_domain) {
+ 		irq_domain_free_fwnode(fn);
+ 		return -ENODEV;
+ 	}
+ 
+ 	return 0;
+ }
+ 
+ static void vmd_remove_irq_domain(struct vmd_dev *vmd)
+ {
+ 	if (vmd->irq_domain) {
+ 		struct fwnode_handle *fn = vmd->irq_domain->fwnode;
+ 
+ 		irq_domain_remove(vmd->irq_domain);
+ 		irq_domain_free_fwnode(fn);
+ 	}
+ }
+ 
  static char __iomem *vmd_cfg_addr(struct vmd_dev *vmd, struct pci_bus *bus,
  				  unsigned int devfn, int reg, int len)
  {
@@@ -568,24 -674,10 +674,16 @@@ static int vmd_enable_domain(struct vmd
  
  	sd->node = pcibus_to_node(vmd->dev->bus);
  
- 	fn = irq_domain_alloc_named_id_fwnode("VMD-MSI", vmd->sysdata.domain);
- 	if (!fn)
- 		return -ENODEV;
- 
- 	vmd->irq_domain = pci_msi_create_irq_domain(fn, &vmd_msi_domain_info,
- 						    NULL);
- 
- 	if (!vmd->irq_domain) {
- 		irq_domain_free_fwnode(fn);
- 		return -ENODEV;
- 	}
+ 	ret = vmd_create_irq_domain(vmd);
+ 	if (ret)
+ 		return ret;
  
 +	/*
 +	 * Override the irq domain bus token so the domain can be distinguished
 +	 * from a regular PCI/MSI domain.
 +	 */
 +	irq_domain_update_bus_token(vmd->irq_domain, DOMAIN_BUS_VMD_MSI);
 +
  	pci_add_resource(&resources, &vmd->resources[0]);
  	pci_add_resource_offset(&resources, &vmd->resources[1], offset[0]);
  	pci_add_resource_offset(&resources, &vmd->resources[2], offset[1]);

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* linux-next: manual merge of the pci tree with the origin tree
@ 2023-04-17 12:45 broonie
  0 siblings, 0 replies; 2+ messages in thread
From: broonie @ 2023-04-17 12:45 UTC (permalink / raw)
  To: Bjorn Helgaas, Lorenzo Pieralisi, Krzysztof Wilczyński
  Cc: Basavaraj Natikar, Linux Kernel Mailing List,
	Linux Next Mailing List, Ron Lee, Ron Lee

Hi all,

Today's linux-next merge of the pci tree got a conflict in:

  arch/x86/pci/fixup.c

between commit:

  f195fc1e9715b ("x86/PCI: Add quirk for AMD XHCI controller that loses MSI-X state in D3hot")

from the origin tree and commit:

  606012dddebbc ("PCI: Fix up L1SS capability for Intel Apollo Lake Root Port")

from the pci tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

diff --cc arch/x86/pci/fixup.c
index bf5161dcf89e7,c6c46605812b4..0000000000000
--- a/arch/x86/pci/fixup.c
+++ b/arch/x86/pci/fixup.c
@@@ -826,22 -825,61 +826,81 @@@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_A
  
  #endif
  
 +#ifdef CONFIG_AMD_NB
 +
 +#define AMD_15B8_RCC_DEV2_EPF0_STRAP2                                  0x10136008
 +#define AMD_15B8_RCC_DEV2_EPF0_STRAP2_NO_SOFT_RESET_DEV2_F0_MASK       0x00000080L
 +
 +static void quirk_clear_strap_no_soft_reset_dev2_f0(struct pci_dev *dev)
 +{
 +	u32 data;
 +
 +	if (!amd_smn_read(0, AMD_15B8_RCC_DEV2_EPF0_STRAP2, &data)) {
 +		data &= ~AMD_15B8_RCC_DEV2_EPF0_STRAP2_NO_SOFT_RESET_DEV2_F0_MASK;
 +		if (amd_smn_write(0, AMD_15B8_RCC_DEV2_EPF0_STRAP2, data))
 +			pci_err(dev, "Failed to write data 0x%x\n", data);
 +	} else {
 +		pci_err(dev, "Failed to read data\n");
 +	}
 +}
 +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, 0x15b8, quirk_clear_strap_no_soft_reset_dev2_f0);
 +#endif
++
+ /*
+  * When returning from D3cold to D0, firmware on some Google Coral and Reef
+  * family Chromebooks with Intel Apollo Lake SoC clobbers the headers of
+  * both the L1 PM Substates capability and the previous capability for the
+  * "Celeron N3350/Pentium N4200/Atom E3900 Series PCI Express Port B #1".
+  *
+  * Save those values at enumeration-time and restore them at resume.
+  */
+ 
+ static u16 prev_cap, l1ss_cap;
+ static u32 prev_header, l1ss_header;
+ 
+ static void chromeos_save_apl_pci_l1ss_capability(struct pci_dev *dev)
+ {
+ 	int pos = PCI_CFG_SPACE_SIZE, prev = 0;
+ 	u32 header, pheader = 0;
+ 
+ 	while (pos) {
+ 		pci_read_config_dword(dev, pos, &header);
+ 		if (PCI_EXT_CAP_ID(header) == PCI_EXT_CAP_ID_L1SS) {
+ 			prev_cap = prev;
+ 			prev_header = pheader;
+ 			l1ss_cap = pos;
+ 			l1ss_header = header;
+ 			return;
+ 		}
+ 
+ 		prev = pos;
+ 		pheader = header;
+ 		pos = PCI_EXT_CAP_NEXT(header);
+ 	}
+ }
+ 
+ static void chromeos_fixup_apl_pci_l1ss_capability(struct pci_dev *dev)
+ {
+ 	u32 header;
+ 
+ 	if (!prev_cap || !prev_header || !l1ss_cap || !l1ss_header)
+ 		return;
+ 
+ 	/* Fixup the header of L1SS Capability if missing */
+ 	pci_read_config_dword(dev, l1ss_cap, &header);
+ 	if (header != l1ss_header) {
+ 		pci_write_config_dword(dev, l1ss_cap, l1ss_header);
+ 		pci_info(dev, "restore L1SS Capability header (was %#010x now %#010x)\n",
+ 			 header, l1ss_header);
+ 	}
+ 
+ 	/* Fixup the link to L1SS Capability if missing */
+ 	pci_read_config_dword(dev, prev_cap, &header);
+ 	if (header != prev_header) {
+ 		pci_write_config_dword(dev, prev_cap, prev_header);
+ 		pci_info(dev, "restore previous Capability header (was %#010x now %#010x)\n",
+ 			 header, prev_header);
+ 	}
+ }
+ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x5ad6, chromeos_save_apl_pci_l1ss_capability);
+ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, 0x5ad6, chromeos_fixup_apl_pci_l1ss_capability);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-04-17 12:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-21 23:46 linux-next: manual merge of the pci tree with the origin tree Stephen Rothwell
2023-04-17 12:45 broonie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).