Return-Path: Received: from mail-bl2nam02on0091.outbound.protection.outlook.com ([104.47.38.91]:39758 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753589AbeBCSHa (ORCPT ); Sat, 3 Feb 2018 13:07:30 -0500 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Yangbo Lu , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL for 3.18 24/24] net: gianfar_ptp: move set_fipers() to spinlock protecting area Date: Sat, 3 Feb 2018 18:05:11 +0000 Message-ID: <20180203180444.10801-24-alexander.levin@microsoft.com> References: <20180203180444.10801-1-alexander.levin@microsoft.com> In-Reply-To: <20180203180444.10801-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Yangbo Lu [ 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 Acked-by: Richard Cochran Reviewed-by: Fabio Estevam Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/freescale/gianfar_ptp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/freescale/gianfar_ptp.c b/drivers/net/eth= ernet/freescale/gianfar_ptp.c index bb568006f37d..503991823551 100644 --- a/drivers/net/ethernet/freescale/gianfar_ptp.c +++ b/drivers/net/ethernet/freescale/gianfar_ptp.c @@ -314,11 +314,10 @@ static int ptp_gianfar_adjtime(struct ptp_clock_info = *ptp, s64 delta) now =3D tmr_cnt_read(etsects); now +=3D delta; tmr_cnt_write(etsects, now); + set_fipers(etsects); =20 spin_unlock_irqrestore(&etsects->lock, flags); =20 - set_fipers(etsects); - return 0; } =20 --=20 2.11.0