linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] ravb: ptp: fix misplaced ravb_ptp_stop() calling in ravb_probe()
@ 2015-12-08 18:39 Yoshihiro Kaneko
  2015-12-08 19:06 ` Sergei Shtylyov
  2015-12-09 14:20 ` Sergei Shtylyov
  0 siblings, 2 replies; 5+ messages in thread
From: Yoshihiro Kaneko @ 2015-12-08 18:39 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, Sergei Shtylyov, Simon Horman, Magnus Damm,
	linux-sh

'commit <f5d7837f96e5> ("ravb: ptp: Add CONFIG mode support")' added
a calling of ravb_ptp_stop() in a wrong place in ravb_probe().

Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
---

This patch is based on the master branch of David Miller's next networking
tree.

Compile tested only.

 drivers/net/ethernet/renesas/ravb_main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
index 1cf1226..93be519 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -1875,12 +1875,12 @@ out_napi_del:
 	netif_napi_del(&priv->napi[RAVB_BE]);
 	ravb_mdio_release(priv);
 out_dma_free:
-	dma_free_coherent(ndev->dev.parent, priv->desc_bat_size, priv->desc_bat,
-			  priv->desc_bat_dma);
-
 	/* Stop PTP Clock driver */
 	if (chip_id != RCAR_GEN2)
 		ravb_ptp_stop(ndev);
+
+	dma_free_coherent(ndev->dev.parent, priv->desc_bat_size, priv->desc_bat,
+			  priv->desc_bat_dma);
 out_release:
 	if (ndev)
 		free_netdev(ndev);
-- 
1.9.1


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

* Re: [PATCH net-next] ravb: ptp: fix misplaced ravb_ptp_stop() calling in ravb_probe()
  2015-12-08 18:39 [PATCH net-next] ravb: ptp: fix misplaced ravb_ptp_stop() calling in ravb_probe() Yoshihiro Kaneko
@ 2015-12-08 19:06 ` Sergei Shtylyov
  2015-12-09 14:20 ` Sergei Shtylyov
  1 sibling, 0 replies; 5+ messages in thread
From: Sergei Shtylyov @ 2015-12-08 19:06 UTC (permalink / raw)
  To: Yoshihiro Kaneko, netdev
  Cc: David S. Miller, Simon Horman, Magnus Damm, linux-sh

Hello.

On 12/08/2015 09:39 PM, Yoshihiro Kaneko wrote:

> 'commit <f5d7837f96e5> ("ravb: ptp: Add CONFIG mode support")' added

    Please run your patches thru scripts/checkpatch.pl -- it now enforces 
certain format of the commit citing: no need for '' and <> there.

> a calling of ravb_ptp_stop() in a wrong place in ravb_probe().
>
> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
> ---
>
> This patch is based on the master branch of David Miller's next networking
> tree.
>
> Compile tested only.
>
>   drivers/net/ethernet/renesas/ravb_main.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
> index 1cf1226..93be519 100644
> --- a/drivers/net/ethernet/renesas/ravb_main.c
> +++ b/drivers/net/ethernet/renesas/ravb_main.c
> @@ -1875,12 +1875,12 @@ out_napi_del:
>   	netif_napi_del(&priv->napi[RAVB_BE]);
>   	ravb_mdio_release(priv);
>   out_dma_free:
> -	dma_free_coherent(ndev->dev.parent, priv->desc_bat_size, priv->desc_bat,
> -			  priv->desc_bat_dma);
> -
>   	/* Stop PTP Clock driver */
>   	if (chip_id != RCAR_GEN2)
>   		ravb_ptp_stop(ndev);
> +
> +	dma_free_coherent(ndev->dev.parent, priv->desc_bat_size, priv->desc_bat,
> +			  priv->desc_bat_dma);

    This is a joke, right? Because this doesn't really change anything. ;-)
Actually, I've just looked at the code once again, and I have to take back my 
former comment about this code being misplaced -- I thought it should be under 
a different label, if not under a separate label and I was wrong.
    BUT... I think you missed some calls of ravb_ptp_{init|stop}() which are 
not necessary on gen3 SoCs. Namely, in ravb_set_ringparam() and 
ravb_tx_timeout_work()...

MBR, Sergei


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

* Re: [PATCH net-next] ravb: ptp: fix misplaced ravb_ptp_stop() calling in ravb_probe()
  2015-12-08 18:39 [PATCH net-next] ravb: ptp: fix misplaced ravb_ptp_stop() calling in ravb_probe() Yoshihiro Kaneko
  2015-12-08 19:06 ` Sergei Shtylyov
@ 2015-12-09 14:20 ` Sergei Shtylyov
  2015-12-13 15:39   ` Yoshihiro Kaneko
  1 sibling, 1 reply; 5+ messages in thread
From: Sergei Shtylyov @ 2015-12-09 14:20 UTC (permalink / raw)
  To: Yoshihiro Kaneko, netdev
  Cc: David S. Miller, Simon Horman, Magnus Damm, linux-sh

Hello.

On 12/8/2015 9:39 PM, Yoshihiro Kaneko wrote:

> 'commit <f5d7837f96e5> ("ravb: ptp: Add CONFIG mode support")' added
> a calling of ravb_ptp_stop() in a wrong place in ravb_probe().
>
> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>

    Well, this patch is good to apply anyway:

Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

MBR, Sergei


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

* Re: [PATCH net-next] ravb: ptp: fix misplaced ravb_ptp_stop() calling in ravb_probe()
  2015-12-09 14:20 ` Sergei Shtylyov
@ 2015-12-13 15:39   ` Yoshihiro Kaneko
  2015-12-13 21:10     ` Sergei Shtylyov
  0 siblings, 1 reply; 5+ messages in thread
From: Yoshihiro Kaneko @ 2015-12-13 15:39 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: netdev, David S. Miller, Simon Horman, Magnus Damm, Linux-sh list

2015-12-09 23:20 GMT+09:00 Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>:
> Hello.
>
> On 12/8/2015 9:39 PM, Yoshihiro Kaneko wrote:
>
>> 'commit <f5d7837f96e5> ("ravb: ptp: Add CONFIG mode support")' added
>> a calling of ravb_ptp_stop() in a wrong place in ravb_probe().
>>
>> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
>
>
>    Well, this patch is good to apply anyway:

I thought that the interrupt should be disabled before freeing memory.
anyway, thanks.

>
> Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>
> MBR, Sergei
>

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

* Re: [PATCH net-next] ravb: ptp: fix misplaced ravb_ptp_stop() calling in ravb_probe()
  2015-12-13 15:39   ` Yoshihiro Kaneko
@ 2015-12-13 21:10     ` Sergei Shtylyov
  0 siblings, 0 replies; 5+ messages in thread
From: Sergei Shtylyov @ 2015-12-13 21:10 UTC (permalink / raw)
  To: Yoshihiro Kaneko
  Cc: netdev, David S. Miller, Simon Horman, Magnus Damm, Linux-sh list

Hello.

On 12/13/2015 06:39 PM, Yoshihiro Kaneko wrote:

>>> 'commit <f5d7837f96e5> ("ravb: ptp: Add CONFIG mode support")' added
>>> a calling of ravb_ptp_stop() in a wrong place in ravb_probe().
>>>
>>> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
>>
>>
>>     Well, this patch is good to apply anyway:
>
> I thought that the interrupt should be disabled before freeing memory.
> anyway, thanks.

    You mean PTP interrupts?

MBR, Sergei


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

end of thread, other threads:[~2015-12-13 21:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-08 18:39 [PATCH net-next] ravb: ptp: fix misplaced ravb_ptp_stop() calling in ravb_probe() Yoshihiro Kaneko
2015-12-08 19:06 ` Sergei Shtylyov
2015-12-09 14:20 ` Sergei Shtylyov
2015-12-13 15:39   ` Yoshihiro Kaneko
2015-12-13 21:10     ` Sergei Shtylyov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).