From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 055E028980B; Wed, 7 May 2025 13:12:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746623563; cv=none; b=E9PH5BFoKlPo6lNi1I/wGFF4HGASxKIHUWYkuBCHcYBBvPsLZiMvCFeQZkwG1QWh0sMwb2TyNv0hHysxEC/7Y8ocYPcsnTc/p+E4560Uv3SiaUxSBkF2WW3akReEAAB1e9r81E3kHD9bYbZokZNiEGenaZGErLYwcDHjYI33+fg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746623563; c=relaxed/simple; bh=5oGKT4p4RhA8bQiJxWoQbeHy9td1b06sEcFen13gzl0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=K/UxkIzbV+hjHCdaMk5GMeLS3kuqqSlW/XDxCdjzHbk7ZgL+84txdrXO2wxQMmZHXRhbYZRCcsePikmyxPKFcxhApQHsDrJmO5Gqeu5EoJ8+2uzWsSQa3CCR2Ygc/wnUdJn9+wQ1PWtNt9hcalTtaMcBZgXhyNcjLsl03uC+MWw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 41AE5339; Wed, 7 May 2025 06:12:31 -0700 (PDT) Received: from bogus (e133711.arm.com [10.1.196.55]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 96DFB3F58B; Wed, 7 May 2025 06:12:39 -0700 (PDT) Date: Wed, 7 May 2025 14:12:36 +0100 From: Sudeep Holla To: Cristian Marussi , Mike Tipton Cc: "Rafael J . Wysocki" , Viresh Kumar , , , , , Peng Fan , Peng Fan Subject: Re: [PATCH v3] cpufreq: scmi: Skip SCMI devices that aren't used by the CPUs Message-ID: <20250507-analytic-practical-carp-5cddaf@sudeepholla> References: <20250428144728.871404-1-quic_mdtipton@quicinc.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Wed, May 07, 2025 at 12:59:45PM +0100, Cristian Marussi wrote: > On Mon, Apr 28, 2025 at 07:47:28AM -0700, Mike Tipton wrote: > > +static bool scmi_dev_used_by_cpus(struct device *scmi_dev) > > +{ > > + struct device_node *scmi_np = dev_of_node(scmi_dev); > > + struct device_node *np; > > + struct device *cpu_dev; > > + int cpu, idx; > > + > > + if (!scmi_np) > > + return false; > > + > > + for_each_possible_cpu(cpu) { > > + cpu_dev = get_cpu_device(cpu); > > + if (!cpu_dev) > > + continue; > > + > > + np = dev_of_node(cpu_dev); > > + > > + if (of_parse_phandle(np, "clocks", 0) == scmi_np) > > Shouldn't this, on Success, be released by an of_node_put() (or, BETTER, > by some OF-related cleanup.h magic...) > Good catch, I missed this. With the above issue fixed, you can add and post new version: Reviewed-by: Sudeep Holla I will drop this patch now that you need to fix and repost. Also Viresh may be away, so better to route via his tree when he is back as I can't take it without his ack. I was holding off my PR for this, but I will send SCMI PR without this now. -- Regards, Sudeep