mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 14:41:02 +07:00
sh: mach-x3proto: Improve ILSEL debugging.
At the moment ILSEL blows up with a BUG when aliased sets are handed in, but as the enable call is able to hand back errors we opt for that path instead. None of the ILSEL peripherals are vital to the board's operation, so trapping a BUG is a bit excessive. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
This commit is contained in:
parent
2c237329f7
commit
3bccf534f9
@ -1,14 +1,16 @@
|
||||
/*
|
||||
* arch/sh/boards/renesas/x3proto/ilsel.c
|
||||
* arch/sh/boards/mach-x3proto/ilsel.c
|
||||
*
|
||||
* Helper routines for SH-X3 proto board ILSEL.
|
||||
*
|
||||
* Copyright (C) 2007 Paul Mundt
|
||||
* Copyright (C) 2007 - 2010 Paul Mundt
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU General Public
|
||||
* License. See the file "COPYING" in the main directory of this archive
|
||||
* for more details.
|
||||
*/
|
||||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||
|
||||
#include <linux/init.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
@ -64,6 +66,8 @@ static void __ilsel_enable(ilsel_source_t set, unsigned int bit)
|
||||
unsigned int tmp, shift;
|
||||
unsigned long addr;
|
||||
|
||||
pr_notice("enabling ILSEL set %d\n", set);
|
||||
|
||||
addr = mk_ilsel_addr(bit);
|
||||
shift = mk_ilsel_shift(bit);
|
||||
|
||||
@ -92,8 +96,10 @@ int ilsel_enable(ilsel_source_t set)
|
||||
{
|
||||
unsigned int bit;
|
||||
|
||||
/* Aliased sources must use ilsel_enable_fixed() */
|
||||
BUG_ON(set > ILSEL_KEY);
|
||||
if (unlikely(set > ILSEL_KEY)) {
|
||||
pr_err("Aliased sources must use ilsel_enable_fixed()\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
do {
|
||||
bit = find_first_zero_bit(&ilsel_level_map, ILSEL_LEVELS);
|
||||
@ -140,6 +146,8 @@ void ilsel_disable(unsigned int irq)
|
||||
unsigned long addr;
|
||||
unsigned int tmp;
|
||||
|
||||
pr_notice("disabling ILSEL set %d\n", irq);
|
||||
|
||||
addr = mk_ilsel_addr(irq);
|
||||
|
||||
tmp = __raw_readw(addr);
|
||||
|
Loading…
Reference in New Issue
Block a user