Skip to content

Commit 9aca90a

Browse files
committed
Merge tag 'powerpc-4.5-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fixes from Michael Ellerman: - eeh: Fix partial hotplug criterion from Gavin Shan - mm: Clear the invalid slot information correctly from Aneesh Kumar K.V * tag 'powerpc-4.5-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/mm/hash: Clear the invalid slot information correctly powerpc/eeh: Fix partial hotplug criterion
2 parents 70d070f + 9ab3ac2 commit 9aca90a

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

arch/powerpc/kernel/eeh_driver.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,7 @@ static void *eeh_rmv_device(void *data, void *userdata)
418418
eeh_pcid_put(dev);
419419
if (driver->err_handler &&
420420
driver->err_handler->error_detected &&
421-
driver->err_handler->slot_reset &&
422-
driver->err_handler->resume)
421+
driver->err_handler->slot_reset)
423422
return NULL;
424423
}
425424

arch/powerpc/mm/hash64_64k.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,13 @@ int __hash_page_4K(unsigned long ea, unsigned long access, unsigned long vsid,
111111
*/
112112
if (!(old_pte & _PAGE_COMBO)) {
113113
flush_hash_page(vpn, rpte, MMU_PAGE_64K, ssize, flags);
114-
old_pte &= ~_PAGE_HASHPTE | _PAGE_F_GIX | _PAGE_F_SECOND;
114+
/*
115+
* clear the old slot details from the old and new pte.
116+
* On hash insert failure we use old pte value and we don't
117+
* want slot information there if we have a insert failure.
118+
*/
119+
old_pte &= ~(_PAGE_HASHPTE | _PAGE_F_GIX | _PAGE_F_SECOND);
120+
new_pte &= ~(_PAGE_HASHPTE | _PAGE_F_GIX | _PAGE_F_SECOND);
115121
goto htab_insert_hpte;
116122
}
117123
/*

arch/powerpc/mm/hugepage-hash64.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,19 @@ int __hash_page_thp(unsigned long ea, unsigned long access, unsigned long vsid,
7878
* base page size. This is because demote_segment won't flush
7979
* hash page table entries.
8080
*/
81-
if ((old_pmd & _PAGE_HASHPTE) && !(old_pmd & _PAGE_COMBO))
81+
if ((old_pmd & _PAGE_HASHPTE) && !(old_pmd & _PAGE_COMBO)) {
8282
flush_hash_hugepage(vsid, ea, pmdp, MMU_PAGE_64K,
8383
ssize, flags);
84+
/*
85+
* With THP, we also clear the slot information with
86+
* respect to all the 64K hash pte mapping the 16MB
87+
* page. They are all invalid now. This make sure we
88+
* don't find the slot valid when we fault with 4k
89+
* base page size.
90+
*
91+
*/
92+
memset(hpte_slot_array, 0, PTE_FRAG_SIZE);
93+
}
8494
}
8595

8696
valid = hpte_valid(hpte_slot_array, index);

0 commit comments

Comments
 (0)