From patchwork Mon Sep 4 06:52:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 111533 Delivered-To: patch@linaro.org Received: by 10.140.94.166 with SMTP id g35csp1147357qge; Sun, 3 Sep 2017 23:52:45 -0700 (PDT) X-Received: by 10.99.149.8 with SMTP id p8mr10648716pgd.398.1504507965246; Sun, 03 Sep 2017 23:52:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504507965; cv=none; d=google.com; s=arc-20160816; b=TMVW6H/ryyOatQIeLA258MjjERXaTF2qxPUkygnZEosAdNLTirz4FsAba3GqkSEgD5 0Hma/nMlVv0YInDpLoOXSIV0JVohhB48PGAI/a4lhzK/5lVKFpZuoAzew1x/iMVTGdgx Bn6obs1k5QYRgzZMJLJz96sd3DaMFoZ/lkY5jZvUc0Am9Jtbo9SNJULV4bBHaXH2fAiM wuwaDHpNt2I0IQjmiiFu9lU27tsT/hr2iGuLfajuQj0ZuUb1i9HgcA3qOboxkdznTXlr L5KrE/Sr0dV0DwqBg3U8JM2DVDbex6FgjjtF8DAwtAOR66ggq2B3DaJGMrB9mHdaA31f bbmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=8BkEJFc67FGshxoLnPzc/SWn3Lm58kJjGczL28qUQDg=; b=jHV54hv8VXD8QaSEh01XDLX3T3Sk7yaz9wA5J5u0Bfj9eGWyht/SGuZymdzqfzsKKm TN5LVyTGQOSb7+uiUIQR3XWvVmh26/kF4Xvr1eQLxPJ3qsu/2CzHxgYFLjJcPBMvqVt4 D74ly4YvmeUSNeBbYS7NtC9bH8N4/NB/Az7fwd7ZrWte2IiyapAzTQBPxeMnzJkPcT0Z 8JGYJKKqIfsgRCm/If4LIlApPFb/BOWZmnVANMGUiFHIShB0qBGnJJ3YAOC4L6o9M/js pdcXmghVnzEJDJPFY8dxAuEUPg3PZX6VqdzqSadOB4MgV44csSUVlQ+/R4Hy3LkGp4ON PNvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZR+usZd8; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i35si4868438plg.483.2017.09.03.23.52.44; Sun, 03 Sep 2017 23:52:45 -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; dkim=pass header.i=@linaro.org header.s=google header.b=ZR+usZd8; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753297AbdIDGwl (ORCPT + 26 others); Mon, 4 Sep 2017 02:52:41 -0400 Received: from mail-pg0-f45.google.com ([74.125.83.45]:33521 "EHLO mail-pg0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751620AbdIDGwi (ORCPT ); Mon, 4 Sep 2017 02:52:38 -0400 Received: by mail-pg0-f45.google.com with SMTP id t3so16467407pgt.0 for ; Sun, 03 Sep 2017 23:52:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8BkEJFc67FGshxoLnPzc/SWn3Lm58kJjGczL28qUQDg=; b=ZR+usZd8OILmOu5pReJMmWCVDAlH+uA8fjnhBElHFdkYknP1CltwHZ+9MCZSHDNz2g MVtWtlmF7QH3n932p4oiLHziYqW6J/HzP+NnsQdyaNkbfHWO44E8nR+M89hLqklqe7m7 xWB23J+HV1ZwrTIFQOdya/Y1PBpVCTd1o+wAE= 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:in-reply-to :references; bh=8BkEJFc67FGshxoLnPzc/SWn3Lm58kJjGczL28qUQDg=; b=fm1pXfRUPt9ERZLu5kNgzkqBNXo7d3UmBDBob4ylejj7PpiWArE7QWRkUKrw0Tqi7H UhD09hOfYpkaJW7BRt1S9I/MYAp1u8g03OH/+CuHbNABCOVf8EsUCRwLRbhS9582dZ50 Xsi0IVfWyHCxFQfPWBoCFfOIXzfoy8C6IiyyE00RdnEV9AB8JVRRMLQEuPYg5byAXDlX eT39CvPVcczf1RLvVU8imAp2bqtcYRu5lL9CNEjF3jZbShdZBTrVAnE4KaajR8tCd9ls cXx53OfQT0K+ftJ8+FJ8+K21qblgEbaTPlBqkkQzQ30BERvQ+b1oUVowb5vWcbfppnq8 q4Xg== X-Gm-Message-State: AHPjjUimjD1S6YWW3UpXpbYkzF8DvboNm5wbw7/UNP/eNSMXEMEDtrsr m+FxPFDXBq0C2Ah5nzc12Q== X-Google-Smtp-Source: ADKCNb5wYRNFk0HmitXWUhXbqlplED4rCocH647d+nCipWMX9B/oBavFLGuYfp/0bN5lBfPlEwVNdA== X-Received: by 10.84.210.37 with SMTP id z34mr1760196plh.186.1504507957998; Sun, 03 Sep 2017 23:52:37 -0700 (PDT) Received: from localhost.localdomain (li1068-205.members.linode.com. [106.184.3.205]) by smtp.gmail.com with ESMTPSA id 73sm9792919pfu.3.2017.09.03.23.52.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 03 Sep 2017 23:52:36 -0700 (PDT) From: Leo Yan To: "Rafael J. Wysocki" , Daniel Lezcano , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leo Yan , Stefan Wahren Subject: [PATCH 2/2] ARM: cpuidle: replace cpuidle_get_driver with cpuidle_get_cpu_driver Date: Mon, 4 Sep 2017 14:52:14 +0800 Message-Id: <1504507934-14218-2-git-send-email-leo.yan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504507934-14218-1-git-send-email-leo.yan@linaro.org> References: <1504507934-14218-1-git-send-email-leo.yan@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org commit d50a7d8acd78 ("ARM: cpuidle: Support asymmetric idle definition") supports multiple CPU idle driver so every CPU has its own driver. When the initialization fails, the failure handling releases the resources for every previous CPU; so it needs to retrieve every CPU device and driver handler and unregister them. But the function cpuidle_get_driver() can only return current CPU driver handler but not the iterated CPU driver handler, so it cannot release resource properly. This patch is to replace cpuidle_get_driver() with cpuidle_get_cpu_driver(), every CPU has its own device handler so this function can get back correct driver handler for the CPU according to the CPU device handler. By using this CPU driver handler we can release resource properly. Cc: Daniel Lezcano Cc: Stefan Wahren Signed-off-by: Leo Yan Fixes: d50a7d8acd78 ("ARM: cpuidle: Support asymmetric idle definition") --- drivers/cpuidle/cpuidle-arm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/cpuidle/cpuidle-arm.c b/drivers/cpuidle/cpuidle-arm.c index f419f6a..ef34780 100644 --- a/drivers/cpuidle/cpuidle-arm.c +++ b/drivers/cpuidle/cpuidle-arm.c @@ -161,9 +161,9 @@ static int __init arm_idle_init(void) while (--cpu >= 0) { dev = per_cpu(cpuidle_devices, cpu); + drv = cpuidle_get_cpu_driver(dev); cpuidle_unregister_device(dev); kfree(dev); - drv = cpuidle_get_driver(); cpuidle_unregister_driver(drv); kfree(drv); }