]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/fscr: Enable interrupts earlier before calling get_user()
authorAnshuman Khandual <khandual@linux.vnet.ibm.com>
Thu, 29 Mar 2018 06:23:37 +0000 (11:53 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 10 Apr 2018 01:23:23 +0000 (11:23 +1000)
commit61e119da9c0aadac42f62d34877437bf54e79520
tree003f922542c606be3d9ede19c0e14e9172f6e8e3
parent55248756440e972f219fda18f2c60fdf811d3207
powerpc/fscr: Enable interrupts earlier before calling get_user()

The function get_user() can sleep while trying to fetch instruction
from user address space and causes the following warning from the
scheduler.

BUG: sleeping function called from invalid context

Though interrupts get enabled back but it happens bit later after
get_user() is called. This change moves enabling these interrupts
earlier covering the function get_user(). While at this, lets check
for kernel mode and crash as this interrupt should not have been
triggered from the kernel context.

Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/traps.c