From patchwork Fri Jun 7 13:02:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Diogo Ivo X-Patchwork-Id: 13689887 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 87BDFC27C6E for ; Fri, 7 Jun 2024 13:14:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=f6+kK2riHYMqsEVetBLAcmBQW04OvAs5axqyoU915i4=; b=XsR9PPGiN+dyqc HWOKfWgtCFUL0U2imisMrbDS5jC7qXgoTzcSb0cgpr4l4JaOJperf0rdiN+G6OFQ7Nzkky0Cmr83p AtWVokuB0rUOQ4gyE+/xRJctUB94QdVLD+djqZQkZgYnkDKcCMx5f9xxpZwC2hn7wND0xW3T5C1Ip IKdJhMfEuPEHmoR+VZ0z3Asold75d1Q6Fr2ZcFK+7NIXNaR0VHi7mvPCo3EGZVq/knx95PuzV4Nov 8QCl4Ox6oyPTVnLZVb0+F1EnhRRFVracKbf9l+aRDEgQMdg1wUu0enOl87xUIniMc5ITZv/EwJbPc a20bLRcTzRG1kmJPaZKg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sFZQL-0000000E4Uj-44DR; Fri, 07 Jun 2024 13:14:29 +0000 Received: from mta-65-225.siemens.flowmailer.net ([185.136.65.225]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sFZQE-0000000E4Q8-06Vi for linux-arm-kernel@lists.infradead.org; Fri, 07 Jun 2024 13:14:23 +0000 Received: by mta-65-225.siemens.flowmailer.net with ESMTPSA id 20240607131412a649750f7bd03f2b95 for ; Fri, 07 Jun 2024 15:14:12 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm2; d=siemens.com; i=diogo.ivo@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=xLX7+CQO0TEbMXn1aOXc/7bQGueWhuMmOf9S1qPGGjk=; b=D20CPWSO8w869qairY0Y5ea1kXH2yfbUrNqtsM/k5ZxVDQfe5j1K0aJwTnkJgqeIk/YYDi XCJy1xFil/yCNVXRyOth/cYdzF+cFX4pQcKfAmRJleatBxmAlz9QBWfp0kqzeGf6rm2bdnsr K92FaLURrh1NDc0FkYTGUNraDewMc=; From: Diogo Ivo Date: Fri, 07 Jun 2024 14:02:43 +0100 Subject: [PATCH net-next v3 2/4] net: ti: icss-iep: Remove spinlock-based synchronization MIME-Version: 1.0 Message-Id: <20240607-iep-v3-2-4824224105bc@siemens.com> References: <20240607-iep-v3-0-4824224105bc@siemens.com> In-Reply-To: <20240607-iep-v3-0-4824224105bc@siemens.com> To: MD Danish Anwar , Roger Quadros , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Richard Cochran , Nishanth Menon , Vignesh Raghavendra , Tero Kristo , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jan Kiszka , Jacob Keller , Simon Horman Cc: linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Diogo Ivo X-Developer-Signature: v=1; a=ed25519-sha256; t=1717766048; l=2559; i=diogo.ivo@siemens.com; s=20240529; h=from:subject:message-id; bh=Lubo51aFliEiy57U/CSrVnSv9x7BSB7UF3Ec1ulGl4U=; b=Ilvq9R68ZKnCvFAGqplauA7xOO0uEcY3dD+RILon+Vwb7nES3d+1FW+V5FuKziyYgRngL4gjp OsIH2tJxAYeD2jvHJ8+PI4+L/As4lC4Ol/AjL/iQKEJ34cUROXSmD1R X-Developer-Key: i=diogo.ivo@siemens.com; a=ed25519; pk=BRGXhMh1q5KDlZ9y2B8SodFFY8FGupal+NMtJPwRpUQ= X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1320519:519-21489:flowmailer X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240607_061422_312510_23EEDE64 X-CRM114-Status: GOOD ( 11.01 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org As all sources of concurrency in hardware register access occur in non-interrupt context eliminate spinlock-based synchronization and rely on the mutex-based synchronization that is already present. Signed-off-by: Diogo Ivo --- drivers/net/ethernet/ti/icssg/icss_iep.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/drivers/net/ethernet/ti/icssg/icss_iep.c b/drivers/net/ethernet/ti/icssg/icss_iep.c index 3025e9c18970..1d6ccdf2583f 100644 --- a/drivers/net/ethernet/ti/icssg/icss_iep.c +++ b/drivers/net/ethernet/ti/icssg/icss_iep.c @@ -110,7 +110,6 @@ struct icss_iep { struct ptp_clock_info ptp_info; struct ptp_clock *ptp_clock; struct mutex ptp_clk_mutex; /* PHC access serializer */ - spinlock_t irq_lock; /* CMP IRQ vs icss_iep_ptp_enable access */ u32 def_inc; s16 slow_cmp_inc; u32 slow_cmp_count; @@ -199,7 +198,6 @@ static void icss_iep_settime(struct icss_iep *iep, u64 ns) return; } - spin_lock_irqsave(&iep->irq_lock, flags); if (iep->pps_enabled || iep->perout_enabled) writel(0, iep->base + iep->plat_data->reg_offs[ICSS_IEP_SYNC_CTRL_REG]); @@ -210,7 +208,6 @@ static void icss_iep_settime(struct icss_iep *iep, u64 ns) writel(IEP_SYNC_CTRL_SYNC_N_EN(0) | IEP_SYNC_CTRL_SYNC_EN, iep->base + iep->plat_data->reg_offs[ICSS_IEP_SYNC_CTRL_REG]); } - spin_unlock_irqrestore(&iep->irq_lock, flags); } /** @@ -559,11 +556,9 @@ static int icss_iep_perout_enable(struct icss_iep *iep, if (iep->perout_enabled == !!on) goto exit; - spin_lock_irqsave(&iep->irq_lock, flags); ret = icss_iep_perout_enable_hw(iep, req, on); if (!ret) iep->perout_enabled = !!on; - spin_unlock_irqrestore(&iep->irq_lock, flags); exit: mutex_unlock(&iep->ptp_clk_mutex); @@ -589,8 +584,6 @@ static int icss_iep_pps_enable(struct icss_iep *iep, int on) if (iep->pps_enabled == !!on) goto exit; - spin_lock_irqsave(&iep->irq_lock, flags); - rq.perout.index = 0; if (on) { ns = icss_iep_gettime(iep, NULL); @@ -607,8 +600,6 @@ static int icss_iep_pps_enable(struct icss_iep *iep, int on) if (!ret) iep->pps_enabled = !!on; - spin_unlock_irqrestore(&iep->irq_lock, flags); - exit: mutex_unlock(&iep->ptp_clk_mutex); @@ -853,7 +844,6 @@ static int icss_iep_probe(struct platform_device *pdev) iep->ptp_info = icss_iep_ptp_info; mutex_init(&iep->ptp_clk_mutex); - spin_lock_init(&iep->irq_lock); dev_set_drvdata(dev, iep); icss_iep_disable(iep);