lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tv7pahvoblw77jziivp7ulassnfdlpsg2z4xvisumbrueapfgu@iyfzlnjjubkv>
Date: Mon, 8 Sep 2025 09:18:15 +0530
From: Manivannan Sadhasivam <mani@...nel.org>
To: Bjorn Helgaas <helgaas@...nel.org>
Cc: manivannan.sadhasivam@....qualcomm.com, 
	Lorenzo Pieralisi <lpieralisi@...nel.org>, Krzysztof Wilczyński <kwilczynski@...nel.org>, 
	Rob Herring <robh@...nel.org>, Bjorn Helgaas <bhelgaas@...gle.com>, 
	Bartosz Golaszewski <brgl@...ev.pl>, Saravana Kannan <saravanak@...gle.com>, 
	linux-pci@...r.kernel.org, linux-arm-msm@...r.kernel.org, linux-kernel@...r.kernel.org, 
	devicetree@...r.kernel.org, Krishna Chaitanya Chundru <krishna.chundru@....qualcomm.com>, 
	Brian Norris <briannorris@...omium.org>, Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Subject: Re: [PATCH v2 2/5] PCI/pwrctrl: Move pci_pwrctrl_init() before
 turning ON the supplies

On Sun, Sep 07, 2025 at 04:22:42PM GMT, Bjorn Helgaas wrote:
> On Wed, Sep 03, 2025 at 12:43:24PM +0530, Manivannan Sadhasivam via B4 Relay wrote:
> > From: Manivannan Sadhasivam <manivannan.sadhasivam@....qualcomm.com>
> > 
> > To allow pwrctrl core to parse the generic resources such as PERST# GPIO
> > before turning on the supplies.
> 
> Can we expand this a little bit?  Which function does that parsing,
> for example?  pci_pwrctrl_init() itself doesn't do any of that, so the
> connection isn't obious.
> 

Sure.

Pwrctrl core function pci_pwrctrl_device_set_ready() deasserts PERST# if the
callback is available. Since that requires accessing 'pwrctrl->dev',
pci_pwrctrl_init() that is setting 'pwrctrl->dev' needs to be called earlier.

I will change the description to be more elaborative. It also requires rewording
since the pwrctrl core is not parsing PERST# on its own now.

- Mani

> > Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
> > Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@....qualcomm.com>
> > ---
> >  drivers/pci/pwrctrl/pci-pwrctrl-pwrseq.c | 4 ++--
> >  drivers/pci/pwrctrl/slot.c               | 4 ++--
> >  2 files changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/pci/pwrctrl/pci-pwrctrl-pwrseq.c b/drivers/pci/pwrctrl/pci-pwrctrl-pwrseq.c
> > index 4e664e7b8dd23f592c0392efbf6728fc5bf9093f..b65955adc7bd44030593e8c49d60db0f39b03d03 100644
> > --- a/drivers/pci/pwrctrl/pci-pwrctrl-pwrseq.c
> > +++ b/drivers/pci/pwrctrl/pci-pwrctrl-pwrseq.c
> > @@ -80,6 +80,8 @@ static int pci_pwrctrl_pwrseq_probe(struct platform_device *pdev)
> >  	if (!data)
> >  		return -ENOMEM;
> >  
> > +	pci_pwrctrl_init(&data->ctx, dev);
> > +
> >  	data->pwrseq = devm_pwrseq_get(dev, pdata->target);
> >  	if (IS_ERR(data->pwrseq))
> >  		return dev_err_probe(dev, PTR_ERR(data->pwrseq),
> > @@ -95,8 +97,6 @@ static int pci_pwrctrl_pwrseq_probe(struct platform_device *pdev)
> >  	if (ret)
> >  		return ret;
> >  
> > -	pci_pwrctrl_init(&data->ctx, dev);
> > -
> >  	ret = devm_pci_pwrctrl_device_set_ready(dev, &data->ctx);
> >  	if (ret)
> >  		return dev_err_probe(dev, ret,
> > diff --git a/drivers/pci/pwrctrl/slot.c b/drivers/pci/pwrctrl/slot.c
> > index 6e138310b45b9f7e930b6814e0a24f7111d25fee..b68406a6b027e4d9f853e86d4340e0ab267b6126 100644
> > --- a/drivers/pci/pwrctrl/slot.c
> > +++ b/drivers/pci/pwrctrl/slot.c
> > @@ -38,6 +38,8 @@ static int pci_pwrctrl_slot_probe(struct platform_device *pdev)
> >  	if (!slot)
> >  		return -ENOMEM;
> >  
> > +	pci_pwrctrl_init(&slot->ctx, dev);
> > +
> >  	ret = of_regulator_bulk_get_all(dev, dev_of_node(dev),
> >  					&slot->supplies);
> >  	if (ret < 0) {
> > @@ -63,8 +65,6 @@ static int pci_pwrctrl_slot_probe(struct platform_device *pdev)
> >  				     "Failed to enable slot clock\n");
> >  	}
> >  
> > -	pci_pwrctrl_init(&slot->ctx, dev);
> > -
> >  	ret = devm_pci_pwrctrl_device_set_ready(dev, &slot->ctx);
> >  	if (ret)
> >  		return dev_err_probe(dev, ret, "Failed to register pwrctrl driver\n");
> > 
> > -- 
> > 2.45.2
> > 
> > 

-- 
மணிவண்ணன் சதாசிவம்

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ