summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYangbo Lu <yangbo.lu@nxp.com>2018-01-09 11:02:33 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-03-03 10:24:37 +0100
commit83d9e9c211fe885d03e9acb425be3cf55c1d3bd8 (patch)
treec7920e1796e703541835eb6296d86cb5f2dffdb5
parent00c840f3b51cda42a3c48fa4067c4fa2091cdbcc (diff)
downloadlinux-exynos-83d9e9c211fe885d03e9acb425be3cf55c1d3bd8.tar.gz
linux-exynos-83d9e9c211fe885d03e9acb425be3cf55c1d3bd8.tar.bz2
linux-exynos-83d9e9c211fe885d03e9acb425be3cf55c1d3bd8.zip
net: gianfar_ptp: move set_fipers() to spinlock protecting area
[ Upstream commit 11d827a993a969c3c6ec56758ff63a44ba19b466 ] set_fipers() calling should be protected by spinlock in case that any interrupt breaks related registers setting and the function we expect. This patch is to move set_fipers() to spinlock protecting area in ptp_gianfar_adjtime(). Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> Acked-by: Richard Cochran <richardcochran@gmail.com> Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/net/ethernet/freescale/gianfar_ptp.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/ethernet/freescale/gianfar_ptp.c b/drivers/net/ethernet/freescale/gianfar_ptp.c
index 544114281ea7..9f8d4f8e57e3 100644
--- a/drivers/net/ethernet/freescale/gianfar_ptp.c
+++ b/drivers/net/ethernet/freescale/gianfar_ptp.c
@@ -319,11 +319,10 @@ static int ptp_gianfar_adjtime(struct ptp_clock_info *ptp, s64 delta)
now = tmr_cnt_read(etsects);
now += delta;
tmr_cnt_write(etsects, now);
+ set_fipers(etsects);
spin_unlock_irqrestore(&etsects->lock, flags);
- set_fipers(etsects);
-
return 0;
}