From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752884AbdJGMM5 (ORCPT ); Sat, 7 Oct 2017 08:12:57 -0400 Received: from mail-pf0-f182.google.com ([209.85.192.182]:56590 "EHLO mail-pf0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752759AbdJGMMz (ORCPT ); Sat, 7 Oct 2017 08:12:55 -0400 X-Google-Smtp-Source: AOwi7QC9acydMetOn5/BJaUvk8NRtfW/TjkNw6PI48eapJRsiRj6OIiGR0jOIPBPSusM7gsYgLdM7g== Date: Sat, 7 Oct 2017 20:12:47 +0800 From: Leo Yan To: "Rafael J. Wysocki" , Daniel Lezcano , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Stefan Wahren Subject: Re: [PATCH 2/2] ARM: cpuidle: replace cpuidle_get_driver with cpuidle_get_cpu_driver Message-ID: <20171007121247.GB23080@leoy-linaro> References: <1504507934-14218-1-git-send-email-leo.yan@linaro.org> <1504507934-14218-2-git-send-email-leo.yan@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1504507934-14218-2-git-send-email-leo.yan@linaro.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 04, 2017 at 02:52:14PM +0800, Leo Yan wrote: > 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") Gentle ping. > --- > drivers/cpuidle/cpuidle-arm.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > 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); > } > -- > 2.7.4 >