From patchwork Thu Jul 20 11:59:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 791570 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xCstf1pwpz9s06 for ; Thu, 20 Jul 2017 22:01:14 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="VxWpu0Vw"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3xCstf0Y56zDrFg for ; Thu, 20 Jul 2017 22:01:14 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="VxWpu0Vw"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-pg0-x244.google.com (mail-pg0-x244.google.com [IPv6:2607:f8b0:400e:c05::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3xCsrw5cQNzDrFM for ; Thu, 20 Jul 2017 21:59:44 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="VxWpu0Vw"; dkim-atps=neutral Received: by mail-pg0-x244.google.com with SMTP id t8so2603065pgs.4 for ; Thu, 20 Jul 2017 04:59:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=WTzFfIL2uYPXeMMAmoHnZ2R+FLKmrItTPEDwgaDQ9oo=; b=VxWpu0Vwh/nl6zP0j2kwoEX4lTbLvjEXNFpVLWsMEmXH+F2W1CjfBhZ6CisfkSP0Cg 2Q1ZXc6ZYssiCcqXNMeciv+S4ivKE9q4evEQ5Qv+pYrCn2kQfnOSS6YFGqBdICjv7sAX 5CLTlW9o/yj2H9PN+T+7BbPucceF/qaxyy3BiNDI04wCYxdlaKkDy/UQPW6sECEdnWf5 EAlppwd/a6gc3ShsKEPsMyq7FqGs9DlepIPdyB/Y4FIOaW//tj2n7JNKKPYd99SrTjJ5 469G3KFgi4rjmW9llXS5/9/GY/EyYnnBrBYPAf810WVCyF+KMddVZl/ywC5zYwmuQnFZ sZfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=WTzFfIL2uYPXeMMAmoHnZ2R+FLKmrItTPEDwgaDQ9oo=; b=pKGLkJ+N3I3y9TB30iwSlicgbI98YeGQu8aKbu/wZVADzfC7kcvrudQQfHuK9I9T8+ xOHqnjoX3ockEFx7TwWBxh//O6GCLj0neviV9Fth2XRiJ0f4noNT2pd5Tus8Z2V1aC8s wWhIRUhNidqqJlkCyUlBkuFN9sz6J5tCMrK0szgBrhr+4UvW7TYsm+TWQzFpOh9T8gPv P/hQjP/e+B1hKgzMIHZaL3quKkhYJ+xUT8p203C7VaNu6rT1vockWaq/ogUH53oaZSHT 7l48MTQQUJ8/WDZGECXlvHnnswC44yqGmuYCVZ1cnBQTphX/n8aOt+UuC+rx27mYYA3F PKoQ== X-Gm-Message-State: AIVw112cEd5BpBKPO4RMh00NHYZAv+dWFPx4YgY2TJ7XDxcVWn3gRCOE kivTZDRkK0KMxVXZ X-Received: by 10.98.94.5 with SMTP id s5mr3630730pfb.138.1500551981520; Thu, 20 Jul 2017 04:59:41 -0700 (PDT) Received: from roar.ozlabs.ibm.com (147.14.218.139.dynamic.dsl.dv.iprimus.net.au. [139.218.14.147]) by smtp.gmail.com with ESMTPSA id r207sm4401052pfr.106.2017.07.20.04.59.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Jul 2017 04:59:40 -0700 (PDT) From: Nicholas Piggin To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH] powerpc/pseries: energy driver only print message when LPAR guest Date: Thu, 20 Jul 2017 21:59:00 +1000 Message-Id: <20170720115900.455-1-npiggin@gmail.com> X-Mailer: git-send-email 2.11.0 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nicholas Piggin Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" This driver currently reports the H_BEST_ENERGY is unsupported even when booting in a non-LPAR environment (e.g., powernv). Prevent it. Signed-off-by: Nicholas Piggin --- arch/powerpc/platforms/pseries/pseries_energy.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/powerpc/platforms/pseries/pseries_energy.c b/arch/powerpc/platforms/pseries/pseries_energy.c index 164a13d3998a..832b3d7898a3 100644 --- a/arch/powerpc/platforms/pseries/pseries_energy.c +++ b/arch/powerpc/platforms/pseries/pseries_energy.c @@ -229,6 +229,9 @@ static int __init pseries_energy_init(void) int cpu, err; struct device *cpu_dev; + if (!firmware_has_feature(FW_FEATURE_LPAR)) + return 0; + if (!firmware_has_feature(FW_FEATURE_BEST_ENERGY)) { printk(KERN_INFO "Hypercall H_BEST_ENERGY not supported\n"); return 0;