aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/dawr.c
diff options
context:
space:
mode:
authorRavi Bangoria <ravi.bangoria@linux.ibm.com>2020-05-14 16:47:33 +0530
committerMichael Ellerman <mpe@ellerman.id.au>2020-05-19 00:11:05 +1000
commit22a214e461c5cc9428b86915d9cfcf84c6e11ad7 (patch)
treeab63263b79b6a731d18053245cc339e4ac42375e /arch/powerpc/kernel/dawr.c
parentpowerpc/watchpoint: Get watchpoint count dynamically while disabling them (diff)
downloadlinux-dev-22a214e461c5cc9428b86915d9cfcf84c6e11ad7.tar.xz
linux-dev-22a214e461c5cc9428b86915d9cfcf84c6e11ad7.zip
powerpc/watchpoint: Disable all available watchpoints when !dawr_force_enable
Instead of disabling only first watchpoint, disable all available watchpoints while clearing dawr_force_enable. Callback function is used only for disabling watchpoint, rename it to disable_dawrs_cb(). And null_brk parameter is not really required while disabling watchpoint, remove it. Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Reviewed-by: Michael Neuling <mikey@neuling.org> Link: https://lore.kernel.org/r/20200514111741.97993-9-ravi.bangoria@linux.ibm.com
Diffstat (limited to 'arch/powerpc/kernel/dawr.c')
-rw-r--r--arch/powerpc/kernel/dawr.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/dawr.c b/arch/powerpc/kernel/dawr.c
index 8114ad3a8574..500f52fa4711 100644
--- a/arch/powerpc/kernel/dawr.c
+++ b/arch/powerpc/kernel/dawr.c
@@ -50,9 +50,13 @@ int set_dawr(int nr, struct arch_hw_breakpoint *brk)
return 0;
}
-static void set_dawr_cb(void *info)
+static void disable_dawrs_cb(void *info)
{
- set_dawr(0, info);
+ struct arch_hw_breakpoint null_brk = {0};
+ int i;
+
+ for (i = 0; i < nr_wp_slots(); i++)
+ set_dawr(i, &null_brk);
}
static ssize_t dawr_write_file_bool(struct file *file,
@@ -74,7 +78,7 @@ static ssize_t dawr_write_file_bool(struct file *file,
/* If we are clearing, make sure all CPUs have the DAWR cleared */
if (!dawr_force_enable)
- smp_call_function(set_dawr_cb, &null_brk, 0);
+ smp_call_function(disable_dawrs_cb, NULL, 0);
return rc;
}