linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@elte.hu>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Jon Derrick <jonathan.derrick@intel.com>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Linux Next Mailing List <linux-next@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: linux-next: manual merge of the tip tree with the pci tree
Date: Tue, 13 Oct 2020 14:31:57 +1100	[thread overview]
Message-ID: <20201013143157.17997431@canb.auug.org.au> (raw)
In-Reply-To: <20200925152118.2afb794b@canb.auug.org.au>

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

Hi all,

On Fri, 25 Sep 2020 15:21:18 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> 
> Today's linux-next merge of the tip tree got a conflict in:
> 
>   drivers/pci/controller/vmd.c
> 
> between commit:
> 
>   42443f036042 ("PCI: vmd: Create IRQ Domain configuration helper")
> 
> from the pci tree and commit:
> 
>   585dfe8abc44 ("PCI: vmd: Dont abuse vector irqomain as parent")
> 
> from the tip 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 drivers/pci/controller/vmd.c
> index 3c4418cbde1c,aa1b12bac9a1..000000000000
> --- a/drivers/pci/controller/vmd.c
> +++ b/drivers/pci/controller/vmd.c
> @@@ -304,50 -298,6 +304,50 @@@ static struct msi_domain_info vmd_msi_d
>   	.chip		= &vmd_msi_controller,
>   };
>   
>  +static void vmd_enable_msi_remapping(struct vmd_dev *vmd, bool enable)
>  +{
>  +	u16 reg;
>  +
>  +	pci_read_config_word(vmd->dev, PCI_REG_VMCONFIG, &reg);
>  +	reg = enable ? (reg & ~0x2) : (reg | 0x2);
>  +	pci_write_config_word(vmd->dev, PCI_REG_VMCONFIG, reg);
>  +}
>  +
>  +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)
>  +{
>  +	/*
>  +	 * Some production BIOS won't enable remapping between soft reboots.
>  +	 * Ensure remapping is restored before unloading the driver
>  +	 */
>  +	if (!vmd->msix_count)
>  +		vmd_enable_msi_remapping(vmd, true);
>  +
>  +	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)
>   {
> @@@ -717,12 -568,24 +717,18 @@@ 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;
>  +	if (vmd->msix_count) {
>  +		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]);

This is now a conflict between the pci tree and Linus' tree.

-- 
Cheers,
Stephen Rothwell

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

  reply	other threads:[~2020-10-13  3:32 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-25  5:21 linux-next: manual merge of the tip tree with the pci tree Stephen Rothwell
2020-10-13  3:31 ` Stephen Rothwell [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-10-09  2:47 Stephen Rothwell
2023-10-31 23:15 ` Stephen Rothwell
2022-11-21  4:11 Stephen Rothwell
2020-11-30  4:03 Stephen Rothwell
2020-11-30 10:21 ` Borislav Petkov
2020-11-30 17:40   ` Bjorn Helgaas
2020-10-01  6:38 Stephen Rothwell
2020-10-01 16:06 ` Bjorn Helgaas
2020-09-25  5:35 Stephen Rothwell
2020-10-13  3:34 ` Stephen Rothwell
2017-06-28  3:15 Stephen Rothwell
2017-06-29  0:14 ` Christoph Hellwig
2016-12-09  2:38 Stephen Rothwell
2016-12-12 16:09 ` Bjorn Helgaas
2014-11-24  5:18 Stephen Rothwell
2014-11-24 10:51 ` Thomas Gleixner
2014-03-12 22:18 Mark Brown
2014-03-03  6:07 Stephen Rothwell
2014-03-03  6:03 Stephen Rothwell
2014-03-03  9:26 ` Liviu Dudau
2013-10-29  6:33 Stephen Rothwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201013143157.17997431@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=bhelgaas@google.com \
    --cc=hpa@zytor.com \
    --cc=jonathan.derrick@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).