linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [4.2.y-ckt stable] Linux 4.2.8-ckt13 stable review
@ 2016-07-08 17:06 Kamal Mostafa
  2016-07-08 17:07 ` [PATCH 4.2.y-ckt 1/5] [4.2-stable only] Revert "perf test: Ignore kcore files in the "vmlinux matches kallsyms" test" Kamal Mostafa
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Kamal Mostafa @ 2016-07-08 17:06 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Kamal Mostafa

This is the start of the review cycle for the Linux 4.2.8-ckt13 stable
kernel.

***
*** Note that this will be the FINAL 4.2.y-ckt RELEASE in this series.
***

This version contains 5 new patches, summarized below.  The new patches
are posted as replies to this message and also available in this git branch:

https://git.launchpad.net/~canonical-kernel/linux/+git/linux-stable-ckt/log/?h=linux-4.2.y-review

git://git.launchpad.net/~canonical-kernel/linux/+git/linux-stable-ckt  linux-4.2.y-review

The review period for version 4.2.8-ckt13 will be open for the next three
days.  To report a problem, please reply to the relevant follow-up patch
message.

For more information about the Linux 4.2.y-ckt extended stable kernel
series, see https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable .

 -Kamal

--
 arch/powerpc/platforms/pseries/iommu.c | 24 ++++++++--------
 drivers/net/can/dev.c                  |  3 ++
 mm/migrate.c                           | 51 +++++++++++++++++++++-------------
 tools/perf/tests/vmlinux-kallsyms.c    |  8 +-----
 4 files changed, 47 insertions(+), 39 deletions(-)

Gavin Shan (1):
      powerpc/pseries: Fix PCI config address for DDW

Guilherme G. Piccoli (1):
      powerpc/iommu: Remove the dependency on EEH struct in DDW mechanism

Hugh Dickins (1):
      mm: migrate dirty page without clear_page_dirty_for_io etc

Oliver Hartkopp (1):
      can: fix handling of unmodifiable configuration options fix

Tim Gardner (1):
      [4.2-stable only] Revert "perf test: Ignore kcore files in the "vmlinux matches kallsyms" test"

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 4.2.y-ckt 1/5] [4.2-stable only] Revert "perf test: Ignore kcore files in the "vmlinux matches kallsyms" test"
  2016-07-08 17:06 [4.2.y-ckt stable] Linux 4.2.8-ckt13 stable review Kamal Mostafa
@ 2016-07-08 17:07 ` Kamal Mostafa
  2016-07-08 17:07 ` [PATCH 4.2.y-ckt 2/5] mm: migrate dirty page without clear_page_dirty_for_io etc Kamal Mostafa
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Kamal Mostafa @ 2016-07-08 17:07 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Tim Gardner, Kamal Mostafa

4.2.8-ckt13 -stable review patch.  If anyone has any objections, please let me know.

---8<------------------------------------------------------------

From: Tim Gardner <tim.gardner@canonical.com>

BugLink: http://bugs.launchpad.net/bugs/1592552

This reverts commit 159436d273a248e99f05dcd15f39e2c6bdb02652.

Causes an FTBS.

tests/vmlinux-kallsyms.c: In function 'test__vmlinux_matches_kallsyms':
tests/vmlinux-kallsyms.c:64:6: error: implicit declaration of function '__machine__load_kallsyms' [-Werror=implicit-function-declaration]
  if (__machine__load_kallsyms(&kallsyms, "/proc/kallsyms", type, true, NULL) <= 0) {
      ^
tests/vmlinux-kallsyms.c:64:2: error: nested extern declaration of '__machine__load_kallsyms' [-Werror=nested-externs]
  if (__machine__load_kallsyms(&kallsyms, "/proc/kallsyms", type, true, NULL) <= 0) {
  ^
cc1: all warnings being treated as errors

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 tools/perf/tests/vmlinux-kallsyms.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/tools/perf/tests/vmlinux-kallsyms.c b/tools/perf/tests/vmlinux-kallsyms.c
index 8de34ea..b34c5fc 100644
--- a/tools/perf/tests/vmlinux-kallsyms.c
+++ b/tools/perf/tests/vmlinux-kallsyms.c
@@ -54,14 +54,8 @@ int test__vmlinux_matches_kallsyms(void)
 	 * Step 3:
 	 *
 	 * Load and split /proc/kallsyms into multiple maps, one per module.
-	 * Do not use kcore, as this test was designed before kcore support
-	 * and has parts that only make sense if using the non-kcore code.
-	 * XXX: extend it to stress the kcorre code as well, hint: the list
-	 * of modules extracted from /proc/kcore, in its current form, can't
-	 * be compacted against the list of modules found in the "vmlinux"
-	 * code and with the one got from /proc/modules from the "kallsyms" code.
 	 */
-	if (__machine__load_kallsyms(&kallsyms, "/proc/kallsyms", type, true, NULL) <= 0) {
+	if (machine__load_kallsyms(&kallsyms, "/proc/kallsyms", type, NULL) <= 0) {
 		pr_debug("dso__load_kallsyms ");
 		goto out;
 	}
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 4.2.y-ckt 2/5] mm: migrate dirty page without clear_page_dirty_for_io etc
  2016-07-08 17:06 [4.2.y-ckt stable] Linux 4.2.8-ckt13 stable review Kamal Mostafa
  2016-07-08 17:07 ` [PATCH 4.2.y-ckt 1/5] [4.2-stable only] Revert "perf test: Ignore kcore files in the "vmlinux matches kallsyms" test" Kamal Mostafa
@ 2016-07-08 17:07 ` Kamal Mostafa
  2016-07-08 17:07 ` [PATCH 4.2.y-ckt 3/5] can: fix handling of unmodifiable configuration options fix Kamal Mostafa
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Kamal Mostafa @ 2016-07-08 17:07 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Hugh Dickins, Christoph Lameter, Kirill A. Shutemov,
	Rik van Riel, Vlastimil Babka, Davidlohr Bueso, Oleg Nesterov,
	Sasha Levin, Dmitry Vyukov, KOSAKI Motohiro, Andrew Morton,
	Linus Torvalds, Ben Hutchings, Luis Henriques, Kamal Mostafa

4.2.8-ckt13 -stable review patch.  If anyone has any objections, please let me know.

---8<------------------------------------------------------------

From: Hugh Dickins <hughd@google.com>

commit 42cb14b110a5698ccf26ce59c4441722605a3743 upstream.

clear_page_dirty_for_io() has accumulated writeback and memcg subtleties
since v2.6.16 first introduced page migration; and the set_page_dirty()
which completed its migration of PageDirty, later had to be moderated to
__set_page_dirty_nobuffers(); then PageSwapBacked had to skip that too.

No actual problems seen with this procedure recently, but if you look into
what the clear_page_dirty_for_io(page)+set_page_dirty(newpage) is actually
achieving, it turns out to be nothing more than moving the PageDirty flag,
and its NR_FILE_DIRTY stat from one zone to another.

It would be good to avoid a pile of irrelevant decrementations and
incrementations, and improper event counting, and unnecessary descent of
the radix_tree under tree_lock (to set the PAGECACHE_TAG_DIRTY which
radix_tree_replace_slot() left in place anyway).

Do the NR_FILE_DIRTY movement, like the other stats movements, while
interrupts still disabled in migrate_page_move_mapping(); and don't even
bother if the zone is the same.  Do the PageDirty movement there under
tree_lock too, where old page is frozen and newpage not yet visible:
bearing in mind that as soon as newpage becomes visible in radix_tree, an
un-page-locked set_page_dirty() might interfere (or perhaps that's just
not possible: anything doing so should already hold an additional
reference to the old page, preventing its migration; but play safe).

But we do still need to transfer PageDirty in migrate_page_copy(), for
those who don't go the mapping route through migrate_page_move_mapping().

Signed-off-by: Hugh Dickins <hughd@google.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Sasha Levin <sasha.levin@oracle.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[bwh: Backported to 3.16: adjust context.  This is not just an optimisation,
 but turned out to fix a possible oops (CVE-2016-3070).]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 mm/migrate.c | 51 +++++++++++++++++++++++++++++++--------------------
 1 file changed, 31 insertions(+), 20 deletions(-)

diff --git a/mm/migrate.c b/mm/migrate.c
index fcb6204..a14784c 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -30,6 +30,7 @@
 #include <linux/mempolicy.h>
 #include <linux/vmalloc.h>
 #include <linux/security.h>
+#include <linux/backing-dev.h>
 #include <linux/memcontrol.h>
 #include <linux/syscalls.h>
 #include <linux/hugetlb.h>
@@ -310,6 +311,8 @@ int migrate_page_move_mapping(struct address_space *mapping,
 		struct buffer_head *head, enum migrate_mode mode,
 		int extra_count)
 {
+	struct zone *oldzone, *newzone;
+	int dirty;
 	int expected_count = 1 + extra_count;
 	void **pslot;
 
@@ -320,6 +323,9 @@ int migrate_page_move_mapping(struct address_space *mapping,
 		return MIGRATEPAGE_SUCCESS;
 	}
 
+	oldzone = page_zone(page);
+	newzone = page_zone(newpage);
+
 	spin_lock_irq(&mapping->tree_lock);
 
 	pslot = radix_tree_lookup_slot(&mapping->page_tree,
@@ -360,6 +366,13 @@ int migrate_page_move_mapping(struct address_space *mapping,
 		set_page_private(newpage, page_private(page));
 	}
 
+	/* Move dirty while page refs frozen and newpage not yet exposed */
+	dirty = PageDirty(page);
+	if (dirty) {
+		ClearPageDirty(page);
+		SetPageDirty(newpage);
+	}
+
 	radix_tree_replace_slot(pslot, newpage);
 
 	/*
@@ -369,6 +382,9 @@ int migrate_page_move_mapping(struct address_space *mapping,
 	 */
 	page_unfreeze_refs(page, expected_count - 1);
 
+	spin_unlock(&mapping->tree_lock);
+	/* Leave irq disabled to prevent preemption while updating stats */
+
 	/*
 	 * If moved to a different zone then also account
 	 * the page for that zone. Other VM counters will be
@@ -379,13 +395,19 @@ int migrate_page_move_mapping(struct address_space *mapping,
 	 * via NR_FILE_PAGES and NR_ANON_PAGES if they
 	 * are mapped to swap space.
 	 */
-	__dec_zone_page_state(page, NR_FILE_PAGES);
-	__inc_zone_page_state(newpage, NR_FILE_PAGES);
-	if (!PageSwapCache(page) && PageSwapBacked(page)) {
-		__dec_zone_page_state(page, NR_SHMEM);
-		__inc_zone_page_state(newpage, NR_SHMEM);
+	if (newzone != oldzone) {
+		__dec_zone_state(oldzone, NR_FILE_PAGES);
+		__inc_zone_state(newzone, NR_FILE_PAGES);
+		if (PageSwapBacked(page) && !PageSwapCache(page)) {
+			__dec_zone_state(oldzone, NR_SHMEM);
+			__inc_zone_state(newzone, NR_SHMEM);
+		}
+		if (dirty && mapping_cap_account_dirty(mapping)) {
+			__dec_zone_state(oldzone, NR_FILE_DIRTY);
+			__inc_zone_state(newzone, NR_FILE_DIRTY);
+		}
 	}
-	spin_unlock_irq(&mapping->tree_lock);
+	local_irq_enable();
 
 	return MIGRATEPAGE_SUCCESS;
 }
@@ -509,20 +531,9 @@ void migrate_page_copy(struct page *newpage, struct page *page)
 	if (PageMappedToDisk(page))
 		SetPageMappedToDisk(newpage);
 
-	if (PageDirty(page)) {
-		clear_page_dirty_for_io(page);
-		/*
-		 * Want to mark the page and the radix tree as dirty, and
-		 * redo the accounting that clear_page_dirty_for_io undid,
-		 * but we can't use set_page_dirty because that function
-		 * is actually a signal that all of the page has become dirty.
-		 * Whereas only part of our page may be dirty.
-		 */
-		if (PageSwapBacked(page))
-			SetPageDirty(newpage);
-		else
-			__set_page_dirty_nobuffers(newpage);
- 	}
+	/* Move dirty on pages not done by migrate_page_move_mapping() */
+	if (PageDirty(page))
+		SetPageDirty(newpage);
 
 	/*
 	 * Copy NUMA information to the new page, to prevent over-eager
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 4.2.y-ckt 3/5] can: fix handling of unmodifiable configuration options fix
  2016-07-08 17:06 [4.2.y-ckt stable] Linux 4.2.8-ckt13 stable review Kamal Mostafa
  2016-07-08 17:07 ` [PATCH 4.2.y-ckt 1/5] [4.2-stable only] Revert "perf test: Ignore kcore files in the "vmlinux matches kallsyms" test" Kamal Mostafa
  2016-07-08 17:07 ` [PATCH 4.2.y-ckt 2/5] mm: migrate dirty page without clear_page_dirty_for_io etc Kamal Mostafa
@ 2016-07-08 17:07 ` Kamal Mostafa
  2016-07-08 17:07 ` [PATCH 4.2.y-ckt 4/5] powerpc/iommu: Remove the dependency on EEH struct in DDW mechanism Kamal Mostafa
  2016-07-08 17:07 ` [PATCH 4.2.y-ckt 5/5] powerpc/pseries: Fix PCI config address for DDW Kamal Mostafa
  4 siblings, 0 replies; 6+ messages in thread
From: Kamal Mostafa @ 2016-07-08 17:07 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Oliver Hartkopp, Marc Kleine-Budde, Kamal Mostafa

4.2.8-ckt13 -stable review patch.  If anyone has any objections, please let me know.

---8<------------------------------------------------------------

From: Oliver Hartkopp <socketcan@hartkopp.net>

commit bce271f255dae8335dc4d2ee2c4531e09cc67f5a upstream.

With upstream commit bb208f144cf3f59 (can: fix handling of unmodifiable
configuration options) a new can_validate() function was introduced.

When invoking 'ip link set can0 type can' without any configuration data
can_validate() tries to validate the content without taking into account that
there's totally no content. This patch adds a check for missing content.

Reported-by: ajneu <ajneu1@gmail.com>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/net/can/dev.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
index 910c12e..348dd50 100644
--- a/drivers/net/can/dev.c
+++ b/drivers/net/can/dev.c
@@ -798,6 +798,9 @@ static int can_validate(struct nlattr *tb[], struct nlattr *data[])
 	 * - control mode with CAN_CTRLMODE_FD set
 	 */
 
+	if (!data)
+		return 0;
+
 	if (data[IFLA_CAN_CTRLMODE]) {
 		struct can_ctrlmode *cm = nla_data(data[IFLA_CAN_CTRLMODE]);
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 4.2.y-ckt 4/5] powerpc/iommu: Remove the dependency on EEH struct in DDW mechanism
  2016-07-08 17:06 [4.2.y-ckt stable] Linux 4.2.8-ckt13 stable review Kamal Mostafa
                   ` (2 preceding siblings ...)
  2016-07-08 17:07 ` [PATCH 4.2.y-ckt 3/5] can: fix handling of unmodifiable configuration options fix Kamal Mostafa
@ 2016-07-08 17:07 ` Kamal Mostafa
  2016-07-08 17:07 ` [PATCH 4.2.y-ckt 5/5] powerpc/pseries: Fix PCI config address for DDW Kamal Mostafa
  4 siblings, 0 replies; 6+ messages in thread
From: Kamal Mostafa @ 2016-07-08 17:07 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Guilherme G . Piccoli, Michael Ellerman, Kamal Mostafa

4.2.8-ckt13 -stable review patch.  If anyone has any objections, please let me know.

---8<------------------------------------------------------------

From: "Guilherme G. Piccoli" <gpiccoli@linux.vnet.ibm.com>

commit 8445a87f7092bc8336ea1305be9306f26b846d93 upstream.

Commit 39baadbf36ce ("powerpc/eeh: Remove eeh information from pci_dn")
changed the pci_dn struct by removing its EEH-related members.
As part of this clean-up, DDW mechanism was modified to read the device
configuration address from eeh_dev struct.

As a consequence, now if we disable EEH mechanism on kernel command-line
for example, the DDW mechanism will fail, generating a kernel oops by
dereferencing a NULL pointer (which turns to be the eeh_dev pointer).

This patch just changes the configuration address calculation on DDW
functions to a manual calculation based on pci_dn members instead of
using eeh_dev-based address.

No functional changes were made. This was tested on pSeries, both
in PHyp and qemu guest.

Fixes: 39baadbf36ce ("powerpc/eeh: Remove eeh information from pci_dn")
Reviewed-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 arch/powerpc/platforms/pseries/iommu.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index 10510de..34ee145 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -913,7 +913,8 @@ machine_arch_initcall(pseries, find_existing_ddw_windows);
 static int query_ddw(struct pci_dev *dev, const u32 *ddw_avail,
 			struct ddw_query_response *query)
 {
-	struct eeh_dev *edev;
+	struct device_node *dn;
+	struct pci_dn *pdn;
 	u32 cfg_addr;
 	u64 buid;
 	int ret;
@@ -924,11 +925,10 @@ static int query_ddw(struct pci_dev *dev, const u32 *ddw_avail,
 	 * Retrieve them from the pci device, not the node with the
 	 * dma-window property
 	 */
-	edev = pci_dev_to_eeh_dev(dev);
-	cfg_addr = edev->config_addr;
-	if (edev->pe_config_addr)
-		cfg_addr = edev->pe_config_addr;
-	buid = edev->phb->buid;
+	dn = pci_device_to_OF_node(dev);
+	pdn = PCI_DN(dn);
+	buid = pdn->phb->buid;
+	cfg_addr = (pdn->busno << 8) | pdn->devfn;
 
 	ret = rtas_call(ddw_avail[0], 3, 5, (u32 *)query,
 		  cfg_addr, BUID_HI(buid), BUID_LO(buid));
@@ -942,7 +942,8 @@ static int create_ddw(struct pci_dev *dev, const u32 *ddw_avail,
 			struct ddw_create_response *create, int page_shift,
 			int window_shift)
 {
-	struct eeh_dev *edev;
+	struct device_node *dn;
+	struct pci_dn *pdn;
 	u32 cfg_addr;
 	u64 buid;
 	int ret;
@@ -953,11 +954,10 @@ static int create_ddw(struct pci_dev *dev, const u32 *ddw_avail,
 	 * Retrieve them from the pci device, not the node with the
 	 * dma-window property
 	 */
-	edev = pci_dev_to_eeh_dev(dev);
-	cfg_addr = edev->config_addr;
-	if (edev->pe_config_addr)
-		cfg_addr = edev->pe_config_addr;
-	buid = edev->phb->buid;
+	dn = pci_device_to_OF_node(dev);
+	pdn = PCI_DN(dn);
+	buid = pdn->phb->buid;
+	cfg_addr = (pdn->busno << 8) | pdn->devfn;
 
 	do {
 		/* extra outputs are LIOBN and dma-addr (hi, lo) */
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 4.2.y-ckt 5/5] powerpc/pseries: Fix PCI config address for DDW
  2016-07-08 17:06 [4.2.y-ckt stable] Linux 4.2.8-ckt13 stable review Kamal Mostafa
                   ` (3 preceding siblings ...)
  2016-07-08 17:07 ` [PATCH 4.2.y-ckt 4/5] powerpc/iommu: Remove the dependency on EEH struct in DDW mechanism Kamal Mostafa
@ 2016-07-08 17:07 ` Kamal Mostafa
  4 siblings, 0 replies; 6+ messages in thread
From: Kamal Mostafa @ 2016-07-08 17:07 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Gavin Shan, Michael Ellerman, Kamal Mostafa

4.2.8-ckt13 -stable review patch.  If anyone has any objections, please let me know.

---8<------------------------------------------------------------

From: Gavin Shan <gwshan@linux.vnet.ibm.com>

commit 8a934efe94347eee843aeea65bdec8077a79e259 upstream.

In commit 8445a87f7092 "powerpc/iommu: Remove the dependency on EEH
struct in DDW mechanism", the PE address was replaced with the PCI
config address in order to remove dependency on EEH. According to PAPR
spec, firmware (pHyp or QEMU) should accept "xxBBSSxx" format PCI config
address, not "xxxxBBSS" provided by the patch. Note that "BB" is PCI bus
number and "SS" is the combination of slot and function number.

This fixes the PCI address passed to DDW RTAS calls.

Fixes: 8445a87f7092 ("powerpc/iommu: Remove the dependency on EEH struct in DDW mechanism")
Reported-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Tested-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 arch/powerpc/platforms/pseries/iommu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index 34ee145..cd148c3 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -928,7 +928,7 @@ static int query_ddw(struct pci_dev *dev, const u32 *ddw_avail,
 	dn = pci_device_to_OF_node(dev);
 	pdn = PCI_DN(dn);
 	buid = pdn->phb->buid;
-	cfg_addr = (pdn->busno << 8) | pdn->devfn;
+	cfg_addr = ((pdn->busno << 16) | (pdn->devfn << 8));
 
 	ret = rtas_call(ddw_avail[0], 3, 5, (u32 *)query,
 		  cfg_addr, BUID_HI(buid), BUID_LO(buid));
@@ -957,7 +957,7 @@ static int create_ddw(struct pci_dev *dev, const u32 *ddw_avail,
 	dn = pci_device_to_OF_node(dev);
 	pdn = PCI_DN(dn);
 	buid = pdn->phb->buid;
-	cfg_addr = (pdn->busno << 8) | pdn->devfn;
+	cfg_addr = ((pdn->busno << 16) | (pdn->devfn << 8));
 
 	do {
 		/* extra outputs are LIOBN and dma-addr (hi, lo) */
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-07-08 17:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-08 17:06 [4.2.y-ckt stable] Linux 4.2.8-ckt13 stable review Kamal Mostafa
2016-07-08 17:07 ` [PATCH 4.2.y-ckt 1/5] [4.2-stable only] Revert "perf test: Ignore kcore files in the "vmlinux matches kallsyms" test" Kamal Mostafa
2016-07-08 17:07 ` [PATCH 4.2.y-ckt 2/5] mm: migrate dirty page without clear_page_dirty_for_io etc Kamal Mostafa
2016-07-08 17:07 ` [PATCH 4.2.y-ckt 3/5] can: fix handling of unmodifiable configuration options fix Kamal Mostafa
2016-07-08 17:07 ` [PATCH 4.2.y-ckt 4/5] powerpc/iommu: Remove the dependency on EEH struct in DDW mechanism Kamal Mostafa
2016-07-08 17:07 ` [PATCH 4.2.y-ckt 5/5] powerpc/pseries: Fix PCI config address for DDW Kamal Mostafa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).