From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CAE6C281369 for ; Wed, 7 May 2025 13:18:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746623921; cv=none; b=V+GQ+eByrA8inIueO48aQnQBTYTVngwXT0/wuYr2wiAlLyfoRrZN6XI6pXnYs20zgz063Jx/jAr1XYbFoPnmM69pFvMdYqc6v2SjKGpIEONvGEDXeFaROsSctKQTKGjZb0xI6DfEKRPa84QVXC2l6SsqcJ+Loi9XFl8ehjDTqms= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746623921; c=relaxed/simple; bh=vANADi+020FCH5I2njw3FMWd3fKb5Ttxnfby5ZW9V8Q=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BVR0CJMfeN/7tU/GYkuaagi1U5ha163hPx6UysdbNVoFA+ckB3MoKFH+UXuFbVwwjEl0cZKUlG6bXa/cVJExbUnU/8kFWKfpEHJh4nLfEOkMIf9uquDgH5Lvb/Ed25UD1oJwzOUcLfYio6y/R+GjNwlcMDQCxJGgDgLmTzQw1bg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=sOQUj9rH; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="sOQUj9rH" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-43cf3192f3bso66656755e9.1 for ; Wed, 07 May 2025 06:18:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1746623918; x=1747228718; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=mMwJyAtJK/aLIyT6CLn61d8dMsByyOcrMzhv12s06BY=; b=sOQUj9rH/JgpwIXZKDU0vxXibY7ngcB5Zhta1Ld9Tw0B+eqV//1Tfnvu1x229JHoyd C1FCWmHeVXCv1W4HuqLOUbbI6UeHytrLg8zOd6GYrckEooLWXGPHG8pDCqn9Hfvz9CXz um+kfAPh7+R+ve7rLwQlpaUInSmHus7lOeE2GONq/k+45lrjIcmGdsUoU6mY3HZeQIpz 58J9aIpYZVs7sdLhnwIxCEoKXQukEsn5/U2ZE/ERjC2K5z3F5HXOuWjL5SW4fhYuLQwz 0qdyaQfhWPwe0wqOAuumot/HrDgedba6t5rd3+AeMW0eh9uLFqEPaTkuTavgfXDBcP4X t8Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746623918; x=1747228718; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=mMwJyAtJK/aLIyT6CLn61d8dMsByyOcrMzhv12s06BY=; b=IE29yqC69gSymHMKfxVTTklW71VMikdlK5gDNKtOZiAt0uHJW4dz8ZkUcFqU+o9EYq e8mbN3ywSAPJ8XNH+OAzoRqBNdZPtoAxS+s28zU5h05XFiRfmJR9gxvslujjLNJlqQTO VdoeoVxIIMw1GH+EmbP1u5RCXwFsTY64P7pZ6BfHOgpx6R/BjjEJRItwATUlg6ogUiPq GjcWJy7vciOotsujGksfrmtL+lavbTVRP6+qO79Q9g9Xj1wy4XUDz/1UxBAVX661J7AB m3AEnvUKlODmFzb/7hcSKQFOn7gk60odUChoG8LmyS5LFrn5NshHN9vDX3rbWNXYQzEu MSSA== X-Forwarded-Encrypted: i=1; AJvYcCV6ZKgVY6OpAdhz0ELm6XKdoNFpJrkN/FH2aG7/gNwT8BiXk3s/Jbc1pM9DZA297KnGdAbBczUYNE1cuUg=@vger.kernel.org X-Gm-Message-State: AOJu0YxGVWTQrGAgm1gt/w/0cVN4yhfW0o6tmZXMmIBAbBBtaiw40Alk W5z5bXyFi08YxnXPAd8Z5rf5p/QS0mQnBFKz6G2rAe8H7qda3HVtBKoIgQlflG4= X-Gm-Gg: ASbGncuo9kOliM6Tf/SW+E1X4HuI4A9KsAk/Rd79+1Bal2NKdAON1+7aTi8DZTOIeTu QdsDCayOdlcUrai/BtHwMdOVqYJv6o1TO2CEKZ3QvJnXy6AGToAbGKStNVF6coWglpFIHHleNWV cAusxg59XibFe76UeG1uPQDaoSMS5xr6shbqgnwkIFcHYtNaaGlaf3oh8Mbp6hQ9nQd7VilHCdc eyvlJBaZ6rF6SvQX5fKOWmc9QTS2AXqW4SdYSZ2AHDCoUDSsFYUiPRFeHa9e+kiH0sZDG2/9bUs FeXE6hGt7t5os7/z5j0AmL06LsUV820PDxq4FdXFoiCRvA== X-Google-Smtp-Source: AGHT+IH3Qorr4/m1vHEg7Ot9UQ5uCqOCNeK+Gmt1pu97YiZ6JvL10Fw4EinSPUDzBFREtrSqd0/vwg== X-Received: by 2002:a05:600c:6085:b0:439:643a:c8d5 with SMTP id 5b1f17b1804b1-441d448ca1bmr37445495e9.0.1746623918101; Wed, 07 May 2025 06:18:38 -0700 (PDT) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-442cd380ca4sm629535e9.36.2025.05.07.06.18.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 May 2025 06:18:37 -0700 (PDT) Date: Wed, 7 May 2025 16:18:34 +0300 From: Dan Carpenter To: Cristian Marussi Cc: Mike Tipton , Sudeep Holla , "Rafael J . Wysocki" , Viresh Kumar , arm-scmi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Peng Fan , Peng Fan Subject: Re: [PATCH v3] cpufreq: scmi: Skip SCMI devices that aren't used by the CPUs Message-ID: References: <20250428144728.871404-1-quic_mdtipton@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@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: > > +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...) > The cleanup.h magic is __free(of_node_put) but dev_of_node() doesn't take a reference so I don't think it's required. regards, dan carpenter > > + return true; > > + > > + idx = of_property_match_string(np, "power-domain-names", "perf"); > > + > > + if (of_parse_phandle(np, "power-domains", idx) == scmi_np) > > Same. > > > + return true; > > + } > > + > > + return false; > > +}