Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753593AbeAIDV7 (ORCPT + 1 other); Mon, 8 Jan 2018 22:21:59 -0500 Received: from mail-bl2nam02on0087.outbound.protection.outlook.com ([104.47.38.87]:22541 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751844AbeAIDVz (ORCPT ); Mon, 8 Jan 2018 22:21:55 -0500 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; From: Yangbo Lu To: Fabio Estevam , Claudiu Manoil , Richard Cochran , , CC: Yangbo Lu Subject: [v2] net: gianfar_ptp: move set_fipers() to spinlock protecting area Date: Tue, 9 Jan 2018 11:02:33 +0800 Message-ID: <20180109030233.16013-1-yangbo.lu@nxp.com> X-Mailer: git-send-email 2.14.1 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131599416836420929;(91ab9b29-cfa4-454e-5278-08d120cd25b8);() X-Forefront-Antispam-Report: CIP:192.88.168.50;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(39380400002)(396003)(39860400002)(346002)(376002)(2980300002)(1110001)(1109001)(339900001)(189003)(199004)(2906002)(53936002)(316002)(106466001)(8936002)(105606002)(97736004)(50466002)(48376002)(77096006)(59450400001)(8656006)(85426001)(47776003)(36756003)(6666003)(81166006)(4326008)(39060400002)(51416003)(498600001)(356003)(16586007)(1076002)(2201001)(81156014)(68736007)(50226002)(305945005)(8676002)(5660300001)(86362001)(110136005)(104016004);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR03MB2698;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11FD040;1:fz9m/0pohJAv/vulUjpZ5BxC3qL1srYBmdCcx8FE1hRpWVyD8ZL5eP5SmIM962UWcVfUSe7jymr44WTUjOFY9rrHj9nzHIcAyI+SFIz1F6l6YScvfMAwKTkSLAyoU/j+ MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5e1f15ef-6d10-4b3e-f541-08d557100fa5 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(5600026)(4604075)(4534020)(4628075)(201703131517081)(2017052603307);SRVR:DM5PR03MB2698; X-Microsoft-Exchange-Diagnostics: 1;DM5PR03MB2698;3:Vj0v3eSlqoTGk2QGjrg82f1eZt4rv/f/Rfe9XZk1lQLX5KXlX2GgSbKWZox94Zb6vL8QTV374caooYgVHbYrBl9shPUolKjbokteOvkDO1qKgQTuKhFaA9toJ78cReFkTIgt9CGgE8dXJPEhm6MhQCFEthca/VnqjrynmdEhGeW3goOZ7E+7yw29/z/nF7TyikbBix4G0vv0XHxWIUV1zAPLJ8LEqdSPKMx65sBMOpzww2wCEBUlfZwNXmUEUGUmC/B4HFN1LsScL5rGBwbYPVlkmrps3yzXvQ4bmSLTVDLA9rHPSaA+USyBza+CekJDolybyBdor9FSR5l+2NHNcUUozT4HyoGdHPkQO0z4wLE=;25:Q9UlChXO5zUHSwn8R8VjKWtiJ8IJku/CdjEBGmXCuHik4gfkDglRk/Aqntceni5E9AYiVzVs9QEXKL9+rylOYbYJ4OGOCdYnz7kFVcIwON9+t4XebTEP8l/Wd8ZA+2XXzBufXlvgg4gsM6cfdv+HowqloJ1ZosQ6k5x6Q4GHVVOiynakGqPWleCZ3clnaU7qgXw/5uVwhCqwewa/kp9H+jJ44+e1PB4uJ0ER3Od5jksN6J9LkWueJ/m8+6qlSfdxDqk9GdgUhTuRFH3/yTKqKvUcJqVKI5e6nY+pEk2kUQ1lkiAj1YSTXcQ6bP1DPUlGftnOkTqAuBR0p+9YuEhgjw== X-MS-TrafficTypeDiagnostic: DM5PR03MB2698: X-Microsoft-Exchange-Diagnostics: 1;DM5PR03MB2698;31:5f6WbJ+N3iJCkLVep8ymZU4UEhBjECpmTllk98Onj7VfoYzkf90itVfnVmB5969NVD4wSi/kAQ6B7BnYh6dzJdn2NyEcdKOnOPwfBn2sk3NddPCLL+mqAGeBP2i4I7xASEY7XfJ0ZyN2KCUITr2oaoW6lnqft5xabcWrwFfM0CbDgr7KH3q3QEyIuItuPRcuqpppA7lTe1F8h1pGsWFj4dUkgSxIuKrFKeYcBjSysdI=;4:UKsx+cX+dcASqaxQ9CjduNjJ8E7HhUxEUIEXio3jtsMPxlpzGdz0eQnNbcVmxeC1GPARdbfNklQx+7wQyfW62aaua8Vywkvxbr0X0kyDIksMGs066RktenBASwOs5SOAxdiRec6yY2BwM2CZGxi3uj+y6iZk7SaE5r/wyh0DIW3/Yk6zrPftSBmFhi3yXpZ+7S3naKZVvmvD/9kGrOb2WXLvS/gJnZWKFcELs5xYEVaqLxmOHEqLXrCwUtOmJQv0w1UTsNnaxFeAUnsY3eszPUM6ZmbvbQXVy7QGBT65WhQWalFoA9JGodfAg+/tD1KE X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6095135)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231023)(944510075)(944921075)(946801075)(946901075)(6055026)(6096035)(20161123561025)(20161123556025)(20161123563025)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123559100)(20161123565025)(201708071742011);SRVR:DM5PR03MB2698;BCL:0;PCL:0;RULEID:(100000803101)(100110400095)(400006);SRVR:DM5PR03MB2698; X-Forefront-PRVS: 0547116B72 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM5PR03MB2698;23:65iiCt9wNWCiv0O/a0emjTir0bUcM3jXTMEjvbFu4?= =?us-ascii?Q?HQLmmHsiGPhnYVqDJgdVIlZ0Gil3Fl6s/PceEj+Oz4h/E4xlZY6UzUtK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bsGjEjaPHwykfj SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2018 03:21:23.4860 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5e1f15ef-6d10-4b3e-f541-08d557100fa5 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR03MB2698 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 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 --- Changes for v2: - explained why spinlock was needed in commit message. --- drivers/net/ethernet/freescale/gianfar_ptp.c | 3 +-- 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 5441142..9f8d4f8 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; } -- 1.7.1