Skip to content
Snippets Groups Projects
  1. May 25, 2020
  2. Jul 08, 2019
  3. May 05, 2019
    • Guenter Roeck's avatar
      watchdog: Convert to use devm_platform_ioremap_resource · 0f0a6a28
      Guenter Roeck authored
      
      Use devm_platform_ioremap_resource to reduce source code size,
      improve readability, and reduce the likelyhood of bugs.
      
      The conversion was done automatically with coccinelle using the
      following semantic patch.
      
      @r@
      identifier res, pdev;
      expression a;
      expression index;
      expression e;
      @@
      
      <+...
      - res = platform_get_resource(pdev, IORESOURCE_MEM, index);
      - a = devm_ioremap_resource(e, res);
      + a = devm_platform_ioremap_resource(pdev, index);
      ...+>
      
      @depends on r@
      identifier r.res;
      @@
      - struct resource *res;
        ... when != res
      
      @@
      identifier res, pdev;
      expression index;
      expression a;
      @@
      - struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, index);
      - a = devm_ioremap_resource(&pdev->dev, res);
      + a = devm_platform_ioremap_resource(pdev, index);
      
      Cc: Joel Stanley <joel@jms.id.au>
      Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
      Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Baruch Siach <baruch@tkos.co.il>
      Cc: Keguang Zhang <keguang.zhang@gmail.com>
      Cc: Vladimir Zapolskiy <vz@mleia.com>
      Cc: Kevin Hilman <khilman@baylibre.com>
      Cc: Matthias Brugger <matthias.bgg@gmail.com>
      Cc: Avi Fishman <avifishman70@gmail.com>
      Cc: Nancy Yuen <yuenn@google.com>
      Cc: Brendan Higgins <brendanhiggins@google.com>
      Cc: Wan ZongShun <mcuos.com@gmail.com>
      Cc: Michal Simek <michal.simek@xilinx.com>
      Cc: Sylvain Lemieux <slemieux.tyco@gmail.com>
      Cc: Kukjin Kim <kgene@kernel.org>
      Cc: Barry Song <baohua@kernel.org>
      Cc: Orson Zhai <orsonzhai@gmail.com>
      Cc: Patrice Chotard <patrice.chotard@st.com>
      Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
      Cc: Maxime Ripard <maxime.ripard@bootlin.com>
      Cc: Chen-Yu Tsai <wens@csie.org>
      Cc: Marc Gonzalez <marc.w.gonzalez@free.fr>
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Cc: Shawn Guo <shawnguo@kernel.org>
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Acked-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
      Tested-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
      Acked-by: default avatarJoel Stanley <joel@jms.id.au>
      Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Acked-by: default avatarMaxime Ripard <maxime.ripard@bootlin.com>
      Acked-by: Michal Simek <michal.simek@xilinx.com> (cadence/xilinx wdts)
      Acked-by: default avatarThierry Reding <treding@nvidia.com>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Acked-by: default avatarPatrice Chotard <patrice.chotard@st.com>
      Acked-by: default avatarVladimir Zapolskiy <vz@mleia.com>
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarWim Van Sebroeck <wim@linux-watchdog.org>
      0f0a6a28
  4. Jul 07, 2018
    • Randy Dunlap's avatar
      headers: separate linux/mod_devicetable.h from linux/platform_device.h · ac316725
      Randy Dunlap authored
      
      At over 4000 #includes, <linux/platform_device.h> is the 9th most
      #included header file in the Linux kernel.  It does not need
      <linux/mod_devicetable.h>, so drop that header and explicitly add
      <linux/mod_devicetable.h> to source files that need it.
      
         4146 #include <linux/platform_device.h>
      
      After this patch, there are 225 files that use <linux/mod_devicetable.h>,
      for a reduction of around 3900 times that <linux/mod_devicetable.h>
      does not have to be read & parsed.
      
          225 #include <linux/mod_devicetable.h>
      
      This patch was build-tested on 20 different arch-es.
      
      It also makes these drivers SubmitChecklist#1 compliant.
      
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Reported-by: kbuild test robot <lkp@intel.com> # drivers/media/platform/vimc/
      Reported-by: kbuild test robot <lkp@intel.com> # drivers/pinctrl/pinctrl-u300.c
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ac316725
  5. Mar 03, 2018
  6. Dec 27, 2015
  7. Nov 23, 2015
    • Peter Robinson's avatar
      watchdog: omap_wdt: fix null pointer dereference · de55acd1
      Peter Robinson authored
      
      Fix issue from two patches overlapping causing a kernel oops
      
      [ 3569.297449] Unable to handle kernel NULL pointer dereference at virtual address 00000088
      [ 3569.306272] pgd = dc894000
      [ 3569.309287] [00000088] *pgd=00000000
      [ 3569.313104] Internal error: Oops: 5 [#1] SMP ARM
      [ 3569.317986] Modules linked in: ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 xt_conntrack ebtable_filter ebtable_nat ebtable_broute bridge stp llc ebtables ip6table_security ip6table_raw ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_filter ip6_tables iptable_security iptable_raw iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack iptable_mangle musb_dsps cppi41 musb_hdrc phy_am335x udc_core phy_generic phy_am335x_control omap_sham omap_aes omap_rng omap_hwspinlock omap_mailbox hwspinlock_core musb_am335x omap_wdt at24 8250_omap leds_gpio cpufreq_dt smsc davinci_mdio mmc_block ti_cpsw cpsw_common ptp pps_core cpsw_ale davinci_cpdma omap_hsmmc omap_dma mmc_core i2c_dev
      [ 3569.386293] CPU: 0 PID: 1429 Comm: wdctl Not tainted 4.3.0-0.rc7.git0.1.fc24.armv7hl #1
      [ 3569.394740] Hardware name: Generic AM33XX (Flattened Device Tree)
      [ 3569.401179] task: dbd11a00 ti: dbaac000 task.ti: dbaac000
      [ 3569.406917] PC is at omap_wdt_get_timeleft+0xc/0x20 [omap_wdt]
      [ 3569.413106] LR is at watchdog_ioctl+0x3cc/0x42c
      [ 3569.417902] pc : [<bf0ab138>]    lr : [<c0739c54>]    psr: 600f0013
      [ 3569.417902] sp : dbaadf18  ip : 00000003  fp : 7f5d3bbe
      [ 3569.430014] r10: 00000000  r9 : 00000003  r8 : bef21ab8
      [ 3569.435535] r7 : dbbc0f7c  r6 : dbbc0f18  r5 : bef21ab8  r4 : 00000000
      [ 3569.442427] r3 : 00000000  r2 : 00000000  r1 : 8004570a  r0 : dbbc0f18
      [ 3569.449323] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
      [ 3569.456858] Control: 10c5387d  Table: 9c894019  DAC: 00000051
      [ 3569.462927] Process wdctl (pid: 1429, stack limit = 0xdbaac220)
      [ 3569.469179] Stack: (0xdbaadf18 to 0xdbaae000)
      [ 3569.473790] df00:                                                       bef21ab8 dbf60e38
      [ 3569.482441] df20: dc91b840 8004570a bef21ab8 c03988a4 dbaadf48 dc854000 00000000 dd313850
      [ 3569.491092] df40: ddf033b8 0000570a dc91b80b dbaadf3c dbf60e38 00000020 c0df9250 c0df6c48
      [ 3569.499741] df60: dc91b840 8004570a 00000000 dc91b840 dc91b840 8004570a bef21ab8 00000003
      [ 3569.508389] df80: 00000000 c03989d4 bef21b74 7f5d3bad 00000003 00000036 c020fcc4 dbaac000
      [ 3569.517037] dfa0: 00000000 c020fb00 bef21b74 7f5d3bad 00000003 8004570a bef21ab8 00000001
      [ 3569.525685] dfc0: bef21b74 7f5d3bad 00000003 00000036 00000001 00000000 7f5e4eb0 7f5d3bbe
      [ 3569.534334] dfe0: 7f5e4f10 bef21a3c 7f5d0a54 b6e97e0c a00f0010 00000003 00000000 00000000
      [ 3569.543038] [<bf0ab138>] (omap_wdt_get_timeleft [omap_wdt]) from [<c0739c54>] (watchdog_ioctl+0x3cc/0x42c)
      [ 3569.553266] [<c0739c54>] (watchdog_ioctl) from [<c03988a4>] (do_vfs_ioctl+0x5bc/0x698)
      [ 3569.561648] [<c03988a4>] (do_vfs_ioctl) from [<c03989d4>] (SyS_ioctl+0x54/0x7c)
      [ 3569.569400] [<c03989d4>] (SyS_ioctl) from [<c020fb00>] (ret_fast_syscall+0x0/0x3c)
      [ 3569.577413] Code: e12fff1e e52de004 e8bd4000 e5903060 (e5933088)
      [ 3569.584089] ---[ end trace cec3039bd3ae610a ]---
      
      Cc: <stable@vger.kernel.org> # v4.2+
      Signed-off-by: default avatarPeter Robinson <pbrobinson@gmail.com>
      Acked-by: default avatarLars Poeschel <poeschel@lemonage.de>
      Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
      de55acd1
  8. Sep 09, 2015
  9. Jul 01, 2015
  10. Jun 22, 2015
  11. Feb 17, 2015
  12. Oct 20, 2014
  13. Mar 31, 2014
  14. Nov 17, 2013
  15. Mar 01, 2013
  16. Jan 02, 2013
  17. Dec 19, 2012
  18. Nov 30, 2012
  19. Nov 28, 2012
  20. Nov 08, 2012
    • Paul Walmsley's avatar
      watchdog: OMAP: use standard GETBOOTSTATUS interface; use platform_data fn ptr · 129f5577
      Paul Walmsley authored
      
      Previously the OMAP watchdog driver used a non-standard way to report
      the chip reset source via the GETBOOTSTATUS ioctl.  This patch
      converts the driver to use the standard WDIOF_* flags for this
      purpose.
      
      This patch may break existing userspace code that uses the existing
      non-standard data format returned by the OMAP watchdog driver's
      GETBOOTSTATUS ioctl.  To fetch detailed reset source information,
      userspace code will need to retrieve it directly from the CGRM or PRM
      drivers when those are completed.
      
      Previously, to fetch the reset source, the driver either read a
      register outside the watchdog IP block (OMAP1), or called a function
      exported directly from arch/arm/mach-omap2.  Both approaches are
      broken.  This patch also converts the driver to use a platform_data
      function pointer.  This approach is temporary, and is due to the lack
      of drivers for the OMAP16xx+ Clock Generation and Reset Management IP
      block and the OMAP2+ Power and Reset Management IP block.  Once
      drivers are available for those IP blocks, the watchdog driver can be
      converted to call exported functions from those drivers directly.
      At that point, the platform_data function pointer can be removed.
      
      In the short term, this patch is needed to allow the PRM code to be
      removed from arch/arm/mach-omap2 (it is being moved to a driver).
      
      This version integrates a fix from Jon Hunter <jon-hunter@ti.com>
      that avoids a NULL pointer dereference in a DT-only boot, and integrates
      a patch commit message fix from Felipe Balbi <balbi@ti.com>.
      
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      Cc: Wim Van Sebroeck <wim@iguana.be>
      Acked-by: default avatarWim Van Sebroeck <wim@iguana.be>
      [paul@pwsan.com: integrated pdata fix from Jon Hunter]
      Cc: Jon Hunter <jon-hunter@ti.com>
      [paul@pwsan.com: integrated changelog fix from Felipe Balbi]
      Cc: Felipe Balbi <balbi@ti.com>
      129f5577
  21. Sep 13, 2012
    • Tony Lindgren's avatar
      ARM: OMAP: Split plat/hardware.h, use local soc.h for omap2+ · dbc04161
      Tony Lindgren authored
      
      As the plat and mach includes need to disappear for single zImage work,
      we need to remove plat/hardware.h.
      
      Do this by splitting plat/hardware.h into omap1 and omap2+ specific files.
      
      The old plat/hardware.h already has omap1 only defines, so it gets moved
      to mach/hardware.h for omap1. For omap2+, we use the local soc.h
      that for now just includes the related SoC headers to keep this patch more
      readable.
      
      Note that the local soc.h still includes plat/cpu.h that can be dealt
      with in later patches. Let's also include plat/serial.h from common.h for
      all the board-*.c files. This allows making the include files local later
      on without patching these files again.
      
      Note that only minimal changes are done in this patch for the
      drivers/watchdog/omap_wdt.c driver to keep things compiling. Further
      patches are needed to eventually remove cpu_is_omap usage in the drivers.
      
      Also only minimal changes are done to sound/soc/omap/* to remove the
      unneeded includes and to define OMAP44XX_MCPDM_L3_BASE locally so there's
      no need to include omap44xx.h.
      
      While at it, also sort some of the includes in the standard way.
      
      Cc: linux-watchdog@vger.kernel.org
      Cc: alsa-devel@alsa-project.org
      Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
      Cc: Jarkko Nikula <jarkko.nikula@bitmer.com>
      Cc: Liam Girdwood <lrg@ti.com>
      Acked-by: default avatarWim Van Sebroeck <wim@iguana.be>
      Acked-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      dbc04161
  22. Jul 23, 2012
    • Lokesh Vutla's avatar
      Watchdog: OMAP: Fix the runtime pm code to avoid module getting stuck intransition state. · 41814eed
      Lokesh Vutla authored
      
      OMAP watchdog driver is adapted to runtime PM like a general device
      driver but it is not appropriate. It is causing couple of functional
      issues.
      
      1. On OMAP4 SYSCLK can't be gated, because of issue with WDTIMER2 module,
      which constantly stays in "in transition" state. Value of register
      CM_WKUP_WDTIMER2_CLKCTRL is always 0x00010000 in this case.
      Issue occurs immediately after first idle, when hwmod framework tries
      to disable WDTIMER2 functional clock - "wd_timer2_fck". After this
      module falls to "in transition" state, and SYSCLK gating is blocked.
      
      2. Due to runtime PM, watchdog timer may be completely disabled.
      In current code base watchdog timer is not disabled only because of
      issue 1. Otherwise state of WDTIMER2 module will be "Disabled", and there
      will be no interrupts from omap_wdt. In other words watchdog will not
      work at all.
      
      Watchdong is a special IP and it should not be disabled otherwise
      purpose of it itself is defeated. Watchdog functional clock should
      never be disabled. This patch updates the runtime PM handling in
      driver so that runtime PM is limited only during probe/shutdown
      and suspend/resume.
      
      The patch fixes issue 1 and 2
      
      Signed-off-by: default avatarLokesh Vutla <lokeshvutla@ti.com>
      Acked-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
      Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
      41814eed
  23. Jul 09, 2012
  24. Mar 27, 2012
  25. Jan 27, 2012
  26. Jan 06, 2012
    • Shubhrajyoti D's avatar
      watchdog: omap_wdt.c: fix the WDIOC_GETBOOTSTATUS ioctl if not implemented. · e2bf7c4c
      Shubhrajyoti D authored
      
      WDIOC_GETBOOTSTATUS ioctl is imlemented for cpu_is_omap16xx and cpu_is_omap24xx
      cpus only. For other cpus it falls through to WDIOC_KEEPALIVE.
      This patch prevents the fall through.
      
      Cc: sricharan <r.sricharan@ti.com>
      Signed-off-by: default avatarShubhrajyoti D <shubhrajyoti@ti.com>
      Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
      e2bf7c4c
    • Axel Lin's avatar
      watchdog: convert drivers/watchdog/* to use module_platform_driver() · b8ec6118
      Axel Lin authored
      
      This patch converts the drivers in drivers/watchdog/* to use the
      module_platform_driver() macro which makes the code smaller and a bit
      simpler.
      
      Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
      Cc: Nicolas Thill <nico@openwrt.org>
      Cc: Florian Fainelli <florian@openwrt.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Paul Cercueil <paul@crapouillou.net>
      Cc: Marc Zyngier <maz@misterjones.org>
      Cc: Wan ZongShun <mcuos.com@gmail.com>
      Cc: Alejandro Cabrera <aldaya@gmail.com>
      Cc: "George G. Davis" <gdavis@mvista.com>
      Cc: Sylver Bruneau <sylver.bruneau@googlemail.com>
      Cc: Vitaly Wool <vital@embeddedalley.com>
      Cc: Mika Westerberg <mika.westerberg@iki.fi>
      Cc: Timo Kokkonen <timo.t.kokkonen@nokia.com>
      Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
      b8ec6118
    • Axel Lin's avatar
      watchdog: Use DEFINE_SPINLOCK() for static spinlocks · 1334f329
      Axel Lin authored
      
      Rather than just defining static spinlock_t variables and then
      initializing them later in init functions, simply define them with
      DEFINE_SPINLOCK() and remove the calls to spin_lock_init().
      
      Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
      Cc: Nicolas Thill <nico@openwrt.org>
      Cc: Heiko Ronsdorf <hero@ihg.uni-duisburg.de>
      Cc: Rodolfo Giometti <giometti@ascensit.com>
      Cc: Andrey Panin <pazke@donpac.ru>
      Cc: Guido Guenther <agx@sigxcpu.org>
      Cc: Curt E Bruns <curt.e.bruns@intel.com>
      Cc: Deepak Saxena <dsaxena@plexity.net>
      Cc: Andrew Victor <linux@maxim.org.za>
      Cc: George G. Davis <gdavis@mvista.com>
      Cc: Sylver Bruneau <sylver.bruneau@googlemail.com>
      Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
      1334f329
Loading