Linux PWM subsystem development
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Thierry Reding <thierry.reding@gmail.com>
Cc: linux-pwm@vger.kernel.org,
	Mika Westerberg <mika.westerberg@linux.intel.com>
Subject: Re: [PATCH] pwm: lpss-platform: Cleanly exit probe on boards without resources
Date: Sun, 14 Jan 2018 20:58:51 +0100	[thread overview]
Message-ID: <bc345627-cbe2-8f59-18ca-82ed21871dbe@redhat.com> (raw)
In-Reply-To: <1515762291.7000.947.camel@linux.intel.com>

Hi,

On 12-01-18 14:04, Andy Shevchenko wrote:
> +Cc: Mika
> 
> On Fri, 2018-01-12 at 12:38 +0100, Hans de Goede wrote:
>> Some boards which do not use the pwm-controller have an empty or
>> invalid
>> resource-table in ACPI the for pwm-controller. Currently this causes
>> these
>> error messages to get logged:
>> [    3.281966] pwm-lpss 80862288:00: invalid resource
>> [    3.287098] pwm-lpss: probe of 80862288:00 failed with error -22
>>
>> This commit silences these error messages on these boards by cleanly
>> exiting pwm_lpss_probe_platform() if there is no memory resource.
>>
> 
> I don't see anything wrong with message per se.

Given all the effort distros have done with splash-screens to give
users a nice clean boot experience, we really want dmesg --level=err
to not print anything unless there is a real problem with either the
hardware or the kernel.

(Note that plymouth will drop back to text-mode when kernel errors
do show up.)

>> +
>> +	/*
>> +	 * Some boards which don't use the pwm controller have an
>> empty
>> +	 * resources table, so if we cannot get the resource, return
>> -ENODEV.
>> +	 */
>>   	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>> +	if (!r)
>> +		return -ENODEV;
> 
> But this one looks like a quirk for some platforms when other can
> survive without.

Right, this is something platform specific, but on platforms which
have a proper resource for the PWM this patch is a no-op, so there
is no need to do a quirk table for this, we can just silence the
error and be done with it.

> Can we actually check this in acpi_lpss.c and prevent platform device
> registration at all?

That is a good idea, it was not entirely trivial to achieve this
but I've come up with a patch which does that. If that is deemed
acceptable then we can go with that patch instead.

Regards,

Hans

      reply	other threads:[~2018-01-14 19:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-12 11:38 [PATCH] pwm: lpss-platform: Cleanly exit probe on boards without resources Hans de Goede
2018-01-12 13:04 ` Andy Shevchenko
2018-01-14 19:58   ` Hans de Goede [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=bc345627-cbe2-8f59-18ca-82ed21871dbe@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=linux-pwm@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=thierry.reding@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox