Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3332700imm; Tue, 29 May 2018 05:33:11 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpuO+M4wOfRG03wWqrZ1nQa9HAhRVwY7KlBdqLcfbQ2X3PdDJDPuoVGsBmgU1auO8WZF5Cu X-Received: by 2002:a63:7b51:: with SMTP id k17-v6mr13671334pgn.55.1527597190961; Tue, 29 May 2018 05:33:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527597190; cv=none; d=google.com; s=arc-20160816; b=OYm408/64WYqFI4msUUbSV7qtBKhIk9UGypan/u93WZA9iRRfT06ocsHm0HqSMOQVc ALZ1liNJ6H6fspiDb5CnWJT3lS24h0VAREehj6oFKWuApj1HNut9+DWmn7JGM3ApSWh6 kv0rK76jNVDg5Nub4R4H7w8FXrydOTj/5cNTrRBr7YLErgt5lsI9Z1VfWPGM6KZg7c4e wzogtv8nQnQpxDKkMK2bZXoOvtELtR7TX3YRi9bVSZSG1ySkqA8NIIPSkVjyRnciO07Q F7Mg8Qbpj5vht+FYQxd/hM7fNDky22RUu3H+HnQ/D5/toyvE6JlGD7y0QtfUI3GHo1JT 1ISg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:arc-authentication-results; bh=cMxRooRDdAAgxrCQh7RA5fPs//5qhy1Z1utrmyylftQ=; b=KdwEhXUqIbvRRHYou09Bu/f5wIvalPmz5qpHpFVmfr5KgOzz1q/fpdKWnbjaUhX9Og wjElCyUkFdDg5QWWYgB05mW6Fx6rtA6+GL3l43OE5a4T7p478D2Htt813FlaW0ZPXLBz QAktuJQAv2vWvJUhd4+WbFt0JEc2RNXVsshvVmo1bm/dJtWMlDJ22oAGbanVCauHpapz 5M/adeVy/v/nL8hFnHZnS80X1h4wGMjFp4bwur7esf1iFKi7kNFsq2so7I9xBnokeFOK UJC2YQLcGQcItgS1zf5wrzHA1jiKa5JpWN2si6F4Tu69CbHjC5dq5IaRmf5vKDbCMpC/ mmUQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v20-v6si30820378pff.363.2018.05.29.05.32.56; Tue, 29 May 2018 05:33:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933959AbeE2MbI (ORCPT + 99 others); Tue, 29 May 2018 08:31:08 -0400 Received: from ozlabs.org ([203.11.71.1]:57297 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933744AbeE2MbD (ORCPT ); Tue, 29 May 2018 08:31:03 -0400 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPSA id 40wCkY2Xwzz9s0W; Tue, 29 May 2018 22:31:01 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au From: Michael Ellerman To: Stewart Smith , Abhishek Goel , rjw@rjwysocki.net, daniel.lezcano@linaro.org, benh@kernel.crashing.org, paulus@samba.org, linux-pm@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Cc: Abhishek Goel Subject: Re: [PATCH] cpuidle/powernv : Add Description for cpuidle state In-Reply-To: <87d0xf6y16.fsf@linux.vnet.ibm.com> References: <20180528173442.100642-1-huntbag@linux.vnet.ibm.com> <87d0xf6y16.fsf@linux.vnet.ibm.com> Date: Tue, 29 May 2018 22:30:57 +1000 Message-ID: <87sh6a4pa6.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Stewart Smith writes: > Abhishek Goel writes: >> @@ -215,7 +216,7 @@ static inline void add_powernv_state(int index, const char *name, >> u64 psscr_val, u64 psscr_mask) >> { >> strlcpy(powernv_states[index].name, name, CPUIDLE_NAME_LEN); >> - strlcpy(powernv_states[index].desc, name, CPUIDLE_NAME_LEN); >> + strlcpy(powernv_states[index].desc, desc, CPUIDLE_DESC_LEN); > > We should still fall back to using name in the event of desc being null, > as not all firmware will expose the descriptions. > >> @@ -311,6 +313,11 @@ static int powernv_add_idle_states(void) >> pr_warn("cpuidle-powernv: missing ibm,cpu-idle-state-names in DT\n"); >> goto out; >> } >> + if (of_property_read_string_array(power_mgt, >> + "ibm,cpu-idle-state-descs", descs, dt_idle_states) < 0) { >> + pr_warn("cpuidle-powernv: missing ibm,cpu-idle-state-descs in DT\n"); >> + goto out; >> + } > > I don't think pr_warn is appropriate here, as for all current released > firmware we don't have that property. I think perhaps just silently > continuing on is okay, as we have to keep compatibility with that firmware. +1 Anyone who's wondering why they're not seeing the names can just look at the device tree on the machine to see if the property is there or not, they don't need a printk in dmesg to tell them. cheers