public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: Lubomir Rintel <lkundrak@v3.sk>
Cc: linux-kernel@vger.kernel.org, Wim Van Sebroeck <wim@iguana.be>,
	linux-rpi-kernel@lists.infradead.org,
	linux-watchdog@vger.kernel.org
Subject: Re: [PATCH] watchdog: Add Broadcom BCM2708 watchdog timer driver
Date: Fri, 22 Mar 2013 20:24:51 -0600	[thread overview]
Message-ID: <514D1273.8070902@wwwdotorg.org> (raw)
In-Reply-To: <1363956907-5644-1-git-send-email-lkundrak@v3.sk>

On 03/22/2013 06:55 AM, Lubomir Rintel wrote:
> Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>

A commit description would be useful.

>  arch/arm/configs/bcm2835_defconfig |    4 +
>  drivers/watchdog/Kconfig           |   11 +++
>  drivers/watchdog/Makefile          |    1 +
>  drivers/watchdog/bcm2835_wdt.c     |  158 ++++++++++++++++++++++++++++++++++++

The changes to bcm2835_defconfig should be a separate patch, since they
would be applied in the BCM2835 ARM sub-arch tree, whereas the driver
patch would be applied to the watchdog driver tree.

> diff --git a/arch/arm/configs/bcm2835_defconfig b/arch/arm/configs/bcm2835_defconfig

> +CONFIG_BCM2835_WDT=y
> +
>  CONFIG_MMC=y

That blank line is a little odd; was this defconfig change created using
"make savedefconfig"?

> diff --git a/drivers/watchdog/bcm2835_wdt.c b/drivers/watchdog/bcm2835_wdt.c

> +static int heartbeat = -1;
> +static bool nowayout = WATCHDOG_NOWAYOUT;
> +static void __iomem *wdt_regs;
> +static DEFINE_SPINLOCK(wdog_lock);

Can these be stored in a dynamically-allocated structure, stored in the
device's drvdata?

> +static struct platform_driver bcm2835_wdt_driver = {
...
> +};
> +
> +module_platform_driver(bcm2835_wdt_driver);

I believe it's typical not to leave a blank line before
module_platform_driver();

A couple of general comments:

1)

This driver touches the same registers that
arch/arm/mach-bcm2835/bcm2835.c uses to implement reboot and "power
off". Some co-ordination might be necessary.

The implementation of bcm2835_power_off() could easily be moved into
this driver, to avoid some of the need for co-ordination.

Moving bcm2835_restart() would be more tricky, since the ARM machine
descriptor needs a pointer to that function. I guess the kernel probably
ensures that none of the code in this watchdog driver is running by the
time bcm2835_restart() is called, although perhaps it'd be better to
have mach-bcm2835/bcm2835.c and this driver share a lock?

2)

I'm curious where you got the documentation to write this driver; this
HW module isn't described in BCM2835-ARM-Peripherals.pdf. I assume this
is based on the downstream kernel driver? If so, at least some credit in
the commit description might be appropriate. At least the relevant
commit downstream already has an appropriate Signed-off-by line:-)

  parent reply	other threads:[~2013-03-23  2:24 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-22 12:55 [PATCH] watchdog: Add Broadcom BCM2708 watchdog timer driver Lubomir Rintel
2013-03-22 13:56 ` Guenter Roeck
2013-03-24 14:06   ` Lubomir Rintel
2013-03-24 15:36     ` Guenter Roeck
2013-03-22 18:46 ` [PATCH] " Arend van Spriel
2013-03-24 14:08   ` Lubomir Rintel
2013-03-23  2:24 ` Stephen Warren [this message]
2013-03-24 14:12   ` Lubomir Rintel
2013-03-27  3:26     ` Stephen Warren
2013-03-27  3:33     ` Stephen Warren
2013-03-24 14:22 ` [PATCH v2] watchdog: Add Broadcom BCM2835 " Lubomir Rintel
2013-03-24 14:25   ` [PATCH v2] arm: Add Broadcom BCM2835 watchdog timer driver to bcm2835_defconfig Lubomir Rintel
2013-03-26 17:48     ` [PATCH v2] bcm2835: Add Broadcom BCM2835 RNG to the device tree Lubomir Rintel
2013-03-26 17:50       ` Lubomir Rintel
2013-03-26 17:50     ` [PATCH v3] watchdog: Add Broadcom BCM2835 watchdog timer driver Lubomir Rintel
2013-03-26 21:03       ` Guenter Roeck
2013-03-27 16:39         ` Lubomir Rintel
2013-03-27  3:40       ` Stephen Warren
2013-03-27 16:36         ` Lubomir Rintel
2013-03-27  3:49       ` Stephen Warren
2013-03-27 16:40       ` [PATCH v4] " Lubomir Rintel
2013-03-27 19:52         ` Guenter Roeck
2013-03-28  3:00         ` Stephen Warren
2013-03-28  3:50           ` Guenter Roeck
2013-05-26 14:22           ` Wim Van Sebroeck
2013-06-18 16:50             ` Lubomir Rintel
2013-06-18 17:10               ` Stephen Warren
2013-06-18 17:44                 ` [PATCH v5] " Lubomir Rintel
2013-06-18 18:24                   ` Guenter Roeck
2013-06-27 20:25                   ` Wim Van Sebroeck
2013-05-17  2:59         ` [PATCH v4] " Stephen Warren
2013-03-24 16:12   ` [PATCH v2] " Guenter Roeck
2013-03-26 17:47     ` Lubomir Rintel
2013-03-26 19:47       ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=514D1273.8070902@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=lkundrak@v3.sk \
    --cc=wim@iguana.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox