Re: [PATCH v5 1/6] PCI: mediatek-gen3: Add missing reset_control_deassert() for mac_rst in mtk_pcie_en7581_power_up()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On Sat, Nov 30, 2024 at 12:20:10AM +0100, Lorenzo Bianconi wrote:
> > Even if this is not a real issue since Airoha EN7581 SoC does not require
> > the mac reset line, add missing reset_control_deassert() for mac reset
> > line in mtk_pcie_en7581_power_up() callback.

Hi Bjorn,

since this patch is already in Krzysztof's controller/mediatek branch, do you
want to repost the full series or just incremental changes?

> 
> s/mac/MAC/ in English text since "mac" is an acronym, not a real word

ack, I will fix it.

> 
> This doesn't really say why we need this patch.
> 
> This adds both assert and deassert, so it doesn't really look like
> adding a *missing* deassert.
> 
> On EN7581, is mac_reset optional or always absent?

AFAIK mac_reset is never used on EN7581. We added it since we were discussing in
[0] to move the reset asssert/deassert callbacks in the same routine (in the
original codeabse we have reset_control_assert(pcie->mac_reset) in mtk_pcie_setup()
and reset_control_deassert(pcie->mac_reset) in mtk_pcie_power_up()).
I think we can remove mac_reset support at all for EN7581.  What do you prefer?

Regards,
Lorenzo

[0] https://lore.kernel.org/linux-pci/20241106233123.GA1580663@bhelgaas/

> 
> If mac_reset is always absent for EN7581, why add this patch at all?
> If it's optional, say so.
> 
> > Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxx>
> > Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@xxxxxxxxxxxxx>
> > Signed-off-by: Lorenzo Bianconi <lorenzo@xxxxxxxxxx>
> > ---
> >  drivers/pci/controller/pcie-mediatek-gen3.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/drivers/pci/controller/pcie-mediatek-gen3.c b/drivers/pci/controller/pcie-mediatek-gen3.c
> > index 64ef8ff71b0357b9bf9ad8484095b7aa60c22271..4d1c797a32c236faf79428eb8a83708e9c4f21d8 100644
> > --- a/drivers/pci/controller/pcie-mediatek-gen3.c
> > +++ b/drivers/pci/controller/pcie-mediatek-gen3.c
> > @@ -942,6 +942,9 @@ static int mtk_pcie_en7581_power_up(struct mtk_gen3_pcie *pcie)
> >  	 */
> >  	mdelay(PCIE_EN7581_RESET_TIME_MS);
> >  
> > +	/* MAC power on and enable transaction layer clocks */
> > +	reset_control_deassert(pcie->mac_reset);
> > +
> >  	pm_runtime_enable(dev);
> >  	pm_runtime_get_sync(dev);
> >  
> > @@ -976,6 +979,7 @@ static int mtk_pcie_en7581_power_up(struct mtk_gen3_pcie *pcie)
> >  err_clk_prepare:
> >  	pm_runtime_put_sync(dev);
> >  	pm_runtime_disable(dev);
> > +	reset_control_assert(pcie->mac_reset);
> >  	reset_control_bulk_assert(pcie->soc->phy_resets.num_resets, pcie->phy_resets);
> >  err_phy_deassert:
> >  	phy_power_off(pcie->phy);
> > 
> > -- 
> > 2.47.0
> > 

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux