Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp708004imu; Tue, 20 Nov 2018 05:49:34 -0800 (PST) X-Google-Smtp-Source: AFSGD/XuVXIoO/FexbMwZCP5B4KxIMDOTBx6BWLZbL8lcR9vNGjzbOq7F7+Bnsst+rme5K0cxolk X-Received: by 2002:a65:5bc4:: with SMTP id o4mr1981059pgr.426.1542721774003; Tue, 20 Nov 2018 05:49:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542721773; cv=none; d=google.com; s=arc-20160816; b=XjDAA0faTuxLvb8/2QtKIUCOWfB3AS/12k6MXWvbauytMk8tipf27JPtqbjWi/bE3l wFNKWpyoxpmfyiq1lAs+QGjeM3dQWnU5+nUGwy0aDyVvS9rb+YJ19A8eoOw9Ng93lYkJ wwh7UOpyEI2BPI+rN9FtG6OVOh2WOJlvZ/Mr2Nd7weQBkXYBNsjcp8otw1MzNQe7d6r2 Y4A3a17QnA4k7DHg8Is93pnldQDc9dHxGZIEro8BKxFHwaH+j5iAbdE4jHyv6A2NV3YQ yjR4R88oFxn1znT7JpZ9QsIvQSpoepK1Wo3/4HSe8Iw21xWH9NElW1l5UPOT/iEvZnqh 47aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from; bh=2aDgQmmAki+1b6QuHGOOpLmZzJGNea2i3A2I+I8X+Ss=; b=I0duJ9egBoupikf1aODP15BMhoiLp+gFNyLkz1Dtr5gOoUy40lqHp2KWg+sYJMgUAR jIcjlZwSruEaf+exvCWwLagTnBV8DiTLitWedhCGEn1lLtpyUZgP8Ar8z1yrTqQJD6cM kebcddErUmrxz8nLKyxcQYNBThBqe1vqKhujK+YeKLmTgCMeUHBji+sxVq+5Yh5Qqsp1 ae26hmK/E7PGJjgwkCyWKgGmOqJtSnu26wZYy/rO3sTmM9mKDvMx8C1kE83dSjGt7krZ +EyM9alyDx0UQu1npqweJweOrBwTe4fufEknubu9qUxIDjL3VXW1s4C9Sp2aeQkz+kBs 9zug== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l81si13382408pfj.230.2018.11.20.05.49.18; Tue, 20 Nov 2018 05:49:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728292AbeKUARy (ORCPT + 99 others); Tue, 20 Nov 2018 19:17:54 -0500 Received: from mx2.suse.de ([195.135.220.15]:55028 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726119AbeKUARy (ORCPT ); Tue, 20 Nov 2018 19:17:54 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 6FACDAFE5; Tue, 20 Nov 2018 13:48:38 +0000 (UTC) From: Andreas Schwab To: Quentin Schulz Cc: davem@davemloft.net, andrew@lunn.ch, f.fainelli@gmail.com, allan.nielsen@microchip.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, thomas.petazzoni@bootlin.com, alexandre.belloni@bootlin.com, linux-riscv@lists.infradead.org Subject: [PATCH] net: phy: mscc: fix locking in vsc85xx_default_config References: <20181008100728.24959-1-quentin.schulz@bootlin.com> <20181008100728.24959-2-quentin.schulz@bootlin.com> X-Yow: Did you GAIN WEIGHT in th' past 5 MINUTES or am I just DREAMING of two BROCCOLI FLORETS lying in an empty GAS TANK? Date: Tue, 20 Nov 2018 14:48:37 +0100 In-Reply-To: (Andreas Schwab's message of "Mon, 19 Nov 2018 15:57:17 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Don't use locking phy_read/phy_write functions while inside phy_select_patch/phy_restore_page region. Fixes: 6a0bfbbe20 ("net: phy: mscc: migrate to phy_select/restore_page functions") Signed-off-by: Andreas Schwab --- drivers/net/phy/mscc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/phy/mscc.c b/drivers/net/phy/mscc.c index a2e59f4f6f..a398ab9410 100644 --- a/drivers/net/phy/mscc.c +++ b/drivers/net/phy/mscc.c @@ -814,10 +814,10 @@ static int vsc85xx_default_config(struct phy_device *phydev) if (rc < 0) goto out_unlock; - reg_val = phy_read(phydev, MSCC_PHY_RGMII_CNTL); + reg_val = __phy_read(phydev, MSCC_PHY_RGMII_CNTL); reg_val &= ~(RGMII_RX_CLK_DELAY_MASK); reg_val |= (RGMII_RX_CLK_DELAY_1_1_NS << RGMII_RX_CLK_DELAY_POS); - phy_write(phydev, MSCC_PHY_RGMII_CNTL, reg_val); + __phy_write(phydev, MSCC_PHY_RGMII_CNTL, reg_val); out_unlock: rc = phy_restore_page(phydev, rc, rc > 0 ? 0 : rc); -- 2.19.1 -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."