All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: "Opensource [Steve Twiss]" <stwiss.opensource@diasemi.com>
Cc: LINUXKERNEL <linux-kernel@vger.kernel.org>,
	LINUXWATCHDOG <linux-watchdog@vger.kernel.org>,
	Wim Van Sebroeck <wim@iguana.be>,
	Alessandro Zummo <a.zummo@towertech.it>,
	DEVICETREE <devicetree@vger.kernel.org>,
	David Dajun Chen <david.chen@diasemi.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	LINUXINPUT <linux-input@vger.kernel.org>,
	Lee Jones <lee.jones@linaro.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Pawel Moll <pawel.moll@arm.com>,
	RTCLINUX <rtc-linux@googlegroups.com>,
	Rob Herring <robh+dt@kernel.org>,
	Samuel Ortiz <sameo@linux.intel.com>,
	Support Opensource <Support.Opensource@diasemi.com>
Subject: Re: [PATCH V2 3/4] watchdog: da9062: DA9062 watchdog driver
Date: Fri, 15 May 2015 13:20:05 -0700	[thread overview]
Message-ID: <20150515202005.GA23133@roeck-us.net> (raw)
In-Reply-To: <6ED8E3B22081A4459DAC7699F3695FB7014B22B6E2@SW-EX-MBX02.diasemi.com>

On Fri, May 15, 2015 at 03:35:50PM +0000, Opensource [Steve Twiss] wrote:
> 
> > > +
> > > +/* E_WDG_WARN interrupt handler */
> > > +static irqreturn_t da9062_wdt_wdg_warn_irq_handler(int irq, void *data)
> > > +{
> > > +	struct da9062_watchdog *wdt = data;
> > > +
> > > +	dev_notice(wdt->hw->dev, "Watchdog timeout warning trigger.\n");
> > > +	return IRQ_HANDLED;
> > > +}
> > > +
> 
> On 15 May 2015 13:58 Guenter Roeck wrote:
> 
>  [...]
>  
> > >>> +
> > >>> +	irq = platform_get_irq_byname(pdev, "WDG_WARN");
> > >>> +	if (irq < 0) {
> > >>> +		dev_err(wdt->hw->dev, "Failed to get IRQ.\n");
> > >>> +		ret = irq;
> > >>> +		goto error;
> 
> [...]
> 
> > >
> > >> Also, is the interrupt mandatory ? All it does is to display a message.
> > >> Looks very optional to me.
> > >
> > > It is a place holder for something more application specific.
> > > I could remove it, but I figured it would just get re-added when somebody takes the
> > > driver and modifies it for their needs.
> > >
> > > If this is a problem however, it can go.
> > > Please advise ..
> > >
> > 
> > Then this someone should add the code. For the time being, it just increases
> > kernel size and may cause the driver to fail for no good reason. Plus, given
> > the driver apparently works without interrupt, even then it should be
> > optional, and the driver does not have to fail loading if it is not supported on a
> > given platform.
> > 
> 
> Hi Guenter,
> 
> I'm not sure if I got my previous point across there ...
> 
> Leaving this in wouldn't really do any real harm I think. If this feature is not supported
> in somebody's platform then there wouldn't be a problem, the IRQ would fire (as a
> warning that the watchdog was about to time-out), the handler function would be
> executed, it would handle the IRQ -- and that would be it. Nothing would happen apart
> from a debug print.

I didn't get my point across either. Problem is that your driver fails to load
if the interrupt is not there. With the interrupt really being optional, I don't
see the point in making it mandatory just to display a message if it fires.

> 
> There are already examples of this in the kernel, I've not looked very hard ...
> http://lxr.free-electrons.com/source/drivers/mfd/qcom_rpm.c#L412
> http://lxr.free-electrons.com/source/drivers/mfd/arizona-irq.c#L72
> 

Never a good argument to make with me. 100 people doing something wrong
doesn't mean you should continue to do so.

Guenter

WARNING: multiple messages have this Message-ID (diff)
From: Guenter Roeck <linux@roeck-us.net>
To: "Opensource [Steve Twiss]" <stwiss.opensource@diasemi.com>
Cc: LINUXKERNEL <linux-kernel@vger.kernel.org>,
	LINUXWATCHDOG <linux-watchdog@vger.kernel.org>,
	Wim Van Sebroeck <wim@iguana.be>,
	Alessandro Zummo <a.zummo@towertech.it>,
	DEVICETREE <devicetree@vger.kernel.org>,
	David Dajun Chen <david.chen@diasemi.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	LINUXINPUT <linux-input@vger.kernel.org>,
	Lee Jones <lee.jones@linaro.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Pawel Moll <pawel.moll@arm.com>,
	RTCLINUX <rtc-linux@googlegroups.com>,
	Rob Herring <robh+dt@kernel.org>,
	Samuel Ortiz <sameo@linux.intel.com>,
	Support Opensource <Support.Opensource@diasemi.com>
Subject: [rtc-linux] Re: [PATCH V2 3/4] watchdog: da9062: DA9062 watchdog driver
Date: Fri, 15 May 2015 13:20:05 -0700	[thread overview]
Message-ID: <20150515202005.GA23133@roeck-us.net> (raw)
In-Reply-To: <6ED8E3B22081A4459DAC7699F3695FB7014B22B6E2@SW-EX-MBX02.diasemi.com>

On Fri, May 15, 2015 at 03:35:50PM +0000, Opensource [Steve Twiss] wrote:
> 
> > > +
> > > +/* E_WDG_WARN interrupt handler */
> > > +static irqreturn_t da9062_wdt_wdg_warn_irq_handler(int irq, void *data)
> > > +{
> > > +	struct da9062_watchdog *wdt = data;
> > > +
> > > +	dev_notice(wdt->hw->dev, "Watchdog timeout warning trigger.\n");
> > > +	return IRQ_HANDLED;
> > > +}
> > > +
> 
> On 15 May 2015 13:58 Guenter Roeck wrote:
> 
>  [...]
>  
> > >>> +
> > >>> +	irq = platform_get_irq_byname(pdev, "WDG_WARN");
> > >>> +	if (irq < 0) {
> > >>> +		dev_err(wdt->hw->dev, "Failed to get IRQ.\n");
> > >>> +		ret = irq;
> > >>> +		goto error;
> 
> [...]
> 
> > >
> > >> Also, is the interrupt mandatory ? All it does is to display a message.
> > >> Looks very optional to me.
> > >
> > > It is a place holder for something more application specific.
> > > I could remove it, but I figured it would just get re-added when somebody takes the
> > > driver and modifies it for their needs.
> > >
> > > If this is a problem however, it can go.
> > > Please advise ..
> > >
> > 
> > Then this someone should add the code. For the time being, it just increases
> > kernel size and may cause the driver to fail for no good reason. Plus, given
> > the driver apparently works without interrupt, even then it should be
> > optional, and the driver does not have to fail loading if it is not supported on a
> > given platform.
> > 
> 
> Hi Guenter,
> 
> I'm not sure if I got my previous point across there ...
> 
> Leaving this in wouldn't really do any real harm I think. If this feature is not supported
> in somebody's platform then there wouldn't be a problem, the IRQ would fire (as a
> warning that the watchdog was about to time-out), the handler function would be
> executed, it would handle the IRQ -- and that would be it. Nothing would happen apart
> from a debug print.

I didn't get my point across either. Problem is that your driver fails to load
if the interrupt is not there. With the interrupt really being optional, I don't
see the point in making it mandatory just to display a message if it fires.

> 
> There are already examples of this in the kernel, I've not looked very hard ...
> http://lxr.free-electrons.com/source/drivers/mfd/qcom_rpm.c#L412
> http://lxr.free-electrons.com/source/drivers/mfd/arizona-irq.c#L72
> 

Never a good argument to make with me. 100 people doing something wrong
doesn't mean you should continue to do so.

Guenter

-- 
-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

  reply	other threads:[~2015-05-15 20:20 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-14 16:43 [PATCH V2 0/4] da9062: DA9062 driver submission S Twiss
2015-05-14 16:43 ` S Twiss
2015-05-14 16:43 ` [rtc-linux] " S Twiss
2015-05-14 16:43 ` [PATCH V2 1/4] mfd: da9062: DA9062 MFD core driver S Twiss
2015-05-14 16:43   ` [rtc-linux] " S Twiss
     [not found]   ` <af5a7d289bb149e9111ebc70bb0589a994ee2407.1431621833.git.stwiss.opensource-WBD+wuPFNBhBDgjK7y7TUQ@public.gmane.org>
2015-05-16  8:53     ` Alexandre Belloni
2015-05-16  8:53       ` Alexandre Belloni
     [not found]       ` <20150516085328.GI3338-m++hUPXGwpdeoWH0uzbU5w@public.gmane.org>
2015-05-19  8:34         ` Opensource [Steve Twiss]
2015-05-19  8:34           ` Opensource [Steve Twiss]
2015-05-19  8:34           ` Opensource [Steve Twiss]
2015-05-14 16:43 ` [PATCH V2 2/4] regulator: da9062: DA9062 regulator driver S Twiss
2015-05-14 16:43   ` [rtc-linux] " S Twiss
     [not found] ` <cover.1431621833.git.stwiss.opensource-WBD+wuPFNBhBDgjK7y7TUQ@public.gmane.org>
2015-05-14 16:43   ` [PATCH V2 3/4] watchdog: da9062: DA9062 watchdog driver S Twiss
2015-05-14 16:43     ` S Twiss
2015-05-14 16:43     ` [rtc-linux] " S Twiss
     [not found]     ` <6a51f163b99edfad9165ad29609abb072dbaa2b7.1431621833.git.stwiss.opensource-WBD+wuPFNBhBDgjK7y7TUQ@public.gmane.org>
2015-05-15  2:13       ` Guenter Roeck
2015-05-15  2:13         ` Guenter Roeck
2015-05-15  2:13         ` [rtc-linux] " Guenter Roeck
2015-05-15  8:13         ` Opensource [Steve Twiss]
2015-05-15  8:13           ` [rtc-linux] " Opensource [Steve Twiss]
2015-05-15 12:57           ` Guenter Roeck
2015-05-15 12:57             ` [rtc-linux] " Guenter Roeck
     [not found]             ` <5555ED4F.5070003-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2015-05-15 15:35               ` Opensource [Steve Twiss]
2015-05-15 15:35                 ` Opensource [Steve Twiss]
2015-05-15 15:35                 ` [rtc-linux] " Opensource [Steve Twiss]
2015-05-15 20:20                 ` Guenter Roeck [this message]
2015-05-15 20:20                   ` [rtc-linux] " Guenter Roeck
2015-05-18 14:15                   ` Opensource [Steve Twiss]
2015-05-18 14:15                     ` [rtc-linux] " Opensource [Steve Twiss]
     [not found]                     ` <6ED8E3B22081A4459DAC7699F3695FB7014B22B8C8-68WUHU125fLzLL1Oxlh9IgLouzNaz+3S@public.gmane.org>
2015-05-18 15:27                       ` Guenter Roeck
2015-05-18 15:27                         ` Guenter Roeck
2015-05-18 15:27                         ` [rtc-linux] " Guenter Roeck
2015-05-18 16:03                         ` Opensource [Steve Twiss]
2015-05-18 16:03                           ` [rtc-linux] " Opensource [Steve Twiss]
     [not found]                           ` <6ED8E3B22081A4459DAC7699F3695FB7014B22B8FE-68WUHU125fLzLL1Oxlh9IgLouzNaz+3S@public.gmane.org>
2015-05-18 17:39                             ` Alexandre Belloni
2015-05-18 17:39                               ` Alexandre Belloni
2015-05-18 17:39                               ` Alexandre Belloni
2015-05-19 10:16                               ` Opensource [Steve Twiss]
2015-05-19 10:16                                 ` Opensource [Steve Twiss]
2015-05-16  0:46   ` [rtc-linux] [PATCH V2 0/4] da9062: DA9062 driver submission Alexandre Belloni
2015-05-16  0:46     ` Alexandre Belloni
2015-05-18 14:23     ` Opensource [Steve Twiss]
2015-05-18 14:23       ` Opensource [Steve Twiss]
2015-05-14 16:43 ` [PATCH V2 4/4] devicetree: da9062: Add bindings for DA9062 driver S Twiss
2015-05-14 16:43   ` [rtc-linux] " S Twiss

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=20150515202005.GA23133@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=Support.Opensource@diasemi.com \
    --cc=a.zummo@towertech.it \
    --cc=broonie@kernel.org \
    --cc=david.chen@diasemi.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=lee.jones@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=rtc-linux@googlegroups.com \
    --cc=sameo@linux.intel.com \
    --cc=stwiss.opensource@diasemi.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.