From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F02A4C433E0 for ; Thu, 11 Mar 2021 12:11:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9D23464FE6 for ; Thu, 11 Mar 2021 12:11:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232915AbhCKMLU (ORCPT ); Thu, 11 Mar 2021 07:11:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232781AbhCKMLK (ORCPT ); Thu, 11 Mar 2021 07:11:10 -0500 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBA7FC061574; Thu, 11 Mar 2021 04:11:09 -0800 (PST) Received: by mail-pg1-x52e.google.com with SMTP id 16so7126308pgo.13; Thu, 11 Mar 2021 04:11:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=w69u9haWUp7YyyRifTBBdCO9AMFL3iKp2esRU3gVS/w=; b=Uzq1lJTQHfliiP9ckv3avNMXf3O4PAJF/m/o25aGvNCDamWpxVXQI2c0kIZizBdeKm hcNZ88NTPFuexUtkXAAaT+8TqRoxmq8P9mUa+q0EXzHivpwAVQSiRiHoO3BwF2O0sRvc 4MUQwnCOSl2KNBur4T1OemCxhBtvDS1bKRNF3MnQK2fa+6ll/aW3wzLkwoMv9fA8y1tE jjhlfYPIh8PnAGTYbQlmznDUtpyanW5cbtpHnDGrtgbjuPUyoHpR1ayX7Z0T9iA0HdKL RuYzvDZd/sz7WOi1NL4NK5kJJP4GAfuVBsWvBo9zT25AaYGLZYplr9WkFxKhCUdNtpf5 fDYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=w69u9haWUp7YyyRifTBBdCO9AMFL3iKp2esRU3gVS/w=; b=Gx7tTfYMD+C4BX0iodI88Tgp/p5CIBu5Chdjoq5oSzYG1w7Tl/uYiLGunB77imabFc hyor5j/xxV9sLuL56u+cyRdxxBOg81S9RquyYTnFJVaXzL3ZdGkijBCEv/LRYHB2FQO1 PCgnR4UdCpBOj5Vr99D1mxTGbC+TqKrnR+sKpyL6kUu+GcCnffHy6JvAZ7wZ+GqvGm9L KKWFXNtCwCqrOK13Fi2VrMlIkYS/tbx5UyVtvqcw1jIOJCbXh7XdDMJkmuV8PhZVvMMO rTpfbuOPj1obrYel6SdWywwUww+bmYHFNfUjfZbVm6oO3o9z4Q9xLM+tnaW+lxqu1ZnF W8kg== X-Gm-Message-State: AOAM530sOA6wgkvJ5VGk54f929Ts1z0POsR2FZ9jEOlLkNrQqtY52mVL xnmMp/x5AUXDjypLMi5FO3hFJZ1nyubrk5qvPs0= X-Google-Smtp-Source: ABdhPJwDJ2LyrvM+yGoawF7YjWlt50VsanO16V59FCreJ6iqEaHGFZt6YEvCIYprPTzm5Z6rkDvc2xMG6HvKI1x3SpA= X-Received: by 2002:a62:7c43:0:b029:1ef:20ce:ba36 with SMTP id x64-20020a627c430000b02901ef20ceba36mr7662587pfc.40.1615464669404; Thu, 11 Mar 2021 04:11:09 -0800 (PST) MIME-Version: 1.0 References: <20210311062011.8054-1-calvin.johnson@oss.nxp.com> <20210311062011.8054-11-calvin.johnson@oss.nxp.com> In-Reply-To: <20210311062011.8054-11-calvin.johnson@oss.nxp.com> From: Andy Shevchenko Date: Thu, 11 Mar 2021 14:10:53 +0200 Message-ID: Subject: Re: [net-next PATCH v7 10/16] ACPI: utils: Introduce acpi_get_local_address() To: Calvin Johnson Cc: Grant Likely , "Rafael J . Wysocki" , Jeremy Linton , Andrew Lunn , Florian Fainelli , Russell King - ARM Linux admin , Cristi Sovaiala , Florin Laurentiu Chiculita , Ioana Ciornei , Madalin Bucur , Heikki Krogerus , Marcin Wojtas , Pieter Jansen Van Vuuren , Jon , Saravana Kannan , Randy Dunlap , linux-arm Mailing List , Diana Madalina Craciun , ACPI Devel Maling List , Linux Kernel Mailing List , "linux.cj" , netdev , Laurentiu Tudor , Len Brown , "Rafael J. Wysocki" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org On Thu, Mar 11, 2021 at 8:22 AM Calvin Johnson wrote: > > Introduce a wrapper around the _ADR evaluation. Reviewed-by: Andy Shevchenko > Signed-off-by: Calvin Johnson > --- > > Changes in v7: None > Changes in v6: None > Changes in v5: > - Replace fwnode_get_id() with acpi_get_local_address() > > Changes in v4: > - Improve code structure to handle all cases > > Changes in v3: > - Modified to retrieve reg property value for ACPI as well > - Resolved compilation issue with CONFIG_ACPI = n > - Added more info into documentation > > Changes in v2: None > > drivers/acpi/utils.c | 14 ++++++++++++++ > include/linux/acpi.h | 7 +++++++ > 2 files changed, 21 insertions(+) > > diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c > index 682edd913b3b..41fe380a09a7 100644 > --- a/drivers/acpi/utils.c > +++ b/drivers/acpi/utils.c > @@ -277,6 +277,20 @@ acpi_evaluate_integer(acpi_handle handle, > > EXPORT_SYMBOL(acpi_evaluate_integer); > > +int acpi_get_local_address(acpi_handle handle, u32 *addr) > +{ > + unsigned long long adr; > + acpi_status status; > + > + status = acpi_evaluate_integer(handle, METHOD_NAME__ADR, NULL, &adr); > + if (ACPI_FAILURE(status)) > + return -ENODATA; > + > + *addr = (u32)adr; > + return 0; > +} > +EXPORT_SYMBOL(acpi_get_local_address); > + > acpi_status > acpi_evaluate_reference(acpi_handle handle, > acpi_string pathname, > diff --git a/include/linux/acpi.h b/include/linux/acpi.h > index fcdaab723916..700f9fc303ab 100644 > --- a/include/linux/acpi.h > +++ b/include/linux/acpi.h > @@ -706,6 +706,8 @@ static inline u64 acpi_arch_get_root_pointer(void) > } > #endif > > +int acpi_get_local_address(acpi_handle handle, u32 *addr); > + > #else /* !CONFIG_ACPI */ > > #define acpi_disabled 1 > @@ -953,6 +955,11 @@ static inline struct acpi_device *acpi_resource_consumer(struct resource *res) > return NULL; > } > > +static inline int acpi_get_local_address(acpi_handle handle, u32 *addr) > +{ > + return -ENODEV; > +} > + > #endif /* !CONFIG_ACPI */ > > #ifdef CONFIG_ACPI_HOTPLUG_IOAPIC > -- > 2.17.1 > -- With Best Regards, Andy Shevchenko From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50792C433DB for ; Thu, 11 Mar 2021 12:12:49 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B2F3A64EFD for ; Thu, 11 Mar 2021 12:12:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B2F3A64EFD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=hWSaGoDWfVak7GnnumZHhkYeZR3hiz62YAhc35MNtfY=; b=UgVTgfuB8as8r9LkRlhKU4m2X VYOsj0ZsCiI/WrtMi9BIoAZNmFWN+psPoGPuVDTauaOSpV1so40jCFUx+1yEEGP+L86irakjueOqm u4yPVzgjl8Wb9p1NIDUXghD69RVvjfAebYESLGTlIiZDjX4904/GgW8nwiX/ZjbqpTFq8cpFRy1Lw +GwbTFny8fKm/D1WI+J9lzWGyJMeoR0l5l2DfiynU9X6IfXPxxxVBYa9dT5GgirUIrm8LyHDkrY1C mdJX8lvC7N0J2PYY8rUyEPGmBEMphpUo3xYD2BQNZPWVrN91p/Ns38tmm1pyv/saQFH2B76P6TdJu 5/J7Mck4w==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lKK9s-0092m9-MM; Thu, 11 Mar 2021 12:11:16 +0000 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lKK9n-0092kb-0U for linux-arm-kernel@lists.infradead.org; Thu, 11 Mar 2021 12:11:13 +0000 Received: by mail-pg1-x534.google.com with SMTP id q5so899780pgk.5 for ; Thu, 11 Mar 2021 04:11:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=w69u9haWUp7YyyRifTBBdCO9AMFL3iKp2esRU3gVS/w=; b=Uzq1lJTQHfliiP9ckv3avNMXf3O4PAJF/m/o25aGvNCDamWpxVXQI2c0kIZizBdeKm hcNZ88NTPFuexUtkXAAaT+8TqRoxmq8P9mUa+q0EXzHivpwAVQSiRiHoO3BwF2O0sRvc 4MUQwnCOSl2KNBur4T1OemCxhBtvDS1bKRNF3MnQK2fa+6ll/aW3wzLkwoMv9fA8y1tE jjhlfYPIh8PnAGTYbQlmznDUtpyanW5cbtpHnDGrtgbjuPUyoHpR1ayX7Z0T9iA0HdKL RuYzvDZd/sz7WOi1NL4NK5kJJP4GAfuVBsWvBo9zT25AaYGLZYplr9WkFxKhCUdNtpf5 fDYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=w69u9haWUp7YyyRifTBBdCO9AMFL3iKp2esRU3gVS/w=; b=b9T2npu1N99t4Xe3/DvWB44tAyhbwvgi9adpaDC8lIhNNkjUhbfk7i/U22ryla5u/E R6WXx93yqvPwOmP1ZKCLFEWf5nKR+C4RM/D6Ep7nUcHWo1ixDepKul/fHbfUaOGx48n+ /xNh124SCvWj3/lnYFVbQoUOoKweB7Tb0ekWwmP/oUdmAmUgyY6sJd+rV6DUls2UwSJK vGucVTZl+M3OvDI3JeUVFs48IkT9U0bnOo4RXSuGOWTwzK4jHEpTeFyZJqOFwbVbxLim Logx9HjptjExDETkoSk+Cw8anlFFh3Vm2urdrAbxornY1KmvkRvIHOC/IE6tnzL8vHPp HJ5Q== X-Gm-Message-State: AOAM530yiOLSsCXQbd3pL4j07KJ/4AOoU+K0E1sQkhZrsl8QXJtINQIt /fc2LTAtnphNwle9q63A/PkxKr8jYHWZqnlEudg= X-Google-Smtp-Source: ABdhPJwDJ2LyrvM+yGoawF7YjWlt50VsanO16V59FCreJ6iqEaHGFZt6YEvCIYprPTzm5Z6rkDvc2xMG6HvKI1x3SpA= X-Received: by 2002:a62:7c43:0:b029:1ef:20ce:ba36 with SMTP id x64-20020a627c430000b02901ef20ceba36mr7662587pfc.40.1615464669404; Thu, 11 Mar 2021 04:11:09 -0800 (PST) MIME-Version: 1.0 References: <20210311062011.8054-1-calvin.johnson@oss.nxp.com> <20210311062011.8054-11-calvin.johnson@oss.nxp.com> In-Reply-To: <20210311062011.8054-11-calvin.johnson@oss.nxp.com> From: Andy Shevchenko Date: Thu, 11 Mar 2021 14:10:53 +0200 Message-ID: Subject: Re: [net-next PATCH v7 10/16] ACPI: utils: Introduce acpi_get_local_address() To: Calvin Johnson Cc: Grant Likely , "Rafael J . Wysocki" , Jeremy Linton , Andrew Lunn , Florian Fainelli , Russell King - ARM Linux admin , Cristi Sovaiala , Florin Laurentiu Chiculita , Ioana Ciornei , Madalin Bucur , Heikki Krogerus , Marcin Wojtas , Pieter Jansen Van Vuuren , Jon , Saravana Kannan , Randy Dunlap , linux-arm Mailing List , Diana Madalina Craciun , ACPI Devel Maling List , Linux Kernel Mailing List , "linux.cj" , netdev , Laurentiu Tudor , Len Brown , "Rafael J. Wysocki" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210311_121111_297720_374F738C X-CRM114-Status: GOOD ( 20.16 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Mar 11, 2021 at 8:22 AM Calvin Johnson wrote: > > Introduce a wrapper around the _ADR evaluation. Reviewed-by: Andy Shevchenko > Signed-off-by: Calvin Johnson > --- > > Changes in v7: None > Changes in v6: None > Changes in v5: > - Replace fwnode_get_id() with acpi_get_local_address() > > Changes in v4: > - Improve code structure to handle all cases > > Changes in v3: > - Modified to retrieve reg property value for ACPI as well > - Resolved compilation issue with CONFIG_ACPI = n > - Added more info into documentation > > Changes in v2: None > > drivers/acpi/utils.c | 14 ++++++++++++++ > include/linux/acpi.h | 7 +++++++ > 2 files changed, 21 insertions(+) > > diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c > index 682edd913b3b..41fe380a09a7 100644 > --- a/drivers/acpi/utils.c > +++ b/drivers/acpi/utils.c > @@ -277,6 +277,20 @@ acpi_evaluate_integer(acpi_handle handle, > > EXPORT_SYMBOL(acpi_evaluate_integer); > > +int acpi_get_local_address(acpi_handle handle, u32 *addr) > +{ > + unsigned long long adr; > + acpi_status status; > + > + status = acpi_evaluate_integer(handle, METHOD_NAME__ADR, NULL, &adr); > + if (ACPI_FAILURE(status)) > + return -ENODATA; > + > + *addr = (u32)adr; > + return 0; > +} > +EXPORT_SYMBOL(acpi_get_local_address); > + > acpi_status > acpi_evaluate_reference(acpi_handle handle, > acpi_string pathname, > diff --git a/include/linux/acpi.h b/include/linux/acpi.h > index fcdaab723916..700f9fc303ab 100644 > --- a/include/linux/acpi.h > +++ b/include/linux/acpi.h > @@ -706,6 +706,8 @@ static inline u64 acpi_arch_get_root_pointer(void) > } > #endif > > +int acpi_get_local_address(acpi_handle handle, u32 *addr); > + > #else /* !CONFIG_ACPI */ > > #define acpi_disabled 1 > @@ -953,6 +955,11 @@ static inline struct acpi_device *acpi_resource_consumer(struct resource *res) > return NULL; > } > > +static inline int acpi_get_local_address(acpi_handle handle, u32 *addr) > +{ > + return -ENODEV; > +} > + > #endif /* !CONFIG_ACPI */ > > #ifdef CONFIG_ACPI_HOTPLUG_IOAPIC > -- > 2.17.1 > -- With Best Regards, Andy Shevchenko _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel