Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1259110 > unrolled thread

[PATCH v4 4/7] PCI: Add fwnode_handle to pci_sysdata

Started byjakeo@microsoft.com
First post2015-10-30 00:50 +0100
Last post2015-10-30 17:10 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v4 4/7] PCI: Add fwnode_handle to pci_sysdata jakeo@microsoft.com - 2015-10-30 00:50 +0100
    Re: [PATCH v4 4/7] PCI: Add fwnode_handle to pci_sysdata Jiang Liu <jiang.liu@linux.intel.com> - 2015-10-30 03:00 +0100
      RE: [PATCH v4 4/7] PCI: Add fwnode_handle to pci_sysdata Jake Oshins <jakeo@microsoft.com> - 2015-10-30 17:10 +0100

#1259110 — [PATCH v4 4/7] PCI: Add fwnode_handle to pci_sysdata

Fromjakeo@microsoft.com
Date2015-10-30 00:50 +0100
Subject[PATCH v4 4/7] PCI: Add fwnode_handle to pci_sysdata
Message-ID<qp57c-6Mj-15@gated-at.bofh.it>
From: Jake Oshins <jakeo@microsoft.com>

This patch adds an fwnode_handle to struct pci_sysdata, which is
used by the next patch in the series when trying to locate an
IRQ domain associated with a root PCI bus.

Signed-off-by: Jake Oshins <jakeo@microsoft.com>
---
 arch/x86/include/asm/pci.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h
index 4625943..10213a1 100644
--- a/arch/x86/include/asm/pci.h
+++ b/arch/x86/include/asm/pci.h
@@ -20,6 +20,9 @@ struct pci_sysdata {
 #ifdef CONFIG_X86_64
 	void		*iommu;		/* IOMMU private data */
 #endif
+#ifdef CONFIG_PCI_MSI_IRQ_DOMAIN
+	void		*fwnode;	/* IRQ domain for MSI assignment */
+#endif
 };
 
 extern int pci_routeirq;
@@ -41,6 +44,14 @@ static inline int pci_proc_domain(struct pci_bus *bus)
 }
 #endif
 
+#ifdef CONFIG_PCI_MSI_IRQ_DOMAIN
+static inline void *pci_fwnode(struct pci_bus *bus)
+{
+	struct pci_sysdata *sd = bus->sysdata;
+	return sd->fwnode;
+}
+#endif
+
 /* Can be used to override the logic in pci_scan_bus for skipping
    already-configured bus numbers - to be used for buggy BIOSes
    or architectures with incomplete PCI setup by the loader */
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1259165

FromJiang Liu <jiang.liu@linux.intel.com>
Date2015-10-30 03:00 +0100
Message-ID<qp78Z-7WW-3@gated-at.bofh.it>
In reply to#1259110

On 2015/10/30 7:46, jakeo@microsoft.com wrote:
> From: Jake Oshins <jakeo@microsoft.com>
> 
> This patch adds an fwnode_handle to struct pci_sysdata, which is
> used by the next patch in the series when trying to locate an
> IRQ domain associated with a root PCI bus.
> 
> Signed-off-by: Jake Oshins <jakeo@microsoft.com>
> ---
>  arch/x86/include/asm/pci.h | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h
> index 4625943..10213a1 100644
> --- a/arch/x86/include/asm/pci.h
> +++ b/arch/x86/include/asm/pci.h
> @@ -20,6 +20,9 @@ struct pci_sysdata {
>  #ifdef CONFIG_X86_64
>  	void		*iommu;		/* IOMMU private data */
>  #endif
> +#ifdef CONFIG_PCI_MSI_IRQ_DOMAIN
> +	void		*fwnode;	/* IRQ domain for MSI assignment */
> +#endif
>  };
>  
>  extern int pci_routeirq;
> @@ -41,6 +44,14 @@ static inline int pci_proc_domain(struct pci_bus *bus)
>  }
>  #endif
>  
> +#ifdef CONFIG_PCI_MSI_IRQ_DOMAIN
> +static inline void *pci_fwnode(struct pci_bus *bus)
> +{
> +	struct pci_sysdata *sd = bus->sysdata;
> +	return sd->fwnode;
> +}
> +#endif
Hi Jakeo,
	I would be better that if the function name indicates
that we are getting PCI host bridge(root bus) firmware node.
And you also need some magic here to avoid breaking compilation
on other archs:
in arch/x86/include/asm/pci.h
#define pci_fwnode		pci_fwnode

in include/asm-generic/pci.h
#ifndef pci_fwnode
#define pci_fwnode(bus)         ((void)(bus),NULL)
#endif

Thanks,
Gerry
> +
>  /* Can be used to override the logic in pci_scan_bus for skipping
>     already-configured bus numbers - to be used for buggy BIOSes
>     or architectures with incomplete PCI setup by the loader */
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1259600

FromJake Oshins <jakeo@microsoft.com>
Date2015-10-30 17:10 +0100
Message-ID<qpkpz-7XQ-1@gated-at.bofh.it>
In reply to#1259165
> -----Original Message-----
> From: Jiang Liu [mailto:jiang.liu@linux.intel.com]
> Sent: Thursday, October 29, 2015 6:55 PM
> To: Jake Oshins <jakeo@microsoft.com>; gregkh@linuxfoundation.org; KY
> Srinivasan <kys@microsoft.com>; linux-kernel@vger.kernel.org;
> devel@linuxdriverproject.org; olaf@aepfle.de; apw@canonical.com;
> vkuznets@redhat.com; tglx@redhat.com; Haiyang Zhang
> <haiyangz@microsoft.com>; marc.zyngier@arm.com;
> bhelgaas@google.com; linux-pci@vger.kernel.org
> Subject: Re: [PATCH v4 4/7] PCI: Add fwnode_handle to pci_sysdata
> 


> >
> > +#ifdef CONFIG_PCI_MSI_IRQ_DOMAIN
> > +static inline void *pci_fwnode(struct pci_bus *bus)
> > +{
> > +	struct pci_sysdata *sd = bus->sysdata;
> > +	return sd->fwnode;
> > +}
> > +#endif
> Hi Jakeo,
> 	I would be better that if the function name indicates
> that we are getting PCI host bridge(root bus) firmware node.
> And you also need some magic here to avoid breaking compilation
> on other archs:
> in arch/x86/include/asm/pci.h
> #define pci_fwnode		pci_fwnode
> 
> in include/asm-generic/pci.h
> #ifndef pci_fwnode
> #define pci_fwnode(bus)         ((void)(bus),NULL)
> #endif
> 
> Thanks,
> Gerry

Got it.  Thanks.  I'll fix and resend.

-- Jake Oshins
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web