* [PATCH] PCI: move cfg space size (256/4096) macros to pci_regs.h
@ 2016-09-22 1:05 Wang Sheng-Hui
2016-11-11 20:51 ` Bjorn Helgaas
0 siblings, 1 reply; 3+ messages in thread
From: Wang Sheng-Hui @ 2016-09-22 1:05 UTC (permalink / raw)
To: yu.zhao, jbarnes, alex.williamson; +Cc: bhelgaas, linux-pci, kvm, linux-kernel
This is a cleanup that moves PCI configuration space size
macros (PCI_CFG_SPACE_SIZE and PCI_CFG_SPACE_EXP_SIZE) from
drivers/pci/pci.h to include/uapi/linux/pci_regs.h
So that the macros can be used by more drivers and eliminate
potential duplicate definition.
Signed-off-by: Wang Sheng-Hui <shhuiw@foxmail.com>
---
drivers/pci/pci.h | 3 ---
drivers/vfio/pci/vfio_pci_config.c | 2 --
include/uapi/linux/pci_regs.h | 7 +++++++
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index 9730c47..12d651a 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -1,9 +1,6 @@
#ifndef DRIVERS_PCI_H
#define DRIVERS_PCI_H
-#define PCI_CFG_SPACE_SIZE 256
-#define PCI_CFG_SPACE_EXP_SIZE 4096
-
#define PCI_FIND_CAP_TTL 48
extern const unsigned char pcie_link_speed[];
diff --git a/drivers/vfio/pci/vfio_pci_config.c b/drivers/vfio/pci/vfio_pci_config.c
index 688691d..8dc8a5a 100644
--- a/drivers/vfio/pci/vfio_pci_config.c
+++ b/drivers/vfio/pci/vfio_pci_config.c
@@ -31,8 +31,6 @@
#include "vfio_pci_private.h"
-#define PCI_CFG_SPACE_SIZE 256
-
/* Fake capability ID for standard config space */
#define PCI_CAP_ID_BASIC 0
diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h
index 4040951..a07c53c 100644
--- a/include/uapi/linux/pci_regs.h
+++ b/include/uapi/linux/pci_regs.h
@@ -23,6 +23,13 @@
#define LINUX_PCI_REGS_H
/*
+ * Under PCI, each device has 256 bytes of configuration address space.
+ * Under PCIe, each device has 4096 bytes of configuration address space.
+ */
+#define PCI_CFG_SPACE_SIZE 256
+#define PCI_CFG_SPACE_EXP_SIZE 4096
+
+/*
* Under PCI, each device has 256 bytes of configuration address space,
* of which the first 64 bytes are standardized as follows:
*/
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] PCI: move cfg space size (256/4096) macros to pci_regs.h
2016-09-22 1:05 [PATCH] PCI: move cfg space size (256/4096) macros to pci_regs.h Wang Sheng-Hui
@ 2016-11-11 20:51 ` Bjorn Helgaas
2016-11-12 1:25 ` Wang Sheng-Hui
0 siblings, 1 reply; 3+ messages in thread
From: Bjorn Helgaas @ 2016-11-11 20:51 UTC (permalink / raw)
To: Wang Sheng-Hui
Cc: yu.zhao, jbarnes, alex.williamson, bhelgaas, linux-pci, kvm,
linux-kernel
On Thu, Sep 22, 2016 at 09:05:46AM +0800, Wang Sheng-Hui wrote:
> This is a cleanup that moves PCI configuration space size
> macros (PCI_CFG_SPACE_SIZE and PCI_CFG_SPACE_EXP_SIZE) from
> drivers/pci/pci.h to include/uapi/linux/pci_regs.h
>
> So that the macros can be used by more drivers and eliminate
> potential duplicate definition.
>
> Signed-off-by: Wang Sheng-Hui <shhuiw@foxmail.com>
Applied to pci/misc for v4.10, thanks!
I updated the comment to include PCI-X details, since the extended config
space applies to PCI-X Mode 2 devices as well as to PCIe devices:
+ * Conventional PCI and PCI-X Mode 1 devices have 256 bytes of
+ * configuration space. PCI-X Mode 2 and PCIe devices have 4096 bytes of
+ * configuration space.
> ---
> drivers/pci/pci.h | 3 ---
> drivers/vfio/pci/vfio_pci_config.c | 2 --
> include/uapi/linux/pci_regs.h | 7 +++++++
> 3 files changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
> index 9730c47..12d651a 100644
> --- a/drivers/pci/pci.h
> +++ b/drivers/pci/pci.h
> @@ -1,9 +1,6 @@
> #ifndef DRIVERS_PCI_H
> #define DRIVERS_PCI_H
>
> -#define PCI_CFG_SPACE_SIZE 256
> -#define PCI_CFG_SPACE_EXP_SIZE 4096
> -
> #define PCI_FIND_CAP_TTL 48
>
> extern const unsigned char pcie_link_speed[];
> diff --git a/drivers/vfio/pci/vfio_pci_config.c b/drivers/vfio/pci/vfio_pci_config.c
> index 688691d..8dc8a5a 100644
> --- a/drivers/vfio/pci/vfio_pci_config.c
> +++ b/drivers/vfio/pci/vfio_pci_config.c
> @@ -31,8 +31,6 @@
>
> #include "vfio_pci_private.h"
>
> -#define PCI_CFG_SPACE_SIZE 256
> -
> /* Fake capability ID for standard config space */
> #define PCI_CAP_ID_BASIC 0
>
> diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h
> index 4040951..a07c53c 100644
> --- a/include/uapi/linux/pci_regs.h
> +++ b/include/uapi/linux/pci_regs.h
> @@ -23,6 +23,13 @@
> #define LINUX_PCI_REGS_H
>
> /*
> + * Under PCI, each device has 256 bytes of configuration address space.
> + * Under PCIe, each device has 4096 bytes of configuration address space.
> + */
> +#define PCI_CFG_SPACE_SIZE 256
> +#define PCI_CFG_SPACE_EXP_SIZE 4096
> +
> +/*
> * Under PCI, each device has 256 bytes of configuration address space,
> * of which the first 64 bytes are standardized as follows:
> */
> --
> 2.7.4
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] PCI: move cfg space size (256/4096) macros to pci_regs.h
2016-11-11 20:51 ` Bjorn Helgaas
@ 2016-11-12 1:25 ` Wang Sheng-Hui
0 siblings, 0 replies; 3+ messages in thread
From: Wang Sheng-Hui @ 2016-11-12 1:25 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: yu.zhao, jbarnes, alex.williamson, bhelgaas, linux-pci, kvm,
linux-kernel
Thanks!
Regards,
Wang Sheng-Hui
------------------ Original ------------------
From: "Bjorn Helgaas";<helgaas@kernel.org>;
Date: Sat, Nov 12, 2016 04:51 AM
To: "Wang Sheng-Hui"<shhuiw@foxmail.com>;
Cc: "yu.zhao"<yu.zhao@intel.com>; "jbarnes"<jbarnes@virtuousgeek.org>; "alex.williamson"<alex.williamson@redhat.com>; "bhelgaas"<bhelgaas@google.com>; "linux-pci"<linux-pci@vger.kernel.org>; "kvm"<kvm@vger.kernel.org>; "linux-kernel"<linux-kernel@vger.kernel.org>;
Subject: Re: [PATCH] PCI: move cfg space size (256/4096) macros to pci_regs.h
On Thu, Sep 22, 2016 at 09:05:46AM +0800, Wang Sheng-Hui wrote:
> This is a cleanup that moves PCI configuration space size
> macros (PCI_CFG_SPACE_SIZE and PCI_CFG_SPACE_EXP_SIZE) from
> drivers/pci/pci.h to include/uapi/linux/pci_regs.h
>
> So that the macros can be used by more drivers and eliminate
> potential duplicate definition.
>
> Signed-off-by: Wang Sheng-Hui <shhuiw@foxmail.com>
Applied to pci/misc for v4.10, thanks!
I updated the comment to include PCI-X details, since the extended config
space applies to PCI-X Mode 2 devices as well as to PCIe devices:
+ * Conventional PCI and PCI-X Mode 1 devices have 256 bytes of
+ * configuration space. PCI-X Mode 2 and PCIe devices have 4096 bytes of
+ * configuration space.
> ---
> drivers/pci/pci.h | 3 ---
> drivers/vfio/pci/vfio_pci_config.c | 2 --
> include/uapi/linux/pci_regs.h | 7 +++++++
> 3 files changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
> index 9730c47..12d651a 100644
> --- a/drivers/pci/pci.h
> +++ b/drivers/pci/pci.h
> @@ -1,9 +1,6 @@
> #ifndef DRIVERS_PCI_H
> #define DRIVERS_PCI_H
>
> -#define PCI_CFG_SPACE_SIZE 256
> -#define PCI_CFG_SPACE_EXP_SIZE 4096
> -
> #define PCI_FIND_CAP_TTL 48
>
> extern const unsigned char pcie_link_speed[];
> diff --git a/drivers/vfio/pci/vfio_pci_config.c b/drivers/vfio/pci/vfio_pci_config.c
> index 688691d..8dc8a5a 100644
> --- a/drivers/vfio/pci/vfio_pci_config.c
> +++ b/drivers/vfio/pci/vfio_pci_config.c
> @@ -31,8 +31,6 @@
>
> #include "vfio_pci_private.h"
>
> -#define PCI_CFG_SPACE_SIZE 256
> -
> /* Fake capability ID for standard config space */
> #define PCI_CAP_ID_BASIC 0
>
> diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h
> index 4040951..a07c53c 100644
> --- a/include/uapi/linux/pci_regs.h
> +++ b/include/uapi/linux/pci_regs.h
> @@ -23,6 +23,13 @@
> #define LINUX_PCI_REGS_H
>
> /*
> + * Under PCI, each device has 256 bytes of configuration address space.
> + * Under PCIe, each device has 4096 bytes of configuration address space.
> + */
> +#define PCI_CFG_SPACE_SIZE 256
> +#define PCI_CFG_SPACE_EXP_SIZE 4096
> +
> +/*
> * Under PCI, each device has 256 bytes of configuration address space,
> * of which the first 64 bytes are standardized as follows:
> */
> --
> 2.7.4
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-11-12 1:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-22 1:05 [PATCH] PCI: move cfg space size (256/4096) macros to pci_regs.h Wang Sheng-Hui
2016-11-11 20:51 ` Bjorn Helgaas
2016-11-12 1:25 ` Wang Sheng-Hui
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).