Message ID | 1675944939-22631-3-git-send-email-ssengar@linux.microsoft.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp300954wrn; Thu, 9 Feb 2023 04:19:45 -0800 (PST) X-Google-Smtp-Source: AK7set97wYlBlQmGzFjJY9FWkbaxvw0ANV4yLuU/gV6NIFPcVH05FlfIpe69maFOrztvViWkXeX4 X-Received: by 2002:a17:90b:1a84:b0:230:a609:ff3b with SMTP id ng4-20020a17090b1a8400b00230a609ff3bmr12891278pjb.32.1675945185401; Thu, 09 Feb 2023 04:19:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675945185; cv=none; d=google.com; s=arc-20160816; b=HQm9IwsqJD6neLvMt1COKfGq6OfSHLndmYnU54TYGxk1lSRu1IzG+YlKB51X4qiXi0 Gu2XzstmQPBbQ1FkoQ9KBo/jRqdV0FIeKjpqNh0yaP2+ueR6xVe7/9jkz+RMvUZcLx6E z104e8et/B5NAnJAkfaLRGPE4XN++RppSbLCnqr+VocJIfauKSWnttJl3N84XqGgUVUw lXKlTZ89jB+D4eOR77ttfvaHJg9qZbro7OqBfJ2cxwKhwyHvSo7zOuoJuF2E4fnoziPT w57Uty36OEV+RP8gpMl61zsMETTSobX0q1PzVug+MouCuzMHXrZuOjLO8JD6YnYX4Yr3 0g0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :to:from:dkim-signature:dkim-filter; bh=i1p50TI+7fOgk4LW62buuCzlHOInl+oROOTdYyM1xe0=; b=K9sqUsrOxrhGfDUQjdCxCA6/CAyq1vAn8aGM0/QsfV4kXGCBIUcDrR0aT4jee5FwZd d7Hk/bL1lVO1qjXazkuTdtIuFsgSug5x6s7LKpun7CMICxA5cOajPCgOMUz5FpFn2gq7 nblbZls5qKSk2Gf+/gqXheophRTn8t55g27cB+OAgRm3fWwuDfiuhip/PcTIQxs/xY6/ XKErTJc7ETYgCfbe0RjZ6B17pifeT09fUt1Rr8U5umpAzQ3T8fgkf9E4udmEI6qdcacI 9KVuy1FeTbqyXaEdh9ZskCds30Y3ghK8IQMYfuLcCNX2L/cx11LseYMnOPpkQ/IFpVrw 2fng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=R45l2Rjl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g9-20020a17090ace8900b002192eb3532bsi5052312pju.116.2023.02.09.04.19.33; Thu, 09 Feb 2023 04:19:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=R45l2Rjl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229881AbjBIMRC (ORCPT <rfc822;ybw1215001957@gmail.com> + 99 others); Thu, 9 Feb 2023 07:17:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229699AbjBIMQt (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 9 Feb 2023 07:16:49 -0500 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EBE19EB4A; Thu, 9 Feb 2023 04:16:30 -0800 (PST) Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id B424120C8AEE; Thu, 9 Feb 2023 04:15:43 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com B424120C8AEE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1675944943; bh=i1p50TI+7fOgk4LW62buuCzlHOInl+oROOTdYyM1xe0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=R45l2RjlJuLHuNwf4WONyHHr7T+kRK6l5zCqx/yYfKrb1R2/eigbHgmD6zqWhOFl3 sltSm2pidcN4VNi6j9iT4lMkklpiK8zqstWEO2chSL6SL81tbs+zK7SGDPP26hnxc/ UIl+MdjWxFPHmIu87aPIgyFILzzgSdHJk7YU2erI= From: Saurabh Sengar <ssengar@linux.microsoft.com> To: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, daniel.lezcano@linaro.org, tglx@linutronix.de, virtualization@lists.linux-foundation.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, mikelley@microsoft.com, ssengar@linux.microsoft.com, dphadke@linux.microsoft.com Subject: [PATCH v5 2/5] Drivers: hv: allow non ACPI compilation for hv_is_hibernation_supported Date: Thu, 9 Feb 2023 04:15:36 -0800 Message-Id: <1675944939-22631-3-git-send-email-ssengar@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1675944939-22631-1-git-send-email-ssengar@linux.microsoft.com> References: <1675944939-22631-1-git-send-email-ssengar@linux.microsoft.com> X-Spam-Status: No, score=-19.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757355898931807933?= X-GMAIL-MSGID: =?utf-8?q?1757355898931807933?= |
Series |
Device tree support for Hyper-V VMBus driver
|
|
Commit Message
Saurabh Singh Sengar
Feb. 9, 2023, 12:15 p.m. UTC
acpi_sleep_state_supported() currently is defined only when CONFIG_ACPI=y. For future work to enable device tree builds, put this function under #ifdef CONFIG_ACPI. Otherwise, return 'false' from hv_is_hibernation_supported() as Hyper-V guest configs using device tree don't support hibernation. Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com> Reviewed-by: Michael Kelley <mikelley@microsoft.com> --- drivers/hv/hv_common.c | 4 ++++ 1 file changed, 4 insertions(+)
Comments
On Thu, Feb 9, 2023 at 6:15 AM Saurabh Sengar <ssengar@linux.microsoft.com> wrote: > > acpi_sleep_state_supported() currently is defined only when > CONFIG_ACPI=y. For future work to enable device tree builds, put this > function under #ifdef CONFIG_ACPI. Otherwise, return 'false' from > hv_is_hibernation_supported() as Hyper-V guest configs using device > tree don't support hibernation. > > Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com> > Reviewed-by: Michael Kelley <mikelley@microsoft.com> > --- > drivers/hv/hv_common.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/hv/hv_common.c b/drivers/hv/hv_common.c > index 52a6f89ccdbd..370ec20d1993 100644 > --- a/drivers/hv/hv_common.c > +++ b/drivers/hv/hv_common.c > @@ -234,7 +234,11 @@ EXPORT_SYMBOL_GPL(hv_setup_dma_ops); > > bool hv_is_hibernation_supported(void) > { > +#ifdef CONFIG_ACPI > return !hv_root_partition && acpi_sleep_state_supported(ACPI_STATE_S4); Rework the acpi_bus.h header so that this is defined for !CONFIG_ACPI: static inline bool acpi_sleep_state_supported(u8 sleep_state) { return false; } Then you don't need this change here. That or using IS_ENABLED() is strongly preferred over #ifdefs. Rob
On Thu, Feb 09, 2023 at 09:17:45AM -0600, Rob Herring wrote: > On Thu, Feb 9, 2023 at 6:15 AM Saurabh Sengar > <ssengar@linux.microsoft.com> wrote: > > > > acpi_sleep_state_supported() currently is defined only when > > CONFIG_ACPI=y. For future work to enable device tree builds, put this > > function under #ifdef CONFIG_ACPI. Otherwise, return 'false' from > > hv_is_hibernation_supported() as Hyper-V guest configs using device > > tree don't support hibernation. > > > > Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com> > > Reviewed-by: Michael Kelley <mikelley@microsoft.com> > > --- > > drivers/hv/hv_common.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/drivers/hv/hv_common.c b/drivers/hv/hv_common.c > > index 52a6f89ccdbd..370ec20d1993 100644 > > --- a/drivers/hv/hv_common.c > > +++ b/drivers/hv/hv_common.c > > @@ -234,7 +234,11 @@ EXPORT_SYMBOL_GPL(hv_setup_dma_ops); > > > > bool hv_is_hibernation_supported(void) > > { > > +#ifdef CONFIG_ACPI > > return !hv_root_partition && acpi_sleep_state_supported(ACPI_STATE_S4); > > Rework the acpi_bus.h header so that this is defined for !CONFIG_ACPI: > > static inline bool acpi_sleep_state_supported(u8 sleep_state) { return false; } Sure, acpi_bus.h doesn't get included in case of !ACPI, I will put this in include/linux/acpi.h Regards, Saurabh > > Then you don't need this change here. That or using IS_ENABLED() is > strongly preferred over #ifdefs. > > Rob
diff --git a/drivers/hv/hv_common.c b/drivers/hv/hv_common.c index 52a6f89ccdbd..370ec20d1993 100644 --- a/drivers/hv/hv_common.c +++ b/drivers/hv/hv_common.c @@ -234,7 +234,11 @@ EXPORT_SYMBOL_GPL(hv_setup_dma_ops); bool hv_is_hibernation_supported(void) { +#ifdef CONFIG_ACPI return !hv_root_partition && acpi_sleep_state_supported(ACPI_STATE_S4); +#else + return false; +#endif } EXPORT_SYMBOL_GPL(hv_is_hibernation_supported);