From: Neeraj Upadhyay Subject: Re: [PATCH] cpu/hotplug: Fix rollback during error-out in takedown_cpu() Date: Thu, 6 Sep 2018 08:26:20 +0530 Message-ID: <9cac90ff-1a43-8663-da2e-7191975b5e93@codeaurora.org> References: <1536042803-6152-1-git-send-email-neeraju@codeaurora.org> <5b0e528f-e597-9598-3ff6-b9e08ddb8165@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: Thomas Gleixner Cc: josh@joshtriplett.org, peterz@infradead.org, mingo@kernel.org, jiangshanlai@gmail.com, dzickus@redhat.com, brendan.jackman@arm.com, malat@debian.org, linux-kernel@vger.kernel.org, sramana@codeaurora.org, linux-arm-msm@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org On 09/05/2018 06:47 PM, Thomas Gleixner wrote: > On Wed, 5 Sep 2018, Neeraj Upadhyay wrote: >> On 09/05/2018 05:53 PM, Thomas Gleixner wrote: >>> And looking closer this is a general issue. Just that the TEARDOWN state >>> makes it simple to observe. It's universaly broken, when the first teardown >>> callback fails because, st->state is only decremented _AFTER_ the callback >>> returns success, but undo_cpu_down() increments unconditionally. >>> >> As per my understanding, there are 2 problems here; one is fixed with your >> patch, and other is cpuhp_reset_state() is used during rollback from non-AP to >> AP state, which seem to result in 2 increments of st->state (one increment >> done by cpuhp_reset_state() and another by cpu_thread_fun()) . > And how did your hack fix that up magically? I'll have a look later today. > > Thanks, > > tglx The hack fixes it by not calling cpuhp_reset_state() and doing rollback state reset inline inĀ  _cpu_down(). -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation