Re: [PATCH v4 03/15] PCI: imx6: Simplify reset handling by using by using *_FLAG_HAS_*_RESET

From: Manivannan Sadhasivam
Date: Sun Dec 17 2023 - 12:35:10 EST


On Sun, Dec 17, 2023 at 12:11:58AM -0500, Frank Li wrote:
> Refactors the reset handling logic in the imx6 PCI driver by adding
> IMX6_PCIE_FLAG_HAS_*_RESET bitmask define for drvdata::flags.
>
> The drvdata::flags and a bitmask ensures a cleaner and more scalable
> switch-case structure for handling reset.
>
> Reviewed-by: Philipp Zabel <p.zabel@xxxxxxxxxxxxxx>
> Signed-off-by: Frank Li <Frank.Li@xxxxxxx>

One nitpick below. With that fixed,

Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxx>

> ---
>
> Notes:
> Change from v2 to v3:
> - add Philipp's Reviewed-by tag
> Change from v1 to v2:
> - remove condition check before reset_control_(de)assert() because it is
> none ops if a NULL pointer pass down.
> - still keep condition check at probe to help identify dts file mismatch
> problem.
>
> Change from v1 to v2:
> - remove condition check before reset_control_(de)assert() because it is
> none ops if a NULL pointer pass down.
> - still keep condition check at probe to help identify dts file mismatch
> problem.
>
> drivers/pci/controller/dwc/pci-imx6.c | 108 ++++++++++----------------
> 1 file changed, 41 insertions(+), 67 deletions(-)
>
> diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
> index 91ba26a4b4c3d..c1fb38a2ebeb6 100644
> --- a/drivers/pci/controller/dwc/pci-imx6.c
> +++ b/drivers/pci/controller/dwc/pci-imx6.c

[...]

> @@ -1441,31 +1407,39 @@ static const struct imx6_pcie_drvdata drvdata[] = {
> },
> [IMX7D] = {
> .variant = IMX7D,
> - .flags = IMX6_PCIE_FLAG_SUPPORTS_SUSPEND,
> + .flags = IMX6_PCIE_FLAG_SUPPORTS_SUSPEND |
> + IMX6_PCIE_FLAG_HAS_APP_RESET |
> + IMX6_PCIE_FLAG_HAS_PHY_RESET,
> .gpr = "fsl,imx7d-iomuxc-gpr",
> .clk_names = {IMX6_CLKS_NO_PHYDRV},
> },
> [IMX8MQ] = {
> .variant = IMX8MQ,
> + .flags = IMX6_PCIE_FLAG_HAS_APP_RESET |
> + IMX6_PCIE_FLAG_HAS_PHY_RESET,
> .gpr = "fsl,imx8mq-iomuxc-gpr",
> .clk_names = {IMX6_CLKS_NO_PHYDRV, "pcie_aux"},
> },
> [IMX8MM] = {
> .variant = IMX8MM,
> .flags = IMX6_PCIE_FLAG_SUPPORTS_SUSPEND |
> - IMX6_PCIE_FLAG_HAS_PHY,
> + IMX6_PCIE_FLAG_HAS_PHY |
> + IMX6_PCIE_FLAG_HAS_APP_RESET,
> .gpr = "fsl,imx8mm-iomuxc-gpr",
> .clk_names = {IMX6_CLKS_COMMON, "pcie_aux"},
> },
> [IMX8MP] = {
> .variant = IMX8MP,
> .flags = IMX6_PCIE_FLAG_SUPPORTS_SUSPEND |
> - IMX6_PCIE_FLAG_HAS_PHY,
> + IMX6_PCIE_FLAG_HAS_PHY |
> + IMX6_PCIE_FLAG_HAS_APP_RESET,
> .gpr = "fsl,imx8mp-iomuxc-gpr",
> .clk_names = {IMX6_CLKS_COMMON, "pcie_aux"},
> },
> [IMX8MQ_EP] = {
> .variant = IMX8MQ_EP,
> + .flags = IMX6_PCIE_FLAG_HAS_PHY |

This change is not part of this patch.

- Mani

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