From patchwork Tue Dec 9 05:48:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 42029 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8D7AC244AC for ; Tue, 9 Dec 2014 05:49:22 +0000 (UTC) Received: by mail-la0-f70.google.com with SMTP id hs14sf3592236lab.1 for ; Mon, 08 Dec 2014 21:49:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=J6GoPN1E4wZ7fIA+ZdXVgIgVHySpnPVYux+5qwmqGcI=; b=LcM/nYQwZmKeziKuzwC77Zc4i7mWxMwf3hvx5cA2UqYActCrpBYl5cIuUO4qEycaLN rtOI3gvlVjDXgHyLI3uo01Q2TXHXTzmzA30Zq8mw5y0ROBUJnBnyh77OIBL/2Ib0z4a/ FPOiMLCI7kMSRFX+9ZS0Udd0cNUK2b1PKtSqDMIG5JOmQ0A5uHzPFKVSRTsdEno5FTJf 6sC/WM6hfAQBAT5ggVnuiUpsiEHHRfQ1opyD+uOewPBvbteGQSPTsIRfEq8TJ6NlQXBW 6cKF3oTEu4Iq0HYmhQ4gnKTgZDhbWbY6UBhSP96w4Q8FtZKGuueeCcinEdQBNCr+kwYy 9n1w== X-Gm-Message-State: ALoCoQlDQigIrJenfTQydyhpyEZmorSne0Xx/Y5zzlXxjnkiPp3JMQj+a+0/igBIkW5/BiscDAQu X-Received: by 10.112.154.194 with SMTP id vq2mr55249lbb.10.1418104161118; Mon, 08 Dec 2014 21:49:21 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.29.5 with SMTP id f5ls688383lah.62.gmail; Mon, 08 Dec 2014 21:49:20 -0800 (PST) X-Received: by 10.152.3.67 with SMTP id a3mr19917549laa.56.1418104160633; Mon, 08 Dec 2014 21:49:20 -0800 (PST) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com. [209.85.215.46]) by mx.google.com with ESMTPS id uj9si162584lbb.97.2014.12.08.21.49.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 08 Dec 2014 21:49:20 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by mail-la0-f46.google.com with SMTP id q1so5126718lam.5 for ; Mon, 08 Dec 2014 21:49:20 -0800 (PST) X-Received: by 10.112.235.196 with SMTP id uo4mr19607429lbc.66.1418104160321; Mon, 08 Dec 2014 21:49:20 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp712863lbc; Mon, 8 Dec 2014 21:49:19 -0800 (PST) X-Received: by 10.68.203.130 with SMTP id kq2mr2119496pbc.1.1418104158780; Mon, 08 Dec 2014 21:49:18 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i4si30353pdh.240.2014.12.08.21.49.18 for ; Mon, 08 Dec 2014 21:49:18 -0800 (PST) Received-SPF: none (google.com: linux-pm-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753023AbaLIFtR (ORCPT + 12 others); Tue, 9 Dec 2014 00:49:17 -0500 Received: from mail-pd0-f177.google.com ([209.85.192.177]:64516 "EHLO mail-pd0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754760AbaLIFtR (ORCPT ); Tue, 9 Dec 2014 00:49:17 -0500 Received: by mail-pd0-f177.google.com with SMTP id ft15so6589979pdb.22 for ; Mon, 08 Dec 2014 21:49:16 -0800 (PST) X-Received: by 10.66.157.101 with SMTP id wl5mr2029410pab.37.1418104156634; Mon, 08 Dec 2014 21:49:16 -0800 (PST) Received: from localhost ([122.166.92.172]) by mx.google.com with ESMTPSA id rv6sm311106pab.9.2014.12.08.21.49.15 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 08 Dec 2014 21:49:15 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, Viresh Kumar Subject: [PATCH] opp: set new_opp->dev_opp to a valid dev_opp Date: Tue, 9 Dec 2014 11:18:51 +0530 Message-Id: <92ee61e091ccc336e6937f7af093f7ce569f5485.1418104004.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.2.0 Sender: linux-pm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , We find/allocate dev_opp after using its value to fill new_opp->dev_opp right now. Move this to a later point where dev_opp is valid. Fixes: a7470db6fec4 ("PM / OPP don't match for existing OPPs when list is empty") Signed-off-by: Viresh Kumar --- drivers/base/power/opp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c index 2d195f3a1998..c2020520b2bf 100644 --- a/drivers/base/power/opp.c +++ b/drivers/base/power/opp.c @@ -400,7 +400,6 @@ static int dev_pm_opp_add_dynamic(struct device *dev, unsigned long freq, mutex_lock(&dev_opp_list_lock); /* populate the opp table */ - new_opp->dev_opp = dev_opp; new_opp->rate = freq; new_opp->u_volt = u_volt; new_opp->available = true; @@ -460,6 +459,7 @@ static int dev_pm_opp_add_dynamic(struct device *dev, unsigned long freq, } list_add: + new_opp->dev_opp = dev_opp; list_add_rcu(&new_opp->node, head); mutex_unlock(&dev_opp_list_lock);