* [PATCH 00/13] Refactor pci_is_brdige() to simplify code
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linuxppc-dev, linux-kernel, Tony Luck, linux-ia64,
David S. Miller, sparclinux, Thomas Gleixner, x86,
Benjamin Herrenschmidt, Yijing Wang
This patchset rename the current pci_is_bridge() to pci_has_subordinate(),
and introduce a new pci_is_bridge() which determine pci bridge by check
dev->hdr_type. The new one is more accurate. PCIe Spec define the pci
device is a bridge by the dev->hdr_type = 0x01 || 0x02.
Yijing Wang (13):
PCI: rename pci_is_bridge() to pci_has_subordinate()
PCI: Introduce new pci_is_bridge() helper function
PCI: Use new pci_is_bridge() to simplify code
x86/PCI: Use new pci_is_bridge() to simplify code
IA64/PCI: Use new pci_is_bridge() to simplify code
powerpc/PCI: Use new pci_is_bridge() to simplify code
sparc/PCI: Use new pci_is_bridge() to simplify code
PCI, rpaphp: Use new pci_is_bridge() to simplify code
PCI, shpchp: Use new pci_is_bridge() to simplify code
PCI, cpcihp: Use new pci_is_bridge() to simplify code
PCI, acpiphp: Use new pci_is_bridge() to simplify code
PCI, pcmcia: Use new pci_is_bridge() to simplify code
PCI, pciehp: Use new pci_is_bridge() to simplify code
arch/ia64/pci/fixup.c | 4 +---
arch/powerpc/kernel/pci-hotplug.c | 3 +--
arch/powerpc/kernel/pci_of_scan.c | 3 +--
arch/sparc/kernel/pci.c | 3 +--
arch/x86/pci/fixup.c | 4 +---
drivers/pci/hotplug/acpiphp_glue.c | 3 +--
drivers/pci/hotplug/cpci_hotplug_pci.c | 3 +--
drivers/pci/hotplug/pciehp_pci.c | 3 +--
drivers/pci/hotplug/rpadlpar_core.c | 3 +--
drivers/pci/hotplug/shpchp_pci.c | 3 +--
drivers/pci/pci-acpi.c | 8 +-------
drivers/pci/pci-driver.c | 8 ++++----
drivers/pci/pci.h | 2 +-
drivers/pci/probe.c | 3 +--
drivers/pci/setup-bus.c | 4 +---
drivers/pcmcia/cardbus.c | 3 +--
include/linux/pci.h | 6 ++++++
17 files changed, 25 insertions(+), 41 deletions(-)
^ permalink raw reply [flat|nested] 77+ messages in thread
* [PATCH 00/13] Refactor pci_is_brdige() to simplify code
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Tony Luck, linux-ia64, x86, linux-kernel, Yijing Wang,
sparclinux, Thomas Gleixner, linuxppc-dev, David S. Miller
This patchset rename the current pci_is_bridge() to pci_has_subordinate(),
and introduce a new pci_is_bridge() which determine pci bridge by check
dev->hdr_type. The new one is more accurate. PCIe Spec define the pci
device is a bridge by the dev->hdr_type = 0x01 || 0x02.
Yijing Wang (13):
PCI: rename pci_is_bridge() to pci_has_subordinate()
PCI: Introduce new pci_is_bridge() helper function
PCI: Use new pci_is_bridge() to simplify code
x86/PCI: Use new pci_is_bridge() to simplify code
IA64/PCI: Use new pci_is_bridge() to simplify code
powerpc/PCI: Use new pci_is_bridge() to simplify code
sparc/PCI: Use new pci_is_bridge() to simplify code
PCI, rpaphp: Use new pci_is_bridge() to simplify code
PCI, shpchp: Use new pci_is_bridge() to simplify code
PCI, cpcihp: Use new pci_is_bridge() to simplify code
PCI, acpiphp: Use new pci_is_bridge() to simplify code
PCI, pcmcia: Use new pci_is_bridge() to simplify code
PCI, pciehp: Use new pci_is_bridge() to simplify code
arch/ia64/pci/fixup.c | 4 +---
arch/powerpc/kernel/pci-hotplug.c | 3 +--
arch/powerpc/kernel/pci_of_scan.c | 3 +--
arch/sparc/kernel/pci.c | 3 +--
arch/x86/pci/fixup.c | 4 +---
drivers/pci/hotplug/acpiphp_glue.c | 3 +--
drivers/pci/hotplug/cpci_hotplug_pci.c | 3 +--
drivers/pci/hotplug/pciehp_pci.c | 3 +--
drivers/pci/hotplug/rpadlpar_core.c | 3 +--
drivers/pci/hotplug/shpchp_pci.c | 3 +--
drivers/pci/pci-acpi.c | 8 +-------
drivers/pci/pci-driver.c | 8 ++++----
drivers/pci/pci.h | 2 +-
drivers/pci/probe.c | 3 +--
drivers/pci/setup-bus.c | 4 +---
drivers/pcmcia/cardbus.c | 3 +--
include/linux/pci.h | 6 ++++++
17 files changed, 25 insertions(+), 41 deletions(-)
^ permalink raw reply [flat|nested] 77+ messages in thread
* [PATCH 00/13] Refactor pci_is_brdige() to simplify code
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Tony Luck, linux-ia64, x86, linux-kernel, Yijing Wang,
sparclinux, Thomas Gleixner, linuxppc-dev, David S. Miller
This patchset rename the current pci_is_bridge() to pci_has_subordinate(),
and introduce a new pci_is_bridge() which determine pci bridge by check
dev->hdr_type. The new one is more accurate. PCIe Spec define the pci
device is a bridge by the dev->hdr_type = 0x01 || 0x02.
Yijing Wang (13):
PCI: rename pci_is_bridge() to pci_has_subordinate()
PCI: Introduce new pci_is_bridge() helper function
PCI: Use new pci_is_bridge() to simplify code
x86/PCI: Use new pci_is_bridge() to simplify code
IA64/PCI: Use new pci_is_bridge() to simplify code
powerpc/PCI: Use new pci_is_bridge() to simplify code
sparc/PCI: Use new pci_is_bridge() to simplify code
PCI, rpaphp: Use new pci_is_bridge() to simplify code
PCI, shpchp: Use new pci_is_bridge() to simplify code
PCI, cpcihp: Use new pci_is_bridge() to simplify code
PCI, acpiphp: Use new pci_is_bridge() to simplify code
PCI, pcmcia: Use new pci_is_bridge() to simplify code
PCI, pciehp: Use new pci_is_bridge() to simplify code
arch/ia64/pci/fixup.c | 4 +---
arch/powerpc/kernel/pci-hotplug.c | 3 +--
arch/powerpc/kernel/pci_of_scan.c | 3 +--
arch/sparc/kernel/pci.c | 3 +--
arch/x86/pci/fixup.c | 4 +---
drivers/pci/hotplug/acpiphp_glue.c | 3 +--
drivers/pci/hotplug/cpci_hotplug_pci.c | 3 +--
drivers/pci/hotplug/pciehp_pci.c | 3 +--
drivers/pci/hotplug/rpadlpar_core.c | 3 +--
drivers/pci/hotplug/shpchp_pci.c | 3 +--
drivers/pci/pci-acpi.c | 8 +-------
drivers/pci/pci-driver.c | 8 ++++----
drivers/pci/pci.h | 2 +-
drivers/pci/probe.c | 3 +--
drivers/pci/setup-bus.c | 4 +---
drivers/pcmcia/cardbus.c | 3 +--
include/linux/pci.h | 6 ++++++
17 files changed, 25 insertions(+), 41 deletions(-)
^ permalink raw reply [flat|nested] 77+ messages in thread
* [PATCH 00/13] Refactor pci_is_brdige() to simplify code
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linuxppc-dev, linux-kernel, Tony Luck, linux-ia64,
David S. Miller, sparclinux, Thomas Gleixner, x86,
Benjamin Herrenschmidt, Yijing Wang
This patchset rename the current pci_is_bridge() to pci_has_subordinate(),
and introduce a new pci_is_bridge() which determine pci bridge by check
dev->hdr_type. The new one is more accurate. PCIe Spec define the pci
device is a bridge by the dev->hdr_type = 0x01 || 0x02.
Yijing Wang (13):
PCI: rename pci_is_bridge() to pci_has_subordinate()
PCI: Introduce new pci_is_bridge() helper function
PCI: Use new pci_is_bridge() to simplify code
x86/PCI: Use new pci_is_bridge() to simplify code
IA64/PCI: Use new pci_is_bridge() to simplify code
powerpc/PCI: Use new pci_is_bridge() to simplify code
sparc/PCI: Use new pci_is_bridge() to simplify code
PCI, rpaphp: Use new pci_is_bridge() to simplify code
PCI, shpchp: Use new pci_is_bridge() to simplify code
PCI, cpcihp: Use new pci_is_bridge() to simplify code
PCI, acpiphp: Use new pci_is_bridge() to simplify code
PCI, pcmcia: Use new pci_is_bridge() to simplify code
PCI, pciehp: Use new pci_is_bridge() to simplify code
arch/ia64/pci/fixup.c | 4 +---
arch/powerpc/kernel/pci-hotplug.c | 3 +--
arch/powerpc/kernel/pci_of_scan.c | 3 +--
arch/sparc/kernel/pci.c | 3 +--
arch/x86/pci/fixup.c | 4 +---
drivers/pci/hotplug/acpiphp_glue.c | 3 +--
drivers/pci/hotplug/cpci_hotplug_pci.c | 3 +--
drivers/pci/hotplug/pciehp_pci.c | 3 +--
drivers/pci/hotplug/rpadlpar_core.c | 3 +--
drivers/pci/hotplug/shpchp_pci.c | 3 +--
drivers/pci/pci-acpi.c | 8 +-------
drivers/pci/pci-driver.c | 8 ++++----
drivers/pci/pci.h | 2 +-
drivers/pci/probe.c | 3 +--
drivers/pci/setup-bus.c | 4 +---
drivers/pcmcia/cardbus.c | 3 +--
include/linux/pci.h | 6 ++++++
17 files changed, 25 insertions(+), 41 deletions(-)
^ permalink raw reply [flat|nested] 77+ messages in thread
* [PATCH 01/13] PCI: rename pci_is_bridge() to pci_has_subordinate()
2014-04-25 9:18 ` Yijing Wang
(?)
(?)
@ 2014-04-25 9:18 ` Yijing Wang
-1 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linuxppc-dev, linux-kernel, Tony Luck, linux-ia64,
David S. Miller, sparclinux, Thomas Gleixner, x86,
Benjamin Herrenschmidt, Yijing Wang
pci_is_bridge() which seems to determine whether device is a bridge,
returns true only when the subordinate bus exists. This confuses
people. PCI device is a bridge means its header type(bit 0 through 6)
is 0x1(PCI bridge) or 0x2(CardBus bridge). Rename the current
pci_is_bridge() helper function to pci_has_subordinate().
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
drivers/pci/pci-driver.c | 8 ++++----
drivers/pci/pci.h | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index d911e0c..b7850cb 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -580,14 +580,14 @@ static void pci_pm_default_resume(struct pci_dev *pci_dev)
{
pci_fixup_device(pci_fixup_resume, pci_dev);
- if (!pci_is_bridge(pci_dev))
+ if (!pci_has_subordinate(pci_dev))
pci_enable_wake(pci_dev, PCI_D0, false);
}
static void pci_pm_default_suspend(struct pci_dev *pci_dev)
{
/* Disable non-bridge devices without PM support */
- if (!pci_is_bridge(pci_dev))
+ if (!pci_has_subordinate(pci_dev))
pci_disable_enabled_device(pci_dev);
}
@@ -717,7 +717,7 @@ static int pci_pm_suspend_noirq(struct device *dev)
if (!pci_dev->state_saved) {
pci_save_state(pci_dev);
- if (!pci_is_bridge(pci_dev))
+ if (!pci_has_subordinate(pci_dev))
pci_prepare_to_sleep(pci_dev);
}
@@ -971,7 +971,7 @@ static int pci_pm_poweroff_noirq(struct device *dev)
return error;
}
- if (!pci_dev->state_saved && !pci_is_bridge(pci_dev))
+ if (!pci_dev->state_saved && !pci_has_subordinate(pci_dev))
pci_prepare_to_sleep(pci_dev);
/*
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index 6bd0822..65108fc 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -77,7 +77,7 @@ static inline void pci_wakeup_event(struct pci_dev *dev)
pm_wakeup_event(&dev->dev, 100);
}
-static inline bool pci_is_bridge(struct pci_dev *pci_dev)
+static inline bool pci_has_subordinate(struct pci_dev *pci_dev)
{
return !!(pci_dev->subordinate);
}
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 01/13] PCI: rename pci_is_bridge() to pci_has_subordinate()
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Tony Luck, linux-ia64, x86, linux-kernel, Yijing Wang,
sparclinux, Thomas Gleixner, linuxppc-dev, David S. Miller
pci_is_bridge() which seems to determine whether device is a bridge,
returns true only when the subordinate bus exists. This confuses
people. PCI device is a bridge means its header type(bit 0 through 6)
is 0x1(PCI bridge) or 0x2(CardBus bridge). Rename the current
pci_is_bridge() helper function to pci_has_subordinate().
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
drivers/pci/pci-driver.c | 8 ++++----
drivers/pci/pci.h | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index d911e0c..b7850cb 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -580,14 +580,14 @@ static void pci_pm_default_resume(struct pci_dev *pci_dev)
{
pci_fixup_device(pci_fixup_resume, pci_dev);
- if (!pci_is_bridge(pci_dev))
+ if (!pci_has_subordinate(pci_dev))
pci_enable_wake(pci_dev, PCI_D0, false);
}
static void pci_pm_default_suspend(struct pci_dev *pci_dev)
{
/* Disable non-bridge devices without PM support */
- if (!pci_is_bridge(pci_dev))
+ if (!pci_has_subordinate(pci_dev))
pci_disable_enabled_device(pci_dev);
}
@@ -717,7 +717,7 @@ static int pci_pm_suspend_noirq(struct device *dev)
if (!pci_dev->state_saved) {
pci_save_state(pci_dev);
- if (!pci_is_bridge(pci_dev))
+ if (!pci_has_subordinate(pci_dev))
pci_prepare_to_sleep(pci_dev);
}
@@ -971,7 +971,7 @@ static int pci_pm_poweroff_noirq(struct device *dev)
return error;
}
- if (!pci_dev->state_saved && !pci_is_bridge(pci_dev))
+ if (!pci_dev->state_saved && !pci_has_subordinate(pci_dev))
pci_prepare_to_sleep(pci_dev);
/*
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index 6bd0822..65108fc 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -77,7 +77,7 @@ static inline void pci_wakeup_event(struct pci_dev *dev)
pm_wakeup_event(&dev->dev, 100);
}
-static inline bool pci_is_bridge(struct pci_dev *pci_dev)
+static inline bool pci_has_subordinate(struct pci_dev *pci_dev)
{
return !!(pci_dev->subordinate);
}
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 01/13] PCI: rename pci_is_bridge() to pci_has_subordinate()
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Tony Luck, linux-ia64, x86, linux-kernel, Yijing Wang,
sparclinux, Thomas Gleixner, linuxppc-dev, David S. Miller
pci_is_bridge() which seems to determine whether device is a bridge,
returns true only when the subordinate bus exists. This confuses
people. PCI device is a bridge means its header type(bit 0 through 6)
is 0x1(PCI bridge) or 0x2(CardBus bridge). Rename the current
pci_is_bridge() helper function to pci_has_subordinate().
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
drivers/pci/pci-driver.c | 8 ++++----
drivers/pci/pci.h | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index d911e0c..b7850cb 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -580,14 +580,14 @@ static void pci_pm_default_resume(struct pci_dev *pci_dev)
{
pci_fixup_device(pci_fixup_resume, pci_dev);
- if (!pci_is_bridge(pci_dev))
+ if (!pci_has_subordinate(pci_dev))
pci_enable_wake(pci_dev, PCI_D0, false);
}
static void pci_pm_default_suspend(struct pci_dev *pci_dev)
{
/* Disable non-bridge devices without PM support */
- if (!pci_is_bridge(pci_dev))
+ if (!pci_has_subordinate(pci_dev))
pci_disable_enabled_device(pci_dev);
}
@@ -717,7 +717,7 @@ static int pci_pm_suspend_noirq(struct device *dev)
if (!pci_dev->state_saved) {
pci_save_state(pci_dev);
- if (!pci_is_bridge(pci_dev))
+ if (!pci_has_subordinate(pci_dev))
pci_prepare_to_sleep(pci_dev);
}
@@ -971,7 +971,7 @@ static int pci_pm_poweroff_noirq(struct device *dev)
return error;
}
- if (!pci_dev->state_saved && !pci_is_bridge(pci_dev))
+ if (!pci_dev->state_saved && !pci_has_subordinate(pci_dev))
pci_prepare_to_sleep(pci_dev);
/*
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index 6bd0822..65108fc 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -77,7 +77,7 @@ static inline void pci_wakeup_event(struct pci_dev *dev)
pm_wakeup_event(&dev->dev, 100);
}
-static inline bool pci_is_bridge(struct pci_dev *pci_dev)
+static inline bool pci_has_subordinate(struct pci_dev *pci_dev)
{
return !!(pci_dev->subordinate);
}
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 01/13] PCI: rename pci_is_bridge() to pci_has_subordinate()
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linuxppc-dev, linux-kernel, Tony Luck, linux-ia64,
David S. Miller, sparclinux, Thomas Gleixner, x86,
Benjamin Herrenschmidt, Yijing Wang
pci_is_bridge() which seems to determine whether device is a bridge,
returns true only when the subordinate bus exists. This confuses
people. PCI device is a bridge means its header type(bit 0 through 6)
is 0x1(PCI bridge) or 0x2(CardBus bridge). Rename the current
pci_is_bridge() helper function to pci_has_subordinate().
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
drivers/pci/pci-driver.c | 8 ++++----
drivers/pci/pci.h | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index d911e0c..b7850cb 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -580,14 +580,14 @@ static void pci_pm_default_resume(struct pci_dev *pci_dev)
{
pci_fixup_device(pci_fixup_resume, pci_dev);
- if (!pci_is_bridge(pci_dev))
+ if (!pci_has_subordinate(pci_dev))
pci_enable_wake(pci_dev, PCI_D0, false);
}
static void pci_pm_default_suspend(struct pci_dev *pci_dev)
{
/* Disable non-bridge devices without PM support */
- if (!pci_is_bridge(pci_dev))
+ if (!pci_has_subordinate(pci_dev))
pci_disable_enabled_device(pci_dev);
}
@@ -717,7 +717,7 @@ static int pci_pm_suspend_noirq(struct device *dev)
if (!pci_dev->state_saved) {
pci_save_state(pci_dev);
- if (!pci_is_bridge(pci_dev))
+ if (!pci_has_subordinate(pci_dev))
pci_prepare_to_sleep(pci_dev);
}
@@ -971,7 +971,7 @@ static int pci_pm_poweroff_noirq(struct device *dev)
return error;
}
- if (!pci_dev->state_saved && !pci_is_bridge(pci_dev))
+ if (!pci_dev->state_saved && !pci_has_subordinate(pci_dev))
pci_prepare_to_sleep(pci_dev);
/*
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index 6bd0822..65108fc 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -77,7 +77,7 @@ static inline void pci_wakeup_event(struct pci_dev *dev)
pm_wakeup_event(&dev->dev, 100);
}
-static inline bool pci_is_bridge(struct pci_dev *pci_dev)
+static inline bool pci_has_subordinate(struct pci_dev *pci_dev)
{
return !!(pci_dev->subordinate);
}
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 02/13] PCI: Introduce new pci_is_bridge() helper function
2014-04-25 9:18 ` Yijing Wang
(?)
(?)
@ 2014-04-25 9:18 ` Yijing Wang
-1 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linuxppc-dev, linux-kernel, Tony Luck, linux-ia64,
David S. Miller, sparclinux, Thomas Gleixner, x86,
Benjamin Herrenschmidt, Yijing Wang
PCIe Spec define the PCI bridge is the PCI device
which header type(bit 0 through 6) is 0x1(PCI bridge)
or 0x2(CardBus bridge).
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
include/linux/pci.h | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/include/linux/pci.h b/include/linux/pci.h
index aab57b4..827077a 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -477,6 +477,12 @@ static inline bool pci_is_root_bus(struct pci_bus *pbus)
return !(pbus->parent);
}
+static inline bool pci_is_bridge(struct pci_dev *dev)
+{
+ return dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
+ dev->hdr_type == PCI_HEADER_TYPE_CARDBUS;
+}
+
static inline struct pci_dev *pci_upstream_bridge(struct pci_dev *dev)
{
dev = pci_physfn(dev);
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 02/13] PCI: Introduce new pci_is_bridge() helper function
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Tony Luck, linux-ia64, x86, linux-kernel, Yijing Wang,
sparclinux, Thomas Gleixner, linuxppc-dev, David S. Miller
PCIe Spec define the PCI bridge is the PCI device
which header type(bit 0 through 6) is 0x1(PCI bridge)
or 0x2(CardBus bridge).
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
include/linux/pci.h | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/include/linux/pci.h b/include/linux/pci.h
index aab57b4..827077a 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -477,6 +477,12 @@ static inline bool pci_is_root_bus(struct pci_bus *pbus)
return !(pbus->parent);
}
+static inline bool pci_is_bridge(struct pci_dev *dev)
+{
+ return dev->hdr_type = PCI_HEADER_TYPE_BRIDGE ||
+ dev->hdr_type = PCI_HEADER_TYPE_CARDBUS;
+}
+
static inline struct pci_dev *pci_upstream_bridge(struct pci_dev *dev)
{
dev = pci_physfn(dev);
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 02/13] PCI: Introduce new pci_is_bridge() helper function
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Tony Luck, linux-ia64, x86, linux-kernel, Yijing Wang,
sparclinux, Thomas Gleixner, linuxppc-dev, David S. Miller
PCIe Spec define the PCI bridge is the PCI device
which header type(bit 0 through 6) is 0x1(PCI bridge)
or 0x2(CardBus bridge).
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
include/linux/pci.h | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/include/linux/pci.h b/include/linux/pci.h
index aab57b4..827077a 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -477,6 +477,12 @@ static inline bool pci_is_root_bus(struct pci_bus *pbus)
return !(pbus->parent);
}
+static inline bool pci_is_bridge(struct pci_dev *dev)
+{
+ return dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
+ dev->hdr_type == PCI_HEADER_TYPE_CARDBUS;
+}
+
static inline struct pci_dev *pci_upstream_bridge(struct pci_dev *dev)
{
dev = pci_physfn(dev);
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 02/13] PCI: Introduce new pci_is_bridge() helper function
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linuxppc-dev, linux-kernel, Tony Luck, linux-ia64,
David S. Miller, sparclinux, Thomas Gleixner, x86,
Benjamin Herrenschmidt, Yijing Wang
PCIe Spec define the PCI bridge is the PCI device
which header type(bit 0 through 6) is 0x1(PCI bridge)
or 0x2(CardBus bridge).
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
include/linux/pci.h | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/include/linux/pci.h b/include/linux/pci.h
index aab57b4..827077a 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -477,6 +477,12 @@ static inline bool pci_is_root_bus(struct pci_bus *pbus)
return !(pbus->parent);
}
+static inline bool pci_is_bridge(struct pci_dev *dev)
+{
+ return dev->hdr_type = PCI_HEADER_TYPE_BRIDGE ||
+ dev->hdr_type = PCI_HEADER_TYPE_CARDBUS;
+}
+
static inline struct pci_dev *pci_upstream_bridge(struct pci_dev *dev)
{
dev = pci_physfn(dev);
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 03/13] PCI: Use new pci_is_bridge() to simplify code
2014-04-25 9:18 ` Yijing Wang
(?)
(?)
@ 2014-04-25 9:18 ` Yijing Wang
-1 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linuxppc-dev, linux-kernel, Tony Luck, linux-ia64,
David S. Miller, sparclinux, Thomas Gleixner, x86,
Benjamin Herrenschmidt, Yijing Wang
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
drivers/pci/pci-acpi.c | 8 +-------
drivers/pci/probe.c | 3 +--
drivers/pci/setup-bus.c | 4 +---
3 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
index f49abef..ca4927b 100644
--- a/drivers/pci/pci-acpi.c
+++ b/drivers/pci/pci-acpi.c
@@ -309,13 +309,7 @@ static struct acpi_device *acpi_pci_find_companion(struct device *dev)
bool check_children;
u64 addr;
- /*
- * pci_is_bridge() is not suitable here, because pci_dev->subordinate
- * is set only after acpi_pci_find_device() has been called for the
- * given device.
- */
- check_children = pci_dev->hdr_type == PCI_HEADER_TYPE_BRIDGE
- || pci_dev->hdr_type == PCI_HEADER_TYPE_CARDBUS;
+ check_children = pci_is_bridge(pci_dev);
/* Please ref to ACPI spec for the syntax of _ADR */
addr = (PCI_SLOT(pci_dev->devfn) << 16) | PCI_FUNC(pci_dev->devfn);
return acpi_find_child_device(ACPI_COMPANION(dev->parent), addr,
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index ef09f5f..f831dd8 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -1670,8 +1670,7 @@ unsigned int pci_scan_child_bus(struct pci_bus *bus)
for (pass=0; pass < 2; pass++)
list_for_each_entry(dev, &bus->devices, bus_list) {
- if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
- dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)
+ if (pci_is_bridge(dev))
max = pci_scan_bridge(bus, dev, max, pass);
}
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 138bdd6..e399d00 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -1629,9 +1629,7 @@ void pci_assign_unassigned_bus_resources(struct pci_bus *bus)
down_read(&pci_bus_sem);
list_for_each_entry(dev, &bus->devices, bus_list)
- if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
- dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)
- if (dev->subordinate)
+ if (pci_is_bridge(dev) && pci_has_subordinate(dev))
__pci_bus_size_bridges(dev->subordinate,
&add_list);
up_read(&pci_bus_sem);
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 03/13] PCI: Use new pci_is_bridge() to simplify code
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Tony Luck, linux-ia64, x86, linux-kernel, Yijing Wang,
sparclinux, Thomas Gleixner, linuxppc-dev, David S. Miller
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
drivers/pci/pci-acpi.c | 8 +-------
drivers/pci/probe.c | 3 +--
drivers/pci/setup-bus.c | 4 +---
3 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
index f49abef..ca4927b 100644
--- a/drivers/pci/pci-acpi.c
+++ b/drivers/pci/pci-acpi.c
@@ -309,13 +309,7 @@ static struct acpi_device *acpi_pci_find_companion(struct device *dev)
bool check_children;
u64 addr;
- /*
- * pci_is_bridge() is not suitable here, because pci_dev->subordinate
- * is set only after acpi_pci_find_device() has been called for the
- * given device.
- */
- check_children = pci_dev->hdr_type = PCI_HEADER_TYPE_BRIDGE
- || pci_dev->hdr_type = PCI_HEADER_TYPE_CARDBUS;
+ check_children = pci_is_bridge(pci_dev);
/* Please ref to ACPI spec for the syntax of _ADR */
addr = (PCI_SLOT(pci_dev->devfn) << 16) | PCI_FUNC(pci_dev->devfn);
return acpi_find_child_device(ACPI_COMPANION(dev->parent), addr,
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index ef09f5f..f831dd8 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -1670,8 +1670,7 @@ unsigned int pci_scan_child_bus(struct pci_bus *bus)
for (pass=0; pass < 2; pass++)
list_for_each_entry(dev, &bus->devices, bus_list) {
- if (dev->hdr_type = PCI_HEADER_TYPE_BRIDGE ||
- dev->hdr_type = PCI_HEADER_TYPE_CARDBUS)
+ if (pci_is_bridge(dev))
max = pci_scan_bridge(bus, dev, max, pass);
}
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 138bdd6..e399d00 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -1629,9 +1629,7 @@ void pci_assign_unassigned_bus_resources(struct pci_bus *bus)
down_read(&pci_bus_sem);
list_for_each_entry(dev, &bus->devices, bus_list)
- if (dev->hdr_type = PCI_HEADER_TYPE_BRIDGE ||
- dev->hdr_type = PCI_HEADER_TYPE_CARDBUS)
- if (dev->subordinate)
+ if (pci_is_bridge(dev) && pci_has_subordinate(dev))
__pci_bus_size_bridges(dev->subordinate,
&add_list);
up_read(&pci_bus_sem);
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 03/13] PCI: Use new pci_is_bridge() to simplify code
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Tony Luck, linux-ia64, x86, linux-kernel, Yijing Wang,
sparclinux, Thomas Gleixner, linuxppc-dev, David S. Miller
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
drivers/pci/pci-acpi.c | 8 +-------
drivers/pci/probe.c | 3 +--
drivers/pci/setup-bus.c | 4 +---
3 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
index f49abef..ca4927b 100644
--- a/drivers/pci/pci-acpi.c
+++ b/drivers/pci/pci-acpi.c
@@ -309,13 +309,7 @@ static struct acpi_device *acpi_pci_find_companion(struct device *dev)
bool check_children;
u64 addr;
- /*
- * pci_is_bridge() is not suitable here, because pci_dev->subordinate
- * is set only after acpi_pci_find_device() has been called for the
- * given device.
- */
- check_children = pci_dev->hdr_type == PCI_HEADER_TYPE_BRIDGE
- || pci_dev->hdr_type == PCI_HEADER_TYPE_CARDBUS;
+ check_children = pci_is_bridge(pci_dev);
/* Please ref to ACPI spec for the syntax of _ADR */
addr = (PCI_SLOT(pci_dev->devfn) << 16) | PCI_FUNC(pci_dev->devfn);
return acpi_find_child_device(ACPI_COMPANION(dev->parent), addr,
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index ef09f5f..f831dd8 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -1670,8 +1670,7 @@ unsigned int pci_scan_child_bus(struct pci_bus *bus)
for (pass=0; pass < 2; pass++)
list_for_each_entry(dev, &bus->devices, bus_list) {
- if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
- dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)
+ if (pci_is_bridge(dev))
max = pci_scan_bridge(bus, dev, max, pass);
}
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 138bdd6..e399d00 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -1629,9 +1629,7 @@ void pci_assign_unassigned_bus_resources(struct pci_bus *bus)
down_read(&pci_bus_sem);
list_for_each_entry(dev, &bus->devices, bus_list)
- if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
- dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)
- if (dev->subordinate)
+ if (pci_is_bridge(dev) && pci_has_subordinate(dev))
__pci_bus_size_bridges(dev->subordinate,
&add_list);
up_read(&pci_bus_sem);
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 03/13] PCI: Use new pci_is_bridge() to simplify code
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linuxppc-dev, linux-kernel, Tony Luck, linux-ia64,
David S. Miller, sparclinux, Thomas Gleixner, x86,
Benjamin Herrenschmidt, Yijing Wang
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
drivers/pci/pci-acpi.c | 8 +-------
drivers/pci/probe.c | 3 +--
drivers/pci/setup-bus.c | 4 +---
3 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
index f49abef..ca4927b 100644
--- a/drivers/pci/pci-acpi.c
+++ b/drivers/pci/pci-acpi.c
@@ -309,13 +309,7 @@ static struct acpi_device *acpi_pci_find_companion(struct device *dev)
bool check_children;
u64 addr;
- /*
- * pci_is_bridge() is not suitable here, because pci_dev->subordinate
- * is set only after acpi_pci_find_device() has been called for the
- * given device.
- */
- check_children = pci_dev->hdr_type = PCI_HEADER_TYPE_BRIDGE
- || pci_dev->hdr_type = PCI_HEADER_TYPE_CARDBUS;
+ check_children = pci_is_bridge(pci_dev);
/* Please ref to ACPI spec for the syntax of _ADR */
addr = (PCI_SLOT(pci_dev->devfn) << 16) | PCI_FUNC(pci_dev->devfn);
return acpi_find_child_device(ACPI_COMPANION(dev->parent), addr,
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index ef09f5f..f831dd8 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -1670,8 +1670,7 @@ unsigned int pci_scan_child_bus(struct pci_bus *bus)
for (pass=0; pass < 2; pass++)
list_for_each_entry(dev, &bus->devices, bus_list) {
- if (dev->hdr_type = PCI_HEADER_TYPE_BRIDGE ||
- dev->hdr_type = PCI_HEADER_TYPE_CARDBUS)
+ if (pci_is_bridge(dev))
max = pci_scan_bridge(bus, dev, max, pass);
}
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 138bdd6..e399d00 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -1629,9 +1629,7 @@ void pci_assign_unassigned_bus_resources(struct pci_bus *bus)
down_read(&pci_bus_sem);
list_for_each_entry(dev, &bus->devices, bus_list)
- if (dev->hdr_type = PCI_HEADER_TYPE_BRIDGE ||
- dev->hdr_type = PCI_HEADER_TYPE_CARDBUS)
- if (dev->subordinate)
+ if (pci_is_bridge(dev) && pci_has_subordinate(dev))
__pci_bus_size_bridges(dev->subordinate,
&add_list);
up_read(&pci_bus_sem);
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 04/13] x86/PCI: Use new pci_is_bridge() to simplify code
2014-04-25 9:18 ` Yijing Wang
(?)
(?)
@ 2014-04-25 9:18 ` Yijing Wang
-1 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linuxppc-dev, linux-kernel, Tony Luck, linux-ia64,
David S. Miller, sparclinux, Thomas Gleixner, x86,
Benjamin Herrenschmidt, Yijing Wang
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
arch/x86/pci/fixup.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c
index 94ae9ae..e5f000c 100644
--- a/arch/x86/pci/fixup.c
+++ b/arch/x86/pci/fixup.c
@@ -337,9 +337,7 @@ static void pci_fixup_video(struct pci_dev *pdev)
* type BRIDGE, or CARDBUS. Host to PCI controllers use
* PCI header type NORMAL.
*/
- if (bridge
- && ((bridge->hdr_type == PCI_HEADER_TYPE_BRIDGE)
- || (bridge->hdr_type == PCI_HEADER_TYPE_CARDBUS))) {
+ if (bridge && (pci_is_bridge(bridge))) {
pci_read_config_word(bridge, PCI_BRIDGE_CONTROL,
&config);
if (!(config & PCI_BRIDGE_CTL_VGA))
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 04/13] x86/PCI: Use new pci_is_bridge() to simplify code
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Tony Luck, linux-ia64, x86, linux-kernel, Yijing Wang,
sparclinux, Thomas Gleixner, linuxppc-dev, David S. Miller
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
arch/x86/pci/fixup.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c
index 94ae9ae..e5f000c 100644
--- a/arch/x86/pci/fixup.c
+++ b/arch/x86/pci/fixup.c
@@ -337,9 +337,7 @@ static void pci_fixup_video(struct pci_dev *pdev)
* type BRIDGE, or CARDBUS. Host to PCI controllers use
* PCI header type NORMAL.
*/
- if (bridge
- && ((bridge->hdr_type = PCI_HEADER_TYPE_BRIDGE)
- || (bridge->hdr_type = PCI_HEADER_TYPE_CARDBUS))) {
+ if (bridge && (pci_is_bridge(bridge))) {
pci_read_config_word(bridge, PCI_BRIDGE_CONTROL,
&config);
if (!(config & PCI_BRIDGE_CTL_VGA))
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 04/13] x86/PCI: Use new pci_is_bridge() to simplify code
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Tony Luck, linux-ia64, x86, linux-kernel, Yijing Wang,
sparclinux, Thomas Gleixner, linuxppc-dev, David S. Miller
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
arch/x86/pci/fixup.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c
index 94ae9ae..e5f000c 100644
--- a/arch/x86/pci/fixup.c
+++ b/arch/x86/pci/fixup.c
@@ -337,9 +337,7 @@ static void pci_fixup_video(struct pci_dev *pdev)
* type BRIDGE, or CARDBUS. Host to PCI controllers use
* PCI header type NORMAL.
*/
- if (bridge
- && ((bridge->hdr_type == PCI_HEADER_TYPE_BRIDGE)
- || (bridge->hdr_type == PCI_HEADER_TYPE_CARDBUS))) {
+ if (bridge && (pci_is_bridge(bridge))) {
pci_read_config_word(bridge, PCI_BRIDGE_CONTROL,
&config);
if (!(config & PCI_BRIDGE_CTL_VGA))
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 04/13] x86/PCI: Use new pci_is_bridge() to simplify code
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linuxppc-dev, linux-kernel, Tony Luck, linux-ia64,
David S. Miller, sparclinux, Thomas Gleixner, x86,
Benjamin Herrenschmidt, Yijing Wang
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
arch/x86/pci/fixup.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c
index 94ae9ae..e5f000c 100644
--- a/arch/x86/pci/fixup.c
+++ b/arch/x86/pci/fixup.c
@@ -337,9 +337,7 @@ static void pci_fixup_video(struct pci_dev *pdev)
* type BRIDGE, or CARDBUS. Host to PCI controllers use
* PCI header type NORMAL.
*/
- if (bridge
- && ((bridge->hdr_type = PCI_HEADER_TYPE_BRIDGE)
- || (bridge->hdr_type = PCI_HEADER_TYPE_CARDBUS))) {
+ if (bridge && (pci_is_bridge(bridge))) {
pci_read_config_word(bridge, PCI_BRIDGE_CONTROL,
&config);
if (!(config & PCI_BRIDGE_CTL_VGA))
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 05/13] IA64/PCI: Use new pci_is_bridge() to simplify code
2014-04-25 9:18 ` Yijing Wang
(?)
(?)
@ 2014-04-25 9:18 ` Yijing Wang
-1 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linuxppc-dev, linux-kernel, Tony Luck, linux-ia64,
David S. Miller, sparclinux, Thomas Gleixner, x86,
Benjamin Herrenschmidt, Yijing Wang
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
arch/ia64/pci/fixup.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/arch/ia64/pci/fixup.c b/arch/ia64/pci/fixup.c
index eee069a..1fe9aa5 100644
--- a/arch/ia64/pci/fixup.c
+++ b/arch/ia64/pci/fixup.c
@@ -49,9 +49,7 @@ static void pci_fixup_video(struct pci_dev *pdev)
* type BRIDGE, or CARDBUS. Host to PCI controllers use
* PCI header type NORMAL.
*/
- if (bridge
- &&((bridge->hdr_type == PCI_HEADER_TYPE_BRIDGE)
- ||(bridge->hdr_type == PCI_HEADER_TYPE_CARDBUS))) {
+ if (bridge && (pci_is_bridge(bridge))) {
pci_read_config_word(bridge, PCI_BRIDGE_CONTROL,
&config);
if (!(config & PCI_BRIDGE_CTL_VGA))
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 05/13] IA64/PCI: Use new pci_is_bridge() to simplify code
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Tony Luck, linux-ia64, x86, linux-kernel, Yijing Wang,
sparclinux, Thomas Gleixner, linuxppc-dev, David S. Miller
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
arch/ia64/pci/fixup.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/arch/ia64/pci/fixup.c b/arch/ia64/pci/fixup.c
index eee069a..1fe9aa5 100644
--- a/arch/ia64/pci/fixup.c
+++ b/arch/ia64/pci/fixup.c
@@ -49,9 +49,7 @@ static void pci_fixup_video(struct pci_dev *pdev)
* type BRIDGE, or CARDBUS. Host to PCI controllers use
* PCI header type NORMAL.
*/
- if (bridge
- &&((bridge->hdr_type = PCI_HEADER_TYPE_BRIDGE)
- ||(bridge->hdr_type = PCI_HEADER_TYPE_CARDBUS))) {
+ if (bridge && (pci_is_bridge(bridge))) {
pci_read_config_word(bridge, PCI_BRIDGE_CONTROL,
&config);
if (!(config & PCI_BRIDGE_CTL_VGA))
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 05/13] IA64/PCI: Use new pci_is_bridge() to simplify code
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Tony Luck, linux-ia64, x86, linux-kernel, Yijing Wang,
sparclinux, Thomas Gleixner, linuxppc-dev, David S. Miller
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
arch/ia64/pci/fixup.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/arch/ia64/pci/fixup.c b/arch/ia64/pci/fixup.c
index eee069a..1fe9aa5 100644
--- a/arch/ia64/pci/fixup.c
+++ b/arch/ia64/pci/fixup.c
@@ -49,9 +49,7 @@ static void pci_fixup_video(struct pci_dev *pdev)
* type BRIDGE, or CARDBUS. Host to PCI controllers use
* PCI header type NORMAL.
*/
- if (bridge
- &&((bridge->hdr_type == PCI_HEADER_TYPE_BRIDGE)
- ||(bridge->hdr_type == PCI_HEADER_TYPE_CARDBUS))) {
+ if (bridge && (pci_is_bridge(bridge))) {
pci_read_config_word(bridge, PCI_BRIDGE_CONTROL,
&config);
if (!(config & PCI_BRIDGE_CTL_VGA))
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 05/13] IA64/PCI: Use new pci_is_bridge() to simplify code
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linuxppc-dev, linux-kernel, Tony Luck, linux-ia64,
David S. Miller, sparclinux, Thomas Gleixner, x86,
Benjamin Herrenschmidt, Yijing Wang
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
arch/ia64/pci/fixup.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/arch/ia64/pci/fixup.c b/arch/ia64/pci/fixup.c
index eee069a..1fe9aa5 100644
--- a/arch/ia64/pci/fixup.c
+++ b/arch/ia64/pci/fixup.c
@@ -49,9 +49,7 @@ static void pci_fixup_video(struct pci_dev *pdev)
* type BRIDGE, or CARDBUS. Host to PCI controllers use
* PCI header type NORMAL.
*/
- if (bridge
- &&((bridge->hdr_type = PCI_HEADER_TYPE_BRIDGE)
- ||(bridge->hdr_type = PCI_HEADER_TYPE_CARDBUS))) {
+ if (bridge && (pci_is_bridge(bridge))) {
pci_read_config_word(bridge, PCI_BRIDGE_CONTROL,
&config);
if (!(config & PCI_BRIDGE_CTL_VGA))
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 06/13] powerpc/PCI: Use new pci_is_bridge() to simplify code
2014-04-25 9:18 ` Yijing Wang
(?)
(?)
@ 2014-04-25 9:18 ` Yijing Wang
-1 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linuxppc-dev, linux-kernel, Tony Luck, linux-ia64,
David S. Miller, sparclinux, Thomas Gleixner, x86,
Benjamin Herrenschmidt, Yijing Wang
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
arch/powerpc/kernel/pci-hotplug.c | 3 +--
arch/powerpc/kernel/pci_of_scan.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/kernel/pci-hotplug.c b/arch/powerpc/kernel/pci-hotplug.c
index c1e17ae..5b78917 100644
--- a/arch/powerpc/kernel/pci-hotplug.c
+++ b/arch/powerpc/kernel/pci-hotplug.c
@@ -98,8 +98,7 @@ void pcibios_add_pci_devices(struct pci_bus * bus)
max = bus->busn_res.start;
for (pass = 0; pass < 2; pass++) {
list_for_each_entry(dev, &bus->devices, bus_list) {
- if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
- dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)
+ if (pci_is_bridge(dev))
max = pci_scan_bridge(bus, dev,
max, pass);
}
diff --git a/arch/powerpc/kernel/pci_of_scan.c b/arch/powerpc/kernel/pci_of_scan.c
index 83c26d8..059e244 100644
--- a/arch/powerpc/kernel/pci_of_scan.c
+++ b/arch/powerpc/kernel/pci_of_scan.c
@@ -362,8 +362,7 @@ static void __of_scan_bus(struct device_node *node, struct pci_bus *bus,
/* Now scan child busses */
list_for_each_entry(dev, &bus->devices, bus_list) {
- if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
- dev->hdr_type == PCI_HEADER_TYPE_CARDBUS) {
+ if (pci_is_bridge(dev)) {
of_scan_pci_bridge(dev);
}
}
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 06/13] powerpc/PCI: Use new pci_is_bridge() to simplify code
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Tony Luck, linux-ia64, x86, linux-kernel, Yijing Wang,
sparclinux, Thomas Gleixner, linuxppc-dev, David S. Miller
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
arch/powerpc/kernel/pci-hotplug.c | 3 +--
arch/powerpc/kernel/pci_of_scan.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/kernel/pci-hotplug.c b/arch/powerpc/kernel/pci-hotplug.c
index c1e17ae..5b78917 100644
--- a/arch/powerpc/kernel/pci-hotplug.c
+++ b/arch/powerpc/kernel/pci-hotplug.c
@@ -98,8 +98,7 @@ void pcibios_add_pci_devices(struct pci_bus * bus)
max = bus->busn_res.start;
for (pass = 0; pass < 2; pass++) {
list_for_each_entry(dev, &bus->devices, bus_list) {
- if (dev->hdr_type = PCI_HEADER_TYPE_BRIDGE ||
- dev->hdr_type = PCI_HEADER_TYPE_CARDBUS)
+ if (pci_is_bridge(dev))
max = pci_scan_bridge(bus, dev,
max, pass);
}
diff --git a/arch/powerpc/kernel/pci_of_scan.c b/arch/powerpc/kernel/pci_of_scan.c
index 83c26d8..059e244 100644
--- a/arch/powerpc/kernel/pci_of_scan.c
+++ b/arch/powerpc/kernel/pci_of_scan.c
@@ -362,8 +362,7 @@ static void __of_scan_bus(struct device_node *node, struct pci_bus *bus,
/* Now scan child busses */
list_for_each_entry(dev, &bus->devices, bus_list) {
- if (dev->hdr_type = PCI_HEADER_TYPE_BRIDGE ||
- dev->hdr_type = PCI_HEADER_TYPE_CARDBUS) {
+ if (pci_is_bridge(dev)) {
of_scan_pci_bridge(dev);
}
}
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 06/13] powerpc/PCI: Use new pci_is_bridge() to simplify code
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Tony Luck, linux-ia64, x86, linux-kernel, Yijing Wang,
sparclinux, Thomas Gleixner, linuxppc-dev, David S. Miller
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
arch/powerpc/kernel/pci-hotplug.c | 3 +--
arch/powerpc/kernel/pci_of_scan.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/kernel/pci-hotplug.c b/arch/powerpc/kernel/pci-hotplug.c
index c1e17ae..5b78917 100644
--- a/arch/powerpc/kernel/pci-hotplug.c
+++ b/arch/powerpc/kernel/pci-hotplug.c
@@ -98,8 +98,7 @@ void pcibios_add_pci_devices(struct pci_bus * bus)
max = bus->busn_res.start;
for (pass = 0; pass < 2; pass++) {
list_for_each_entry(dev, &bus->devices, bus_list) {
- if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
- dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)
+ if (pci_is_bridge(dev))
max = pci_scan_bridge(bus, dev,
max, pass);
}
diff --git a/arch/powerpc/kernel/pci_of_scan.c b/arch/powerpc/kernel/pci_of_scan.c
index 83c26d8..059e244 100644
--- a/arch/powerpc/kernel/pci_of_scan.c
+++ b/arch/powerpc/kernel/pci_of_scan.c
@@ -362,8 +362,7 @@ static void __of_scan_bus(struct device_node *node, struct pci_bus *bus,
/* Now scan child busses */
list_for_each_entry(dev, &bus->devices, bus_list) {
- if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
- dev->hdr_type == PCI_HEADER_TYPE_CARDBUS) {
+ if (pci_is_bridge(dev)) {
of_scan_pci_bridge(dev);
}
}
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 06/13] powerpc/PCI: Use new pci_is_bridge() to simplify code
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linuxppc-dev, linux-kernel, Tony Luck, linux-ia64,
David S. Miller, sparclinux, Thomas Gleixner, x86,
Benjamin Herrenschmidt, Yijing Wang
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
arch/powerpc/kernel/pci-hotplug.c | 3 +--
arch/powerpc/kernel/pci_of_scan.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/kernel/pci-hotplug.c b/arch/powerpc/kernel/pci-hotplug.c
index c1e17ae..5b78917 100644
--- a/arch/powerpc/kernel/pci-hotplug.c
+++ b/arch/powerpc/kernel/pci-hotplug.c
@@ -98,8 +98,7 @@ void pcibios_add_pci_devices(struct pci_bus * bus)
max = bus->busn_res.start;
for (pass = 0; pass < 2; pass++) {
list_for_each_entry(dev, &bus->devices, bus_list) {
- if (dev->hdr_type = PCI_HEADER_TYPE_BRIDGE ||
- dev->hdr_type = PCI_HEADER_TYPE_CARDBUS)
+ if (pci_is_bridge(dev))
max = pci_scan_bridge(bus, dev,
max, pass);
}
diff --git a/arch/powerpc/kernel/pci_of_scan.c b/arch/powerpc/kernel/pci_of_scan.c
index 83c26d8..059e244 100644
--- a/arch/powerpc/kernel/pci_of_scan.c
+++ b/arch/powerpc/kernel/pci_of_scan.c
@@ -362,8 +362,7 @@ static void __of_scan_bus(struct device_node *node, struct pci_bus *bus,
/* Now scan child busses */
list_for_each_entry(dev, &bus->devices, bus_list) {
- if (dev->hdr_type = PCI_HEADER_TYPE_BRIDGE ||
- dev->hdr_type = PCI_HEADER_TYPE_CARDBUS) {
+ if (pci_is_bridge(dev)) {
of_scan_pci_bridge(dev);
}
}
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 07/13] sparc/PCI: Use new pci_is_bridge() to simplify code
2014-04-25 9:18 ` Yijing Wang
(?)
(?)
@ 2014-04-25 9:18 ` Yijing Wang
-1 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linuxppc-dev, linux-kernel, Tony Luck, linux-ia64,
David S. Miller, sparclinux, Thomas Gleixner, x86,
Benjamin Herrenschmidt, Yijing Wang
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
arch/sparc/kernel/pci.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c
index 1555bbc..857ad77 100644
--- a/arch/sparc/kernel/pci.c
+++ b/arch/sparc/kernel/pci.c
@@ -543,8 +543,7 @@ static void pci_of_scan_bus(struct pci_pbm_info *pbm,
printk("PCI: dev header type: %x\n",
dev->hdr_type);
- if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
- dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)
+ if (pci_is_bridge(dev))
of_scan_pci_bridge(pbm, child, dev);
}
}
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 07/13] sparc/PCI: Use new pci_is_bridge() to simplify code
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Tony Luck, linux-ia64, x86, linux-kernel, Yijing Wang,
sparclinux, Thomas Gleixner, linuxppc-dev, David S. Miller
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
arch/sparc/kernel/pci.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c
index 1555bbc..857ad77 100644
--- a/arch/sparc/kernel/pci.c
+++ b/arch/sparc/kernel/pci.c
@@ -543,8 +543,7 @@ static void pci_of_scan_bus(struct pci_pbm_info *pbm,
printk("PCI: dev header type: %x\n",
dev->hdr_type);
- if (dev->hdr_type = PCI_HEADER_TYPE_BRIDGE ||
- dev->hdr_type = PCI_HEADER_TYPE_CARDBUS)
+ if (pci_is_bridge(dev))
of_scan_pci_bridge(pbm, child, dev);
}
}
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 07/13] sparc/PCI: Use new pci_is_bridge() to simplify code
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Tony Luck, linux-ia64, x86, linux-kernel, Yijing Wang,
sparclinux, Thomas Gleixner, linuxppc-dev, David S. Miller
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
arch/sparc/kernel/pci.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c
index 1555bbc..857ad77 100644
--- a/arch/sparc/kernel/pci.c
+++ b/arch/sparc/kernel/pci.c
@@ -543,8 +543,7 @@ static void pci_of_scan_bus(struct pci_pbm_info *pbm,
printk("PCI: dev header type: %x\n",
dev->hdr_type);
- if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
- dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)
+ if (pci_is_bridge(dev))
of_scan_pci_bridge(pbm, child, dev);
}
}
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 07/13] sparc/PCI: Use new pci_is_bridge() to simplify code
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linuxppc-dev, linux-kernel, Tony Luck, linux-ia64,
David S. Miller, sparclinux, Thomas Gleixner, x86,
Benjamin Herrenschmidt, Yijing Wang
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
arch/sparc/kernel/pci.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c
index 1555bbc..857ad77 100644
--- a/arch/sparc/kernel/pci.c
+++ b/arch/sparc/kernel/pci.c
@@ -543,8 +543,7 @@ static void pci_of_scan_bus(struct pci_pbm_info *pbm,
printk("PCI: dev header type: %x\n",
dev->hdr_type);
- if (dev->hdr_type = PCI_HEADER_TYPE_BRIDGE ||
- dev->hdr_type = PCI_HEADER_TYPE_CARDBUS)
+ if (pci_is_bridge(dev))
of_scan_pci_bridge(pbm, child, dev);
}
}
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 08/13] PCI, rpaphp: Use new pci_is_bridge() to simplify code
2014-04-25 9:18 ` Yijing Wang
(?)
(?)
@ 2014-04-25 9:18 ` Yijing Wang
-1 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linuxppc-dev, linux-kernel, Tony Luck, linux-ia64,
David S. Miller, sparclinux, Thomas Gleixner, x86,
Benjamin Herrenschmidt, Yijing Wang
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
drivers/pci/hotplug/rpadlpar_core.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/hotplug/rpadlpar_core.c b/drivers/pci/hotplug/rpadlpar_core.c
index 4fcdeed..7660232 100644
--- a/drivers/pci/hotplug/rpadlpar_core.c
+++ b/drivers/pci/hotplug/rpadlpar_core.c
@@ -157,8 +157,7 @@ static void dlpar_pci_add_bus(struct device_node *dn)
}
/* Scan below the new bridge */
- if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
- dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)
+ if (pci_is_bridge(dev))
of_scan_pci_bridge(dev);
/* Map IO space for child bus, which may or may not succeed */
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 08/13] PCI, rpaphp: Use new pci_is_bridge() to simplify code
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Tony Luck, linux-ia64, x86, linux-kernel, Yijing Wang,
sparclinux, Thomas Gleixner, linuxppc-dev, David S. Miller
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
drivers/pci/hotplug/rpadlpar_core.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/hotplug/rpadlpar_core.c b/drivers/pci/hotplug/rpadlpar_core.c
index 4fcdeed..7660232 100644
--- a/drivers/pci/hotplug/rpadlpar_core.c
+++ b/drivers/pci/hotplug/rpadlpar_core.c
@@ -157,8 +157,7 @@ static void dlpar_pci_add_bus(struct device_node *dn)
}
/* Scan below the new bridge */
- if (dev->hdr_type = PCI_HEADER_TYPE_BRIDGE ||
- dev->hdr_type = PCI_HEADER_TYPE_CARDBUS)
+ if (pci_is_bridge(dev))
of_scan_pci_bridge(dev);
/* Map IO space for child bus, which may or may not succeed */
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 08/13] PCI, rpaphp: Use new pci_is_bridge() to simplify code
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Tony Luck, linux-ia64, x86, linux-kernel, Yijing Wang,
sparclinux, Thomas Gleixner, linuxppc-dev, David S. Miller
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
drivers/pci/hotplug/rpadlpar_core.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/hotplug/rpadlpar_core.c b/drivers/pci/hotplug/rpadlpar_core.c
index 4fcdeed..7660232 100644
--- a/drivers/pci/hotplug/rpadlpar_core.c
+++ b/drivers/pci/hotplug/rpadlpar_core.c
@@ -157,8 +157,7 @@ static void dlpar_pci_add_bus(struct device_node *dn)
}
/* Scan below the new bridge */
- if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
- dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)
+ if (pci_is_bridge(dev))
of_scan_pci_bridge(dev);
/* Map IO space for child bus, which may or may not succeed */
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 08/13] PCI, rpaphp: Use new pci_is_bridge() to simplify code
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linuxppc-dev, linux-kernel, Tony Luck, linux-ia64,
David S. Miller, sparclinux, Thomas Gleixner, x86,
Benjamin Herrenschmidt, Yijing Wang
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
drivers/pci/hotplug/rpadlpar_core.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/hotplug/rpadlpar_core.c b/drivers/pci/hotplug/rpadlpar_core.c
index 4fcdeed..7660232 100644
--- a/drivers/pci/hotplug/rpadlpar_core.c
+++ b/drivers/pci/hotplug/rpadlpar_core.c
@@ -157,8 +157,7 @@ static void dlpar_pci_add_bus(struct device_node *dn)
}
/* Scan below the new bridge */
- if (dev->hdr_type = PCI_HEADER_TYPE_BRIDGE ||
- dev->hdr_type = PCI_HEADER_TYPE_CARDBUS)
+ if (pci_is_bridge(dev))
of_scan_pci_bridge(dev);
/* Map IO space for child bus, which may or may not succeed */
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 09/13] PCI, shpchp: Use new pci_is_bridge() to simplify code
2014-04-25 9:18 ` Yijing Wang
(?)
(?)
@ 2014-04-25 9:18 ` Yijing Wang
-1 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linuxppc-dev, linux-kernel, Tony Luck, linux-ia64,
David S. Miller, sparclinux, Thomas Gleixner, x86,
Benjamin Herrenschmidt, Yijing Wang
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
drivers/pci/hotplug/shpchp_pci.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/hotplug/shpchp_pci.c b/drivers/pci/hotplug/shpchp_pci.c
index 2bf69fe..ea8ad31 100644
--- a/drivers/pci/hotplug/shpchp_pci.c
+++ b/drivers/pci/hotplug/shpchp_pci.c
@@ -64,8 +64,7 @@ int __ref shpchp_configure_device(struct slot *p_slot)
list_for_each_entry(dev, &parent->devices, bus_list) {
if (PCI_SLOT(dev->devfn) != p_slot->device)
continue;
- if ((dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) ||
- (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS))
+ if (pci_is_bridge(dev))
pci_hp_add_bridge(dev);
}
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 09/13] PCI, shpchp: Use new pci_is_bridge() to simplify code
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Tony Luck, linux-ia64, x86, linux-kernel, Yijing Wang,
sparclinux, Thomas Gleixner, linuxppc-dev, David S. Miller
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
drivers/pci/hotplug/shpchp_pci.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/hotplug/shpchp_pci.c b/drivers/pci/hotplug/shpchp_pci.c
index 2bf69fe..ea8ad31 100644
--- a/drivers/pci/hotplug/shpchp_pci.c
+++ b/drivers/pci/hotplug/shpchp_pci.c
@@ -64,8 +64,7 @@ int __ref shpchp_configure_device(struct slot *p_slot)
list_for_each_entry(dev, &parent->devices, bus_list) {
if (PCI_SLOT(dev->devfn) != p_slot->device)
continue;
- if ((dev->hdr_type = PCI_HEADER_TYPE_BRIDGE) ||
- (dev->hdr_type = PCI_HEADER_TYPE_CARDBUS))
+ if (pci_is_bridge(dev))
pci_hp_add_bridge(dev);
}
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 09/13] PCI, shpchp: Use new pci_is_bridge() to simplify code
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Tony Luck, linux-ia64, x86, linux-kernel, Yijing Wang,
sparclinux, Thomas Gleixner, linuxppc-dev, David S. Miller
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
drivers/pci/hotplug/shpchp_pci.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/hotplug/shpchp_pci.c b/drivers/pci/hotplug/shpchp_pci.c
index 2bf69fe..ea8ad31 100644
--- a/drivers/pci/hotplug/shpchp_pci.c
+++ b/drivers/pci/hotplug/shpchp_pci.c
@@ -64,8 +64,7 @@ int __ref shpchp_configure_device(struct slot *p_slot)
list_for_each_entry(dev, &parent->devices, bus_list) {
if (PCI_SLOT(dev->devfn) != p_slot->device)
continue;
- if ((dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) ||
- (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS))
+ if (pci_is_bridge(dev))
pci_hp_add_bridge(dev);
}
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 09/13] PCI, shpchp: Use new pci_is_bridge() to simplify code
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linuxppc-dev, linux-kernel, Tony Luck, linux-ia64,
David S. Miller, sparclinux, Thomas Gleixner, x86,
Benjamin Herrenschmidt, Yijing Wang
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
drivers/pci/hotplug/shpchp_pci.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/hotplug/shpchp_pci.c b/drivers/pci/hotplug/shpchp_pci.c
index 2bf69fe..ea8ad31 100644
--- a/drivers/pci/hotplug/shpchp_pci.c
+++ b/drivers/pci/hotplug/shpchp_pci.c
@@ -64,8 +64,7 @@ int __ref shpchp_configure_device(struct slot *p_slot)
list_for_each_entry(dev, &parent->devices, bus_list) {
if (PCI_SLOT(dev->devfn) != p_slot->device)
continue;
- if ((dev->hdr_type = PCI_HEADER_TYPE_BRIDGE) ||
- (dev->hdr_type = PCI_HEADER_TYPE_CARDBUS))
+ if (pci_is_bridge(dev))
pci_hp_add_bridge(dev);
}
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 10/13] PCI, cpcihp: Use new pci_is_bridge() to simplify code
2014-04-25 9:18 ` Yijing Wang
(?)
(?)
@ 2014-04-25 9:18 ` Yijing Wang
-1 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linuxppc-dev, linux-kernel, Tony Luck, linux-ia64,
David S. Miller, sparclinux, Thomas Gleixner, x86,
Benjamin Herrenschmidt, Yijing Wang
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
drivers/pci/hotplug/cpci_hotplug_pci.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/hotplug/cpci_hotplug_pci.c b/drivers/pci/hotplug/cpci_hotplug_pci.c
index 8c14648..9843371 100644
--- a/drivers/pci/hotplug/cpci_hotplug_pci.c
+++ b/drivers/pci/hotplug/cpci_hotplug_pci.c
@@ -289,8 +289,7 @@ int __ref cpci_configure_slot(struct slot *slot)
list_for_each_entry(dev, &parent->devices, bus_list)
if (PCI_SLOT(dev->devfn) != PCI_SLOT(slot->devfn))
continue;
- if ((dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) ||
- (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS))
+ if (pci_is_bridge(dev))
pci_hp_add_bridge(dev);
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 10/13] PCI, cpcihp: Use new pci_is_bridge() to simplify code
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Tony Luck, linux-ia64, x86, linux-kernel, Yijing Wang,
sparclinux, Thomas Gleixner, linuxppc-dev, David S. Miller
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
drivers/pci/hotplug/cpci_hotplug_pci.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/hotplug/cpci_hotplug_pci.c b/drivers/pci/hotplug/cpci_hotplug_pci.c
index 8c14648..9843371 100644
--- a/drivers/pci/hotplug/cpci_hotplug_pci.c
+++ b/drivers/pci/hotplug/cpci_hotplug_pci.c
@@ -289,8 +289,7 @@ int __ref cpci_configure_slot(struct slot *slot)
list_for_each_entry(dev, &parent->devices, bus_list)
if (PCI_SLOT(dev->devfn) != PCI_SLOT(slot->devfn))
continue;
- if ((dev->hdr_type = PCI_HEADER_TYPE_BRIDGE) ||
- (dev->hdr_type = PCI_HEADER_TYPE_CARDBUS))
+ if (pci_is_bridge(dev))
pci_hp_add_bridge(dev);
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 10/13] PCI, cpcihp: Use new pci_is_bridge() to simplify code
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Tony Luck, linux-ia64, x86, linux-kernel, Yijing Wang,
sparclinux, Thomas Gleixner, linuxppc-dev, David S. Miller
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
drivers/pci/hotplug/cpci_hotplug_pci.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/hotplug/cpci_hotplug_pci.c b/drivers/pci/hotplug/cpci_hotplug_pci.c
index 8c14648..9843371 100644
--- a/drivers/pci/hotplug/cpci_hotplug_pci.c
+++ b/drivers/pci/hotplug/cpci_hotplug_pci.c
@@ -289,8 +289,7 @@ int __ref cpci_configure_slot(struct slot *slot)
list_for_each_entry(dev, &parent->devices, bus_list)
if (PCI_SLOT(dev->devfn) != PCI_SLOT(slot->devfn))
continue;
- if ((dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) ||
- (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS))
+ if (pci_is_bridge(dev))
pci_hp_add_bridge(dev);
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 10/13] PCI, cpcihp: Use new pci_is_bridge() to simplify code
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linuxppc-dev, linux-kernel, Tony Luck, linux-ia64,
David S. Miller, sparclinux, Thomas Gleixner, x86,
Benjamin Herrenschmidt, Yijing Wang
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
drivers/pci/hotplug/cpci_hotplug_pci.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/hotplug/cpci_hotplug_pci.c b/drivers/pci/hotplug/cpci_hotplug_pci.c
index 8c14648..9843371 100644
--- a/drivers/pci/hotplug/cpci_hotplug_pci.c
+++ b/drivers/pci/hotplug/cpci_hotplug_pci.c
@@ -289,8 +289,7 @@ int __ref cpci_configure_slot(struct slot *slot)
list_for_each_entry(dev, &parent->devices, bus_list)
if (PCI_SLOT(dev->devfn) != PCI_SLOT(slot->devfn))
continue;
- if ((dev->hdr_type = PCI_HEADER_TYPE_BRIDGE) ||
- (dev->hdr_type = PCI_HEADER_TYPE_CARDBUS))
+ if (pci_is_bridge(dev))
pci_hp_add_bridge(dev);
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 11/13] PCI, acpiphp: Use new pci_is_bridge() to simplify code
2014-04-25 9:18 ` Yijing Wang
(?)
(?)
@ 2014-04-25 9:18 ` Yijing Wang
-1 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linuxppc-dev, linux-kernel, Tony Luck, linux-ia64,
David S. Miller, sparclinux, Thomas Gleixner, x86,
Benjamin Herrenschmidt, Yijing Wang
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
drivers/pci/hotplug/acpiphp_glue.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index bccc27e..f1f9bd1 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -516,8 +516,7 @@ static void __ref enable_slot(struct acpiphp_slot *slot)
if (PCI_SLOT(dev->devfn) != slot->device)
continue;
- if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
- dev->hdr_type == PCI_HEADER_TYPE_CARDBUS) {
+ if (pci_is_bridge(dev)) {
max = pci_scan_bridge(bus, dev, max, pass);
if (pass && dev->subordinate) {
check_hotplug_bridge(slot, dev);
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 11/13] PCI, acpiphp: Use new pci_is_bridge() to simplify code
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Tony Luck, linux-ia64, x86, linux-kernel, Yijing Wang,
sparclinux, Thomas Gleixner, linuxppc-dev, David S. Miller
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
drivers/pci/hotplug/acpiphp_glue.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index bccc27e..f1f9bd1 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -516,8 +516,7 @@ static void __ref enable_slot(struct acpiphp_slot *slot)
if (PCI_SLOT(dev->devfn) != slot->device)
continue;
- if (dev->hdr_type = PCI_HEADER_TYPE_BRIDGE ||
- dev->hdr_type = PCI_HEADER_TYPE_CARDBUS) {
+ if (pci_is_bridge(dev)) {
max = pci_scan_bridge(bus, dev, max, pass);
if (pass && dev->subordinate) {
check_hotplug_bridge(slot, dev);
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 11/13] PCI, acpiphp: Use new pci_is_bridge() to simplify code
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Tony Luck, linux-ia64, x86, linux-kernel, Yijing Wang,
sparclinux, Thomas Gleixner, linuxppc-dev, David S. Miller
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
drivers/pci/hotplug/acpiphp_glue.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index bccc27e..f1f9bd1 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -516,8 +516,7 @@ static void __ref enable_slot(struct acpiphp_slot *slot)
if (PCI_SLOT(dev->devfn) != slot->device)
continue;
- if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
- dev->hdr_type == PCI_HEADER_TYPE_CARDBUS) {
+ if (pci_is_bridge(dev)) {
max = pci_scan_bridge(bus, dev, max, pass);
if (pass && dev->subordinate) {
check_hotplug_bridge(slot, dev);
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 11/13] PCI, acpiphp: Use new pci_is_bridge() to simplify code
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linuxppc-dev, linux-kernel, Tony Luck, linux-ia64,
David S. Miller, sparclinux, Thomas Gleixner, x86,
Benjamin Herrenschmidt, Yijing Wang
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
drivers/pci/hotplug/acpiphp_glue.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index bccc27e..f1f9bd1 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -516,8 +516,7 @@ static void __ref enable_slot(struct acpiphp_slot *slot)
if (PCI_SLOT(dev->devfn) != slot->device)
continue;
- if (dev->hdr_type = PCI_HEADER_TYPE_BRIDGE ||
- dev->hdr_type = PCI_HEADER_TYPE_CARDBUS) {
+ if (pci_is_bridge(dev)) {
max = pci_scan_bridge(bus, dev, max, pass);
if (pass && dev->subordinate) {
check_hotplug_bridge(slot, dev);
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 12/13] PCI, pcmcia: Use new pci_is_bridge() to simplify code
2014-04-25 9:18 ` Yijing Wang
(?)
(?)
@ 2014-04-25 9:18 ` Yijing Wang
-1 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linuxppc-dev, linux-kernel, Tony Luck, linux-ia64,
David S. Miller, sparclinux, Thomas Gleixner, x86,
Benjamin Herrenschmidt, Yijing Wang
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
drivers/pcmcia/cardbus.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/pcmcia/cardbus.c b/drivers/pcmcia/cardbus.c
index 8bde619..4fe4cc4 100644
--- a/drivers/pcmcia/cardbus.c
+++ b/drivers/pcmcia/cardbus.c
@@ -78,8 +78,7 @@ int __ref cb_alloc(struct pcmcia_socket *s)
max = bus->busn_res.start;
for (pass = 0; pass < 2; pass++)
list_for_each_entry(dev, &bus->devices, bus_list)
- if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
- dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)
+ if (pci_is_bridge(dev))
max = pci_scan_bridge(bus, dev, max, pass);
/*
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 12/13] PCI, pcmcia: Use new pci_is_bridge() to simplify code
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Tony Luck, linux-ia64, x86, linux-kernel, Yijing Wang,
sparclinux, Thomas Gleixner, linuxppc-dev, David S. Miller
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
drivers/pcmcia/cardbus.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/pcmcia/cardbus.c b/drivers/pcmcia/cardbus.c
index 8bde619..4fe4cc4 100644
--- a/drivers/pcmcia/cardbus.c
+++ b/drivers/pcmcia/cardbus.c
@@ -78,8 +78,7 @@ int __ref cb_alloc(struct pcmcia_socket *s)
max = bus->busn_res.start;
for (pass = 0; pass < 2; pass++)
list_for_each_entry(dev, &bus->devices, bus_list)
- if (dev->hdr_type = PCI_HEADER_TYPE_BRIDGE ||
- dev->hdr_type = PCI_HEADER_TYPE_CARDBUS)
+ if (pci_is_bridge(dev))
max = pci_scan_bridge(bus, dev, max, pass);
/*
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 12/13] PCI, pcmcia: Use new pci_is_bridge() to simplify code
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Tony Luck, linux-ia64, x86, linux-kernel, Yijing Wang,
sparclinux, Thomas Gleixner, linuxppc-dev, David S. Miller
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
drivers/pcmcia/cardbus.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/pcmcia/cardbus.c b/drivers/pcmcia/cardbus.c
index 8bde619..4fe4cc4 100644
--- a/drivers/pcmcia/cardbus.c
+++ b/drivers/pcmcia/cardbus.c
@@ -78,8 +78,7 @@ int __ref cb_alloc(struct pcmcia_socket *s)
max = bus->busn_res.start;
for (pass = 0; pass < 2; pass++)
list_for_each_entry(dev, &bus->devices, bus_list)
- if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
- dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)
+ if (pci_is_bridge(dev))
max = pci_scan_bridge(bus, dev, max, pass);
/*
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 12/13] PCI, pcmcia: Use new pci_is_bridge() to simplify code
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linuxppc-dev, linux-kernel, Tony Luck, linux-ia64,
David S. Miller, sparclinux, Thomas Gleixner, x86,
Benjamin Herrenschmidt, Yijing Wang
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
drivers/pcmcia/cardbus.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/pcmcia/cardbus.c b/drivers/pcmcia/cardbus.c
index 8bde619..4fe4cc4 100644
--- a/drivers/pcmcia/cardbus.c
+++ b/drivers/pcmcia/cardbus.c
@@ -78,8 +78,7 @@ int __ref cb_alloc(struct pcmcia_socket *s)
max = bus->busn_res.start;
for (pass = 0; pass < 2; pass++)
list_for_each_entry(dev, &bus->devices, bus_list)
- if (dev->hdr_type = PCI_HEADER_TYPE_BRIDGE ||
- dev->hdr_type = PCI_HEADER_TYPE_CARDBUS)
+ if (pci_is_bridge(dev))
max = pci_scan_bridge(bus, dev, max, pass);
/*
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 13/13] PCI, pciehp: Use new pci_is_bridge() to simplify code
2014-04-25 9:18 ` Yijing Wang
(?)
(?)
@ 2014-04-25 9:18 ` Yijing Wang
-1 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linuxppc-dev, linux-kernel, Tony Luck, linux-ia64,
David S. Miller, sparclinux, Thomas Gleixner, x86,
Benjamin Herrenschmidt, Yijing Wang
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
drivers/pci/hotplug/pciehp_pci.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/hotplug/pciehp_pci.c b/drivers/pci/hotplug/pciehp_pci.c
index 1b53306..b6cb1df 100644
--- a/drivers/pci/hotplug/pciehp_pci.c
+++ b/drivers/pci/hotplug/pciehp_pci.c
@@ -62,8 +62,7 @@ int pciehp_configure_device(struct slot *p_slot)
}
list_for_each_entry(dev, &parent->devices, bus_list)
- if ((dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) ||
- (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS))
+ if (pci_is_bridge(dev))
pci_hp_add_bridge(dev);
pci_assign_unassigned_bridge_resources(bridge);
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 13/13] PCI, pciehp: Use new pci_is_bridge() to simplify code
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Tony Luck, linux-ia64, x86, linux-kernel, Yijing Wang,
sparclinux, Thomas Gleixner, linuxppc-dev, David S. Miller
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
drivers/pci/hotplug/pciehp_pci.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/hotplug/pciehp_pci.c b/drivers/pci/hotplug/pciehp_pci.c
index 1b53306..b6cb1df 100644
--- a/drivers/pci/hotplug/pciehp_pci.c
+++ b/drivers/pci/hotplug/pciehp_pci.c
@@ -62,8 +62,7 @@ int pciehp_configure_device(struct slot *p_slot)
}
list_for_each_entry(dev, &parent->devices, bus_list)
- if ((dev->hdr_type = PCI_HEADER_TYPE_BRIDGE) ||
- (dev->hdr_type = PCI_HEADER_TYPE_CARDBUS))
+ if (pci_is_bridge(dev))
pci_hp_add_bridge(dev);
pci_assign_unassigned_bridge_resources(bridge);
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 13/13] PCI, pciehp: Use new pci_is_bridge() to simplify code
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Tony Luck, linux-ia64, x86, linux-kernel, Yijing Wang,
sparclinux, Thomas Gleixner, linuxppc-dev, David S. Miller
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
drivers/pci/hotplug/pciehp_pci.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/hotplug/pciehp_pci.c b/drivers/pci/hotplug/pciehp_pci.c
index 1b53306..b6cb1df 100644
--- a/drivers/pci/hotplug/pciehp_pci.c
+++ b/drivers/pci/hotplug/pciehp_pci.c
@@ -62,8 +62,7 @@ int pciehp_configure_device(struct slot *p_slot)
}
list_for_each_entry(dev, &parent->devices, bus_list)
- if ((dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) ||
- (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS))
+ if (pci_is_bridge(dev))
pci_hp_add_bridge(dev);
pci_assign_unassigned_bridge_resources(bridge);
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [PATCH 13/13] PCI, pciehp: Use new pci_is_bridge() to simplify code
@ 2014-04-25 9:18 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-25 9:18 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linuxppc-dev, linux-kernel, Tony Luck, linux-ia64,
David S. Miller, sparclinux, Thomas Gleixner, x86,
Benjamin Herrenschmidt, Yijing Wang
Now we can use new pci_is_bridge() helper function
to simplify code.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
drivers/pci/hotplug/pciehp_pci.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/hotplug/pciehp_pci.c b/drivers/pci/hotplug/pciehp_pci.c
index 1b53306..b6cb1df 100644
--- a/drivers/pci/hotplug/pciehp_pci.c
+++ b/drivers/pci/hotplug/pciehp_pci.c
@@ -62,8 +62,7 @@ int pciehp_configure_device(struct slot *p_slot)
}
list_for_each_entry(dev, &parent->devices, bus_list)
- if ((dev->hdr_type = PCI_HEADER_TYPE_BRIDGE) ||
- (dev->hdr_type = PCI_HEADER_TYPE_CARDBUS))
+ if (pci_is_bridge(dev))
pci_hp_add_bridge(dev);
pci_assign_unassigned_bridge_resources(bridge);
--
1.7.1
^ permalink raw reply related [flat|nested] 77+ messages in thread
* RE: [PATCH 00/13] Refactor pci_is_brdige() to simplify code
2014-04-25 9:18 ` Yijing Wang
(?)
@ 2014-04-25 9:42 ` David Laight
-1 siblings, 0 replies; 77+ messages in thread
From: David Laight @ 2014-04-25 9:42 UTC (permalink / raw)
To: 'Yijing Wang', Bjorn Helgaas
Cc: Tony Luck, linux-ia64, x86, linux-kernel, sparclinux,
Thomas Gleixner, linuxppc-dev, David S. Miller
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 573 bytes --]
From: Yijing Wang
> This patchset rename the current pci_is_bridge() to pci_has_subordinate(),
> and introduce a new pci_is_bridge() which determine pci bridge by check
> dev->hdr_type. The new one is more accurate. PCIe Spec define the pci
> device is a bridge by the dev->hdr_type = 0x01 || 0x02.
That is a dangerous rename and is likely to cause difficult to
identify bugs in any code you've missed.
David
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 77+ messages in thread
* RE: [PATCH 00/13] Refactor pci_is_brdige() to simplify code
@ 2014-04-25 9:42 ` David Laight
0 siblings, 0 replies; 77+ messages in thread
From: David Laight @ 2014-04-25 9:42 UTC (permalink / raw)
To: 'Yijing Wang', Bjorn Helgaas
Cc: Tony Luck, linux-ia64, x86, linux-kernel, sparclinux,
Thomas Gleixner, linuxppc-dev, David S. Miller
RnJvbTogWWlqaW5nIFdhbmcNCj4gVGhpcyBwYXRjaHNldCByZW5hbWUgdGhlIGN1cnJlbnQgcGNp
X2lzX2JyaWRnZSgpIHRvIHBjaV9oYXNfc3Vib3JkaW5hdGUoKSwNCj4gYW5kIGludHJvZHVjZSBh
IG5ldyBwY2lfaXNfYnJpZGdlKCkgd2hpY2ggZGV0ZXJtaW5lIHBjaSBicmlkZ2UgYnkgY2hlY2sN
Cj4gZGV2LT5oZHJfdHlwZS4gVGhlIG5ldyBvbmUgaXMgbW9yZSBhY2N1cmF0ZS4gUENJZSBTcGVj
IGRlZmluZSB0aGUgcGNpDQo+IGRldmljZSBpcyBhIGJyaWRnZSBieSB0aGUgZGV2LT5oZHJfdHlw
ZSA9IDB4MDEgfHwgMHgwMi4NCg0KVGhhdCBpcyBhIGRhbmdlcm91cyByZW5hbWUgYW5kIGlzIGxp
a2VseSB0byBjYXVzZSBkaWZmaWN1bHQgdG8NCmlkZW50aWZ5IGJ1Z3MgaW4gYW55IGNvZGUgeW91
J3ZlIG1pc3NlZC4NCg0KCURhdmlkDQoNCg=
^ permalink raw reply [flat|nested] 77+ messages in thread
* RE: [PATCH 00/13] Refactor pci_is_brdige() to simplify code
@ 2014-04-25 9:42 ` David Laight
0 siblings, 0 replies; 77+ messages in thread
From: David Laight @ 2014-04-25 9:42 UTC (permalink / raw)
To: 'Yijing Wang', Bjorn Helgaas
Cc: Tony Luck, linux-ia64, x86, linux-kernel, sparclinux,
Thomas Gleixner, linuxppc-dev, David S. Miller
RnJvbTogWWlqaW5nIFdhbmcNCj4gVGhpcyBwYXRjaHNldCByZW5hbWUgdGhlIGN1cnJlbnQgcGNp
X2lzX2JyaWRnZSgpIHRvIHBjaV9oYXNfc3Vib3JkaW5hdGUoKSwNCj4gYW5kIGludHJvZHVjZSBh
IG5ldyBwY2lfaXNfYnJpZGdlKCkgd2hpY2ggZGV0ZXJtaW5lIHBjaSBicmlkZ2UgYnkgY2hlY2sN
Cj4gZGV2LT5oZHJfdHlwZS4gVGhlIG5ldyBvbmUgaXMgbW9yZSBhY2N1cmF0ZS4gUENJZSBTcGVj
IGRlZmluZSB0aGUgcGNpDQo+IGRldmljZSBpcyBhIGJyaWRnZSBieSB0aGUgZGV2LT5oZHJfdHlw
ZSA9IDB4MDEgfHwgMHgwMi4NCg0KVGhhdCBpcyBhIGRhbmdlcm91cyByZW5hbWUgYW5kIGlzIGxp
a2VseSB0byBjYXVzZSBkaWZmaWN1bHQgdG8NCmlkZW50aWZ5IGJ1Z3MgaW4gYW55IGNvZGUgeW91
J3ZlIG1pc3NlZC4NCg0KCURhdmlkDQoNCg==
^ permalink raw reply [flat|nested] 77+ messages in thread
* Re: [PATCH 07/13] sparc/PCI: Use new pci_is_bridge() to simplify code
2014-04-25 9:18 ` Yijing Wang
(?)
(?)
@ 2014-04-25 16:49 ` David Miller
-1 siblings, 0 replies; 77+ messages in thread
From: David Miller @ 2014-04-25 16:49 UTC (permalink / raw)
To: wangyijing
Cc: bhelgaas, linuxppc-dev, linux-kernel, tony.luck, linux-ia64,
sparclinux, tglx, x86, benh
From: Yijing Wang <wangyijing@huawei.com>
Date: Fri, 25 Apr 2014 17:18:29 +0800
> Now we can use new pci_is_bridge() helper function
> to simplify code.
>
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Acked-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply [flat|nested] 77+ messages in thread
* Re: [PATCH 07/13] sparc/PCI: Use new pci_is_bridge() to simplify code
@ 2014-04-25 16:49 ` David Miller
0 siblings, 0 replies; 77+ messages in thread
From: David Miller @ 2014-04-25 16:49 UTC (permalink / raw)
To: wangyijing
Cc: tony.luck, linux-ia64, x86, linux-kernel, sparclinux, bhelgaas,
tglx, linuxppc-dev
From: Yijing Wang <wangyijing@huawei.com>
Date: Fri, 25 Apr 2014 17:18:29 +0800
> Now we can use new pci_is_bridge() helper function
> to simplify code.
>
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Acked-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply [flat|nested] 77+ messages in thread
* Re: [PATCH 07/13] sparc/PCI: Use new pci_is_bridge() to simplify code
@ 2014-04-25 16:49 ` David Miller
0 siblings, 0 replies; 77+ messages in thread
From: David Miller @ 2014-04-25 16:49 UTC (permalink / raw)
To: wangyijing
Cc: tony.luck, linux-ia64, x86, linux-kernel, sparclinux, bhelgaas,
tglx, linuxppc-dev
From: Yijing Wang <wangyijing@huawei.com>
Date: Fri, 25 Apr 2014 17:18:29 +0800
> Now we can use new pci_is_bridge() helper function
> to simplify code.
>
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Acked-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply [flat|nested] 77+ messages in thread
* Re: [PATCH 07/13] sparc/PCI: Use new pci_is_bridge() to simplify code
@ 2014-04-25 16:49 ` David Miller
0 siblings, 0 replies; 77+ messages in thread
From: David Miller @ 2014-04-25 16:49 UTC (permalink / raw)
To: wangyijing
Cc: bhelgaas, linuxppc-dev, linux-kernel, tony.luck, linux-ia64,
sparclinux, tglx, x86, benh
From: Yijing Wang <wangyijing@huawei.com>
Date: Fri, 25 Apr 2014 17:18:29 +0800
> Now we can use new pci_is_bridge() helper function
> to simplify code.
>
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Acked-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply [flat|nested] 77+ messages in thread
* Re: [PATCH 00/13] Refactor pci_is_brdige() to simplify code
2014-04-25 9:42 ` David Laight
@ 2014-04-26 2:49 ` Yijing Wang
-1 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-26 2:49 UTC (permalink / raw)
To: David Laight, Bjorn Helgaas
Cc: Tony Luck, linux-ia64, x86, linux-kernel, sparclinux,
Thomas Gleixner, linuxppc-dev, David S. Miller
On 2014/4/25 17:42, David Laight wrote:
> From: Yijing Wang
>> This patchset rename the current pci_is_bridge() to pci_has_subordinate(),
>> and introduce a new pci_is_bridge() which determine pci bridge by check
>> dev->hdr_type. The new one is more accurate. PCIe Spec define the pci
>> device is a bridge by the dev->hdr_type = 0x01 || 0x02.
>
> That is a dangerous rename and is likely to cause difficult to
Hi David,
I renamed pci_is_bridge() to pci_has_subordinate() because
static inline bool pci_is_bridge(struct pci_dev *pci_dev)
{
return !!(pci_dev->subordinate);
}
which always check dev->subordinate.
> identify bugs in any code you've missed.
What are you referring to ?
Thanks!
Yijing.
>
> David
>
> \x04�{.n�+�������+%��lzwm��b�맲��r��zX��\x19\x1e�w��{ay�\x1dʇڙ�,j\a��f���h���z�\x1e�w���\f���j:+v���w�j�m����\a����zZ+�����ݢj"��!�iO��z��v�^\x14\x04\x1a�^[m����\vnƊ��Y&�
>
--
Thanks!
Yijing
^ permalink raw reply [flat|nested] 77+ messages in thread
* Re: [PATCH 00/13] Refactor pci_is_brdige() to simplify code
@ 2014-04-26 2:49 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-04-26 2:49 UTC (permalink / raw)
To: David Laight, Bjorn Helgaas
Cc: Tony Luck, linux-ia64, x86, linux-kernel, sparclinux,
Thomas Gleixner, linuxppc-dev, David S. Miller
On 2014/4/25 17:42, David Laight wrote:
> From: Yijing Wang
>> This patchset rename the current pci_is_bridge() to pci_has_subordinate(),
>> and introduce a new pci_is_bridge() which determine pci bridge by check
>> dev->hdr_type. The new one is more accurate. PCIe Spec define the pci
>> device is a bridge by the dev->hdr_type = 0x01 || 0x02.
>
> That is a dangerous rename and is likely to cause difficult to
Hi David,
I renamed pci_is_bridge() to pci_has_subordinate() because
static inline bool pci_is_bridge(struct pci_dev *pci_dev)
{
return !!(pci_dev->subordinate);
}
which always check dev->subordinate.
> identify bugs in any code you've missed.
What are you referring to ?
Thanks!
Yijing.
>
> David
>
> \x04�{.n�+�������+%��lzwm��b�맲��r��zX��\x19\x1e�w��{ay�\x1dʇڙ�,j\a��f���h���z�\x1e�w���\f���j:+v���w�j�m����\a����zZ+�����ݢj"��!�iO��z��v�^\x14\x04\x1a�^[m����\vnƊ��Y&�
>
--
Thanks!
Yijing
^ permalink raw reply [flat|nested] 77+ messages in thread
* Re: [PATCH 08/13] PCI, rpaphp: Use new pci_is_bridge() to simplify code
2014-04-25 9:18 ` Yijing Wang
(?)
(?)
@ 2014-04-28 0:43 ` Benjamin Herrenschmidt
-1 siblings, 0 replies; 77+ messages in thread
From: Benjamin Herrenschmidt @ 2014-04-28 0:43 UTC (permalink / raw)
To: Yijing Wang
Cc: Bjorn Helgaas, linuxppc-dev, linux-kernel, Tony Luck, linux-ia64,
David S. Miller, sparclinux, Thomas Gleixner, x86
On Fri, 2014-04-25 at 17:18 +0800, Yijing Wang wrote:
> Now we can use new pci_is_bridge() helper function
> to simplify code.
>
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
> drivers/pci/hotplug/rpadlpar_core.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/hotplug/rpadlpar_core.c b/drivers/pci/hotplug/rpadlpar_core.c
> index 4fcdeed..7660232 100644
> --- a/drivers/pci/hotplug/rpadlpar_core.c
> +++ b/drivers/pci/hotplug/rpadlpar_core.c
> @@ -157,8 +157,7 @@ static void dlpar_pci_add_bus(struct device_node *dn)
> }
>
> /* Scan below the new bridge */
> - if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
> - dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)
> + if (pci_is_bridge(dev))
> of_scan_pci_bridge(dev);
>
> /* Map IO space for child bus, which may or may not succeed */
^ permalink raw reply [flat|nested] 77+ messages in thread
* Re: [PATCH 08/13] PCI, rpaphp: Use new pci_is_bridge() to simplify code
@ 2014-04-28 0:43 ` Benjamin Herrenschmidt
0 siblings, 0 replies; 77+ messages in thread
From: Benjamin Herrenschmidt @ 2014-04-28 0:43 UTC (permalink / raw)
To: Yijing Wang
Cc: Tony Luck, linux-ia64, x86, linux-kernel, sparclinux,
Bjorn Helgaas, Thomas Gleixner, linuxppc-dev, David S. Miller
On Fri, 2014-04-25 at 17:18 +0800, Yijing Wang wrote:
> Now we can use new pci_is_bridge() helper function
> to simplify code.
>
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
> drivers/pci/hotplug/rpadlpar_core.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/hotplug/rpadlpar_core.c b/drivers/pci/hotplug/rpadlpar_core.c
> index 4fcdeed..7660232 100644
> --- a/drivers/pci/hotplug/rpadlpar_core.c
> +++ b/drivers/pci/hotplug/rpadlpar_core.c
> @@ -157,8 +157,7 @@ static void dlpar_pci_add_bus(struct device_node *dn)
> }
>
> /* Scan below the new bridge */
> - if (dev->hdr_type = PCI_HEADER_TYPE_BRIDGE ||
> - dev->hdr_type = PCI_HEADER_TYPE_CARDBUS)
> + if (pci_is_bridge(dev))
> of_scan_pci_bridge(dev);
>
> /* Map IO space for child bus, which may or may not succeed */
^ permalink raw reply [flat|nested] 77+ messages in thread
* Re: [PATCH 08/13] PCI, rpaphp: Use new pci_is_bridge() to simplify code
@ 2014-04-28 0:43 ` Benjamin Herrenschmidt
0 siblings, 0 replies; 77+ messages in thread
From: Benjamin Herrenschmidt @ 2014-04-28 0:43 UTC (permalink / raw)
To: Yijing Wang
Cc: Tony Luck, linux-ia64, x86, linux-kernel, sparclinux,
Bjorn Helgaas, Thomas Gleixner, linuxppc-dev, David S. Miller
On Fri, 2014-04-25 at 17:18 +0800, Yijing Wang wrote:
> Now we can use new pci_is_bridge() helper function
> to simplify code.
>
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
> drivers/pci/hotplug/rpadlpar_core.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/hotplug/rpadlpar_core.c b/drivers/pci/hotplug/rpadlpar_core.c
> index 4fcdeed..7660232 100644
> --- a/drivers/pci/hotplug/rpadlpar_core.c
> +++ b/drivers/pci/hotplug/rpadlpar_core.c
> @@ -157,8 +157,7 @@ static void dlpar_pci_add_bus(struct device_node *dn)
> }
>
> /* Scan below the new bridge */
> - if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
> - dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)
> + if (pci_is_bridge(dev))
> of_scan_pci_bridge(dev);
>
> /* Map IO space for child bus, which may or may not succeed */
^ permalink raw reply [flat|nested] 77+ messages in thread
* Re: [PATCH 08/13] PCI, rpaphp: Use new pci_is_bridge() to simplify code
@ 2014-04-28 0:43 ` Benjamin Herrenschmidt
0 siblings, 0 replies; 77+ messages in thread
From: Benjamin Herrenschmidt @ 2014-04-28 0:43 UTC (permalink / raw)
To: Yijing Wang
Cc: Bjorn Helgaas, linuxppc-dev, linux-kernel, Tony Luck, linux-ia64,
David S. Miller, sparclinux, Thomas Gleixner, x86
On Fri, 2014-04-25 at 17:18 +0800, Yijing Wang wrote:
> Now we can use new pci_is_bridge() helper function
> to simplify code.
>
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
> drivers/pci/hotplug/rpadlpar_core.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/hotplug/rpadlpar_core.c b/drivers/pci/hotplug/rpadlpar_core.c
> index 4fcdeed..7660232 100644
> --- a/drivers/pci/hotplug/rpadlpar_core.c
> +++ b/drivers/pci/hotplug/rpadlpar_core.c
> @@ -157,8 +157,7 @@ static void dlpar_pci_add_bus(struct device_node *dn)
> }
>
> /* Scan below the new bridge */
> - if (dev->hdr_type = PCI_HEADER_TYPE_BRIDGE ||
> - dev->hdr_type = PCI_HEADER_TYPE_CARDBUS)
> + if (pci_is_bridge(dev))
> of_scan_pci_bridge(dev);
>
> /* Map IO space for child bus, which may or may not succeed */
^ permalink raw reply [flat|nested] 77+ messages in thread
* Re: [PATCH 00/13] Refactor pci_is_brdige() to simplify code
2014-04-25 9:18 ` Yijing Wang
(?)
(?)
@ 2014-04-30 16:29 ` Bjorn Helgaas
-1 siblings, 0 replies; 77+ messages in thread
From: Bjorn Helgaas @ 2014-04-30 16:29 UTC (permalink / raw)
To: Yijing Wang
Cc: linuxppc-dev, linux-kernel, Tony Luck, linux-ia64,
David S. Miller, sparclinux, Thomas Gleixner, x86,
Benjamin Herrenschmidt
On Fri, Apr 25, 2014 at 3:18 AM, Yijing Wang <wangyijing@huawei.com> wrote:
> This patchset rename the current pci_is_bridge() to pci_has_subordinate(),
> and introduce a new pci_is_bridge() which determine pci bridge by check
> dev->hdr_type. The new one is more accurate. PCIe Spec define the pci
> device is a bridge by the dev->hdr_type = 0x01 || 0x02.
This needs to be posted to the linux-pci list. The fact that it
wasn't means it's not in patchwork, so it's not on my to-do list.
Currently we have one interface: pci_is_bridge().
After your series, we would have two interfaces: pci_is_bridge() and
pci_has_subordinate(). Presumably, both are used, and you should
explain how you decided which to use at each place.
I assume the difference is that the old pci_is_bridge() is true for a
bridge that has a subordinate bus. The new pci_is_bridge() is true
for any bridge, even if there is no subordinate bus. When do we even
have a bridge with no subordinate bus? This is the sort of stuff you
need to explain so we know why we should apply these patches.
Bjorn
> Yijing Wang (13):
> PCI: rename pci_is_bridge() to pci_has_subordinate()
> PCI: Introduce new pci_is_bridge() helper function
> PCI: Use new pci_is_bridge() to simplify code
> x86/PCI: Use new pci_is_bridge() to simplify code
> IA64/PCI: Use new pci_is_bridge() to simplify code
> powerpc/PCI: Use new pci_is_bridge() to simplify code
> sparc/PCI: Use new pci_is_bridge() to simplify code
> PCI, rpaphp: Use new pci_is_bridge() to simplify code
> PCI, shpchp: Use new pci_is_bridge() to simplify code
> PCI, cpcihp: Use new pci_is_bridge() to simplify code
> PCI, acpiphp: Use new pci_is_bridge() to simplify code
> PCI, pcmcia: Use new pci_is_bridge() to simplify code
> PCI, pciehp: Use new pci_is_bridge() to simplify code
>
> arch/ia64/pci/fixup.c | 4 +---
> arch/powerpc/kernel/pci-hotplug.c | 3 +--
> arch/powerpc/kernel/pci_of_scan.c | 3 +--
> arch/sparc/kernel/pci.c | 3 +--
> arch/x86/pci/fixup.c | 4 +---
> drivers/pci/hotplug/acpiphp_glue.c | 3 +--
> drivers/pci/hotplug/cpci_hotplug_pci.c | 3 +--
> drivers/pci/hotplug/pciehp_pci.c | 3 +--
> drivers/pci/hotplug/rpadlpar_core.c | 3 +--
> drivers/pci/hotplug/shpchp_pci.c | 3 +--
> drivers/pci/pci-acpi.c | 8 +-------
> drivers/pci/pci-driver.c | 8 ++++----
> drivers/pci/pci.h | 2 +-
> drivers/pci/probe.c | 3 +--
> drivers/pci/setup-bus.c | 4 +---
> drivers/pcmcia/cardbus.c | 3 +--
> include/linux/pci.h | 6 ++++++
> 17 files changed, 25 insertions(+), 41 deletions(-)
>
>
^ permalink raw reply [flat|nested] 77+ messages in thread
* Re: [PATCH 00/13] Refactor pci_is_brdige() to simplify code
@ 2014-04-30 16:29 ` Bjorn Helgaas
0 siblings, 0 replies; 77+ messages in thread
From: Bjorn Helgaas @ 2014-04-30 16:29 UTC (permalink / raw)
To: Yijing Wang
Cc: Tony Luck, linux-ia64, x86, linux-kernel, sparclinux,
Thomas Gleixner, linuxppc-dev, David S. Miller
On Fri, Apr 25, 2014 at 3:18 AM, Yijing Wang <wangyijing@huawei.com> wrote:
> This patchset rename the current pci_is_bridge() to pci_has_subordinate(),
> and introduce a new pci_is_bridge() which determine pci bridge by check
> dev->hdr_type. The new one is more accurate. PCIe Spec define the pci
> device is a bridge by the dev->hdr_type = 0x01 || 0x02.
This needs to be posted to the linux-pci list. The fact that it
wasn't means it's not in patchwork, so it's not on my to-do list.
Currently we have one interface: pci_is_bridge().
After your series, we would have two interfaces: pci_is_bridge() and
pci_has_subordinate(). Presumably, both are used, and you should
explain how you decided which to use at each place.
I assume the difference is that the old pci_is_bridge() is true for a
bridge that has a subordinate bus. The new pci_is_bridge() is true
for any bridge, even if there is no subordinate bus. When do we even
have a bridge with no subordinate bus? This is the sort of stuff you
need to explain so we know why we should apply these patches.
Bjorn
> Yijing Wang (13):
> PCI: rename pci_is_bridge() to pci_has_subordinate()
> PCI: Introduce new pci_is_bridge() helper function
> PCI: Use new pci_is_bridge() to simplify code
> x86/PCI: Use new pci_is_bridge() to simplify code
> IA64/PCI: Use new pci_is_bridge() to simplify code
> powerpc/PCI: Use new pci_is_bridge() to simplify code
> sparc/PCI: Use new pci_is_bridge() to simplify code
> PCI, rpaphp: Use new pci_is_bridge() to simplify code
> PCI, shpchp: Use new pci_is_bridge() to simplify code
> PCI, cpcihp: Use new pci_is_bridge() to simplify code
> PCI, acpiphp: Use new pci_is_bridge() to simplify code
> PCI, pcmcia: Use new pci_is_bridge() to simplify code
> PCI, pciehp: Use new pci_is_bridge() to simplify code
>
> arch/ia64/pci/fixup.c | 4 +---
> arch/powerpc/kernel/pci-hotplug.c | 3 +--
> arch/powerpc/kernel/pci_of_scan.c | 3 +--
> arch/sparc/kernel/pci.c | 3 +--
> arch/x86/pci/fixup.c | 4 +---
> drivers/pci/hotplug/acpiphp_glue.c | 3 +--
> drivers/pci/hotplug/cpci_hotplug_pci.c | 3 +--
> drivers/pci/hotplug/pciehp_pci.c | 3 +--
> drivers/pci/hotplug/rpadlpar_core.c | 3 +--
> drivers/pci/hotplug/shpchp_pci.c | 3 +--
> drivers/pci/pci-acpi.c | 8 +-------
> drivers/pci/pci-driver.c | 8 ++++----
> drivers/pci/pci.h | 2 +-
> drivers/pci/probe.c | 3 +--
> drivers/pci/setup-bus.c | 4 +---
> drivers/pcmcia/cardbus.c | 3 +--
> include/linux/pci.h | 6 ++++++
> 17 files changed, 25 insertions(+), 41 deletions(-)
>
>
^ permalink raw reply [flat|nested] 77+ messages in thread
* Re: [PATCH 00/13] Refactor pci_is_brdige() to simplify code
@ 2014-04-30 16:29 ` Bjorn Helgaas
0 siblings, 0 replies; 77+ messages in thread
From: Bjorn Helgaas @ 2014-04-30 16:29 UTC (permalink / raw)
To: Yijing Wang
Cc: Tony Luck, linux-ia64, x86, linux-kernel, sparclinux,
Thomas Gleixner, linuxppc-dev, David S. Miller
On Fri, Apr 25, 2014 at 3:18 AM, Yijing Wang <wangyijing@huawei.com> wrote:
> This patchset rename the current pci_is_bridge() to pci_has_subordinate(),
> and introduce a new pci_is_bridge() which determine pci bridge by check
> dev->hdr_type. The new one is more accurate. PCIe Spec define the pci
> device is a bridge by the dev->hdr_type = 0x01 || 0x02.
This needs to be posted to the linux-pci list. The fact that it
wasn't means it's not in patchwork, so it's not on my to-do list.
Currently we have one interface: pci_is_bridge().
After your series, we would have two interfaces: pci_is_bridge() and
pci_has_subordinate(). Presumably, both are used, and you should
explain how you decided which to use at each place.
I assume the difference is that the old pci_is_bridge() is true for a
bridge that has a subordinate bus. The new pci_is_bridge() is true
for any bridge, even if there is no subordinate bus. When do we even
have a bridge with no subordinate bus? This is the sort of stuff you
need to explain so we know why we should apply these patches.
Bjorn
> Yijing Wang (13):
> PCI: rename pci_is_bridge() to pci_has_subordinate()
> PCI: Introduce new pci_is_bridge() helper function
> PCI: Use new pci_is_bridge() to simplify code
> x86/PCI: Use new pci_is_bridge() to simplify code
> IA64/PCI: Use new pci_is_bridge() to simplify code
> powerpc/PCI: Use new pci_is_bridge() to simplify code
> sparc/PCI: Use new pci_is_bridge() to simplify code
> PCI, rpaphp: Use new pci_is_bridge() to simplify code
> PCI, shpchp: Use new pci_is_bridge() to simplify code
> PCI, cpcihp: Use new pci_is_bridge() to simplify code
> PCI, acpiphp: Use new pci_is_bridge() to simplify code
> PCI, pcmcia: Use new pci_is_bridge() to simplify code
> PCI, pciehp: Use new pci_is_bridge() to simplify code
>
> arch/ia64/pci/fixup.c | 4 +---
> arch/powerpc/kernel/pci-hotplug.c | 3 +--
> arch/powerpc/kernel/pci_of_scan.c | 3 +--
> arch/sparc/kernel/pci.c | 3 +--
> arch/x86/pci/fixup.c | 4 +---
> drivers/pci/hotplug/acpiphp_glue.c | 3 +--
> drivers/pci/hotplug/cpci_hotplug_pci.c | 3 +--
> drivers/pci/hotplug/pciehp_pci.c | 3 +--
> drivers/pci/hotplug/rpadlpar_core.c | 3 +--
> drivers/pci/hotplug/shpchp_pci.c | 3 +--
> drivers/pci/pci-acpi.c | 8 +-------
> drivers/pci/pci-driver.c | 8 ++++----
> drivers/pci/pci.h | 2 +-
> drivers/pci/probe.c | 3 +--
> drivers/pci/setup-bus.c | 4 +---
> drivers/pcmcia/cardbus.c | 3 +--
> include/linux/pci.h | 6 ++++++
> 17 files changed, 25 insertions(+), 41 deletions(-)
>
>
^ permalink raw reply [flat|nested] 77+ messages in thread
* Re: [PATCH 00/13] Refactor pci_is_brdige() to simplify code
@ 2014-04-30 16:29 ` Bjorn Helgaas
0 siblings, 0 replies; 77+ messages in thread
From: Bjorn Helgaas @ 2014-04-30 16:29 UTC (permalink / raw)
To: Yijing Wang
Cc: linuxppc-dev, linux-kernel, Tony Luck, linux-ia64,
David S. Miller, sparclinux, Thomas Gleixner, x86,
Benjamin Herrenschmidt
On Fri, Apr 25, 2014 at 3:18 AM, Yijing Wang <wangyijing@huawei.com> wrote:
> This patchset rename the current pci_is_bridge() to pci_has_subordinate(),
> and introduce a new pci_is_bridge() which determine pci bridge by check
> dev->hdr_type. The new one is more accurate. PCIe Spec define the pci
> device is a bridge by the dev->hdr_type = 0x01 || 0x02.
This needs to be posted to the linux-pci list. The fact that it
wasn't means it's not in patchwork, so it's not on my to-do list.
Currently we have one interface: pci_is_bridge().
After your series, we would have two interfaces: pci_is_bridge() and
pci_has_subordinate(). Presumably, both are used, and you should
explain how you decided which to use at each place.
I assume the difference is that the old pci_is_bridge() is true for a
bridge that has a subordinate bus. The new pci_is_bridge() is true
for any bridge, even if there is no subordinate bus. When do we even
have a bridge with no subordinate bus? This is the sort of stuff you
need to explain so we know why we should apply these patches.
Bjorn
> Yijing Wang (13):
> PCI: rename pci_is_bridge() to pci_has_subordinate()
> PCI: Introduce new pci_is_bridge() helper function
> PCI: Use new pci_is_bridge() to simplify code
> x86/PCI: Use new pci_is_bridge() to simplify code
> IA64/PCI: Use new pci_is_bridge() to simplify code
> powerpc/PCI: Use new pci_is_bridge() to simplify code
> sparc/PCI: Use new pci_is_bridge() to simplify code
> PCI, rpaphp: Use new pci_is_bridge() to simplify code
> PCI, shpchp: Use new pci_is_bridge() to simplify code
> PCI, cpcihp: Use new pci_is_bridge() to simplify code
> PCI, acpiphp: Use new pci_is_bridge() to simplify code
> PCI, pcmcia: Use new pci_is_bridge() to simplify code
> PCI, pciehp: Use new pci_is_bridge() to simplify code
>
> arch/ia64/pci/fixup.c | 4 +---
> arch/powerpc/kernel/pci-hotplug.c | 3 +--
> arch/powerpc/kernel/pci_of_scan.c | 3 +--
> arch/sparc/kernel/pci.c | 3 +--
> arch/x86/pci/fixup.c | 4 +---
> drivers/pci/hotplug/acpiphp_glue.c | 3 +--
> drivers/pci/hotplug/cpci_hotplug_pci.c | 3 +--
> drivers/pci/hotplug/pciehp_pci.c | 3 +--
> drivers/pci/hotplug/rpadlpar_core.c | 3 +--
> drivers/pci/hotplug/shpchp_pci.c | 3 +--
> drivers/pci/pci-acpi.c | 8 +-------
> drivers/pci/pci-driver.c | 8 ++++----
> drivers/pci/pci.h | 2 +-
> drivers/pci/probe.c | 3 +--
> drivers/pci/setup-bus.c | 4 +---
> drivers/pcmcia/cardbus.c | 3 +--
> include/linux/pci.h | 6 ++++++
> 17 files changed, 25 insertions(+), 41 deletions(-)
>
>
^ permalink raw reply [flat|nested] 77+ messages in thread
* Re: [PATCH 00/13] Refactor pci_is_brdige() to simplify code
2014-04-30 16:29 ` Bjorn Helgaas
(?)
(?)
@ 2014-05-04 4:16 ` Yijing Wang
-1 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-05-04 4:16 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linuxppc-dev, linux-kernel, Tony Luck, linux-ia64,
David S. Miller, sparclinux, Thomas Gleixner, x86,
Benjamin Herrenschmidt
> This needs to be posted to the linux-pci list. The fact that it
> wasn't means it's not in patchwork, so it's not on my to-do list.
>
> Currently we have one interface: pci_is_bridge().
>
> After your series, we would have two interfaces: pci_is_bridge() and
> pci_has_subordinate(). Presumably, both are used, and you should
> explain how you decided which to use at each place.
>
> I assume the difference is that the old pci_is_bridge() is true for a
> bridge that has a subordinate bus. The new pci_is_bridge() is true
> for any bridge, even if there is no subordinate bus. When do we even
> have a bridge with no subordinate bus? This is the sort of stuff you
> need to explain so we know why we should apply these patches.
>
Hi Bjorn, sorry forgot to cc pci list, will resend the v2 patchset with
some new description for new pci_is_bridge().
>
>> Yijing Wang (13):
>> PCI: rename pci_is_bridge() to pci_has_subordinate()
>> PCI: Introduce new pci_is_bridge() helper function
>> PCI: Use new pci_is_bridge() to simplify code
>> x86/PCI: Use new pci_is_bridge() to simplify code
>> IA64/PCI: Use new pci_is_bridge() to simplify code
>> powerpc/PCI: Use new pci_is_bridge() to simplify code
>> sparc/PCI: Use new pci_is_bridge() to simplify code
>> PCI, rpaphp: Use new pci_is_bridge() to simplify code
>> PCI, shpchp: Use new pci_is_bridge() to simplify code
>> PCI, cpcihp: Use new pci_is_bridge() to simplify code
>> PCI, acpiphp: Use new pci_is_bridge() to simplify code
>> PCI, pcmcia: Use new pci_is_bridge() to simplify code
>> PCI, pciehp: Use new pci_is_bridge() to simplify code
>>
>> arch/ia64/pci/fixup.c | 4 +---
>> arch/powerpc/kernel/pci-hotplug.c | 3 +--
>> arch/powerpc/kernel/pci_of_scan.c | 3 +--
>> arch/sparc/kernel/pci.c | 3 +--
>> arch/x86/pci/fixup.c | 4 +---
>> drivers/pci/hotplug/acpiphp_glue.c | 3 +--
>> drivers/pci/hotplug/cpci_hotplug_pci.c | 3 +--
>> drivers/pci/hotplug/pciehp_pci.c | 3 +--
>> drivers/pci/hotplug/rpadlpar_core.c | 3 +--
>> drivers/pci/hotplug/shpchp_pci.c | 3 +--
>> drivers/pci/pci-acpi.c | 8 +-------
>> drivers/pci/pci-driver.c | 8 ++++----
>> drivers/pci/pci.h | 2 +-
>> drivers/pci/probe.c | 3 +--
>> drivers/pci/setup-bus.c | 4 +---
>> drivers/pcmcia/cardbus.c | 3 +--
>> include/linux/pci.h | 6 ++++++
>> 17 files changed, 25 insertions(+), 41 deletions(-)
>>
>>
>
> .
>
--
Thanks!
Yijing
^ permalink raw reply [flat|nested] 77+ messages in thread
* Re: [PATCH 00/13] Refactor pci_is_brdige() to simplify code
@ 2014-05-04 4:16 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-05-04 4:16 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Tony Luck, linux-ia64, x86, linux-kernel, sparclinux,
Thomas Gleixner, linuxppc-dev, David S. Miller
> This needs to be posted to the linux-pci list. The fact that it
> wasn't means it's not in patchwork, so it's not on my to-do list.
>
> Currently we have one interface: pci_is_bridge().
>
> After your series, we would have two interfaces: pci_is_bridge() and
> pci_has_subordinate(). Presumably, both are used, and you should
> explain how you decided which to use at each place.
>
> I assume the difference is that the old pci_is_bridge() is true for a
> bridge that has a subordinate bus. The new pci_is_bridge() is true
> for any bridge, even if there is no subordinate bus. When do we even
> have a bridge with no subordinate bus? This is the sort of stuff you
> need to explain so we know why we should apply these patches.
>
Hi Bjorn, sorry forgot to cc pci list, will resend the v2 patchset with
some new description for new pci_is_bridge().
>
>> Yijing Wang (13):
>> PCI: rename pci_is_bridge() to pci_has_subordinate()
>> PCI: Introduce new pci_is_bridge() helper function
>> PCI: Use new pci_is_bridge() to simplify code
>> x86/PCI: Use new pci_is_bridge() to simplify code
>> IA64/PCI: Use new pci_is_bridge() to simplify code
>> powerpc/PCI: Use new pci_is_bridge() to simplify code
>> sparc/PCI: Use new pci_is_bridge() to simplify code
>> PCI, rpaphp: Use new pci_is_bridge() to simplify code
>> PCI, shpchp: Use new pci_is_bridge() to simplify code
>> PCI, cpcihp: Use new pci_is_bridge() to simplify code
>> PCI, acpiphp: Use new pci_is_bridge() to simplify code
>> PCI, pcmcia: Use new pci_is_bridge() to simplify code
>> PCI, pciehp: Use new pci_is_bridge() to simplify code
>>
>> arch/ia64/pci/fixup.c | 4 +---
>> arch/powerpc/kernel/pci-hotplug.c | 3 +--
>> arch/powerpc/kernel/pci_of_scan.c | 3 +--
>> arch/sparc/kernel/pci.c | 3 +--
>> arch/x86/pci/fixup.c | 4 +---
>> drivers/pci/hotplug/acpiphp_glue.c | 3 +--
>> drivers/pci/hotplug/cpci_hotplug_pci.c | 3 +--
>> drivers/pci/hotplug/pciehp_pci.c | 3 +--
>> drivers/pci/hotplug/rpadlpar_core.c | 3 +--
>> drivers/pci/hotplug/shpchp_pci.c | 3 +--
>> drivers/pci/pci-acpi.c | 8 +-------
>> drivers/pci/pci-driver.c | 8 ++++----
>> drivers/pci/pci.h | 2 +-
>> drivers/pci/probe.c | 3 +--
>> drivers/pci/setup-bus.c | 4 +---
>> drivers/pcmcia/cardbus.c | 3 +--
>> include/linux/pci.h | 6 ++++++
>> 17 files changed, 25 insertions(+), 41 deletions(-)
>>
>>
>
> .
>
--
Thanks!
Yijing
^ permalink raw reply [flat|nested] 77+ messages in thread
* Re: [PATCH 00/13] Refactor pci_is_brdige() to simplify code
@ 2014-05-04 4:16 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-05-04 4:16 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Tony Luck, linux-ia64, x86, linux-kernel, sparclinux,
Thomas Gleixner, linuxppc-dev, David S. Miller
> This needs to be posted to the linux-pci list. The fact that it
> wasn't means it's not in patchwork, so it's not on my to-do list.
>
> Currently we have one interface: pci_is_bridge().
>
> After your series, we would have two interfaces: pci_is_bridge() and
> pci_has_subordinate(). Presumably, both are used, and you should
> explain how you decided which to use at each place.
>
> I assume the difference is that the old pci_is_bridge() is true for a
> bridge that has a subordinate bus. The new pci_is_bridge() is true
> for any bridge, even if there is no subordinate bus. When do we even
> have a bridge with no subordinate bus? This is the sort of stuff you
> need to explain so we know why we should apply these patches.
>
Hi Bjorn, sorry forgot to cc pci list, will resend the v2 patchset with
some new description for new pci_is_bridge().
>
>> Yijing Wang (13):
>> PCI: rename pci_is_bridge() to pci_has_subordinate()
>> PCI: Introduce new pci_is_bridge() helper function
>> PCI: Use new pci_is_bridge() to simplify code
>> x86/PCI: Use new pci_is_bridge() to simplify code
>> IA64/PCI: Use new pci_is_bridge() to simplify code
>> powerpc/PCI: Use new pci_is_bridge() to simplify code
>> sparc/PCI: Use new pci_is_bridge() to simplify code
>> PCI, rpaphp: Use new pci_is_bridge() to simplify code
>> PCI, shpchp: Use new pci_is_bridge() to simplify code
>> PCI, cpcihp: Use new pci_is_bridge() to simplify code
>> PCI, acpiphp: Use new pci_is_bridge() to simplify code
>> PCI, pcmcia: Use new pci_is_bridge() to simplify code
>> PCI, pciehp: Use new pci_is_bridge() to simplify code
>>
>> arch/ia64/pci/fixup.c | 4 +---
>> arch/powerpc/kernel/pci-hotplug.c | 3 +--
>> arch/powerpc/kernel/pci_of_scan.c | 3 +--
>> arch/sparc/kernel/pci.c | 3 +--
>> arch/x86/pci/fixup.c | 4 +---
>> drivers/pci/hotplug/acpiphp_glue.c | 3 +--
>> drivers/pci/hotplug/cpci_hotplug_pci.c | 3 +--
>> drivers/pci/hotplug/pciehp_pci.c | 3 +--
>> drivers/pci/hotplug/rpadlpar_core.c | 3 +--
>> drivers/pci/hotplug/shpchp_pci.c | 3 +--
>> drivers/pci/pci-acpi.c | 8 +-------
>> drivers/pci/pci-driver.c | 8 ++++----
>> drivers/pci/pci.h | 2 +-
>> drivers/pci/probe.c | 3 +--
>> drivers/pci/setup-bus.c | 4 +---
>> drivers/pcmcia/cardbus.c | 3 +--
>> include/linux/pci.h | 6 ++++++
>> 17 files changed, 25 insertions(+), 41 deletions(-)
>>
>>
>
> .
>
--
Thanks!
Yijing
^ permalink raw reply [flat|nested] 77+ messages in thread
* Re: [PATCH 00/13] Refactor pci_is_brdige() to simplify code
@ 2014-05-04 4:16 ` Yijing Wang
0 siblings, 0 replies; 77+ messages in thread
From: Yijing Wang @ 2014-05-04 4:16 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linuxppc-dev, linux-kernel, Tony Luck, linux-ia64,
David S. Miller, sparclinux, Thomas Gleixner, x86,
Benjamin Herrenschmidt
> This needs to be posted to the linux-pci list. The fact that it
> wasn't means it's not in patchwork, so it's not on my to-do list.
>
> Currently we have one interface: pci_is_bridge().
>
> After your series, we would have two interfaces: pci_is_bridge() and
> pci_has_subordinate(). Presumably, both are used, and you should
> explain how you decided which to use at each place.
>
> I assume the difference is that the old pci_is_bridge() is true for a
> bridge that has a subordinate bus. The new pci_is_bridge() is true
> for any bridge, even if there is no subordinate bus. When do we even
> have a bridge with no subordinate bus? This is the sort of stuff you
> need to explain so we know why we should apply these patches.
>
Hi Bjorn, sorry forgot to cc pci list, will resend the v2 patchset with
some new description for new pci_is_bridge().
>
>> Yijing Wang (13):
>> PCI: rename pci_is_bridge() to pci_has_subordinate()
>> PCI: Introduce new pci_is_bridge() helper function
>> PCI: Use new pci_is_bridge() to simplify code
>> x86/PCI: Use new pci_is_bridge() to simplify code
>> IA64/PCI: Use new pci_is_bridge() to simplify code
>> powerpc/PCI: Use new pci_is_bridge() to simplify code
>> sparc/PCI: Use new pci_is_bridge() to simplify code
>> PCI, rpaphp: Use new pci_is_bridge() to simplify code
>> PCI, shpchp: Use new pci_is_bridge() to simplify code
>> PCI, cpcihp: Use new pci_is_bridge() to simplify code
>> PCI, acpiphp: Use new pci_is_bridge() to simplify code
>> PCI, pcmcia: Use new pci_is_bridge() to simplify code
>> PCI, pciehp: Use new pci_is_bridge() to simplify code
>>
>> arch/ia64/pci/fixup.c | 4 +---
>> arch/powerpc/kernel/pci-hotplug.c | 3 +--
>> arch/powerpc/kernel/pci_of_scan.c | 3 +--
>> arch/sparc/kernel/pci.c | 3 +--
>> arch/x86/pci/fixup.c | 4 +---
>> drivers/pci/hotplug/acpiphp_glue.c | 3 +--
>> drivers/pci/hotplug/cpci_hotplug_pci.c | 3 +--
>> drivers/pci/hotplug/pciehp_pci.c | 3 +--
>> drivers/pci/hotplug/rpadlpar_core.c | 3 +--
>> drivers/pci/hotplug/shpchp_pci.c | 3 +--
>> drivers/pci/pci-acpi.c | 8 +-------
>> drivers/pci/pci-driver.c | 8 ++++----
>> drivers/pci/pci.h | 2 +-
>> drivers/pci/probe.c | 3 +--
>> drivers/pci/setup-bus.c | 4 +---
>> drivers/pcmcia/cardbus.c | 3 +--
>> include/linux/pci.h | 6 ++++++
>> 17 files changed, 25 insertions(+), 41 deletions(-)
>>
>>
>
> .
>
--
Thanks!
Yijing
^ permalink raw reply [flat|nested] 77+ messages in thread
end of thread, other threads:[~2014-05-04 4:21 UTC | newest]
Thread overview: 77+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-25 9:18 [PATCH 00/13] Refactor pci_is_brdige() to simplify code Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:18 ` [PATCH 01/13] PCI: rename pci_is_bridge() to pci_has_subordinate() Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:18 ` [PATCH 02/13] PCI: Introduce new pci_is_bridge() helper function Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:18 ` [PATCH 03/13] PCI: Use new pci_is_bridge() to simplify code Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:18 ` [PATCH 04/13] x86/PCI: " Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:18 ` [PATCH 05/13] IA64/PCI: " Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:18 ` [PATCH 06/13] powerpc/PCI: " Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:18 ` [PATCH 07/13] sparc/PCI: " Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 16:49 ` David Miller
2014-04-25 16:49 ` David Miller
2014-04-25 16:49 ` David Miller
2014-04-25 16:49 ` David Miller
2014-04-25 9:18 ` [PATCH 08/13] PCI, rpaphp: " Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-28 0:43 ` Benjamin Herrenschmidt
2014-04-28 0:43 ` Benjamin Herrenschmidt
2014-04-28 0:43 ` Benjamin Herrenschmidt
2014-04-28 0:43 ` Benjamin Herrenschmidt
2014-04-25 9:18 ` [PATCH 09/13] PCI, shpchp: " Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:18 ` [PATCH 10/13] PCI, cpcihp: " Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:18 ` [PATCH 11/13] PCI, acpiphp: " Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:18 ` [PATCH 12/13] PCI, pcmcia: " Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:18 ` [PATCH 13/13] PCI, pciehp: " Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:18 ` Yijing Wang
2014-04-25 9:42 ` [PATCH 00/13] Refactor pci_is_brdige() " David Laight
2014-04-25 9:42 ` David Laight
2014-04-25 9:42 ` David Laight
2014-04-26 2:49 ` Yijing Wang
2014-04-26 2:49 ` Yijing Wang
2014-04-30 16:29 ` Bjorn Helgaas
2014-04-30 16:29 ` Bjorn Helgaas
2014-04-30 16:29 ` Bjorn Helgaas
2014-04-30 16:29 ` Bjorn Helgaas
2014-05-04 4:16 ` Yijing Wang
2014-05-04 4:16 ` Yijing Wang
2014-05-04 4:16 ` Yijing Wang
2014-05-04 4:16 ` Yijing Wang
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.