diff mbox

[054/102] PCI: rockchip: explicitly request exclusive reset control

Message ID 20170719152646.25903-55-p.zabel@pengutronix.de (mailing list archive)
State New, archived
Headers show

Commit Message

Philipp Zabel July 19, 2017, 3:25 p.m. UTC
Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
reset lines") started to transition the reset control request API calls
to explicitly state whether the driver needs exclusive or shared reset
control behavior. Convert all drivers requesting exclusive resets to the
explicit API call so the temporary transition helpers can be removed.

No functional changes.

Cc: Shawn Lin <shawn.lin@rock-chips.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: linux-pci@vger.kernel.org
Cc: linux-rockchip@lists.infradead.org
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
 drivers/pci/host/pcie-rockchip.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

Comments

Shawn Lin July 22, 2017, 1:12 p.m. UTC | #1
Hi Philipp,

On 2017/7/19 23:25, Philipp Zabel wrote:
> Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
> reset lines") started to transition the reset control request API calls
> to explicitly state whether the driver needs exclusive or shared reset
> control behavior. Convert all drivers requesting exclusive resets to the
> explicit API call so the temporary transition helpers can be removed.
>
> No functional changes.
>
> Cc: Shawn Lin <shawn.lin@rock-chips.com>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: Heiko Stuebner <heiko@sntech.de>
> Cc: linux-pci@vger.kernel.org
> Cc: linux-rockchip@lists.infradead.org
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> ---
>  drivers/pci/host/pcie-rockchip.c | 15 ++++++++-------

As mentioned in the thread of conversion for phy-rockchip-pcie,
I would prefer add your patches after the reconstruction work got
merged.


>  1 file changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/pci/host/pcie-rockchip.c b/drivers/pci/host/pcie-rockchip.c
> index 7bb9870f6d8ce..e50d6f5a81f4b 100644
> --- a/drivers/pci/host/pcie-rockchip.c
> +++ b/drivers/pci/host/pcie-rockchip.c
> @@ -903,49 +903,50 @@ static int rockchip_pcie_parse_dt(struct rockchip_pcie *rockchip)
>  	if (rockchip->link_gen < 0 || rockchip->link_gen > 2)
>  		rockchip->link_gen = 2;
>
> -	rockchip->core_rst = devm_reset_control_get(dev, "core");
> +	rockchip->core_rst = devm_reset_control_get_exclusive(dev, "core");
>  	if (IS_ERR(rockchip->core_rst)) {
>  		if (PTR_ERR(rockchip->core_rst) != -EPROBE_DEFER)
>  			dev_err(dev, "missing core reset property in node\n");
>  		return PTR_ERR(rockchip->core_rst);
>  	}
>
> -	rockchip->mgmt_rst = devm_reset_control_get(dev, "mgmt");
> +	rockchip->mgmt_rst = devm_reset_control_get_exclusive(dev, "mgmt");
>  	if (IS_ERR(rockchip->mgmt_rst)) {
>  		if (PTR_ERR(rockchip->mgmt_rst) != -EPROBE_DEFER)
>  			dev_err(dev, "missing mgmt reset property in node\n");
>  		return PTR_ERR(rockchip->mgmt_rst);
>  	}
>
> -	rockchip->mgmt_sticky_rst = devm_reset_control_get(dev, "mgmt-sticky");
> +	rockchip->mgmt_sticky_rst = devm_reset_control_get_exclusive(dev,
> +								     "mgmt-sticky");
>  	if (IS_ERR(rockchip->mgmt_sticky_rst)) {
>  		if (PTR_ERR(rockchip->mgmt_sticky_rst) != -EPROBE_DEFER)
>  			dev_err(dev, "missing mgmt-sticky reset property in node\n");
>  		return PTR_ERR(rockchip->mgmt_sticky_rst);
>  	}
>
> -	rockchip->pipe_rst = devm_reset_control_get(dev, "pipe");
> +	rockchip->pipe_rst = devm_reset_control_get_exclusive(dev, "pipe");
>  	if (IS_ERR(rockchip->pipe_rst)) {
>  		if (PTR_ERR(rockchip->pipe_rst) != -EPROBE_DEFER)
>  			dev_err(dev, "missing pipe reset property in node\n");
>  		return PTR_ERR(rockchip->pipe_rst);
>  	}
>
> -	rockchip->pm_rst = devm_reset_control_get(dev, "pm");
> +	rockchip->pm_rst = devm_reset_control_get_exclusive(dev, "pm");
>  	if (IS_ERR(rockchip->pm_rst)) {
>  		if (PTR_ERR(rockchip->pm_rst) != -EPROBE_DEFER)
>  			dev_err(dev, "missing pm reset property in node\n");
>  		return PTR_ERR(rockchip->pm_rst);
>  	}
>
> -	rockchip->pclk_rst = devm_reset_control_get(dev, "pclk");
> +	rockchip->pclk_rst = devm_reset_control_get_exclusive(dev, "pclk");
>  	if (IS_ERR(rockchip->pclk_rst)) {
>  		if (PTR_ERR(rockchip->pclk_rst) != -EPROBE_DEFER)
>  			dev_err(dev, "missing pclk reset property in node\n");
>  		return PTR_ERR(rockchip->pclk_rst);
>  	}
>
> -	rockchip->aclk_rst = devm_reset_control_get(dev, "aclk");
> +	rockchip->aclk_rst = devm_reset_control_get_exclusive(dev, "aclk");
>  	if (IS_ERR(rockchip->aclk_rst)) {
>  		if (PTR_ERR(rockchip->aclk_rst) != -EPROBE_DEFER)
>  			dev_err(dev, "missing aclk reset property in node\n");
>
Philipp Zabel July 24, 2017, 8:35 a.m. UTC | #2
Hi Shawn,

On Sat, 2017-07-22 at 21:12 +0800, Shawn Lin wrote:
> Hi Philipp,
> 
> On 2017/7/19 23:25, Philipp Zabel wrote:
> > Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
> > reset lines") started to transition the reset control request API calls
> > to explicitly state whether the driver needs exclusive or shared reset
> > control behavior. Convert all drivers requesting exclusive resets to the
> > explicit API call so the temporary transition helpers can be removed.
> >
> > No functional changes.
> >
> > Cc: Shawn Lin <shawn.lin@rock-chips.com>
> > Cc: Bjorn Helgaas <bhelgaas@google.com>
> > Cc: Heiko Stuebner <heiko@sntech.de>
> > Cc: linux-pci@vger.kernel.org
> > Cc: linux-rockchip@lists.infradead.org
> > Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> > ---
> >  drivers/pci/host/pcie-rockchip.c | 15 ++++++++-------
> 
> As mentioned in the thread of conversion for phy-rockchip-pcie,
> I would prefer add your patches after the reconstruction work got
> merged.

Feel free to add them when and where it is most convenient for you.
Please let me know if you want me to rebase them somewhere.

regards
Philipp
Shawn Lin Aug. 3, 2017, 12:31 a.m. UTC | #3
Hi,

On 2017/7/19 23:25, Philipp Zabel wrote:
> Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
> reset lines") started to transition the reset control request API calls
> to explicitly state whether the driver needs exclusive or shared reset
> control behavior. Convert all drivers requesting exclusive resets to the
> explicit API call so the temporary transition helpers can be removed.
> 
> No functional changes.
> 
> Cc: Shawn Lin <shawn.lin@rock-chips.com>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: Heiko Stuebner <heiko@sntech.de>
> Cc: linux-pci@vger.kernel.org
> Cc: linux-rockchip@lists.infradead.org
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>

Acked-by: Shawn Lin <shawn.lin@rock-chips.com>

> ---
>   drivers/pci/host/pcie-rockchip.c | 15 ++++++++-------
>   1 file changed, 8 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/pci/host/pcie-rockchip.c b/drivers/pci/host/pcie-rockchip.c
> index 7bb9870f6d8ce..e50d6f5a81f4b 100644
> --- a/drivers/pci/host/pcie-rockchip.c
> +++ b/drivers/pci/host/pcie-rockchip.c
> @@ -903,49 +903,50 @@ static int rockchip_pcie_parse_dt(struct rockchip_pcie *rockchip)
>   	if (rockchip->link_gen < 0 || rockchip->link_gen > 2)
>   		rockchip->link_gen = 2;
>   
> -	rockchip->core_rst = devm_reset_control_get(dev, "core");
> +	rockchip->core_rst = devm_reset_control_get_exclusive(dev, "core");
>   	if (IS_ERR(rockchip->core_rst)) {
>   		if (PTR_ERR(rockchip->core_rst) != -EPROBE_DEFER)
>   			dev_err(dev, "missing core reset property in node\n");
>   		return PTR_ERR(rockchip->core_rst);
>   	}
>   
> -	rockchip->mgmt_rst = devm_reset_control_get(dev, "mgmt");
> +	rockchip->mgmt_rst = devm_reset_control_get_exclusive(dev, "mgmt");
>   	if (IS_ERR(rockchip->mgmt_rst)) {
>   		if (PTR_ERR(rockchip->mgmt_rst) != -EPROBE_DEFER)
>   			dev_err(dev, "missing mgmt reset property in node\n");
>   		return PTR_ERR(rockchip->mgmt_rst);
>   	}
>   
> -	rockchip->mgmt_sticky_rst = devm_reset_control_get(dev, "mgmt-sticky");
> +	rockchip->mgmt_sticky_rst = devm_reset_control_get_exclusive(dev,
> +								     "mgmt-sticky");
>   	if (IS_ERR(rockchip->mgmt_sticky_rst)) {
>   		if (PTR_ERR(rockchip->mgmt_sticky_rst) != -EPROBE_DEFER)
>   			dev_err(dev, "missing mgmt-sticky reset property in node\n");
>   		return PTR_ERR(rockchip->mgmt_sticky_rst);
>   	}
>   
> -	rockchip->pipe_rst = devm_reset_control_get(dev, "pipe");
> +	rockchip->pipe_rst = devm_reset_control_get_exclusive(dev, "pipe");
>   	if (IS_ERR(rockchip->pipe_rst)) {
>   		if (PTR_ERR(rockchip->pipe_rst) != -EPROBE_DEFER)
>   			dev_err(dev, "missing pipe reset property in node\n");
>   		return PTR_ERR(rockchip->pipe_rst);
>   	}
>   
> -	rockchip->pm_rst = devm_reset_control_get(dev, "pm");
> +	rockchip->pm_rst = devm_reset_control_get_exclusive(dev, "pm");
>   	if (IS_ERR(rockchip->pm_rst)) {
>   		if (PTR_ERR(rockchip->pm_rst) != -EPROBE_DEFER)
>   			dev_err(dev, "missing pm reset property in node\n");
>   		return PTR_ERR(rockchip->pm_rst);
>   	}
>   
> -	rockchip->pclk_rst = devm_reset_control_get(dev, "pclk");
> +	rockchip->pclk_rst = devm_reset_control_get_exclusive(dev, "pclk");
>   	if (IS_ERR(rockchip->pclk_rst)) {
>   		if (PTR_ERR(rockchip->pclk_rst) != -EPROBE_DEFER)
>   			dev_err(dev, "missing pclk reset property in node\n");
>   		return PTR_ERR(rockchip->pclk_rst);
>   	}
>   
> -	rockchip->aclk_rst = devm_reset_control_get(dev, "aclk");
> +	rockchip->aclk_rst = devm_reset_control_get_exclusive(dev, "aclk");
>   	if (IS_ERR(rockchip->aclk_rst)) {
>   		if (PTR_ERR(rockchip->aclk_rst) != -EPROBE_DEFER)
>   			dev_err(dev, "missing aclk reset property in node\n");
>
Bjorn Helgaas Aug. 3, 2017, 9:43 p.m. UTC | #4
On Wed, Jul 19, 2017 at 05:25:58PM +0200, Philipp Zabel wrote:
> Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
> reset lines") started to transition the reset control request API calls
> to explicitly state whether the driver needs exclusive or shared reset
> control behavior. Convert all drivers requesting exclusive resets to the
> explicit API call so the temporary transition helpers can be removed.
> 
> No functional changes.
> 
> Cc: Shawn Lin <shawn.lin@rock-chips.com>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: Heiko Stuebner <heiko@sntech.de>
> Cc: linux-pci@vger.kernel.org
> Cc: linux-rockchip@lists.infradead.org
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>

Applied with Shawn's ack to pci/host-rockchip for v4.14, thanks!

> ---
>  drivers/pci/host/pcie-rockchip.c | 15 ++++++++-------
>  1 file changed, 8 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/pci/host/pcie-rockchip.c b/drivers/pci/host/pcie-rockchip.c
> index 7bb9870f6d8ce..e50d6f5a81f4b 100644
> --- a/drivers/pci/host/pcie-rockchip.c
> +++ b/drivers/pci/host/pcie-rockchip.c
> @@ -903,49 +903,50 @@ static int rockchip_pcie_parse_dt(struct rockchip_pcie *rockchip)
>  	if (rockchip->link_gen < 0 || rockchip->link_gen > 2)
>  		rockchip->link_gen = 2;
>  
> -	rockchip->core_rst = devm_reset_control_get(dev, "core");
> +	rockchip->core_rst = devm_reset_control_get_exclusive(dev, "core");
>  	if (IS_ERR(rockchip->core_rst)) {
>  		if (PTR_ERR(rockchip->core_rst) != -EPROBE_DEFER)
>  			dev_err(dev, "missing core reset property in node\n");
>  		return PTR_ERR(rockchip->core_rst);
>  	}
>  
> -	rockchip->mgmt_rst = devm_reset_control_get(dev, "mgmt");
> +	rockchip->mgmt_rst = devm_reset_control_get_exclusive(dev, "mgmt");
>  	if (IS_ERR(rockchip->mgmt_rst)) {
>  		if (PTR_ERR(rockchip->mgmt_rst) != -EPROBE_DEFER)
>  			dev_err(dev, "missing mgmt reset property in node\n");
>  		return PTR_ERR(rockchip->mgmt_rst);
>  	}
>  
> -	rockchip->mgmt_sticky_rst = devm_reset_control_get(dev, "mgmt-sticky");
> +	rockchip->mgmt_sticky_rst = devm_reset_control_get_exclusive(dev,
> +								     "mgmt-sticky");
>  	if (IS_ERR(rockchip->mgmt_sticky_rst)) {
>  		if (PTR_ERR(rockchip->mgmt_sticky_rst) != -EPROBE_DEFER)
>  			dev_err(dev, "missing mgmt-sticky reset property in node\n");
>  		return PTR_ERR(rockchip->mgmt_sticky_rst);
>  	}
>  
> -	rockchip->pipe_rst = devm_reset_control_get(dev, "pipe");
> +	rockchip->pipe_rst = devm_reset_control_get_exclusive(dev, "pipe");
>  	if (IS_ERR(rockchip->pipe_rst)) {
>  		if (PTR_ERR(rockchip->pipe_rst) != -EPROBE_DEFER)
>  			dev_err(dev, "missing pipe reset property in node\n");
>  		return PTR_ERR(rockchip->pipe_rst);
>  	}
>  
> -	rockchip->pm_rst = devm_reset_control_get(dev, "pm");
> +	rockchip->pm_rst = devm_reset_control_get_exclusive(dev, "pm");
>  	if (IS_ERR(rockchip->pm_rst)) {
>  		if (PTR_ERR(rockchip->pm_rst) != -EPROBE_DEFER)
>  			dev_err(dev, "missing pm reset property in node\n");
>  		return PTR_ERR(rockchip->pm_rst);
>  	}
>  
> -	rockchip->pclk_rst = devm_reset_control_get(dev, "pclk");
> +	rockchip->pclk_rst = devm_reset_control_get_exclusive(dev, "pclk");
>  	if (IS_ERR(rockchip->pclk_rst)) {
>  		if (PTR_ERR(rockchip->pclk_rst) != -EPROBE_DEFER)
>  			dev_err(dev, "missing pclk reset property in node\n");
>  		return PTR_ERR(rockchip->pclk_rst);
>  	}
>  
> -	rockchip->aclk_rst = devm_reset_control_get(dev, "aclk");
> +	rockchip->aclk_rst = devm_reset_control_get_exclusive(dev, "aclk");
>  	if (IS_ERR(rockchip->aclk_rst)) {
>  		if (PTR_ERR(rockchip->aclk_rst) != -EPROBE_DEFER)
>  			dev_err(dev, "missing aclk reset property in node\n");
> -- 
> 2.11.0
>
diff mbox

Patch

diff --git a/drivers/pci/host/pcie-rockchip.c b/drivers/pci/host/pcie-rockchip.c
index 7bb9870f6d8ce..e50d6f5a81f4b 100644
--- a/drivers/pci/host/pcie-rockchip.c
+++ b/drivers/pci/host/pcie-rockchip.c
@@ -903,49 +903,50 @@  static int rockchip_pcie_parse_dt(struct rockchip_pcie *rockchip)
 	if (rockchip->link_gen < 0 || rockchip->link_gen > 2)
 		rockchip->link_gen = 2;
 
-	rockchip->core_rst = devm_reset_control_get(dev, "core");
+	rockchip->core_rst = devm_reset_control_get_exclusive(dev, "core");
 	if (IS_ERR(rockchip->core_rst)) {
 		if (PTR_ERR(rockchip->core_rst) != -EPROBE_DEFER)
 			dev_err(dev, "missing core reset property in node\n");
 		return PTR_ERR(rockchip->core_rst);
 	}
 
-	rockchip->mgmt_rst = devm_reset_control_get(dev, "mgmt");
+	rockchip->mgmt_rst = devm_reset_control_get_exclusive(dev, "mgmt");
 	if (IS_ERR(rockchip->mgmt_rst)) {
 		if (PTR_ERR(rockchip->mgmt_rst) != -EPROBE_DEFER)
 			dev_err(dev, "missing mgmt reset property in node\n");
 		return PTR_ERR(rockchip->mgmt_rst);
 	}
 
-	rockchip->mgmt_sticky_rst = devm_reset_control_get(dev, "mgmt-sticky");
+	rockchip->mgmt_sticky_rst = devm_reset_control_get_exclusive(dev,
+								     "mgmt-sticky");
 	if (IS_ERR(rockchip->mgmt_sticky_rst)) {
 		if (PTR_ERR(rockchip->mgmt_sticky_rst) != -EPROBE_DEFER)
 			dev_err(dev, "missing mgmt-sticky reset property in node\n");
 		return PTR_ERR(rockchip->mgmt_sticky_rst);
 	}
 
-	rockchip->pipe_rst = devm_reset_control_get(dev, "pipe");
+	rockchip->pipe_rst = devm_reset_control_get_exclusive(dev, "pipe");
 	if (IS_ERR(rockchip->pipe_rst)) {
 		if (PTR_ERR(rockchip->pipe_rst) != -EPROBE_DEFER)
 			dev_err(dev, "missing pipe reset property in node\n");
 		return PTR_ERR(rockchip->pipe_rst);
 	}
 
-	rockchip->pm_rst = devm_reset_control_get(dev, "pm");
+	rockchip->pm_rst = devm_reset_control_get_exclusive(dev, "pm");
 	if (IS_ERR(rockchip->pm_rst)) {
 		if (PTR_ERR(rockchip->pm_rst) != -EPROBE_DEFER)
 			dev_err(dev, "missing pm reset property in node\n");
 		return PTR_ERR(rockchip->pm_rst);
 	}
 
-	rockchip->pclk_rst = devm_reset_control_get(dev, "pclk");
+	rockchip->pclk_rst = devm_reset_control_get_exclusive(dev, "pclk");
 	if (IS_ERR(rockchip->pclk_rst)) {
 		if (PTR_ERR(rockchip->pclk_rst) != -EPROBE_DEFER)
 			dev_err(dev, "missing pclk reset property in node\n");
 		return PTR_ERR(rockchip->pclk_rst);
 	}
 
-	rockchip->aclk_rst = devm_reset_control_get(dev, "aclk");
+	rockchip->aclk_rst = devm_reset_control_get_exclusive(dev, "aclk");
 	if (IS_ERR(rockchip->aclk_rst)) {
 		if (PTR_ERR(rockchip->aclk_rst) != -EPROBE_DEFER)
 			dev_err(dev, "missing aclk reset property in node\n");