Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp291897lqt; Thu, 6 Jun 2024 03:58:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUOJBKsecnVTZz8qZHADr8LLhVV/OQ83IZGXWZ6gvAEN2efZfLWew5ilZf67G+IbhMido4GADVKyA7PBvj/Ay0HgHGz9An26hWdaAdd1g== X-Google-Smtp-Source: AGHT+IEQsZz3MjCDXKvy7EQefz3E6iDCjgQiz2X5VPWneKu/1QeiLdLiGx8sqMEIKB5rcweDHUjp X-Received: by 2002:a17:902:f9c6:b0:1f6:7cc4:a796 with SMTP id d9443c01a7336-1f6a5a71691mr45452735ad.42.1717671514321; Thu, 06 Jun 2024 03:58:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717671514; cv=pass; d=google.com; s=arc-20160816; b=dprYmIAH5ZIjJ1GXDFlR6LM1Ba0uWfo6I1KE8gJqMRmo40Tv71Ghve7eNGrrohFETI B72JrTXB3DCaTVVSwiDThPO26DvQyTrX7hwknxxVWiUKXD+aqpoXTC1GPpB29KxUxarQ SCaJXSeiSCNlbE4tnA++fx8mfTEZtb5Nanv4VShkZZ7U4Auadpm6nAuMgnRV2U+7yb7v kgF+oPo2YNls28nIawhrvFrm0fxYB2y4H8nEedaxa1lDqLBmf7tOC/zGAcTIE4whRidA qWA5BrzvRZB2d/0+JMOoa+c+ZC/ffnSASwZbSzCpQL+bTfzhnyCqkD9ut98S6hRACUqg EVnQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=2ruAkQ6oEawGzBgH/lU0TOJn1AL8q+mkUlNk35sZfO0=; fh=YNc4KGjdePcEZa9sy6y/Mkzxu1ylVrJw9Xd6GbQH9lE=; b=SeJigOzuhppEUFEEt601/B93DyYMvZwVBssZUCExj7yeEH1APegDjFM0gIwxMvT/bi Uz8Avwil/jdzxLj4hjw0xkSWOrzk8L3TXFQsz+WIiZUX4ibevwfM+HAXwiYH+ODk9BTt QXHCWiXzTl0LP9a93qUHGrmfkOkcX/UtH/poxqgl4ixOCbRBd8AueMSnwN7ZITXiFOmT X34kpeW97ehtDGM9ooGhIToLk1WFpD6NsgQFkNCLglL19R5ff/hFStsqNoih9REForh7 0C4PzwvZPqbE5M0D/f3KUgCz/yFo3lhfNOlgVmIx4pWni9fKYJ/zkenofbY071q5+K1a LRmw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jRGQkBAH; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-204149-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204149-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f6bd7d50d4si9552555ad.324.2024.06.06.03.58.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 03:58:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204149-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jRGQkBAH; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-204149-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204149-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 9321D284EC6 for ; Thu, 6 Jun 2024 10:58:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E04AB19539A; Thu, 6 Jun 2024 10:58:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="jRGQkBAH" Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) (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 B73EB195387 for ; Thu, 6 Jun 2024 10:58:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717671508; cv=none; b=HKqI2pSIEvYH16KYmMh3cV+ind4HyHWfenHX2OMO4GzZXpTa/GGfRr+xLGZm+waeDRK9ZjzjOGGxC0FK/ARdKBF+posx33h5r7tsVLzE/zSzTxWLySQzvPJH8OxZLmmC+QMmXxmJryGPU1hL0UHSfXUALpSv70N6Cpze2FSOaPw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717671508; c=relaxed/simple; bh=ZftVfaISYDUW/kUT3woHl6rH2FScfbgcr0GiyC6d54E=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=t5erhno7X0XY5STs5aqY2RqxrpeOt1Hiy4yI0XfZgQzjT8/SboWU46frqUWlVFqLDJnSuIvOfQhQnBniZTqw5f011yZkDxDcY8DhYAP0MuL7E7U8ksjaADsjwXlfgdxbgli8gJwiaZj+O5greu5gJ5GaLukkmiAWxDsNyb/yx/E= 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=jRGQkBAH; arc=none smtp.client-ip=209.85.210.171 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 Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-702492172e3so703210b3a.0 for ; Thu, 06 Jun 2024 03:58:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717671506; x=1718276306; 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=2ruAkQ6oEawGzBgH/lU0TOJn1AL8q+mkUlNk35sZfO0=; b=jRGQkBAHjSrNXcdphLyAvBTnMd+vrDF2dvNjoYFVsm4P8RruGAIvsMFI2+1XAGAo0t WiFiJJ2FeJ4xVQ+HtfpMGf6+uC4KbWRDhbuZIPDpgNtor9j96e6AJkwooV2T+U5E39eG xcoWtbXy1xkBY9ciBIsMChrg2sbPekTKzShPnwhrXsHqESYLbul9AzTbqyx7GhGrW7Jt R5T8z6XMt4JJUiZHISvExEcM2kyzSmKSkh8ErETz0uOaRo2dfwjQddrLGMEMige/5cmy J4prUhd2rF0YWbqUA7iZR7ads87bA2Ugf0dnJkApWI/+PjjK6cuAgTyYNFKckhMd0o7h 4EKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717671506; x=1718276306; 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=2ruAkQ6oEawGzBgH/lU0TOJn1AL8q+mkUlNk35sZfO0=; b=owovcgXtiegjjklYda9XFQHNk9NhfOaIcDd4/rApdK3rjxw7+jb+dRQEBmg+qTY1gZ TlaAfNpq6lDjc4mrXCH30+tA1kK8TbfpbiGMheq+1ZbhGzq+I/hLpPn58q/1qgj/DMoc aIudlN/c60/waowEeHV5Yf+F+AKGhNtLyTqC7MeXEvAHxkvu3cAeuQgjAVz5kfAFvCKo wDyjvFMgZDOxuSGVyasD4Jb6hiu0ulLg28rXoFIDa4BuikokIKl7mB+ymvF5N242D5fJ Xh73tsmdRH6nIO1Uc4eocCNqw4vPm32hO2lZ1CLYK3koAEF+Da6dSC7yEWh0t3kVsnx9 tqVA== X-Forwarded-Encrypted: i=1; AJvYcCWHifpOjgiYSrN1R8oCeofr6jE6GrDe/olRgrCcCg4KA6pn5uz/JhcuiDk0ol4HNbpQuoodLxnb9AIWOwXgIXi7EgymRotLjSyzlHin X-Gm-Message-State: AOJu0YyYOH11VVkhUGySu6W0G+BlpNbXzQAiqQ0hcgjV/pmnGWH50dds RhByV2Stl/sW+YOtlX7XEE1b1GR84bxVl1hLUffcX3+1v0+0bFevZ/85DNYhe0Q= X-Received: by 2002:a05:6a00:189f:b0:6f3:f970:9f2a with SMTP id d2e1a72fcca58-703e596472amr5682219b3a.10.1717671505861; Thu, 06 Jun 2024 03:58:25 -0700 (PDT) Received: from localhost ([122.172.82.13]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-703fd396b0dsm887093b3a.74.2024.06.06.03.58.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 03:58:25 -0700 (PDT) Date: Thu, 6 Jun 2024 16:28:22 +0530 From: Viresh Kumar To: Primoz Fiser Cc: Viresh Kumar , Nishanth Menon , Stephen Boyd , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, upstream@lists.phytec.de Subject: Re: [PATCH] OPP: ti: Fix ti_opp_supply_probe wrong return values Message-ID: <20240606105822.a7giftun56dsnbgc@vireshk-i7> References: <20240606070127.3506240-1-primoz.fiser@norik.com> <20240606085956.wsp3ecyfqck5tltt@vireshk-i7> <20240606094859.6yclnarvlrzl74bj@vireshk-i7> <81919640-b0c4-437c-a04f-1673e8189435@norik.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: <81919640-b0c4-437c-a04f-1673e8189435@norik.com> On 06-06-24, 12:34, Primoz Fiser wrote: > > Ah, I forgot about the token that is returned here. I think the driver > > should be fixed properly once and for all here. > > > > The token must be used to clean the module removal part. Else if you > > try to insert this module, remove it, insert again, you will get some > > errors as the resources aren't cleaned well. > > > > So either provide a remove() callback to the driver, or use > > devm_pm_opp_set_config() here. > > > > So basically, you want v2 with: > > > diff --git a/drivers/opp/ti-opp-supply.c b/drivers/opp/ti-opp-supply.c > > index e3b97cd1fbbf..8a4bcc5fb9dc 100644 > > --- a/drivers/opp/ti-opp-supply.c > > +++ b/drivers/opp/ti-opp-supply.c > > @@ -392,7 +392,7 @@ static int ti_opp_supply_probe(struct platform_device *pdev) > > return ret; > > } > > > > - ret = dev_pm_opp_set_config_regulators(cpu_dev, ti_opp_config_regulators); > > + ret = devm_pm_opp_set_config_regulators(cpu_dev, ti_opp_config_regulators); > > if (ret < 0) > > _free_optimized_voltages(dev, &opp_data); > > > > diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h > > index dd7c8441af42..a2401878d1d9 100644 > > --- a/include/linux/pm_opp.h > > +++ b/include/linux/pm_opp.h > > @@ -654,14 +654,14 @@ static inline int devm_pm_opp_set_clkname(struct device *dev, const char *name) > > } > > > > /* config-regulators helpers */ > > -static inline int dev_pm_opp_set_config_regulators(struct device *dev, Don't remove this, add a new devm_ counterpart. > > +static inline int devm_pm_opp_set_config_regulators(struct device *dev, > > config_regulators_t helper) > > { > > struct dev_pm_opp_config config = { > > .config_regulators = helper, > > }; > > > > - return dev_pm_opp_set_config(dev, &config); > > + return devm_pm_opp_set_config(dev, &config); > > } -- viresh