public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] ravb: Fix "failed to switch device to config mode" message" failed to apply to 4.9-stable tree
@ 2023-01-04 14:16 gregkh
  2023-01-09 10:17 ` Biju Das
  0 siblings, 1 reply; 2+ messages in thread
From: gregkh @ 2023-01-04 14:16 UTC (permalink / raw)
  To: biju.das.jz, leonro, pabeni; +Cc: stable


The patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.

Possible dependencies:

c72a7e42592b ("ravb: Fix "failed to switch device to config mode" message during unbind")

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From c72a7e42592b2e18d862cf120876070947000d7a Mon Sep 17 00:00:00 2001
From: Biju Das <biju.das.jz@bp.renesas.com>
Date: Wed, 14 Dec 2022 10:51:18 +0000
Subject: [PATCH] ravb: Fix "failed to switch device to config mode" message
 during unbind

This patch fixes the error "ravb 11c20000.ethernet eth0: failed to switch
device to config mode" during unbind.

We are doing register access after pm_runtime_put_sync().

We usually do cleanup in reverse order of init. Currently in
remove(), the "pm_runtime_put_sync" is not in reverse order.

Probe
	reset_control_deassert(rstc);
	pm_runtime_enable(&pdev->dev);
	pm_runtime_get_sync(&pdev->dev);

remove
	pm_runtime_put_sync(&pdev->dev);
	unregister_netdev(ndev);
	..
	ravb_mdio_release(priv);
	pm_runtime_disable(&pdev->dev);

Consider the call to unregister_netdev()
unregister_netdev->unregister_netdevice_queue->rollback_registered_many
that calls the below functions which access the registers after
pm_runtime_put_sync()
 1) ravb_get_stats
 2) ravb_close

Fixes: c156633f1353 ("Renesas Ethernet AVB driver proper")
Cc: stable@vger.kernel.org
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Link: https://lore.kernel.org/r/20221214105118.2495313-1-biju.das.jz@bp.renesas.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
index 33f723a9f471..b4e0fc7f65bd 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -2903,12 +2903,12 @@ static int ravb_remove(struct platform_device *pdev)
 			  priv->desc_bat_dma);
 	/* Set reset mode */
 	ravb_write(ndev, CCC_OPC_RESET, CCC);
-	pm_runtime_put_sync(&pdev->dev);
 	unregister_netdev(ndev);
 	if (info->nc_queues)
 		netif_napi_del(&priv->napi[RAVB_NC]);
 	netif_napi_del(&priv->napi[RAVB_BE]);
 	ravb_mdio_release(priv);
+	pm_runtime_put_sync(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
 	reset_control_assert(priv->rstc);
 	free_netdev(ndev);


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: FAILED: patch "[PATCH] ravb: Fix "failed to switch device to config mode" message" failed to apply to 4.9-stable tree
  2023-01-04 14:16 FAILED: patch "[PATCH] ravb: Fix "failed to switch device to config mode" message" failed to apply to 4.9-stable tree gregkh
@ 2023-01-09 10:17 ` Biju Das
  0 siblings, 0 replies; 2+ messages in thread
From: Biju Das @ 2023-01-09 10:17 UTC (permalink / raw)
  To: gregkh@linuxfoundation.org, leonro@nvidia.com, pabeni@redhat.com
  Cc: stable@vger.kernel.org, linux-renesas-soc@vger.kernel.org

Hi All,

I will fix the failed patches and send to 4.9, 4.14, 4.19, 5.4 , 5.10 and 5.15 stable trees.

Cheers,
Biju 

> -----Original Message-----
> From: gregkh@linuxfoundation.org <gregkh@linuxfoundation.org>
> Sent: 04 January 2023 14:17
> To: Biju Das <biju.das.jz@bp.renesas.com>; leonro@nvidia.com;
> pabeni@redhat.com
> Cc: stable@vger.kernel.org
> Subject: FAILED: patch "[PATCH] ravb: Fix "failed to switch device to config
> mode" message" failed to apply to 4.9-stable tree
> 
> 
> The patch below does not apply to the 4.9-stable tree.
> If someone wants it applied there, or to any other stable or longterm tree,
> then please email the backport, including the original git commit id to
> <stable@vger.kernel.org>.
> 
> Possible dependencies:
> 
> c72a7e42592b ("ravb: Fix "failed to switch device to config mode" message
> during unbind")
> 
> thanks,
> 
> greg k-h
> 
> ------------------ original commit in Linus's tree ------------------
> 
> From c72a7e42592b2e18d862cf120876070947000d7a Mon Sep 17 00:00:00 2001
> From: Biju Das <biju.das.jz@bp.renesas.com>
> Date: Wed, 14 Dec 2022 10:51:18 +0000
> Subject: [PATCH] ravb: Fix "failed to switch device to config mode" message
> during unbind
> 
> This patch fixes the error "ravb 11c20000.ethernet eth0: failed to switch
> device to config mode" during unbind.
> 
> We are doing register access after pm_runtime_put_sync().
> 
> We usually do cleanup in reverse order of init. Currently in remove(), the
> "pm_runtime_put_sync" is not in reverse order.
> 
> Probe
> 	reset_control_deassert(rstc);
> 	pm_runtime_enable(&pdev->dev);
> 	pm_runtime_get_sync(&pdev->dev);
> 
> remove
> 	pm_runtime_put_sync(&pdev->dev);
> 	unregister_netdev(ndev);
> 	..
> 	ravb_mdio_release(priv);
> 	pm_runtime_disable(&pdev->dev);
> 
> Consider the call to unregister_netdev() unregister_netdev-
> >unregister_netdevice_queue->rollback_registered_many
> that calls the below functions which access the registers after
> pm_runtime_put_sync()
>  1) ravb_get_stats
>  2) ravb_close
> 
> Fixes: c156633f1353 ("Renesas Ethernet AVB driver proper")
> Cc: stable@vger.kernel.org
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
> Link:
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
> 
> diff --git a/drivers/net/ethernet/renesas/ravb_main.c
> b/drivers/net/ethernet/renesas/ravb_main.c
> index 33f723a9f471..b4e0fc7f65bd 100644
> --- a/drivers/net/ethernet/renesas/ravb_main.c
> +++ b/drivers/net/ethernet/renesas/ravb_main.c
> @@ -2903,12 +2903,12 @@ static int ravb_remove(struct platform_device *pdev)
>  			  priv->desc_bat_dma);
>  	/* Set reset mode */
>  	ravb_write(ndev, CCC_OPC_RESET, CCC);
> -	pm_runtime_put_sync(&pdev->dev);
>  	unregister_netdev(ndev);
>  	if (info->nc_queues)
>  		netif_napi_del(&priv->napi[RAVB_NC]);
>  	netif_napi_del(&priv->napi[RAVB_BE]);
>  	ravb_mdio_release(priv);
> +	pm_runtime_put_sync(&pdev->dev);
>  	pm_runtime_disable(&pdev->dev);
>  	reset_control_assert(priv->rstc);
>  	free_netdev(ndev);


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-01-09 10:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-04 14:16 FAILED: patch "[PATCH] ravb: Fix "failed to switch device to config mode" message" failed to apply to 4.9-stable tree gregkh
2023-01-09 10:17 ` Biju Das

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox