All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: bhelgaas@google.com, linux-pci@vger.kernel.org,
	linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org,
	Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH 2/3] pci: move pci-bridge.h out of asm-generic
Date: Mon, 7 Mar 2016 10:35:29 -0600	[thread overview]
Message-ID: <20160307163529.GA13818@localhost> (raw)
In-Reply-To: <1457277475-8913-3-git-send-email-hch@lst.de>

[+cc Arnd]

On Sun, Mar 06, 2016 at 04:17:54PM +0100, Christoph Hellwig wrote:
> This isn't an asm-generic header, but something used both by common code
> and architectures.

I did something similar with
http://lkml.kernel.org/r/20160202193026.9258.7573.stgit@bhelgaas-glaptop2.roam.corp.google.com

The generic things in include/asm-generic/pci-bridge.h weren't really
bridge-related, so I moved them to include/linux/pci.h instead of creating
include/linux/pci-bridge.h.

Then include/asm-generic/pci-bridge.h was empty, so I removed it and the
includes of it.

There were a few arch-specific asm/pci-bridge.h files, but they do contain
arch-specific things, and they're only included by arch code, so I left
them alone.

My changes are in linux-next, and I plan to merge them during the v4.6
merge window.

Bjorn

> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  arch/alpha/include/asm/pci.h          |  2 +-
>  arch/arm/include/asm/pci.h            |  2 +-
>  arch/arm64/include/asm/pci.h          |  2 +-
>  arch/mips/include/asm/pci.h           |  2 +-
>  arch/powerpc/include/asm/pci-bridge.h |  2 +-
>  arch/unicore32/include/asm/pci.h      |  2 +-
>  arch/x86/pci/common.c                 |  2 +-
>  drivers/of/of_pci.c                   |  2 +-
>  drivers/pci/pci.c                     |  2 +-
>  drivers/pci/probe.c                   |  2 +-
>  drivers/pci/setup-bus.c               |  2 +-
>  include/asm-generic/pci-bridge.h      | 74 -----------------------------------
>  include/linux/pci-bridge.h            | 74 +++++++++++++++++++++++++++++++++++
>  13 files changed, 85 insertions(+), 85 deletions(-)
>  delete mode 100644 include/asm-generic/pci-bridge.h
>  create mode 100644 include/linux/pci-bridge.h
> 
> diff --git a/arch/alpha/include/asm/pci.h b/arch/alpha/include/asm/pci.h
> index 98f2eee..a742497 100644
> --- a/arch/alpha/include/asm/pci.h
> +++ b/arch/alpha/include/asm/pci.h
> @@ -7,7 +7,7 @@
>  #include <linux/dma-mapping.h>
>  #include <linux/scatterlist.h>
>  #include <asm/machvec.h>
> -#include <asm-generic/pci-bridge.h>
> +#include <linux/pci-bridge.h>
>  
>  /*
>   * The following structure is used to manage multiple PCI busses.
> diff --git a/arch/arm/include/asm/pci.h b/arch/arm/include/asm/pci.h
> index a563544..f869627 100644
> --- a/arch/arm/include/asm/pci.h
> +++ b/arch/arm/include/asm/pci.h
> @@ -3,7 +3,7 @@
>  
>  #ifdef __KERNEL__
>  #include <asm-generic/pci-dma-compat.h>
> -#include <asm-generic/pci-bridge.h>
> +#include <linux/pci-bridge.h>
>  
>  #include <asm/mach/pci.h> /* for pci_sys_data */
>  
> diff --git a/arch/arm64/include/asm/pci.h b/arch/arm64/include/asm/pci.h
> index b008a72..a44f008 100644
> --- a/arch/arm64/include/asm/pci.h
> +++ b/arch/arm64/include/asm/pci.h
> @@ -7,7 +7,7 @@
>  #include <linux/dma-mapping.h>
>  
>  #include <asm/io.h>
> -#include <asm-generic/pci-bridge.h>
> +#include <linux/pci-bridge.h>
>  #include <asm-generic/pci-dma-compat.h>
>  
>  #define PCIBIOS_MIN_IO		0x1000
> diff --git a/arch/mips/include/asm/pci.h b/arch/mips/include/asm/pci.h
> index 98c31e5..bb94de4 100644
> --- a/arch/mips/include/asm/pci.h
> +++ b/arch/mips/include/asm/pci.h
> @@ -102,7 +102,7 @@ static inline void pci_resource_to_user(const struct pci_dev *dev, int bar,
>  #include <linux/scatterlist.h>
>  #include <linux/string.h>
>  #include <asm/io.h>
> -#include <asm-generic/pci-bridge.h>
> +#include <linux/pci-bridge.h>
>  
>  struct pci_dev;
>  
> diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h
> index 54843ca..fd0363d 100644
> --- a/arch/powerpc/include/asm/pci-bridge.h
> +++ b/arch/powerpc/include/asm/pci-bridge.h
> @@ -10,7 +10,7 @@
>  #include <linux/pci.h>
>  #include <linux/list.h>
>  #include <linux/ioport.h>
> -#include <asm-generic/pci-bridge.h>
> +#include <linux/pci-bridge.h>
>  
>  struct device_node;
>  
> diff --git a/arch/unicore32/include/asm/pci.h b/arch/unicore32/include/asm/pci.h
> index 38b3f37..e36ca77 100644
> --- a/arch/unicore32/include/asm/pci.h
> +++ b/arch/unicore32/include/asm/pci.h
> @@ -14,7 +14,7 @@
>  
>  #ifdef __KERNEL__
>  #include <asm-generic/pci-dma-compat.h>
> -#include <asm-generic/pci-bridge.h>
> +#include <linux/pci-bridge.h>
>  #include <asm-generic/pci.h>
>  #include <mach/hardware.h> /* for PCIBIOS_MIN_* */
>  
> diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
> index d34b511..edd0022 100644
> --- a/arch/x86/pci/common.c
> +++ b/arch/x86/pci/common.c
> @@ -12,7 +12,7 @@
>  #include <linux/dmi.h>
>  #include <linux/slab.h>
>  
> -#include <asm-generic/pci-bridge.h>
> +#include <linux/pci-bridge.h>
>  #include <asm/acpi.h>
>  #include <asm/segment.h>
>  #include <asm/io.h>
> diff --git a/drivers/of/of_pci.c b/drivers/of/of_pci.c
> index b1449f7..64705ef 100644
> --- a/drivers/of/of_pci.c
> +++ b/drivers/of/of_pci.c
> @@ -5,7 +5,7 @@
>  #include <linux/of_device.h>
>  #include <linux/of_pci.h>
>  #include <linux/slab.h>
> -#include <asm-generic/pci-bridge.h>
> +#include <linux/pci-bridge.h>
>  
>  static inline int __of_pci_pci_compare(struct device_node *node,
>  				       unsigned int data)
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index 602eb42..5e5a196 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -25,7 +25,7 @@
>  #include <linux/device.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/pci_hotplug.h>
> -#include <asm-generic/pci-bridge.h>
> +#include <linux/pci-bridge.h>
>  #include <asm/setup.h>
>  #include <linux/aer.h>
>  #include "pci.h"
> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
> index 6d7ab9b..af4dad3 100644
> --- a/drivers/pci/probe.c
> +++ b/drivers/pci/probe.c
> @@ -15,7 +15,7 @@
>  #include <linux/pci-aspm.h>
>  #include <linux/aer.h>
>  #include <linux/acpi.h>
> -#include <asm-generic/pci-bridge.h>
> +#include <linux/pci-bridge.h>
>  #include "pci.h"
>  
>  #define CARDBUS_LATENCY_TIMER	176	/* secondary latency timer */
> diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
> index 7796d0a..03c047c 100644
> --- a/drivers/pci/setup-bus.c
> +++ b/drivers/pci/setup-bus.c
> @@ -25,7 +25,7 @@
>  #include <linux/ioport.h>
>  #include <linux/cache.h>
>  #include <linux/slab.h>
> -#include <asm-generic/pci-bridge.h>
> +#include <linux/pci-bridge.h>
>  #include "pci.h"
>  
>  unsigned int pci_flags;
> diff --git a/include/asm-generic/pci-bridge.h b/include/asm-generic/pci-bridge.h
> deleted file mode 100644
> index 20db2e5..0000000
> --- a/include/asm-generic/pci-bridge.h
> +++ /dev/null
> @@ -1,74 +0,0 @@
> -/*
> - * This program is free software; you can redistribute it and/or
> - * modify it under the terms of the GNU General Public License
> - * as published by the Free Software Foundation; either version
> - * 2 of the License, or (at your option) any later version.
> - */
> -#ifndef _ASM_GENERIC_PCI_BRIDGE_H
> -#define _ASM_GENERIC_PCI_BRIDGE_H
> -
> -#ifdef __KERNEL__
> -
> -enum {
> -	/* Force re-assigning all resources (ignore firmware
> -	 * setup completely)
> -	 */
> -	PCI_REASSIGN_ALL_RSRC	= 0x00000001,
> -
> -	/* Re-assign all bus numbers */
> -	PCI_REASSIGN_ALL_BUS	= 0x00000002,
> -
> -	/* Do not try to assign, just use existing setup */
> -	PCI_PROBE_ONLY		= 0x00000004,
> -
> -	/* Don't bother with ISA alignment unless the bridge has
> -	 * ISA forwarding enabled
> -	 */
> -	PCI_CAN_SKIP_ISA_ALIGN	= 0x00000008,
> -
> -	/* Enable domain numbers in /proc */
> -	PCI_ENABLE_PROC_DOMAINS	= 0x00000010,
> -	/* ... except for domain 0 */
> -	PCI_COMPAT_DOMAIN_0	= 0x00000020,
> -
> -	/* PCIe downstream ports are bridges that normally lead to only a
> -	 * device 0, but if this is set, we scan all possible devices, not
> -	 * just device 0.
> -	 */
> -	PCI_SCAN_ALL_PCIE_DEVS	= 0x00000040,
> -};
> -
> -#ifdef CONFIG_PCI
> -extern unsigned int pci_flags;
> -
> -static inline void pci_set_flags(int flags)
> -{
> -	pci_flags = flags;
> -}
> -
> -static inline void pci_add_flags(int flags)
> -{
> -	pci_flags |= flags;
> -}
> -
> -static inline void pci_clear_flags(int flags)
> -{
> -	pci_flags &= ~flags;
> -}
> -
> -static inline int pci_has_flag(int flag)
> -{
> -	return pci_flags & flag;
> -}
> -#else
> -static inline void pci_set_flags(int flags) { }
> -static inline void pci_add_flags(int flags) { }
> -static inline void pci_clear_flags(int flags) { }
> -static inline int pci_has_flag(int flag)
> -{
> -	return 0;
> -}
> -#endif	/* CONFIG_PCI */
> -
> -#endif	/* __KERNEL__ */
> -#endif	/* _ASM_GENERIC_PCI_BRIDGE_H */
> diff --git a/include/linux/pci-bridge.h b/include/linux/pci-bridge.h
> new file mode 100644
> index 0000000..25416e0
> --- /dev/null
> +++ b/include/linux/pci-bridge.h
> @@ -0,0 +1,74 @@
> +/*
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License
> + * as published by the Free Software Foundation; either version
> + * 2 of the License, or (at your option) any later version.
> + */
> +#ifndef _LINUX_PCI_BRIDGE_H
> +#define _LINUX_PCI_BRIDGE_H
> +
> +#ifdef __KERNEL__
> +
> +enum {
> +	/* Force re-assigning all resources (ignore firmware
> +	 * setup completely)
> +	 */
> +	PCI_REASSIGN_ALL_RSRC	= 0x00000001,
> +
> +	/* Re-assign all bus numbers */
> +	PCI_REASSIGN_ALL_BUS	= 0x00000002,
> +
> +	/* Do not try to assign, just use existing setup */
> +	PCI_PROBE_ONLY		= 0x00000004,
> +
> +	/* Don't bother with ISA alignment unless the bridge has
> +	 * ISA forwarding enabled
> +	 */
> +	PCI_CAN_SKIP_ISA_ALIGN	= 0x00000008,
> +
> +	/* Enable domain numbers in /proc */
> +	PCI_ENABLE_PROC_DOMAINS	= 0x00000010,
> +	/* ... except for domain 0 */
> +	PCI_COMPAT_DOMAIN_0	= 0x00000020,
> +
> +	/* PCIe downstream ports are bridges that normally lead to only a
> +	 * device 0, but if this is set, we scan all possible devices, not
> +	 * just device 0.
> +	 */
> +	PCI_SCAN_ALL_PCIE_DEVS	= 0x00000040,
> +};
> +
> +#ifdef CONFIG_PCI
> +extern unsigned int pci_flags;
> +
> +static inline void pci_set_flags(int flags)
> +{
> +	pci_flags = flags;
> +}
> +
> +static inline void pci_add_flags(int flags)
> +{
> +	pci_flags |= flags;
> +}
> +
> +static inline void pci_clear_flags(int flags)
> +{
> +	pci_flags &= ~flags;
> +}
> +
> +static inline int pci_has_flag(int flag)
> +{
> +	return pci_flags & flag;
> +}
> +#else
> +static inline void pci_set_flags(int flags) { }
> +static inline void pci_add_flags(int flags) { }
> +static inline void pci_clear_flags(int flags) { }
> +static inline int pci_has_flag(int flag)
> +{
> +	return 0;
> +}
> +#endif	/* CONFIG_PCI */
> +
> +#endif	/* __KERNEL__ */
> +#endif	/* _LINUX_PCI_BRIDGE_H */
> -- 
> 2.1.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-arch" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2016-03-07 16:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-06 15:17 two small PCI header cleanups Christoph Hellwig
2016-03-06 15:17 ` [PATCH 1/3] frv: remove stray pci_{alloc,free}_consistent declaration Christoph Hellwig
2016-03-07 17:57   ` Bjorn Helgaas
2016-03-06 15:17 ` [PATCH 2/3] pci: move pci-bridge.h out of asm-generic Christoph Hellwig
2016-03-07 16:35   ` Bjorn Helgaas [this message]
2016-03-07 16:37     ` Christoph Hellwig
2016-03-06 15:17 ` [PATCH 3/3] pci: move pci_dma_* helpers to common code Christoph Hellwig
2016-03-07 18:28   ` Bjorn Helgaas
2016-03-08  7:32     ` Christoph Hellwig
2016-03-08 17:43     ` Bjorn Helgaas
2016-03-08 17:49       ` Christoph Hellwig
2016-03-08 17:55         ` Bjorn Helgaas
2016-03-06 20:47 ` two small PCI header cleanups Arnd Bergmann
2016-03-06 20:52   ` Christoph Hellwig

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=20160307163529.GA13818@localhost \
    --to=helgaas@kernel.org \
    --cc=arnd@arndb.de \
    --cc=bhelgaas@google.com \
    --cc=hch@lst.de \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.