Re: [PATCH v7 08/13] PCI: tegra194: Apply pinctrl settings for both PCIe RP and EP

From: Manivannan Sadhasivam

Date: Mon Mar 16 2026 - 00:26:35 EST


On Mon, Mar 16, 2026 at 09:11:53AM +0530, Manikanta Maddireddy wrote:
>
>
> On 16/03/26 7:01 am, Manivannan Sadhasivam wrote:
> > On Sun, Mar 15, 2026 at 07:24:48PM +0530, Manikanta Maddireddy wrote:
> > >
> > >
> > > On 05/03/26 3:49 pm, Manivannan Sadhasivam wrote:
> > > > On Tue, Mar 03, 2026 at 12:24:43PM +0530, Manikanta Maddireddy wrote:
> > > > > From: Vidya Sagar <vidyas@xxxxxxxxxx>
> > > > >
> > > > > PERST# and CLKREQ# pinctrl settings should be applied for both Root Port
> > > > > and Endpoint mode. Move pinctrl_pm_select_default_state() function call
> > > > > from Root Port specific configuration function to probe().
> > > > >
> > > >
> > > > Why should this driver care about setting default pinctrl state? Why can't it
> > > > rely on the pinctrl framework as like other drivers?
> > > >
> > > > - Mani
> > >
> > > pinctrl framework doesn't know if PCIe controller is going to be configured
> > > in Endpoint or Root port mode. In Root port mode PERST# signal should be
> > > configured as special function IO pin(SFIO) and in Endpoint mode it should
> > > be configured as general purpose IO pin(GPIO). So, PCIe driver should
> > > request appropriate pinctl values.
> > >
> >
> > So you are saying that irrespective of board design, you can configure the
> > controller in host/endpoint mode? Is it possible? Dual mode controllers are
> > quite common in other SoCs, but they rely on devicetree to either configure the
> > controller in host or endpoint mode.
> >
> > If the devicetree enables the endpoint node, why can't it also define the
> > pinctrl config?
> >
> > - Mani
> >
>
> Root Port and Endpoint role switch is through device tree only.
> pinctrl settings are defined in Root Port/Endpoint device tree node, but to
> apply the pinctrl settings respective driver need to call
> pinctrl_pm_select_default_state().
>

First of all calling pinctrl_pm_select_default_state() from probe() is not
correct. pinctrl_pm_* APIs are supposed to be called from PM callbacks.

Also, the pinctrl default state *should* be selected by the pinctrl core. So
what this driver is doing here looks redundant.

- Mani

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