From: Wolfram Sang <w.sang@pengutronix.de>
To: Marc Vertes <marc.vertes@sigfox.com>
Cc: Wim@vger.kernel.org, wim@iguana.be, Welte@vger.kernel.org,
Van@vger.kernel.org, Sebroeck@vger.kernel.org,
linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org,
HaraldWelte@viatech.com, Harald@vger.kernel.org
Subject: Re: [PATCH RFC] watchdog: add a new driver for VIA chipsets
Date: Tue, 22 Nov 2011 18:30:29 +0100 [thread overview]
Message-ID: <20111122173029.GA14349@pengutronix.de> (raw)
In-Reply-To: <4ecbd66c.8a87vIwdu0Z+quuZ%marc.vertes@sigfox.com>
[-- Attachment #1: Type: text/plain, Size: 2679 bytes --]
On Tue, Nov 22, 2011 at 06:05:48PM +0100, Marc Vertes wrote:
> Wolfram Sang <w.sang@pengutronix.de> wrote:
>
> > On Tue, Nov 22, 2011 at 12:17:13PM +0100, Marc Vertes wrote:
> > > Add a new driver for the hardware watchdog timer on VIA chipsets.
> > > Tested on a Artigo A1100, VX855 chipset.
> > >
> > > Signed-off-by: Marc Vertes <marc.vertes@sigfox.com>
> >
> > New watchdog drivers should use the framework. Have a look at
> > Documentation/watchdog/convert_drivers_to_kernel_api.txt for a guide. It
> > is mainly removing code, though.
> >
> Here it is:
Great, thanks.
> +static int wdt_start(struct watchdog_device *wdev)
> +{
> + /* Nothing to do. The watchdog can only be started by the BIOS. */
> + return 0;
> +}
> +
> +static int wdt_stop(struct watchdog_device *wdev)
> +{
> + /* Nothing to do. The watchdog can not be stopped. */
> + return 0;
> +}
Hmm, I'll leave this to Wim if it can stay like this (or if he wants a timer to
serve the non-stoppable watchdog or so).
> +static int __devinit wdt_probe(struct pci_dev *pdev,
> + const struct pci_device_id *ent)
> +{
> + unsigned int mmio = 0;
> + void __iomem *wdt_mem;
> + int ret;
> +
> + if (pci_enable_device(pdev)) {
> + dev_err(&pdev->dev, "cannot enable PCI device\n");
> + return -ENODEV;
> + }
> + pci_read_config_dword(pdev, VIA_WDT_MB_OFFSET, &mmio);
> + dev_info(&pdev->dev, "VIA Chipset watchdog MMIO: %x\n", mmio);
> + if (mmio == 0) {
> + dev_err(&pdev->dev, "watchdog timer is not enabled in BIOS\n");
> + return -ENODEV;
> + }
What about
if (mmio != 0) {
dev_info("VIA Chipset...")
} else {
dev_err()
return -ENODEV;
}
to only have the needed printouts.
> + wdt_mem = ioremap(mmio, 8);
> + if (wdt_mem == NULL) {
> + dev_err(&pdev->dev, "cannot remap VIA wdt mmio registers\n");
> + return -ENODEV;
> + }
> + ret = watchdog_register_device(&wdt_dev);
> + if (ret)
> + return ret;
You need to iounmap in the error-case.
> + watchdog_set_drvdata(&wdt_dev, wdt_mem);
> + if (readl(wdt_mem) & VIA_WDT_FIRED) {
> + wdt_dev.bootstatus |= WDIOF_CARDRESET;
> + dev_notice(&pdev->dev, "restarted by expired watchdog\n");
Skip the printout. This can be detected using CARDRESET.
> +/*
> + * The driver has not been tested yet on CX700 and VX800.
> + */
Then, I'd rather skip this comment and the IDs. Or if you are sure enough it
works, leave them in ;) Best option would be testers showing up.
Regards,
Wolfram
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2011-11-22 17:30 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-22 11:17 [PATCH RFC] watchdog: add a new driver for VIA chipsets Marc Vertes
2011-11-22 11:22 ` Wolfram Sang
2011-11-22 12:56 ` Rahul Bedarkar
2011-11-22 17:05 ` Marc Vertes
2011-11-22 17:30 ` Wolfram Sang [this message]
2011-11-22 18:09 ` Marc Vertes
2011-11-22 18:55 ` Marc Vertes
2011-11-23 12:10 ` Dmitry Artamonow
2011-11-23 14:12 ` Marc Vertes
2011-11-23 14:37 ` Mark Brown
2011-11-23 19:25 ` Dmitry Artamonow
2011-11-23 21:43 ` Wolfram Sang
2011-11-23 18:22 ` Harald Welte
2011-11-23 21:41 ` Wim Van Sebroeck
2011-11-24 19:22 ` Marc Vertes
2011-11-24 19:34 ` Wim Van Sebroeck
2011-11-25 20:02 ` Marc Vertes
2011-11-22 17:32 ` Mark Brown
2011-11-22 18:40 ` Wolfram Sang
2011-11-23 9:59 ` Marc Vertes
2011-11-23 10:49 ` Wolfram Sang
2011-11-23 11:43 ` Marc Vertes
2011-11-23 12:13 ` Wim Van Sebroeck
2011-11-23 12:20 ` Mark Brown
2011-11-23 12:40 ` Wim Van Sebroeck
2011-11-23 14:46 ` Marc Vertes
2011-11-23 21:43 ` Wim Van Sebroeck
2011-11-23 21:52 ` Wolfram Sang
2011-11-24 8:29 ` Wim Van Sebroeck
2011-11-23 21:46 ` Wim Van Sebroeck
2011-11-24 10:57 ` Marc Vertes
2011-11-24 13:42 ` Wim Van Sebroeck
2011-11-24 14:42 ` Marc Vertes
2011-11-24 15:48 ` Wim Van Sebroeck
2011-11-24 16:47 ` Marc Vertes
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=20111122173029.GA14349@pengutronix.de \
--to=w.sang@pengutronix.de \
--cc=Harald@vger.kernel.org \
--cc=HaraldWelte@viatech.com \
--cc=Sebroeck@vger.kernel.org \
--cc=Van@vger.kernel.org \
--cc=Welte@vger.kernel.org \
--cc=Wim@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=marc.vertes@sigfox.com \
--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