Commit 2c59e993 authored by Yoshihiro Shimoda's avatar Yoshihiro Shimoda Committed by David S. Miller
Browse files

net: renesas: rswitch: Fix GWTSDIE register handling



Since the GWCA has the TX timestamp feature, this driver
should not disable it if one of ports is opened. So, fix it.

Reported-by: default avatarPhong Hoang <phong.hoang.wz@renesas.com>
Fixes: 33f5d733 ("net: renesas: rswitch: Improve TX timestamp accuracy")
Signed-off-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e05bb97d
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -1441,8 +1441,11 @@ static int rswitch_open(struct net_device *ndev)
	rswitch_enadis_data_irq(rdev->priv, rdev->tx_queue->index, true);
	rswitch_enadis_data_irq(rdev->priv, rdev->rx_queue->index, true);

	if (bitmap_empty(rdev->priv->opened_ports, RSWITCH_NUM_PORTS))
		iowrite32(GWCA_TS_IRQ_BIT, rdev->priv->addr + GWTSDIE);

	bitmap_set(rdev->priv->opened_ports, rdev->port, 1);

	return 0;
};

@@ -1452,7 +1455,9 @@ static int rswitch_stop(struct net_device *ndev)
	struct rswitch_gwca_ts_info *ts_info, *ts_info2;

	netif_tx_stop_all_queues(ndev);
	bitmap_clear(rdev->priv->opened_ports, rdev->port, 1);

	if (bitmap_empty(rdev->priv->opened_ports, RSWITCH_NUM_PORTS))
		iowrite32(GWCA_TS_IRQ_BIT, rdev->priv->addr + GWTSDID);

	list_for_each_entry_safe(ts_info, ts_info2, &rdev->priv->gwca.ts_info_list, list) {
+1 −0
Original line number Diff line number Diff line
@@ -998,6 +998,7 @@ struct rswitch_private {
	struct rcar_gen4_ptp_private *ptp_priv;

	struct rswitch_device *rdev[RSWITCH_NUM_PORTS];
	DECLARE_BITMAP(opened_ports, RSWITCH_NUM_PORTS);

	struct rswitch_gwca gwca;
	struct rswitch_etha etha[RSWITCH_NUM_PORTS];