Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp561016ybg; Wed, 3 Jun 2020 07:52:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOpdHXw7ps0Wzt8X2Y7/Z/GKKPn3v3+L20h/pitBYjbvgI4QIHkhiqngiFHKJPwIQZDdBe X-Received: by 2002:aa7:c148:: with SMTP id r8mr20414901edp.108.1591195979182; Wed, 03 Jun 2020 07:52:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591195979; cv=none; d=google.com; s=arc-20160816; b=JqvCdblc9Q1/CPwUGYUyzK4TpZ1vb/Q9E83r9KLuDURxW8/J5/yJO33fQseO1DCUJ+ /qCKm43muPgh+8ABeCNqW/WIIV8CIXe+GNlSsPhBImmSAaGUZ8gvcdhGFyM8V6mNmafx QfLfTRQD88JI/ZlSyUpHYik/BuxZSdq46jPqAi49fBI+VJb+GPrf8eNRDJTL4W9TbZVr wk3bmTg+LBIRE9ZDcMTb79PfRWqB7lcZGt8iFFgWFyKSpWm0cjh95dL2Iuscb3bMPUb/ ed7ihXDfAtJqegnkE8Xj/VTV06vKZhN0M5w+B/UDjBpFZlV2CO386dtA3FvupdCWdwPJ YDGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=DDMbCC8WJBTzEXUGx2hogWyJSW4aqArFao5oFu6p53E=; b=Vbx8xbSA1ka8tI285PBMY4ke108c8sdFzsvgyRpKR9QlS3QO4ocfAahr8/MxoDeZHL YC8OngIv86gkeu0/fSrYRcEhNPKKj4ISD5Q/aZsNeAddwx0R8Q7et6F2q80i5Pfgl0X0 OAOO4vadw9X6isaPGHAXix/XHecn6ZoTU0f+VBVLdtZX0m7KmJajmqx4wr0sSV6C3Ip/ QtECX374oU5YZ86mN3l/bM2rE5lk3zvbd+3gszD3GSsF5cwgW13Mf7p75H8X1JbIeZIJ 96xZL1kS3diz9O8AwwYj3dh4p5zR3jPr1iddbRRT7rTwINcV6w07MD4OWjiK9zS4c5J+ FS+Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o16si1337391edi.177.2020.06.03.07.52.36; Wed, 03 Jun 2020 07:52:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726529AbgFCOu0 (ORCPT + 99 others); Wed, 3 Jun 2020 10:50:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726414AbgFCOuT (ORCPT ); Wed, 3 Jun 2020 10:50:19 -0400 Received: from Galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82937C08C5C0; Wed, 3 Jun 2020 07:50:19 -0700 (PDT) Received: from [5.158.153.53] (helo=debian-buster-darwi.lab.linutronix.de.) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1jgUiP-0001w5-0A; Wed, 03 Jun 2020 16:50:01 +0200 From: "Ahmed S. Darwish" To: Peter Zijlstra , Ingo Molnar , Will Deacon Cc: Thomas Gleixner , "Paul E. McKenney" , "Sebastian A. Siewior" , Steven Rostedt , LKML , "Ahmed S. Darwish" , Andrew Lunn , Florian Fainelli , Heiner Kallweit , Russell King , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org Subject: [PATCH v2 2/6] net: phy: fixed_phy: Remove unused seqcount Date: Wed, 3 Jun 2020 16:49:45 +0200 Message-Id: <20200603144949.1122421-3-a.darwish@linutronix.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200603144949.1122421-1-a.darwish@linutronix.de> References: <20200603144949.1122421-1-a.darwish@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit bf7afb29d545 ("phy: improve safety of fixed-phy MII register reading") protected the fixed PHY status with a sequence counter. Two years later, commit d2b977939b18 ("net: phy: fixed-phy: remove fixed_phy_update_state()") removed the sequence counter's write side critical section -- neutralizing its read side retry loop. Remove the unused seqcount. Signed-off-by: Ahmed S. Darwish Reviewed-by: Sebastian Andrzej Siewior --- drivers/net/phy/fixed_phy.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/drivers/net/phy/fixed_phy.c b/drivers/net/phy/fixed_phy.c index 4a3d34f40cb9..c4641b1704d6 100644 --- a/drivers/net/phy/fixed_phy.c +++ b/drivers/net/phy/fixed_phy.c @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -34,7 +33,6 @@ struct fixed_mdio_bus { struct fixed_phy { int addr; struct phy_device *phydev; - seqcount_t seqcount; struct fixed_phy_status status; bool no_carrier; int (*link_update)(struct net_device *, struct fixed_phy_status *); @@ -80,19 +78,17 @@ static int fixed_mdio_read(struct mii_bus *bus, int phy_addr, int reg_num) list_for_each_entry(fp, &fmb->phys, node) { if (fp->addr == phy_addr) { struct fixed_phy_status state; - int s; - do { - s = read_seqcount_begin(&fp->seqcount); - fp->status.link = !fp->no_carrier; - /* Issue callback if user registered it. */ - if (fp->link_update) - fp->link_update(fp->phydev->attached_dev, - &fp->status); - /* Check the GPIO for change in status */ - fixed_phy_update(fp); - state = fp->status; - } while (read_seqcount_retry(&fp->seqcount, s)); + fp->status.link = !fp->no_carrier; + + /* Issue callback if user registered it. */ + if (fp->link_update) + fp->link_update(fp->phydev->attached_dev, + &fp->status); + + /* Check the GPIO for change in status */ + fixed_phy_update(fp); + state = fp->status; return swphy_read_reg(reg_num, &state); } @@ -150,8 +146,6 @@ static int fixed_phy_add_gpiod(unsigned int irq, int phy_addr, if (!fp) return -ENOMEM; - seqcount_init(&fp->seqcount); - if (irq != PHY_POLL) fmb->mii_bus->irq[phy_addr] = irq; -- 2.20.1