All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pantelis Antoniou <panto@antoniou-consulting.com>
To: Kevin Hilman <khilman@linaro.org>
Cc: "Tony Lindgren" <tony@atomide.com>,
	"Russell King" <linux@arm.linux.org.uk>,
	"Benoît Coussno" <b-cousson@ti.com>,
	"Paul Walmsley" <paul@pwsan.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Sourav Poddar" <sourav.poddar@ti.com>,
	"Russ Dill" <Russ.Dill@ti.com>, "Felipe Balbi" <balbi@ti.com>,
	"Koen Kooi" <koen@circuitco.com>,
	linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/5] omap: Avoid crashes in the case of hwmod misconfiguration
Date: Thu, 8 Aug 2013 12:29:00 +0300	[thread overview]
Message-ID: <AB1CC181-58F8-4C58-9789-71A9A90B2E17@antoniou-consulting.com> (raw)
In-Reply-To: <87siyl19uk.fsf@linaro.org>

Hi Kevin,

On Aug 8, 2013, at 12:15 AM, Kevin Hilman wrote:

> Pantelis Antoniou <panto@antoniou-consulting.com> writes:
> 
>> omap hwmod is really sensitive to hwmod misconfiguration.
>> Getting a minor clock wrong always ended up in a crash.
>> Attempt to be more resilient by not assigning variables with
>> error codes and then attempting to use them.
>> 
>> Without this patch, missing a clock ends up with something like this:
>> omap_hwmod: ehrpwm0: cannot clk_get opt_clk ehrpwm0_tbclk!
> 
> Definitely agree we should not be crashing when given bad data.
> 
> nit Re: "missing clock".  I don't think there will be any crash if a
> clock is missing.  This looks to me more like the clock name is wrong
> (tbclk instead of dbclk?), not missing.
> 

Yes, I'll rephrase.

> [...]
> 
>> index 7341eff..42cb7d4 100644
>> --- a/arch/arm/mach-omap2/omap_hwmod.c
>> +++ b/arch/arm/mach-omap2/omap_hwmod.c
>> @@ -784,7 +784,9 @@ static int _init_interface_clks(struct omap_hwmod *oh)
>> 		if (IS_ERR(c)) {
>> 			pr_warning("omap_hwmod: %s: cannot clk_get interface_clk %s\n",
>> 				   oh->name, os->clk);
>> -			ret = -EINVAL;
>> +			if (ret == 0)
>> +				ret = -EINVAL;
>> +			continue;
> 
> the 'if (ret == 0)' adds confusion IMO.  If we don't care additional
> failures, errors, then just add a 'break' instead of these 3 lines.
> 
> [...]
> 


I tried to carry on as much as possible even on the presence of errors.
The remaining clocks won't be initialized, but that might be OK.

> Kevin

Regards

-- Pantelis


      parent reply	other threads:[~2013-08-08  9:29 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1375775624-12250-1-git-send-email-panto@antoniou-consulting.com>
     [not found] ` <1375775624-12250-6-git-send-email-panto@antoniou-consulting.com>
2013-08-06  9:33   ` [PATCH 5/5] arm: omap: Proper cleanups for omap_device Greg Kroah-Hartman
2013-08-06  9:37     ` Pantelis Antoniou
2013-08-06 10:14       ` Greg Kroah-Hartman
2013-08-06 13:37         ` Alexander Holler
2013-08-07  5:52           ` Greg Kroah-Hartman
2013-08-07 15:22             ` Alexander Holler
2013-08-07  7:44         ` Pantelis Antoniou
2013-08-07 16:15       ` Tony Lindgren
2013-08-07 16:23         ` Pantelis Antoniou
2013-08-08  7:25           ` Tony Lindgren
     [not found] ` <1375775624-12250-2-git-send-email-panto@antoniou-consulting.com>
2013-08-06  9:36   ` [PATCH 1/5] pdev: Fix platform device resource linking Greg Kroah-Hartman
2013-08-06  9:45     ` Pantelis Antoniou
2013-08-06 10:15       ` Greg Kroah-Hartman
2013-08-06 10:19         ` Russell King - ARM Linux
2013-08-07  5:57           ` Greg Kroah-Hartman
2013-08-07  8:27             ` Russell King - ARM Linux
2013-08-06 10:27         ` Pantelis Antoniou
2013-08-07  5:56           ` Greg Kroah-Hartman
2013-08-07  7:37             ` Pantelis Antoniou
2013-08-07 17:13               ` Matt Porter
     [not found] ` <1375775624-12250-4-git-send-email-panto@antoniou-consulting.com>
     [not found]   ` <87a9kt2vd8.fsf@linaro.org>
2013-08-08  9:23     ` [PATCH 3/5] omap: Properly handle resources for omap_devices Pantelis Antoniou
2013-08-09 15:16       ` Kevin Hilman
2013-08-09 15:32         ` Pantelis Antoniou
2013-08-09 16:35           ` Kevin Hilman
2013-08-09 18:08             ` Pantelis Antoniou
     [not found] ` <1375775624-12250-5-git-send-email-panto@antoniou-consulting.com>
     [not found]   ` <87siyl19uk.fsf@linaro.org>
2013-08-08  9:29     ` Pantelis Antoniou [this message]

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=AB1CC181-58F8-4C58-9789-71A9A90B2E17@antoniou-consulting.com \
    --to=panto@antoniou-consulting.com \
    --cc=Russ.Dill@ti.com \
    --cc=b-cousson@ti.com \
    --cc=balbi@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=khilman@linaro.org \
    --cc=koen@circuitco.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=paul@pwsan.com \
    --cc=sourav.poddar@ti.com \
    --cc=tony@atomide.com \
    /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.