From patchwork Mon May 13 06:41:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kunihiko Hayashi X-Patchwork-Id: 164002 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp962362ili; Sun, 12 May 2019 23:42:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqwJ1brBw/Fj0xtQqqArNgM10G/McG5+7r9ivIo1hm0CNbJmdCokOHARhf32ohU5YwcKWNp1 X-Received: by 2002:a17:902:6b03:: with SMTP id o3mr28050005plk.85.1557729753609; Sun, 12 May 2019 23:42:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557729753; cv=none; d=google.com; s=arc-20160816; b=E7wy9JYHonnv0u8xrM9BrYxWLh8fz38tGOx00Du4SGJH9yJ7GovPlH2nO/3eF6IAb9 /mjymUhkhoUQXJtvXU57wiQ6RN91udSitLE6527AJ5EpnmwCaZBSwWzjY2102eHxmf1J fFHP00fH9jzWLgTANKutxTgOrzHtIXN1O/tKR+jGLOxtf9iXpFmtitYsnqSW6+UtYuZ9 6/KcAUGrjArU9DaScyqGslZq4AhOnCyAbCV1luFk9EfH89U7kvwrI7Gf/s+3SM7jEOO3 nU7siTkv04BaxQ8NmVwHdOTORu7XPg3tc7eyEXxOMJ8vP/1nlEKCdOaOGwZ2pqVb+snB p/3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=4VJvfzEwQMK0LA+lqC9cbecQyyVZ5T+bTiAtaYXwRWk=; b=xMzAXiRK70OWP1Pnul3bLo4k/VxWUV+dhi6ecTxOA/j/CZ1Y/po3dy6+diexGvwoVh TNTAgRuK76JHHOyxYrbl803C7PEDB3xmh/M+qe8xkXGiNJmWyjoytpAgXoOdWTmM9hEY DHhBie90fk4VE37aZludl3tC5klv6HNqnv+epWx/ywslxDBJsI+MFAIg2w9xgySYD/EO jXFaiuvxzcQu7Bg2QvjO4pfrqrec6WPHR6SSzIAo0+dWE+k63wrTn2yrVI/IDWbm9t4D eJmf//gjSk/yZpcX3LC+axFxu9uH+lJZ5iZK2yaULk16py10V2sxpKlK9lOio60c5umk OGJA== 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 k184si14281416pge.82.2019.05.12.23.42.33; Sun, 12 May 2019 23:42:33 -0700 (PDT) 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 S1727502AbfEMGmc (ORCPT + 30 others); Mon, 13 May 2019 02:42:32 -0400 Received: from mx.socionext.com ([202.248.49.38]:3119 "EHLO mx.socionext.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726103AbfEMGmb (ORCPT ); Mon, 13 May 2019 02:42:31 -0400 Received: from unknown (HELO kinkan-ex.css.socionext.com) ([172.31.9.52]) by mx.socionext.com with ESMTP; 13 May 2019 15:42:30 +0900 Received: from mail.mfilter.local (m-filter-1 [10.213.24.61]) by kinkan-ex.css.socionext.com (Postfix) with ESMTP id 42C3C180C09; Mon, 13 May 2019 15:42:30 +0900 (JST) Received: from 172.31.9.51 (172.31.9.51) by m-FILTER with ESMTP; Mon, 13 May 2019 15:42:30 +0900 Received: from plum.e01.socionext.com (unknown [10.213.132.32]) by kinkan.css.socionext.com (Postfix) with ESMTP id ED7291A10F1; Mon, 13 May 2019 15:42:28 +0900 (JST) From: Kunihiko Hayashi To: Andrew Lunn , Florian Fainelli , Heiner Kallweit , "David S. Miller" Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Kunihiko Hayashi Subject: [PATCH net] net: phy: realtek: Replace phy functions with non-locked version in rtl8211e_config_init() Date: Mon, 13 May 2019 15:41:45 +0900 Message-Id: <1557729705-6443-1-git-send-email-hayashi.kunihiko@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org After calling phy_select_page() and until calling phy_restore_page(), the mutex 'mdio_lock' is already locked, so the driver should use non-locked version of phy functions. Or there will be a deadlock with 'mdio_lock'. This replaces phy functions called from rtl8211e_config_init() to avoid the deadlock issue. Fixes: f81dadbcf7fd ("net: phy: realtek: Add rtl8211e rx/tx delays config") Signed-off-by: Kunihiko Hayashi --- drivers/net/phy/realtek.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.7.4 Reviewed-by: Andrew Lunn diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c index e1f7a60..61fc76f 100644 --- a/drivers/net/phy/realtek.c +++ b/drivers/net/phy/realtek.c @@ -233,12 +233,12 @@ static int rtl8211e_config_init(struct phy_device *phydev) if (oldpage < 0) goto err_restore_page; - ret = phy_write(phydev, RTL821x_EXT_PAGE_SELECT, 0xa4); + ret = __phy_write(phydev, RTL821x_EXT_PAGE_SELECT, 0xa4); if (ret) goto err_restore_page; - ret = phy_modify(phydev, 0x1c, RTL8211E_TX_DELAY | RTL8211E_RX_DELAY, - val); + ret = __phy_modify(phydev, 0x1c, RTL8211E_TX_DELAY | RTL8211E_RX_DELAY, + val); err_restore_page: return phy_restore_page(phydev, oldpage, ret);