Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp213125pxm; Fri, 25 Feb 2022 06:45:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJxtKpcuNjijyCl3d5/02KIIiSF3pJYUEMt6kV6NYgX1ahPLfLTIEl6IXV7m6OoJjYXKxkyw X-Received: by 2002:a17:90a:7d09:b0:1b8:da11:f70e with SMTP id g9-20020a17090a7d0900b001b8da11f70emr3569425pjl.42.1645800335235; Fri, 25 Feb 2022 06:45:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645800335; cv=none; d=google.com; s=arc-20160816; b=EuXDTHBqmg0m6IGlf7awKZaRBPt/LtK0RjmhquUmNH+w0coKkS8mIy24sVyqpWs2Et cbdXJkoiBIOa33GUBUbeAWT0T0rlu6VDdz6/Pzmx9RCnxXxBu1UpX8Goqj9VTyJReASr 9fZsDzxbk/TWTqHqwzjBsinFN8E60nVszmPlbOTJkkFdsEvTeUPBplyvmT2kDhbRqKI8 Pk35GJT0JFpYbz3VPHqidZMelFhpHRr0EpGNL17scqowFYPHnYa3eLuXRiczzGtLmlrw 386bZjAGFEFdEl6ssuI+a3Wp4kAPygc771WgDtxSqy2jNkISKhEtMrt/hoStT7bNF6il UhYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=ATA/h540PuCv5OByCCc0fA5m57/LgMum4jrO9U4UGhU=; b=0QU65bEz17uHNOcjdQHhZtPjtDFfQEAY6vIu4+LPKVn+eUbHBlRhYvj8U3GNgh06qL pP2MlQX9N3A1t4rw40z9jtG+mGgLfpPfcjhcCU1vRelNTMlI5baXcgiyqBU1iF6xRCka GtT8Nz5352SBdJ1B0begSkuLdHVu+G4fhkOdLnaaPeMgHPn5iuDH8xQesYApnvEAiz8V vw7+KdOLj/D4QWffiLYGnaXC/KslOrSB8aZ5n0jNIhEMbtYdJMJFpjs0VmE3Ki08BOV8 0Q+OP2+/qJUcYsBEW028/SkK/5SmR4o819vLmygRlzzzszBROZbvM/CqtqtoO/XF8ki+ 3r3g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x22-20020a056a00189600b004cebcdda432si2075107pfh.25.2022.02.25.06.45.18; Fri, 25 Feb 2022 06:45:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237864AbiBYOQ1 (ORCPT + 99 others); Fri, 25 Feb 2022 09:16:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241479AbiBYOQT (ORCPT ); Fri, 25 Feb 2022 09:16:19 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C51321FEFB3; Fri, 25 Feb 2022 06:15:46 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 93485106F; Fri, 25 Feb 2022 06:15:46 -0800 (PST) Received: from bogus (unknown [10.57.3.206]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E77C13F5A1; Fri, 25 Feb 2022 06:15:44 -0800 (PST) Date: Fri, 25 Feb 2022 14:14:54 +0000 From: Sudeep Holla To: Shawn Guo Cc: Daniel Lezcano , "Rafael J . Wysocki" , Sudeep Holla , Ulf Hansson , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] cpuidle: psci: Iterate backwards over list in psci_pd_remove() Message-ID: <20220225141454.uvz4pmlxbalr7zwc@bogus> References: <20220225082420.450620-1-shawn.guo@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220225082420.450620-1-shawn.guo@linaro.org> X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 25, 2022 at 04:24:20PM +0800, Shawn Guo wrote: > In case that psci_pd_init_topology() fails for some reason, > psci_pd_remove() will be responsible for deleting provider and removing > genpd from psci_pd_providers list. There will be a failure when removing > the cluster PD, because the cpu (child) PDs haven't been removed. > > [ 0.050232] CPUidle PSCI: init PM domain cpu0 > [ 0.050278] CPUidle PSCI: init PM domain cpu1 > [ 0.050329] CPUidle PSCI: init PM domain cpu2 > [ 0.050370] CPUidle PSCI: init PM domain cpu3 > [ 0.050422] CPUidle PSCI: init PM domain cpu-cluster0 > [ 0.050475] PM: genpd_remove: unable to remove cpu-cluster0 > [ 0.051412] PM: genpd_remove: removed cpu3 > [ 0.051449] PM: genpd_remove: removed cpu2 > [ 0.051499] PM: genpd_remove: removed cpu1 > [ 0.051546] PM: genpd_remove: removed cpu0 > > Fix the problem by iterating the provider list in a reversely order, so > that parent PD gets removed before child's PDs. > Makes sense. Reviewed-by: Sudeep Holla -- Regards, Sudeep