public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: lee.jones@linaro.org (Lee Jones)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] drivers: mfd: check ACPI device companion before checking resources
Date: Wed, 13 May 2015 15:42:43 +0100	[thread overview]
Message-ID: <20150513144243.GB3394@x1> (raw)
In-Reply-To: <1430473270-11359-1-git-send-email-lorenzo.pieralisi@arm.com>

On Fri, 01 May 2015, Lorenzo Pieralisi wrote:

> Current code in mfd-core calls into ACPI to check resources even
> on a system that booted with a DT (on kernels with both DT and ACPI
> support compiled in). This triggers ACPI exceptions since we may
> end up calling the ACPI interpreter when it has not been initialized:
> 
> "ACPI Exception: AE_BAD_PARAMETER, Thread 2064154624 could not acquire
> Mutex [0x1] (20150410/utmutex-285)"
> 
> This patch fixes the issues by adding a check for an ACPI companion
> device before carrying out ACPI resources checks to avoid calling
> the ACPI interpreter if the fwnode representing the device is an OF one.
> 
> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lee Jones <lee.jones@linaro.org>
> Cc: Samuel Ortiz <sameo@linux.intel.com>
> ---
> Lee, Samuel,
> 
> I could not test it on X86 and I do not know if you prefer setting
> ignore_resource_conflicts in the respective mfd cells (ie vexpress),
> just let me know how do you want to fix it.

Patch looks fine to me.  It doesn't change current *expected*
behaviour and adds extra protection against the aforementioned issue.

Applied, thanks.

>  drivers/mfd/mfd-core.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
> index 1aed3b7..14fd5cb 100644
> --- a/drivers/mfd/mfd-core.c
> +++ b/drivers/mfd/mfd-core.c
> @@ -207,9 +207,11 @@ static int mfd_add_device(struct device *parent, int id,
>  		}
>  
>  		if (!cell->ignore_resource_conflicts) {
> -			ret = acpi_check_resource_conflict(&res[r]);
> -			if (ret)
> -				goto fail_alias;
> +			if (has_acpi_companion(&pdev->dev)) {
> +				ret = acpi_check_resource_conflict(&res[r]);
> +				if (ret)
> +					goto fail_alias;
> +			}
>  		}
>  	}
>  

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

      reply	other threads:[~2015-05-13 14:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-01  9:41 [PATCH] drivers: mfd: check ACPI device companion before checking resources Lorenzo Pieralisi
2015-05-13 14:42 ` Lee Jones [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=20150513144243.GB3394@x1 \
    --to=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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