Received: by 2002:a17:90a:bc8d:0:0:0:0 with SMTP id x13csp2414820pjr; Tue, 19 May 2020 14:49:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz16es3BOPY1lgaNAI0NTvmhnLStP8SPC91UKtqaBiVjWv9CXy8EhEI7vm3BhKdOj0ubK/N X-Received: by 2002:a17:906:6a43:: with SMTP id n3mr1107434ejs.33.1589924941723; Tue, 19 May 2020 14:49:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589924941; cv=none; d=google.com; s=arc-20160816; b=Q8BlqwFXjI35Be7jUmfXDodJv65uHKRJH5yk37yWf1MfJGu1YVmlBkGWQC/qKJ9zed BTGX/oFgms4WV/V5gTP4CTlUr1JK84muPfGqFxG4VeSOgGRadXtqjKfTxk8MDft6DQ0f DRHT8f52wiJniVgT+vOJUGf++WjvZD8zri935nk0jmNo88tNtMeArReQuMD1BrDcR95/ XafBbq4qeK6QdVim/+R9P0w3pPGcHOFOtKqqyY6Frlq8Ob8Z8HiKl3+ga2YkyLY3Sy0K XIL28TjUvlvAKvoSobKVue0Oy5b01ZK0b7hixOt+SIW11z8Nl0Tm+S/4u9oKDfJ6Ib/v wP7A== 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=TEP73QmZY7kNAhfBHbcdErJxikdMwO2seqMQqh4qNOc=; b=Hwj6MzXGA6Ntb/p175M1PPln8XOlWCKNFmH8jo/MhPo4XBrOBSMUEjAH/SIkVXc5RQ rCH+eRW3T0B+A5m5opGAYR6IhGoDYLzqV0uzCb1+VSZgbBzZwI8WPJBS+CticxAZx2Ze qlMKfOyGaPLPAWjYYdyC/IJlM9vR7Zq0n7IgaoFDQbRVACFRq1mRTmt3DZMnQfDXqPw8 EUI2A38zJ+QFU8iEMcWSvM6MbXRDv31jZxrhCS0dbNFs/9apGrbLuQ0TZCUUvGupNPWV soTsdgtPgdLR2q8P3QTjEv/Fp9nRxyyO1z7GTJKF1ZSksJIKK0f2UoGsswy1UoSYWvAb Q9WA== 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 z10si678574ejw.152.2020.05.19.14.48.38; Tue, 19 May 2020 14:49:01 -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 S1728276AbgESVq5 (ORCPT + 99 others); Tue, 19 May 2020 17:46:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728219AbgESVqx (ORCPT ); Tue, 19 May 2020 17:46:53 -0400 Received: from Galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64344C08C5C0; Tue, 19 May 2020 14:46:53 -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 1jbA3o-0002bS-13; Tue, 19 May 2020 23:46:04 +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" , netdev@vger.kernel.org Subject: [PATCH v1 03/25] net: phy: fixed_phy: Remove unused seqcount Date: Tue, 19 May 2020 23:45:25 +0200 Message-Id: <20200519214547.352050-4-a.darwish@linutronix.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519214547.352050-1-a.darwish@linutronix.de> References: <20200519214547.352050-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 | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/drivers/net/phy/fixed_phy.c b/drivers/net/phy/fixed_phy.c index 4a3d34f40cb9..f55365c9d1f7 100644 --- a/drivers/net/phy/fixed_phy.c +++ b/drivers/net/phy/fixed_phy.c @@ -34,7 +34,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 +79,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 +147,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