From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965257AbbEMOm6 (ORCPT ); Wed, 13 May 2015 10:42:58 -0400 Received: from mail-wi0-f175.google.com ([209.85.212.175]:38170 "EHLO mail-wi0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934444AbbEMOms (ORCPT ); Wed, 13 May 2015 10:42:48 -0400 Date: Wed, 13 May 2015 15:42:43 +0100 From: Lee Jones To: Lorenzo Pieralisi Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sudeep Holla , Samuel Ortiz Subject: Re: [PATCH] drivers: mfd: check ACPI device companion before checking resources Message-ID: <20150513144243.GB3394@x1> References: <1430473270-11359-1-git-send-email-lorenzo.pieralisi@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1430473270-11359-1-git-send-email-lorenzo.pieralisi@arm.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Cc: Sudeep Holla > Cc: Lee Jones > Cc: Samuel Ortiz > --- > 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