linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: schwab@suse.de (Andreas Schwab)
To: linux-riscv@lists.infradead.org
Subject: [PATCH] net: phy: mscc: fix locking in vsc85xx_default_config
Date: Tue, 20 Nov 2018 14:48:37 +0100	[thread overview]
Message-ID: <mvma7m3n9l6.fsf_-_@suse.de> (raw)
In-Reply-To: <mvm8t1pazea.fsf@suse.de> (Andreas Schwab's message of "Mon, 19 Nov 2018 15:57:17 +0100")

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 <schwab@suse.de>
---
 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 at suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

WARNING: multiple messages have this Message-ID (diff)
From: Andreas Schwab <schwab@suse.de>
To: Quentin Schulz <quentin.schulz@bootlin.com>
Cc: andrew@lunn.ch, alexandre.belloni@bootlin.com,
	f.fainelli@gmail.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, allan.nielsen@microchip.com,
	thomas.petazzoni@bootlin.com, linux-riscv@lists.infradead.org,
	davem@davemloft.net
Subject: [PATCH] net: phy: mscc: fix locking in vsc85xx_default_config
Date: Tue, 20 Nov 2018 14:48:37 +0100	[thread overview]
Message-ID: <mvma7m3n9l6.fsf_-_@suse.de> (raw)
Message-ID: <20181120134837.pgkuQLwBDO4kPfnAnseaTtwTP-DQKbjbDA-H8-UJ74w@z> (raw)
In-Reply-To: <mvm8t1pazea.fsf@suse.de> (Andreas Schwab's message of "Mon, 19 Nov 2018 15:57:17 +0100")

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 <schwab@suse.de>
---
 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."

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  parent reply	other threads:[~2018-11-20 13:48 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20181008100728.24959-1-quentin.schulz@bootlin.com>
     [not found] ` <20181008100728.24959-2-quentin.schulz@bootlin.com>
2018-11-19 14:57   ` [PATCH net-next v3 1/6] net: phy: mscc: migrate to phy_select/restore_page functions Andreas Schwab
2018-11-19 14:57     ` Andreas Schwab
2018-11-19 15:10     ` Andrew Lunn
2018-11-19 15:10       ` Andrew Lunn
2018-11-19 15:13       ` Andreas Schwab
2018-11-19 15:13         ` Andreas Schwab
2018-11-19 15:28         ` Andrew Lunn
2018-11-19 15:28           ` Andrew Lunn
2018-11-19 15:40           ` Alexandre Belloni
2018-11-19 15:40             ` Alexandre Belloni
2018-11-19 15:50             ` Andreas Schwab
2018-11-19 15:50               ` Andreas Schwab
2018-11-19 16:12               ` Andrew Lunn
2018-11-19 16:12                 ` Andrew Lunn
2018-11-19 16:14                 ` Andreas Schwab
2018-11-19 16:14                   ` Andreas Schwab
2018-11-19 16:25                   ` Andrew Lunn
2018-11-19 16:25                     ` Andrew Lunn
2018-11-19 16:32                     ` Andreas Schwab
2018-11-19 16:32                       ` Andreas Schwab
2018-11-19 16:44                       ` Andrew Lunn
2018-11-19 16:44                         ` Andrew Lunn
2018-11-20 11:39                 ` Andreas Schwab
2018-11-20 11:39                   ` Andreas Schwab
2018-11-20 13:20                   ` Quentin Schulz
2018-11-20 13:20                     ` Quentin Schulz
2018-11-20 13:48     ` Andreas Schwab [this message]
2018-11-20 13:48       ` [PATCH] net: phy: mscc: fix locking in vsc85xx_default_config Andreas Schwab
2018-11-20 13:55       ` Quentin Schulz
2018-11-20 13:55         ` Quentin Schulz
2018-11-20 14:01         ` Andreas Schwab
2018-11-20 14:01           ` Andreas Schwab
2018-11-20 14:17           ` Quentin Schulz
2018-11-20 14:17             ` Quentin Schulz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=mvma7m3n9l6.fsf_-_@suse.de \
    --to=schwab@suse.de \
    --cc=linux-riscv@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).