Re: [PATCH v5 02/18] PCI/CXL: Probe the underlying bus reset in cxl_reset_bus_function()

Nicolin Chen <[email protected]>
Newsgroups org.kernel.vger.linux-acpi,dev.linux.lists.iommu,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pci
Message-ID <[email protected]>
On Thu, Aug 27, 2026 at 05:31:31PM -0300, Jason Gunthorpe wrote:
> > [ ... 27 lines skipped ... ]
> > @@ -4979,8 +4979,16 @@ static int cxl_reset_bus_function(struct pci_dev *dev, bool probe)
> >  	if (!dvsec)
> >  		return -ENOTTY;
> >  
> > -	if (probe)
> > -		return 0;
> > +	/*
> > +	 * Do not probe via pci_reset_bus_function(), which would reject a
> > +	 * masked SBR that the do-reset path below unmasks before resetting.
> > +	 */
> > +	if (probe) {
> > +		rc = pci_dev_reset_slot_function(dev, PCI_RESET_PROBE);
> > +		if (rc != -ENOTTY)
> > +			return rc;
> > +		return pci_parent_bus_reset(dev, PCI_RESET_PROBE);
> > +	}
> 
> Why not put this a little lower after the:
> 
> >
> >  	rc = pci_read_config_word(bridge, dvsec + PCI_DVSEC_CXL_PORT_CTL, &reg);
> >  	if (rc)
> 
> ?

Hmm, the "if (probe)" was checked before pci_read_config_word, so I
kept it there. I don't quite get the reason of putting it behind.

Mind elaborating?

Thanks
Nicolin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.