[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1431359540-32227-6-git-send-email-dahi@linux.vnet.ibm.com>
Date: Mon, 11 May 2015 17:52:10 +0200
From: David Hildenbrand <dahi@...ux.vnet.ibm.com>
To: linux-kernel@...r.kernel.org
Cc: mingo@...hat.com, yang.shi@...driver.com, bigeasy@...utronix.de,
benh@...nel.crashing.org, paulus@...ba.org,
akpm@...ux-foundation.org, heiko.carstens@...ibm.com,
schwidefsky@...ibm.com, borntraeger@...ibm.com, mst@...hat.com,
tglx@...utronix.de, David.Laight@...LAB.COM, hughd@...gle.com,
hocko@...e.cz, ralf@...ux-mips.org, herbert@...dor.apana.org.au,
linux@....linux.org.uk, airlied@...ux.ie, daniel.vetter@...el.com,
linux-mm@...ck.org, linux-arch@...r.kernel.org,
peterz@...radead.org, dahi@...ux.vnet.ibm.com
Subject: [PATCH v1 05/15] mips: kmap_coherent relies on disabled preemption
k(un)map_coherent relies on pagefault_disable() to also disable
preemption.
Let's make this explicit, to prepare for pagefault_disable() not
touching preemption anymore.
This patch is based on a patch by Yang Shi on the -rt tree:
"k{un}map_coherent are just called when cpu_has_dc_aliases == 1 with VIPT
cache. However, actually, the most modern MIPS processors have PIPT dcache
without dcache alias issue. In such case, k{un}map_atomic will be called
with preempt enabled."
Signed-off-by: David Hildenbrand <dahi@...ux.vnet.ibm.com>
---
arch/mips/mm/init.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index faa5c98..198a314 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -90,6 +90,7 @@ static void *__kmap_pgprot(struct page *page, unsigned long addr, pgprot_t prot)
BUG_ON(Page_dcache_dirty(page));
+ preempt_disable();
pagefault_disable();
idx = (addr >> PAGE_SHIFT) & (FIX_N_COLOURS - 1);
idx += in_interrupt() ? FIX_N_COLOURS : 0;
@@ -152,6 +153,7 @@ void kunmap_coherent(void)
write_c0_entryhi(old_ctx);
local_irq_restore(flags);
pagefault_enable();
+ preempt_enable();
}
void copy_user_highpage(struct page *to, struct page *from,
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists