Age | Commit message (Collapse) | Author | Files | Lines |
|
Use device managed functions to simplify error handling, reduce
source code size, improve readability, and reduce the likelyhood of bugs.
The conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts used
to generate this commit log are available at
https://github.com/groeck/coccinelle-patches
- Replace 'goto l; ... l: return e;' with 'return e;'
- Drop assignments to otherwise unused variables
- Drop remove function
- Drop platform_set_drvdata()
- Use devm_watchdog_register_driver() to register watchdog device
Acked-by: Adam Thomson <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Use device managed functions to simplify error handling, reduce
source code size, improve readability, and reduce the likelyhood of bugs.
The conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts used
to generate this commit log are available at
https://github.com/groeck/coccinelle-patches
- Replace 'goto l; ... l: return e;' with 'return e;'
- Replace 'val = e; return val;' with 'return e;'
- Drop assignments to otherwise unused variables
- Replace 'if (e) { return expr; }' with 'if (e) return expr;'
- Drop remove function
- Drop platform_set_drvdata()
- Use devm_watchdog_register_driver() to register watchdog device
Acked-by: Adam Thomson <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
improvements
Use device managed functions to simplify error handling, reduce
source code size, improve readability, and reduce the likelyhood of bugs.
Other improvements as listed below.
The conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts used
to generate this commit log are available at
https://github.com/groeck/coccinelle-patches
- Drop assignments to otherwise unused variables
- Replace of_iomap() with platform_get_resource() followed by
devm_ioremap_resource()
- Replace &pdev->dev with dev if 'struct device *dev' is a declared
variable
- Use devm_watchdog_register_driver() to register watchdog device
- Replace shutdown function with call to watchdog_stop_on_reboot()
Cc: Stephen Warren <[email protected]>
Cc: Lee Jones <[email protected]>
Cc: Florian Fainelli <[email protected]>
Cc: Ray Jui <[email protected]>
Cc: Scott Branden <[email protected]>
Acked-by: Eric Anholt <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
improvements
Use device managed functions to simplify error handling, reduce
source code size, improve readability, and reduce the likelyhood of bugs.
Other improvements as listed below.
The conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts used
to generate this commit log are available at
https://github.com/groeck/coccinelle-patches
- Replace 'goto l; ... l: return e;' with 'return e;'
- Drop assignments to otherwise unused variables
- Drop remove function
- Drop unnecessary mutex_destroy() on allocated data
- Use devm_watchdog_register_driver() to register watchdog device
Acked-by: Johannes Thumshirn <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Use device managed functions to simplify error handling, reduce
source code size, improve readability, and reduce the likelyhood of bugs.
The conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts used
to generate this commit log are available at
https://github.com/groeck/coccinelle-patches
- Replace 'goto l; ... l: return e;' with 'return e;'
- Replace 'val = e; return val;' with 'return e;'
- Drop assignments to otherwise unused variables
- Replace 'if (e) { return expr; }' with 'if (e) return expr;'
- Drop remove function
- Drop platform_set_drvdata()
- Use devm_watchdog_register_driver() to register watchdog device
Acked-by: Charles Keepax <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
improvements
Use device managed functions to simplify error handling, reduce
source code size, improve readability, and reduce the likelyhood of bugs.
Other improvements as listed below.
The conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts used
to generate this commit log are available at
https://github.com/groeck/coccinelle-patches
- Replace 'goto l; ... l: return e;' with 'return e;'
- Replace 'val = e; return val;' with 'return e;'
- Drop assignments to otherwise unused variables
- Replace 'if (e) { return expr; }' with 'if (e) return expr;'
- Drop remove function
- Replace of_iomap() with platform_get_resource() followed by
devm_ioremap_resource()
- Drop platform_set_drvdata()
- Replace &pdev->dev with dev if 'struct device *dev' is a declared
variable
- Use devm_watchdog_register_driver() to register watchdog device
- Replace shutdown function with call to watchdog_stop_on_reboot()
Acked-by: Baruch Siach <[email protected]>
Tested-by: Baruch Siach <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
watchdog_stop_on_reboot
The shutdown function calls the stop function.
Call watchdog_stop_on_reboot() from probe instead.
The conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts used
to generate this commit log are available at
https://github.com/groeck/coccinelle-patches
- Replace shutdown function with call to watchdog_stop_on_reboot()
Reviewed-by: Andy Shevchenko <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Use device managed functions to simplify error handling, reduce
source code size, improve readability, and reduce the likelyhood of bugs.
The conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts used
to generate this commit log are available at
https://github.com/groeck/coccinelle-patches
- Drop assignments to otherwise unused variables
- Drop remove function
- Drop platform_set_drvdata()
- Use devm_watchdog_register_driver() to register watchdog device
Reviewed-by: Andy Shevchenko <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
improvements
Use device managed functions to simplify error handling, reduce
source code size, improve readability, and reduce the likelyhood of bugs.
Other improvements as listed below.
The conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts used
to generate this commit log are available at
https://github.com/groeck/coccinelle-patches
- Drop assignments to otherwise unused variables
- Drop remove function
- Drop platform_set_drvdata()
- Use devm_watchdog_register_driver() to register watchdog device
- Replace shutdown function with call to watchdog_stop_on_reboot()
Cc: Carlo Caione <[email protected]>
Acked-by: Kevin Hilman <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
improvements
Use device managed functions to simplify error handling, reduce
source code size, improve readability, and reduce the likelyhood of bugs.
Other improvements as listed below.
The conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts used
to generate this commit log are available at
https://github.com/groeck/coccinelle-patches
- Drop assignments to otherwise unused variables
- Drop remove function
- Drop platform_set_drvdata()
- Use devm_watchdog_register_driver() to register watchdog device
- Replace shutdown function with call to watchdog_stop_on_reboot()
Cc: Chen-Yu Tsai <[email protected]>
Acked-by: Maxime Ripard <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Use device managed functions to simplify error handling, reduce
source code size, improve readability, and reduce the likelyhood of bugs.
The conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts used
to generate this commit log are available at
https://github.com/groeck/coccinelle-patches
- Drop assignments to otherwise unused variables
- Drop remove function
- Drop platform_set_drvdata()
- Use devm_watchdog_register_driver() to register watchdog device
Acked-by: Joel Stanley <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Use a local dev variable instead of dereferencing pdev->dev several
times in the probe function to make the code easier to read.
Reviewed-by: Linus Walleij <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Map resources using devm_ioremap_resource() to simplify error handling.
Reviewed-by: Linus Walleij <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Enabling the clock before accessing chip registers and disabling it
afterwards does not really make sense and only adds complexity to
the driver. In addition to that, a comment int the driver suggests
that it does not serve a useful purpose either.
"The watchdog block is of course always clocked, the
clk_enable()/clk_disable() calls are mainly for performing reference
counting higher up in the clock hierarchy."
Just keep the clock enabled instead.
Reviewed-by: Linus Walleij <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Checking if there is no error followed by a goto if there is one is
confusing. Reverse the logic.
Reviewed-by: Linus Walleij <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Use the infrastructure provided by the watchdog core to install
the restart handler.
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Use the infrastructure provided by the watchdog core to install
the restart handler.
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Use the infrastructure provided by the watchdog core to install
the restart handler.
Acked-by: Eric Anholt <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Use the infrastructure provided by the watchdog core to install
the restart handler.
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Platform data was already validated in the probe function. If it was NULL,
the remove function will never be called. Remove the unnecessary check.
Signed-off-by: Guenter Roeck <[email protected]>
|
|
The 'ret' variable in iTCO_wdt_init_module() does not add any value;
drop it.
Reviewed-by: Andy Shevchenko <[email protected]>
Mika Westerberg <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Use pdev for struct platform_device, pci_dev for struct pci_dev, and dev
for struct device variables to improve consistency.
Remove 'struct platform_device *dev;' from struct iTCO_wdt_private since
it was unused.
Reviewed-by: Andy Shevchenko <[email protected]>
Mika Westerberg <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Using device managed resources simplifies error handling and cleanup,
and to reduce the likelyhood of errors.
Reviewed-by: Andy Shevchenko <[email protected]>
Mika Westerberg <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Allocate private data and the watchdog device to avoid having
to clear it on remove and to enable subsequent simplifications.
Reviewed-by: Andy Shevchenko <[email protected]>
Mika Westerberg <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Trivial fix to spelling mistake in WARN message
Signed-off-by: Colin Ian King <[email protected]>
Reviewed-by: Guenter Roeck <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Building all watchdog drivers is all but impossible since many depend
on platforms which are not enabled by test builds. Add dependency on
COMPILE_TEST where possible to improve the situation.
Signed-off-by: Guenter Roeck <[email protected]>
|
|
pnx833x_wdt does not compile if enabled. Bit operations expect an unsigned
long as argument. If that is fixed, the build still fails because put_user,
get_user, and copy_to_user are undefined.
Mark it as broken.
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Add support for the watchdog timer on PXI Embedded Controller.
Signed-off-by: Hui Chun Ong <[email protected]>
Reviewed-by: Guenter Roeck <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Declare watchdog_info structures as const as they are only stored in the
info field of watchdog_device structures. This field is of type const
struct watchdog_info *, so watchdog_info structures having this property
can be declared const too.
Done using Coccinelle:
@r1 disable optional_qualifier@
identifier i;
position p;
@@
static struct watchdog_info i@p={...};
@ok@
identifier r1.i;
position p;
struct watchdog_device obj;
@@
obj.info=&i@p;
@bad@
position p!={r1.p,ok.p};
identifier r1.i;
@@
i@p
@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct watchdog_info i;
Signed-off-by: Bhumika Goyal <[email protected]>
Acked-by: Florian Fainelli <[email protected]>
Acked-by: Baruch Siach <[email protected]>
Reviewed-by: Guenter Roeck <[email protected]>
Acked-by: Adam Thomson <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
The object ident of type watchdog_info structure is not
modified after getting initialized by pikawdt_init. Apart from getting
referenced in init it is also passed as an argument to the function
copy_to_user but this argument is of type const void *. Therefore add
__ro_after_init to its declaration.
Signed-off-by: Bhumika Goyal <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
The object booke_wdt_info of watchdog_info structure is not
modified after getting initialized by booke_wdt_init. Apart from getting
referenced in init it is also stored in the info field of watchdog_device
structure which is of type const struct watchdog_info *info. So, it
becomes read only after init and therefore add __ro_after_init to it's
declaration.
Signed-off-by: Bhumika Goyal <[email protected]>
Reviewed-by: Guenter Roeck <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
The change corrects release of captured resources on error path, namely
the clock is disabled and put if misc device registration fails and not
enabled clock is not disabled now.
Fixes: 6924089c488e ("watchdog: sa11x0/pxa: get rid of get_clock_tick_rate")
Signed-off-by: Vladimir Zapolskiy <[email protected]>
Acked-by: Robert Jarzmik <[email protected]>
Reviewed-by: Guenter Roeck <[email protected]>
Acked-by: Russell King <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
This patch updates my email address as I no longer have access to the old
one.
Signed-off-by: John Crispin <[email protected]>
Reviewed-by: Guenter Roeck <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Bart reported a case where dm would crash with use-after-free
poison. This is due to dm_softirq_done() accessing memory
associated with a request after calling end_request on it.
This is most visible on !blk-mq, since we free the memory
immediately for that case.
Reported-by: Bart Van Assche <[email protected]>
Suggested-by: Linus Torvalds <[email protected]>
Fixes: eb8db831be80 ("dm: always defer request allocation to the owner of the request_queue")
Signed-off-by: Jens Axboe <[email protected]>
|
|
Originally openrisc spec 0 specified that r0 would be wired to ground.
This is no longer the case. r0 is not guaranteed to be 0 at init, so we
need to initialize it to 0 before using it.
Also, if we are clearing r0 we cant use r0 to clear itself. Change the
the CLEAR_GPR macro to use movhi for clearing.
Reported-by: Jakob Viketoft <[email protected]>
Signed-off-by: Stafford Horne <[email protected]>
|
|
Noticed this when building with allyesconfig. Got build failures due
to iounmap and __ioremap symbols missing. This patch exports them so
modules can use them. This is inline with other architectures.
Signed-off-by: Stafford Horne <[email protected]>
|
|
The Kconfig option for OR12000 is OR1K_1200.
Signed-off-by: Valentin Rothberg <[email protected]>
Signed-off-by: Stafford Horne <[email protected]>
|
|
These string definitions are no longer used removed them. Noticed this
while working on a CONFIG_DEBUG_INFO build issue.
Signed-off-by: Stafford Horne <[email protected]>
|
|
The strings used during the head/init phase of openrisc bootup were
stored in the executable section of the binary.
This causes compilation to fail when using CONFIG_DEBUG_INFO with
error:
Error: unaligned opcodes detected in executable segment
Signed-off-by: Stafford Horne <[email protected]>
|
|
Use execption SR stored in pt_regs for detection, the current SR is not
correct as the handler is running after return from exception.
Also, The code that checks for a delay slot uses a flag bitmask and then
wants to check if the result is not zero. The test it implemented was
wrong.
Correct it by changing the test to check result against non zero.
Signed-off-by: Stafford Horne <[email protected]>
|
|
Cleanups to whitespace and add some comments. Reading through the delay
slot logic I noticed some things:
- Delay slot instructions were not indented
- Some comments are not lined up
- Use tabs and spaces consistent with other code
No functional change
Signed-off-by: Stafford Horne <[email protected]>
|
|
Openrisc stack pointer is managed by decrementing r1. Add regexes to
recognize this.
Signed-off-by: Stafford Horne <[email protected]>
|
|
The openrisc official repository and patch work happens currently on
github. Add the repo for reference.
Signed-off-by: Stafford Horne <[email protected]>
|
|
This helps to suppress the vmlinux.lds file.
Signed-off-by: Stafford Horne <[email protected]>
|
|
The generic memcpy routine provided in kernel does only byte copies.
Using word copies we can lower boot time and cycles spend in memcpy
quite significantly.
Booting on my de0 nano I see boot times go from 7.2 to 5.6 seconds.
The avg cycles in memcpy during boot go from 6467 to 1887.
I tested several algorithms (see code in previous patch mails)
The implementations I tested and avg cycles:
- Word Copies + Loop Unrolls + Non Aligned 1882
- Word Copies + Loop Unrolls 1887
- Word Copies 2441
- Byte Copies + Loop Unrolls 6467
- Byte Copies 7600
In the end I ended up going with Word Copies + Loop Unrolls as it
provides best tradeoff between simplicity and boot speedups.
Signed-off-by: Stafford Horne <[email protected]>
|
|
This adds a hand-optimized assembler version of memset and sets
__HAVE_ARCH_MEMSET to use this version instead of the generic C
routine
Signed-off-by: Olof Kindgren <[email protected]>
Signed-off-by: Stafford Horne <[email protected]>
|
|
This patch adds basic support for the idle state of the cpu.
The patch overrides the regular idle function, enables the interupts,
checks for the power management unit and enables the cpu doze mode
if available.
Signed-off-by: Sebastian Macke <[email protected]>
[[email protected]: Fixed checkpatch, blankline after declarations]
Signed-off-by: Stafford Horne <[email protected]>
|
|
The bits were swapped, as per spec and processor implementation the
power management present bit is 9 and PIC bit is 8. This patch brings
the definitions into spec.
Signed-off-by: Sebastian Macke <[email protected]>
[[email protected]: Added commit body]
Signed-off-by: Stafford Horne <[email protected]>
|
|
This causes the build to fail when building with the or1k-musl-linux-
toolchain and it is not needed.
Signed-off-by: Stafford Horne <[email protected]>
|
|
Support for the futex_atomic_* operations by using the
load-link/store-conditional l.lwa/l.swa instructions.
Most openrisc cores provide these instructions now if not available,
emulation is provided.
Acked-by: Peter Zijlstra (Intel) <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Signed-off-by: Stefan Kristiansson <[email protected]>
[[email protected]: remove OPENRISC_HAVE_INST_LWA_SWA config suggesed by
Alan Cox https://lkml.org/lkml/2014/7/23/666]
Signed-off-by: Stafford Horne <[email protected]>
|