From patchwork Mon Mar 23 15:46:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lina Iyer X-Patchwork-Id: 46207 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 55A3720D10 for ; Mon, 23 Mar 2015 15:47:03 +0000 (UTC) Received: by lbvp9 with SMTP id p9sf28038539lbv.0 for ; Mon, 23 Mar 2015 08:47:02 -0700 (PDT) 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:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=fapqm0DftUEhA2dlHUU2Iyip2AawBZFKNXfC+GT0dZo=; b=gz2A6HtWuNwky9FS8eC0lAIrAOCtJemNepI3iVAvKqt5iUKgHKFefEs7OBp0Y3VeI4 fyHdk61W/Beyggb0/5t8NUpRXrDkYo6N+/H5H2yA5NeSiBK6PRXOTECGTAapO7nXCKgY X9k/TLKNXoK2fojGPLEWog/O4Be5Cd2Ob3oc+Ki/mmYiNrbNx7D8/A+AMc43CId72Led 8w5qPJjRdnZnMcu4HkBklJxdLaEnzQZH4rGTAfwOVF08s59RaY1/GPaIdfs5si9ACZha cGOBGZN9Fcw/PMvNkOlMxHB3MEu5dDoOEaQmjBsnKkuxXGw4UQMV24cYB7hDMVJzEfsk G/yQ== X-Gm-Message-State: ALoCoQltprB6G/oZtDgJqGPB/T7dDyOIK7qlvoaptPSNpSpFIEQJ6pyDlssIOlybzVXiU2I7PCbK X-Received: by 10.112.120.136 with SMTP id lc8mr12563828lbb.24.1427125622261; Mon, 23 Mar 2015 08:47:02 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.19.36 with SMTP id b4ls645484lae.46.gmail; Mon, 23 Mar 2015 08:47:02 -0700 (PDT) X-Received: by 10.112.46.74 with SMTP id t10mr7463558lbm.73.1427125622098; Mon, 23 Mar 2015 08:47:02 -0700 (PDT) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com. [209.85.215.51]) by mx.google.com with ESMTPS id pq6si847366lbc.137.2015.03.23.08.47.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Mar 2015 08:47:02 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by labto5 with SMTP id to5so29824375lab.0 for ; Mon, 23 Mar 2015 08:47:02 -0700 (PDT) X-Received: by 10.112.130.100 with SMTP id od4mr61849101lbb.86.1427125621973; Mon, 23 Mar 2015 08:47:01 -0700 (PDT) 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.57.201 with SMTP id k9csp907843lbq; Mon, 23 Mar 2015 08:47:01 -0700 (PDT) X-Received: by 10.70.65.39 with SMTP id u7mr153772967pds.11.1427125620081; Mon, 23 Mar 2015 08:47:00 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ks9si1473298pab.194.2015.03.23.08.46.59; Mon, 23 Mar 2015 08:47:00 -0700 (PDT) Received-SPF: none (google.com: devicetree-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 S1752608AbbCWPq6 (ORCPT + 5 others); Mon, 23 Mar 2015 11:46:58 -0400 Received: from mail-pa0-f52.google.com ([209.85.220.52]:34097 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752135AbbCWPq5 (ORCPT ); Mon, 23 Mar 2015 11:46:57 -0400 Received: by pacwe9 with SMTP id we9so195289532pac.1 for ; Mon, 23 Mar 2015 08:46:56 -0700 (PDT) X-Received: by 10.68.226.161 with SMTP id rt1mr21962768pbc.101.1427125616566; Mon, 23 Mar 2015 08:46:56 -0700 (PDT) Received: from ubuntu.localdomain (i-global254.qualcomm.com. [199.106.103.254]) by mx.google.com with ESMTPSA id ob7sm1459267pdb.13.2015.03.23.08.46.53 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Mar 2015 08:46:55 -0700 (PDT) From: Lina Iyer To: daniel.lezcano@linaro.org, khilman@linaro.org, sboyd@codeaurora.org, galak@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: lorenzo.pieralisi@arm.com, msivasub@codeaurora.org, devicetree@vger.kernel.org, agross@codeaurora.org, Lina Iyer Subject: [PATCH v17] Currently SPM driver always initializes before the cpuidle driver Date: Mon, 23 Mar 2015 09:46:29 -0600 Message-Id: <1427125589-63560-1-git-send-email-lina.iyer@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1426882877-33008-2-git-send-email-lina.iyer@linaro.org> References: <1426882877-33008-2-git-send-email-lina.iyer@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: devicetree@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lina.iyer@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.51 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: , Remove unnecessary complexity in supporting initialization of SPM driver after cpuidle driver. The current kernel initializes SPM driver before cpuidle driver. Signed-off-by: Lina Iyer --- drivers/soc/qcom/spm.c | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/drivers/soc/qcom/spm.c b/drivers/soc/qcom/spm.c index cda321c..84344e7 100644 --- a/drivers/soc/qcom/spm.c +++ b/drivers/soc/qcom/spm.c @@ -266,13 +266,9 @@ static int __init qcom_cpuidle_init(struct device_node *cpu_node, int cpu) per_cpu(qcom_idle_ops, cpu) = fns; /* - * Condition: cpuidle_driver_register() needs to happen before - * cpuidle_register_device(). - * Check if the SPM probe has happened - - * - If SPM probed successfully before arm_idle_init(), then defer - * the registration of cpuidle_device back to arm_idle_init() - * - If the SPM probe happens in the future, then let the SPM probe - * register the cpuidle device, return -ENXIO. + * SPM probe for the cpu should have happened by now, if the + * SPM device does not exist, return -ENXIO to indicate that the + * cpu does not support idle states. */ check_spm: return per_cpu(cpu_spm_drv, cpu) ? 0 : -ENXIO; @@ -332,7 +328,6 @@ static int spm_dev_probe(struct platform_device *pdev) const struct of_device_id *match_id; void __iomem *addr; int cpu; - int ret = 0; drv = spm_get_drv(pdev, &cpu); if (!drv) @@ -373,22 +368,7 @@ static int spm_dev_probe(struct platform_device *pdev) per_cpu(cpu_spm_drv, cpu) = drv; - /* - * If the cpuidle ops have already been registered with cpuidle, - * then we have been waiting on this SPM probe to register the - * cpuidle device. - */ - if (per_cpu(qcom_idle_ops, cpu)) { - struct cpuidle_device *dev; - - dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL); - if (!dev) - return -ENOMEM; - dev->cpu = cpu; - ret = cpuidle_register_device(dev); - } - - return ret; + return 0; } static struct platform_driver spm_driver = {