From patchwork Thu Dec 17 02:01:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 7868391 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7A3BEBEEE5 for ; Thu, 17 Dec 2015 02:01:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D57FF203EC for ; Thu, 17 Dec 2015 02:01:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C1267203C0 for ; Thu, 17 Dec 2015 02:01:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755873AbbLQCBl (ORCPT ); Wed, 16 Dec 2015 21:01:41 -0500 Received: from mail-pf0-f179.google.com ([209.85.192.179]:33487 "EHLO mail-pf0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753762AbbLQCBi (ORCPT ); Wed, 16 Dec 2015 21:01:38 -0500 Received: by mail-pf0-f179.google.com with SMTP id n128so3065640pfn.0 for ; Wed, 16 Dec 2015 18:01:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=7ZaWDnAhrYsWGIYdgcVbTfSSGrIRYYS6Rq9d/e3otho=; b=aRFB01u74Comapf2FrxgeuqzOdkNWIg2LQb0lTj+8xYPDPMQ7AYIr2KgZ7Pr3mjaxH dZM/RBYRsvo7vfV5B+kod3qGJPXVt7WOCo9XRajI5UplBMCL+4r9jYaC1fOQjUljJhjc 67xVY4Ylt5LXfwBYxEQsLrIGBZBJ3AhsPmX68= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=7ZaWDnAhrYsWGIYdgcVbTfSSGrIRYYS6Rq9d/e3otho=; b=h/w/dXeWMYCvrfZgl9UaZbXWDiaLE+tA4t9cNKCLh1aoGZvp6tE8Sk/JqdqvKKRVUA 2/t9UTAvUnKsvKLeGlb/jc+Fsf65Ms1Jygho+y0et+h/cFlSvbcZQ0hMGc6AIdtF0LN0 /lT61W7mWLopz5dnj9qweuekzZQC5L/8okJWh+0JZbRPe8iLp4wDvMl2pQMluqSYWU0+ AYT1Kqy9HE8E9A+VQWIl5SbHK5CfMi1FGpjN4sQduionxMENJvyu73EMPAhLojxhGZh+ uKFeMG3Eer2TbVjIerDcR9T5tLL3y0+MXcgcUuuksnxSaIy4zuwY3f6Bq9zbzqxkaYc+ 4j0w== X-Gm-Message-State: ALoCoQmN9JOLQx3KdQ0shIwdbtzcx3p13F7jte0Zk3bS0OLif1MphloBYo0zblBiI+91gPKWSad1pYer+Kz7Z8vesTkum33c0A== X-Received: by 10.98.67.148 with SMTP id l20mr10702027pfi.109.1450317697558; Wed, 16 Dec 2015 18:01:37 -0800 (PST) Received: from localhost ([122.172.111.236]) by smtp.gmail.com with ESMTPSA id 73sm7388842pfa.3.2015.12.16.18.01.36 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 16 Dec 2015 18:01:36 -0800 (PST) Date: Thu, 17 Dec 2015 07:31:33 +0530 From: Viresh Kumar To: Bartlomiej Zolnierkiewicz Cc: Lee Jones , "Rafael J. Wysocki" , Stephen Boyd , nm@ti.com, linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, Dmitry Torokhov , Greg Kroah-Hartman , Len Brown , open list , Pavel Machek , Shawn Guo , linux-samsung-soc@vger.kernel.org Subject: Re: [PATCH] PM / OPP: Fix parsing of opp-microvolt and opp-microamp properties Message-ID: <20151217020133.GD3496@ubuntu> References: <18360458.m71vGHrTb9@amdc1976> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <18360458.m71vGHrTb9@amdc1976> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 16-12-15, 16:41, Bartlomiej Zolnierkiewicz wrote: > Commit 01fb4d3c39d3 ("PM / OPP: Parse 'opp--' > bindings") broke support for parsing standard opp-microvolt and > opp-microamp properties. Fix it by setting 'name' string to > proper value for !dev_opp->prop_name cases. > > Cc: Viresh Kumar > Cc: Lee Jones > Cc: Rafael J. Wysocki > Fixes: 01fb4d3c39d3 ("PM / OPP: Parse 'opp-- 'bindings") > Signed-off-by: Bartlomiej Zolnierkiewicz > --- > This fixes Exynos4x12 cpufreq-dt support regression present in > linux-pm/linux-next tree. Rafael, please apply. Thank you. > > drivers/base/power/opp/core.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > Index: b/drivers/base/power/opp/core.c > =================================================================== > --- a/drivers/base/power/opp/core.c 2015-12-16 16:10:13.509171420 +0100 > +++ b/drivers/base/power/opp/core.c 2015-12-16 16:21:18.385183902 +0100 > @@ -806,11 +806,11 @@ static int opp_parse_supplies(struct dev > struct property *prop = NULL; > char name[NAME_MAX]; > > + sprintf(name, "opp-microvolt-%s", dev_opp->prop_name); > + > /* Search for "opp-microvolt-" */ > - if (dev_opp->prop_name) { > - sprintf(name, "opp-microvolt-%s", dev_opp->prop_name); > + if (dev_opp->prop_name) > prop = of_find_property(opp->np, name, NULL); > - } > > if (!prop) { > /* Search for "opp-microvolt" */ > @@ -848,10 +848,10 @@ static int opp_parse_supplies(struct dev > > /* Search for "opp-microamp-" */ > prop = NULL; > - if (dev_opp->prop_name) { > - sprintf(name, "opp-microamp-%s", dev_opp->prop_name); > + sprintf(name, "opp-microamp-%s", dev_opp->prop_name); > + > + if (dev_opp->prop_name) > prop = of_find_property(opp->np, name, NULL); > - } > > if (!prop) { > /* Search for "opp-microamp" */ Sorry about this. And I am disliking the solution suggested by Stephen more and more now. Please resend this patch with following changes instead: diff --git a/drivers/base/power/opp/core.c b/drivers/base/power/opp/core.c index 6c6856e426f0..a96df5cda303 100644 --- a/drivers/base/power/opp/core.c +++ b/drivers/base/power/opp/core.c @@ -816,7 +816,7 @@ static int opp_parse_supplies(struct dev_pm_opp *opp, struct device *dev, if (!prop) { /* Search for "opp-microvolt" */ - name[13] = '\0'; + sprintf(name, "opp-microvolt"); prop = of_find_property(opp->np, name, NULL); /* Missing property isn't a problem, but an invalid entry is */ @@ -857,7 +857,7 @@ static int opp_parse_supplies(struct dev_pm_opp *opp, struct device *dev, if (!prop) { /* Search for "opp-microamp" */ - name[12] = '\0'; + sprintf(name, "opp-microamp"); prop = of_find_property(opp->np, name, NULL); }