From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C48B6ECAAD4 for ; Tue, 30 Aug 2022 12:29:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229710AbiH3M3N (ORCPT ); Tue, 30 Aug 2022 08:29:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229477AbiH3M3M (ORCPT ); Tue, 30 Aug 2022 08:29:12 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [185.16.172.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEBE6EE4AC for ; Tue, 30 Aug 2022 05:29:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=wUipEENb5pG3AhDTYHjfqG9RcHxWGnoFkq5IutLEo1A=; b=AMKS3dyu71DQeqfvJfytGSztL1 bzuTUt6aoG0ei7Z4XI6mjAYDVLYY5mGR6mKJju4FZEfgwjja0VAnEyRCZVXVL8h/sLNkfnyF2Mvz0 QMxlFkUB1wp1bVFWnNTcVaKRPZxv3Vi27noJ58sSIUqnGJZAqYRsqGzx6N10cbPTrIpI=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1oT0Me-00F4Qv-HC; Tue, 30 Aug 2022 14:29:08 +0200 Date: Tue, 30 Aug 2022 14:29:08 +0200 From: Andrew Lunn To: =?iso-8859-1?B?Q3Pza+Fz?= Bence Cc: netdev@vger.kernel.org, Richard Cochran , "David S. Miller" , Jakub Kicinski , qiangqing.zhang@nxp.com, kernel@pengutronix.de, Marc Kleine-Budde Subject: Re: [PATCH v2] net: fec: Use unlocked timecounter reads for saving state Message-ID: References: <20220830111516.82875-1-csokas.bence@prolan.hu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220830111516.82875-1-csokas.bence@prolan.hu> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org > - fec_ptp_gettime(&fep->ptp_caps, &fep->ptp_saved_state.ts_phc); > + if (preempt_count_equals(0)) { ~/linux/drivers$ grep -r preempt_count_equals * ~/linux/drivers$ No other driver plays games like this. Why not unconditionally take the lock? Andrew