aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-02-24watchdog: da9055_wdt: Convert to use device managed functionsGuenter Roeck1-15/+2
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]>
2017-02-24watchdog: da9052_wdt: Convert to use device managed functionsGuenter Roeck1-24/+8
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]>
2017-02-24watchdog: bcm2835_wdt: Convert to use device managed functions and other ↵Guenter Roeck1-19/+8
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]>
2017-02-24watchdog: mena21_wdt: Convert to use device managed functions and other ↵Guenter Roeck1-22/+2
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]>
2017-02-24watchdog: wm831x_wdt: Convert to use device managed functionsGuenter Roeck1-24/+7
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]>
2017-02-24watchdog: digicolor_wdt: Convert to use device managed functions and other ↵Guenter Roeck1-36/+12
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]>
2017-02-24watchdog: iTCO_wdt: Replace shutdown function with call to ↵Guenter Roeck1-8/+1
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]>
2017-02-24watchdog: intel-mid_wdt: Convert to use device managed functionsGuenter Roeck1-10/+1
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]>
2017-02-24watchdog: meson_wdt: Convert to use device managed functions and other ↵Guenter Roeck1-21/+2
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]>
2017-02-24watchdog: sunxi_wdt: Convert to use device managed functions and other ↵Guenter Roeck1-22/+2
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]>
2017-02-24watchdog: aspeed_wdt: Convert to use device managed functionsGuenter Roeck1-13/+1
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]>
2017-02-24watchdog: coh901327_wdt: Use dev variable instead of pdev->devGuenter Roeck1-19/+15
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]>
2017-02-24watchdog: coh901327_wdt: Use devm_ioremap_resource to map resourcesGuenter Roeck1-26/+5
Map resources using devm_ioremap_resource() to simplify error handling. Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2017-02-24watchdog: coh901327_wdt: Keep clock enabled after loading driverGuenter Roeck1-20/+1
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]>
2017-02-24watchdog: coh901327_wdt: Simplify error handling in probe functionGuenter Roeck1-4/+2
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]>
2017-02-24watchdog: tangox: Use watchdog core to install restart handlerGuenter Roeck1-21/+13
Use the infrastructure provided by the watchdog core to install the restart handler. Signed-off-by: Guenter Roeck <[email protected]>
2017-02-24watchdog: dw_wdt: Use watchdog core to install restart handlerGuenter Roeck1-16/+7
Use the infrastructure provided by the watchdog core to install the restart handler. Signed-off-by: Guenter Roeck <[email protected]>
2017-02-24watchdog: bcm2835_wdt: Use watchdog core to install restart handlerGuenter Roeck1-27/+30
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]>
2017-02-24watchdog: asm9260_wdt: Use watchdog core to install restart handlerGuenter Roeck1-15/+7
Use the infrastructure provided by the watchdog core to install the restart handler. Signed-off-by: Guenter Roeck <[email protected]>
2017-02-24watchdog: bcm47xx_wdt: Don't validate platform data on removeGuenter Roeck1-3/+0
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]>
2017-02-24watchdog: iTCO_wdt: Simplify module init functionGuenter Roeck1-7/+1
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]>
2017-02-24watchdog: iTCO_wdt: Use pdev for platform device and pci_dev for pci deviceGuenter Roeck1-27/+26
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]>
2017-02-24watchdog: iTCO_wdt: Use device managed resourcesGuenter Roeck1-63/+17
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]>
2017-02-24watchdog: iTCO_wdt: Use allocated data structuresGuenter Roeck1-197/+205
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]>
2017-02-24watchdog: orion: fix spelling mistake: "harcoded" -> "hardcoded"Colin Ian King1-1/+1
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]>
2017-02-24watchdog: Enable COMPILE_TEST where possibleGuenter Roeck1-59/+59
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]>
2017-02-24watchdog: pnx833x_wdt: Mark as brokenGuenter Roeck1-0/+1
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]>
2017-02-24watchdog: nic7018_wdt: Add NIC7018 watchdog driverHui Chun Ong4-0/+281
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]>
2017-02-24watchdog: constify watchdog_info structuresBhumika Goyal12-12/+12
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]>
2017-02-24watchdog: pika_wdt: add __ro_after_init to identBhumika Goyal1-1/+1
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]>
2017-02-24watchdog: booke_wdt: add __ro_after_init to booke_wdt_infoBhumika Goyal1-1/+1
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]>
2017-02-24watchdog: sa11x0/pxa: fix error path of driver initializationVladimir Zapolskiy1-3/+5
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]>
2017-02-24watchdog: update my email addressJohn Crispin3-5/+5
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]>
2017-02-24dm-rq: don't dereference request payload after ending requestJens Axboe1-2/+4
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]>
2017-02-25openrisc: head: Init r0 to 0 on startStafford Horne1-1/+4
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]>
2017-02-25openrisc: Export ioremap symbols used by modulesStafford Horne1-0/+2
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]>
2017-02-25arch/openrisc/lib/memcpy.c: use correct OR1200 optionValentin Rothberg1-1/+1
The Kconfig option for OR12000 is OR1K_1200. Signed-off-by: Valentin Rothberg <[email protected]> Signed-off-by: Stafford Horne <[email protected]>
2017-02-25openrisc: head: Remove unused stringsStafford Horne1-11/+0
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]>
2017-02-25openrisc: head: Move init strings to rodata sectionStafford Horne1-0/+1
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]>
2017-02-25openrisc: entry: Fix delay slot detectionStafford Horne1-2/+2
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]>
2017-02-25openrisc: entry: Whitespace and comment cleanupsStafford Horne1-20/+18
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]>
2017-02-25scripts/checkstack.pl: Add openrisc supportStafford Horne1-0/+3
Openrisc stack pointer is managed by decrementing r1. Add regexes to recognize this. Signed-off-by: Stafford Horne <[email protected]>
2017-02-25MAINTAINERS: Add the openrisc official repositoryStafford Horne1-0/+1
The openrisc official repository and patch work happens currently on github. Add the repo for reference. Signed-off-by: Stafford Horne <[email protected]>
2017-02-25openrisc: Add .gitignoreStafford Horne1-0/+1
This helps to suppress the vmlinux.lds file. Signed-off-by: Stafford Horne <[email protected]>
2017-02-25openrisc: Add optimized memcpy routineStafford Horne4-2/+128
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]>
2017-02-25openrisc: Add optimized memsetOlof Kindgren4-1/+107
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]>
2017-02-25openrisc: Initial support for the idle stateSebastian Macke1-0/+11
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]>
2017-02-25openrisc: Fix the bitmask for the unit present registerSebastian Macke1-2/+2
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]>
2017-02-25openrisc: remove unnecessary stddef.h includeStefan Kristiansson1-1/+0
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]>
2017-02-25openrisc: add futex_atomic_* implementationsStefan Kristiansson2-1/+135
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]>