]>
Commit | Line | Data |
---|---|---|
8014a082 GKH |
1 | From foo@baz Wed Feb 28 16:23:28 CET 2018 |
2 | From: Yangbo Lu <yangbo.lu@nxp.com> | |
3 | Date: Tue, 9 Jan 2018 11:02:33 +0800 | |
4 | Subject: net: gianfar_ptp: move set_fipers() to spinlock protecting area | |
5 | ||
6 | From: Yangbo Lu <yangbo.lu@nxp.com> | |
7 | ||
8 | ||
9 | [ Upstream commit 11d827a993a969c3c6ec56758ff63a44ba19b466 ] | |
10 | ||
11 | set_fipers() calling should be protected by spinlock in | |
12 | case that any interrupt breaks related registers setting | |
13 | and the function we expect. This patch is to move set_fipers() | |
14 | to spinlock protecting area in ptp_gianfar_adjtime(). | |
15 | ||
16 | Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> | |
17 | Acked-by: Richard Cochran <richardcochran@gmail.com> | |
18 | Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com> | |
19 | Signed-off-by: David S. Miller <davem@davemloft.net> | |
20 | Signed-off-by: Sasha Levin <alexander.levin@verizon.com> | |
21 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
22 | --- | |
23 | drivers/net/ethernet/freescale/gianfar_ptp.c | 3 +-- | |
24 | 1 file changed, 1 insertion(+), 2 deletions(-) | |
25 | ||
26 | --- a/drivers/net/ethernet/freescale/gianfar_ptp.c | |
27 | +++ b/drivers/net/ethernet/freescale/gianfar_ptp.c | |
28 | @@ -319,11 +319,10 @@ static int ptp_gianfar_adjtime(struct pt | |
29 | now = tmr_cnt_read(etsects); | |
30 | now += delta; | |
31 | tmr_cnt_write(etsects, now); | |
32 | + set_fipers(etsects); | |
33 | ||
34 | spin_unlock_irqrestore(&etsects->lock, flags); | |
35 | ||
36 | - set_fipers(etsects); | |
37 | - | |
38 | return 0; | |
39 | } | |
40 |