From patchwork Mon Jun 22 09:37:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 11617791 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D225F14E3 for ; Mon, 22 Jun 2020 13:48:34 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 992B92070E for ; Mon, 22 Jun 2020 13:48:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="GR23VZP4"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="vDHVRs97"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="JohkqRDO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 992B92070E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=QuHKbY1j0U/2c/Q8Zc3OOPz4MTV2a6RNO+TtZrVJJSQ=; b=GR23VZP42po7YH0mjtReGUiY+ a66AXg1dPMouXwynKSrAu4nCi+d3x7qKBt5/f5eggi8mfpE7sO7SBVyJW+bwbkvMCo3/WZeRvN40s F09QtNAMojFCn+HOf5z6TeESeapU72Bjn2IBjUyqRHsbvl0/hfpHsZQymKCnw7+w4G3CiMMDxFFPR oRKQzINqUx/97zyhFTrPEBUR6vYag+kEKnHG16aqW4+xNAYt+2mxg0A1MBQCWvgFYABhIlRCrLxvD ssWRyKhsyHMPUGsH8hmxHsJra330S6g7mQPGgrt6I5cdblDwIRbXZrVtS8rbrat5tI0xmR7NAvn/8 eJn1V9mHQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnMoK-0002Hb-3Y; Mon, 22 Jun 2020 13:48:32 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnLxy-00056R-Cc for linux-mediatek@merlin.infradead.org; Mon, 22 Jun 2020 12:54:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=jZFWs1jjiaVnSG438fJkY7s38xrX7YeHfB9snWv0f6M=; b=vDHVRs97aT3EdypwJo5Jfg+Jt2 612zywnbJPcBMcppfMm3+aQKYGQ8kpTojp4CGgV398sLl9rpkkrIdCHr+rvE/pKzk3mzDc3SjXVzo PxKbP5WtbQBsJiCytXdjNAh9ZX9frr+vNs1RymQ7dID5fxjTn3lFY8lXizBGwH8KolFNSmmWySxVk I1/1KS8gLnbVVM73dKoqzV14x0YNRTj9H+VthuMx46NYfDzU9iZG6sKHTDZqaXyn9C+pN880RpKbz VEjwGyq4Fg2F6rG77FwJpMOSsVIEqU/ZkVS9ESkFkL2FU8I8wGb2ItntVCojFVhTWevBwIc3awdYI cW3YMAIA==; Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnIxI-000496-0q for linux-mediatek@lists.infradead.org; Mon, 22 Jun 2020 09:41:35 +0000 Received: by mail-wm1-x343.google.com with SMTP id t194so15022680wmt.4 for ; Mon, 22 Jun 2020 02:41:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jZFWs1jjiaVnSG438fJkY7s38xrX7YeHfB9snWv0f6M=; b=JohkqRDOkStLwOQBjn7GAxxxqeMmpsJpexC5Nvm3ZMZvZkzc6ARClZYDLYdCfBzdNP R+QJVrGl3nve0LVt+ru6aBGSu24D+tdHE1WXHHZuvA5Ccg3nHihCl36U5ScPUL7gEh57 udVFjmWNOm6E0bczq/erJCZqK+GBkdblmTaRS2wxUujd7J+4fpcSfkvXc70p5jeaQvh0 r7uqyKqpQR2LYCzlfV/PSR3Z3SvvEaicHAEj11kmaMKkCWH4prC3PqUu8JFXFO7jY4OE 2ZItHe0laJ0Lf9dSzMlvGGUIslglMGg/vMwUmi0/DI2fZnDGPbhyK9nizsa0eDmyC4EL qmEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jZFWs1jjiaVnSG438fJkY7s38xrX7YeHfB9snWv0f6M=; b=q7IlUwXjU2APZRry9nU3/ILWzNy7/gKwQ8LZf6aZlpv2ngy9/P0vvG9r/zZGmXwPy2 sDXyRz9Bol0q79U8EICdi7Gp5DifUOMDHYzgOYNbkVDPxtO44UczKoPw3S6/Tf4XWyOy anQyE90VspuXarwSLqrZyJhTf8Y07DjeJvspaY39+493aqcc/JwISG/0XBYwRHAM9V+g UYN6C4nGFhG2rkgMjs0+666IWhhRa+rr+S6xkHAKN4ZXN/FNPjrvHj5PIP4X6Xp1Omc2 uYXnJiDHbvGyM6u8EcHQ0irXCaRtpdTryywhq4WEEWqoMPbI73lWT+lKR4g4KMppUk1U snAg== X-Gm-Message-State: AOAM532PoE+mZZF7FDJOQ2E+XW5BQT4IUdxQaEX6ms8KvipT/tN0Lpv1 m0PBd3DhXZQB4OWckpUz0uP1Ow== X-Google-Smtp-Source: ABdhPJyC1ihQ/cFNQCt/b68/kb0LNRNlp3xUizgD1UJeHr9htbQzK5ESNt14EIs0DoIuJdIEW8DsUQ== X-Received: by 2002:a05:600c:2294:: with SMTP id 20mr18307854wmf.51.1592818883659; Mon, 22 Jun 2020 02:41:23 -0700 (PDT) Received: from localhost.localdomain (lfbn-nic-1-65-232.w2-15.abo.wanadoo.fr. [2.15.156.232]) by smtp.gmail.com with ESMTPSA id j24sm14392652wrd.43.2020.06.22.02.41.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 02:41:23 -0700 (PDT) From: Bartosz Golaszewski To: Andrew Lunn , Florian Fainelli , Heiner Kallweit , Russell King , "David S . Miller" , Jakub Kicinski , Rob Herring , Matthias Brugger , Microchip Linux Driver Support , Vladimir Oltean , Claudiu Manoil , Alexandre Belloni , Vivien Didelot , Tom Lendacky , Yisen Zhuang , Salil Mehta , Jassi Brar , Ilias Apalodimas , Iyappan Subramanian , Keyur Chudgar , Quan Nguyen , Frank Rowand , Philipp Zabel , Liam Girdwood , Mark Brown Subject: [PATCH 01/15] net: phy: arrange headers in mdio_bus.c alphabetically Date: Mon, 22 Jun 2020 11:37:30 +0200 Message-Id: <20200622093744.13685-2-brgl@bgdev.pl> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200622093744.13685-1-brgl@bgdev.pl> References: <20200622093744.13685-1-brgl@bgdev.pl> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200622_104132_181757_091E7FFF X-CRM114-Status: GOOD ( 11.82 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-1.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:343 listed in] [list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Stephane Le Provost , Bartosz Golaszewski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Fabien Parent , linux-mediatek@lists.infradead.org, Andrew Perepech , Pedro Tsai , linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org From: Bartosz Golaszewski Keeping the headers in alphabetical order is better for readability and allows to easily see if given header is already included. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli --- drivers/net/phy/mdio_bus.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index 6ceee82b2839..296cf9771483 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c @@ -8,32 +8,32 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt -#include -#include -#include -#include -#include -#include -#include #include #include +#include +#include +#include #include #include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include #include -#include -#include +#include +#include #include #include +#include #include -#include -#include -#include -#include -#include -#include +#include #include +#include #define CREATE_TRACE_POINTS #include From patchwork Mon Jun 22 09:37:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 11617675 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 176536C1 for ; Mon, 22 Jun 2020 13:14:25 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E341F2068F for ; Mon, 22 Jun 2020 13:14:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="n8cTSgRD"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="IuzgQw1o"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="SP7AoO6j" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E341F2068F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=KIKbcLv0HixmfhZcrJGSFjYV6qyHilHDlW4SPu1ruko=; b=n8cTSgRDDOwsUKpUAJHdupPub 62v8vaXa9tS0+Ybgd3e6LYX6zdHiHi+7oH6c8872BodFUgMSbLaac3I0VYKymV1Dog56M1PmUTfNF R2cBOV/jjnkHZ5tMPTK5M9QilY01qtwQgVXnct9yuRuF3PH2pxE7IEvLHD5IVxkeAurDx9fRQjW1w A26wbYvLjprYaRZlvwntTAIAU8EFMF94/cM37V9mikYxO3cdCf062h6wNmh402g2w5w6X0UMdBIwg bL+txQzHc+8QKfFPgGb+kjp612JNGl+JPg6ra6j4hb/vTNHyCr+aTSeCFRliZzBAllaWB0n0heeHa YCXh4giFQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnMHH-0004Mm-Dc; Mon, 22 Jun 2020 13:14:23 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnLvl-0004C8-20 for linux-mediatek@merlin.infradead.org; Mon, 22 Jun 2020 12:52:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=bqh6HxDlaYo+eDyI7otJcwguVt4xZOU026/4uSBRTYc=; b=IuzgQw1ohmJiMBRuQitwtmJGba TA1Zh+78jhnwlst7iYV1DZtUWtWapr5o8WS1MpZ4C1XKsCkue4WBrTc4Q1u+tdg/jKQKb8WEQaOpy eOJryqE/llrwp1xdXZObRxUj57UZgjloBGF5a7hry0UclShdPcS2vQnqb/j9EMpdCXpOZDl+iXPJ/ H6N/VvOrMzPreEBt2p+LoNA7PwUkKRX8mNklYnjpo6InwHPeXUje1dpfzL307x3QtvLPp3IObV7Mr 8KzVpTjM03Op8Z4hPrC5kgyJma1/Yf0+cp9KgqBj2sHbBw8q0D2Jhpt0+i3EwLeWQcQQkOfaF24Gr iNGju7aA==; Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnIxi-0004Bp-Hd for linux-mediatek@lists.infradead.org; Mon, 22 Jun 2020 09:42:00 +0000 Received: by mail-wm1-x343.google.com with SMTP id g75so6113983wme.5 for ; Mon, 22 Jun 2020 02:41:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bqh6HxDlaYo+eDyI7otJcwguVt4xZOU026/4uSBRTYc=; b=SP7AoO6jktrfliyzCx/xTv9Acl8xJ9sY7iCwKrfwfyNggXkndAn+GiE89e2CakhX93 EtFpneu7Irbs7xZzUb0hX6BSHQi3UozkzhV+p6SQq9kyi9aHVpBp5CBCwNTmulsZslat S7C/Z8dksydKPXBjvs5GBreCNnBfxtAnumAazOf9/1wvwfZCe7m8JALCSbuOLvoF5Rou xBK1gJiM8i95SvZeb+tQiaOslV7j4IZb68JOC/jIisPOWeaDQtMQzPIITSrjs4DzZlJ8 MzF704Nbnte2Zw7NGj8nJyLAt5+AEeIUcZgDNWKDwvTp1MOa2y3CoFw3Vypbd5fd3vFk FLZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bqh6HxDlaYo+eDyI7otJcwguVt4xZOU026/4uSBRTYc=; b=UVXKk1j/oVUVEhpSDfbAgkXylXMpygu9Bgu/rXy8Bnj0MwfCPrc5uKPtPc0K2VxUM8 ptRAMx67ZleOiOVw5+L+ecfzQnH0ZTf0y5TfnXWxs371aX8XD2TQ+0Ps7mzFpWK2wH6i YrI5XtTv0uno/KUu3CmW/Gi3oqQuI9x5+K6GeXn5MudDEe7DZhTDvJ/3JYnTso4Ihv98 ooTKmn3GqyIRubCPH65zYsWhEfCv3aHaPZE0sJ8R3DtZ8f0+qg6VPHTrw6TuG2Hppmnk ZLCeZ2DKsEbAWDX35hIOgfHI3nkpx55FY7rgKqIAsUUtmMh5RadDZFfFI4EBiNkoHwSf 1vvQ== X-Gm-Message-State: AOAM532lFXs+lbSOHLLEJJNr5X/dDxggxXTPQavy+kwqmR+TkVfp+Byj lU8goq9yxdZVQGupNMcsQr8Gmg== X-Google-Smtp-Source: ABdhPJxp7i5US20/aRii1o/KsIXINrL2pr4jmYkXOUQGOXKf71p0QdlmezcpuamEmuUdwfDNh3u4dA== X-Received: by 2002:a1c:a3c5:: with SMTP id m188mr17121192wme.152.1592818885393; Mon, 22 Jun 2020 02:41:25 -0700 (PDT) Received: from localhost.localdomain (lfbn-nic-1-65-232.w2-15.abo.wanadoo.fr. [2.15.156.232]) by smtp.gmail.com with ESMTPSA id j24sm14392652wrd.43.2020.06.22.02.41.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 02:41:24 -0700 (PDT) From: Bartosz Golaszewski To: Andrew Lunn , Florian Fainelli , Heiner Kallweit , Russell King , "David S . Miller" , Jakub Kicinski , Rob Herring , Matthias Brugger , Microchip Linux Driver Support , Vladimir Oltean , Claudiu Manoil , Alexandre Belloni , Vivien Didelot , Tom Lendacky , Yisen Zhuang , Salil Mehta , Jassi Brar , Ilias Apalodimas , Iyappan Subramanian , Keyur Chudgar , Quan Nguyen , Frank Rowand , Philipp Zabel , Liam Girdwood , Mark Brown Subject: [PATCH 02/15] net: phy: arrange headers in mdio_device.c alphabetically Date: Mon, 22 Jun 2020 11:37:31 +0200 Message-Id: <20200622093744.13685-3-brgl@bgdev.pl> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200622093744.13685-1-brgl@bgdev.pl> References: <20200622093744.13685-1-brgl@bgdev.pl> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200622_104158_685746_E7628294 X-CRM114-Status: GOOD ( 13.99 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-1.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:343 listed in] [list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Stephane Le Provost , Bartosz Golaszewski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Fabien Parent , linux-mediatek@lists.infradead.org, Andrew Perepech , Pedro Tsai , linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org From: Bartosz Golaszewski Keeping the headers in alphabetical order is better for readability and allows to easily see if given header is already included. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli --- drivers/net/phy/mdio_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/phy/mdio_device.c b/drivers/net/phy/mdio_device.c index c1d345c3cab3..f60443e48622 100644 --- a/drivers/net/phy/mdio_device.c +++ b/drivers/net/phy/mdio_device.c @@ -6,6 +6,7 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt +#include #include #include #include @@ -20,7 +21,6 @@ #include #include #include -#include void mdio_device_free(struct mdio_device *mdiodev) { From patchwork Mon Jun 22 09:37:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 11617773 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A930F138C for ; Mon, 22 Jun 2020 13:43:11 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7EAE620679 for ; Mon, 22 Jun 2020 13:43:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="aCecRB7a"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="cLdsLnzN"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="2GosbQAa" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7EAE620679 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=lvF5w7MYXBEgKx0ZpVeCjz95jFPZiAdscBkQkohNGFE=; b=aCecRB7aIoqVoH3rds0Tbgxsy 3t3D1uRCoC6jcTVfDXXypUaSf2PPkoYejymifvR9Au1IqtZDfgp5nZU538k/r/Ng+VD1LESZvHNoC Je86ezcFNqpXgHPGNfzQog7vnV/bSxgRYrjvlyxn9sSH7HGUVuUdVG9O9euVPWC7q2jks8mPfbQoh pPClZt7jOlqVQSx56L3JXReVNR2n4YkQJcI8TX8k+PJKGRnIAg0d2OLsZzIpAaRxr6kMtsAlIglHO RQ9B66XrdNug1gBAnv0buAW4SgrBs6LwVp/OleymUOjq+nZrxP+E9KiB36/eUqLdC2j9ip61iodJ9 U/0n4jcvw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnMj5-0007iH-IG; Mon, 22 Jun 2020 13:43:07 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnLxV-0004vO-S2 for linux-mediatek@merlin.infradead.org; Mon, 22 Jun 2020 12:53:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=XLmPOYVdaqe+y9UvFG8JqfkTSyC/6Nk+DJj6OjGJzDQ=; b=cLdsLnzN+TZT4JExvsYp1w714z Yo1BrE/Djl73jT62EZ1xWWl3Z1/G64cfoHlBOJuBJ3DNolSPcmP3Yv61FQ0uuAI5izk7uFAys0q8b XWbzKtj/+IwoWjaVSGyCONl47IAw7gfn6XBMm+r2qVeiajgX1PBfsi4Bq14k135DDh+MDux7mh2mQ osSRodu3iUENFl3LxkGyKMzgHMfCoxdLLFiHeASEe94k3WGWyDxQClUyla1MMhnqNK8VhLHQPRsv1 RNjfE4vLQVXAyEI7IVGCf1l0WhtoNQNdJl2x0l9MgAHa88gQfBHrdDdW0dh752oHM9CdAZudbd8it O5Yt1Kew==; Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnIyB-0004D1-RU for linux-mediatek@lists.infradead.org; Mon, 22 Jun 2020 09:42:30 +0000 Received: by mail-wm1-x343.google.com with SMTP id r9so14206009wmh.2 for ; Mon, 22 Jun 2020 02:42:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XLmPOYVdaqe+y9UvFG8JqfkTSyC/6Nk+DJj6OjGJzDQ=; b=2GosbQAaXiA/JCZI+g11JdzSxLyfN527ZSvaJacFgJHvRnRrhvLEPiWmyJFet6DLEb hARZd6Itp8Ly0hWe26lMW947wIjwj7XUtHNewIkPpHDfvslkT6iaZRGzwVc1+AdkfN9E 77J7zDnRp2cYGiifSFx4PYoShheiwsluJXswRLqt8WCuWUWb6Embtw6Z9mU9W3xNZj5+ FkCtTAjDmKfNu78ysMk7zie06INp6h4obBSJsjUfKcugxIeYOlBAJsbCB32uIVigpa55 H1TopXYcKvoxi2/iyqbeMnFO353y8FNqh6Aqq/dcIb9ZhBcMg37bYYwmNiEdTQ26X7wA iCKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XLmPOYVdaqe+y9UvFG8JqfkTSyC/6Nk+DJj6OjGJzDQ=; b=FS3u4c8JV7B0ChO5mTUUlFCPiEblGXp6BltiaapnbE8lMo7iOPYSUKLceaHbjQyySq 3aIB0H9ys5CsDbgfB0TBz6hx0+BE1QvoI3aJYRVRvPkEaf/zB3ENL91xRlpRDSG0JPEI tZ1QUxa34b04lVJRjxzbvkzq7DgilnM3PUaZbo1jCD4WLS2YxJXO/ca0ueakQcx0Azai jB4H/97LNn+SJh4GztDDsfPGjauyl9RS7L7GjtMigPRN0g/3O9t/SLasUae+gnyU7Yc7 L+3obfzNJk/xLCo8e6a30P+oDUwg0Y/u3QPIAYO6dTC97jcORT/68geel+G1qfzZwgoU fYGg== X-Gm-Message-State: AOAM5310i+EwpL219XAF2ebfiHyPVM3XIzra8W6vcuZmAoGAX2+AF6Zl gPnG9ilpctFXDXD3NPm3ZIBhDA== X-Google-Smtp-Source: ABdhPJzDaXbcIaH5nH0mryMVoe9yjbkPdBB2oGScnXDu1GQppXU4cUVJs6lCaQVoAVfhbUhW/QgYFw== X-Received: by 2002:a1c:f204:: with SMTP id s4mr18359072wmc.159.1592818887262; Mon, 22 Jun 2020 02:41:27 -0700 (PDT) Received: from localhost.localdomain (lfbn-nic-1-65-232.w2-15.abo.wanadoo.fr. [2.15.156.232]) by smtp.gmail.com with ESMTPSA id j24sm14392652wrd.43.2020.06.22.02.41.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 02:41:26 -0700 (PDT) From: Bartosz Golaszewski To: Andrew Lunn , Florian Fainelli , Heiner Kallweit , Russell King , "David S . Miller" , Jakub Kicinski , Rob Herring , Matthias Brugger , Microchip Linux Driver Support , Vladimir Oltean , Claudiu Manoil , Alexandre Belloni , Vivien Didelot , Tom Lendacky , Yisen Zhuang , Salil Mehta , Jassi Brar , Ilias Apalodimas , Iyappan Subramanian , Keyur Chudgar , Quan Nguyen , Frank Rowand , Philipp Zabel , Liam Girdwood , Mark Brown Subject: [PATCH 03/15] net: phy: arrange headers in phy_device.c alphabetically Date: Mon, 22 Jun 2020 11:37:32 +0200 Message-Id: <20200622093744.13685-4-brgl@bgdev.pl> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200622093744.13685-1-brgl@bgdev.pl> References: <20200622093744.13685-1-brgl@bgdev.pl> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200622_104228_021081_F0F4DC9F X-CRM114-Status: GOOD ( 11.74 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-1.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:343 listed in] [list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Stephane Le Provost , Bartosz Golaszewski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Fabien Parent , linux-mediatek@lists.infradead.org, Andrew Perepech , Pedro Tsai , linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org From: Bartosz Golaszewski Keeping the headers in alphabetical order is better for readability and allows to easily see if given header is already included. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli --- drivers/net/phy/phy_device.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 04946de74fa0..1b4df12c70ad 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -9,28 +9,28 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt -#include -#include -#include -#include -#include -#include -#include +#include #include -#include +#include #include -#include +#include +#include +#include +#include +#include +#include +#include #include #include -#include -#include -#include +#include #include #include #include -#include -#include +#include +#include +#include #include +#include MODULE_DESCRIPTION("PHY library"); MODULE_AUTHOR("Andy Fleming"); From patchwork Mon Jun 22 09:37:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 11619381 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 91EB0912 for ; Mon, 22 Jun 2020 23:38:14 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6BA0F20720 for ; Mon, 22 Jun 2020 23:38:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="KgnQKxzI"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="JaPBL52s" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6BA0F20720 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=YI6jznCHx6As0lQIsvyRbBvN6Qr6lhdUMGUDfkD7TlM=; b=KgnQKxzIjap86m//+TyRgIr7V j9v9XZAnf0PU3PVX2Pr9dovVclqhz89+N18xVqm6H+//T2BdKvXm7rlXXu/dE4jY/ZrAJMje2ng1W YXNNu2wL/eQYNG8NJJSn07YnE2c9DgXfd8cEMAoguRvH4nR0U1EUtmAfcmcbGMiX24cbCQESdDKFK FJLHdyB3hBnPpvForkqzZs61e0T5AmlnXH0sYsj+Cp4huVtYov01xLf0/EzXKE3sDh2RCLGZAJ++a L08BhuO7Vd39/I46UHrt38IddR66AT/x58CGNkqdWJGue7y1O4J3rMYz/XgoY+QoOOgNM2ew2FPf2 L+yL4X83g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnW0y-0008Jq-4m; Mon, 22 Jun 2020 23:38:12 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnIyE-0007iV-87 for linux-mediatek@lists.infradead.org; Mon, 22 Jun 2020 09:42:31 +0000 Received: by mail-wr1-x442.google.com with SMTP id b6so15932443wrs.11 for ; Mon, 22 Jun 2020 02:42:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mOzBIeRVdsbICiHu3pBzNsfTlUAFWbCE1cSbRbG1tJ8=; b=JaPBL52s4sikmFvHY2AeWFMdnIt4op0dMdw+2FQiSixTq4d3+bBSRsdwR810I4r17W Dc1Sq8XgKmuI3/9qeQSaRigNEUtgpr3V54J04DIfxrMUrogAvx9GOjtxzTIREfdMQfH/ ZIoRTVgzdEw7FUgW+wJfkmEOOAhCW69U1CPS7FhzT/GuIAsc5CiRXTTEG/mAZov3cV1/ Kw2v4DduJlhcgiBk0rJIlyn1FmnjOS6Kg1a7IMwNMqUETbLfpnIxgx6hHvx4LD/zZ23w MiFdp3RuROPF6Vz8gGOhgj1XQ/lErO7eajC9HU+kNQCI4qgh6cJgSRDclHcQ/M0Q+ZK0 akZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mOzBIeRVdsbICiHu3pBzNsfTlUAFWbCE1cSbRbG1tJ8=; b=YiAathWjd/TImbaeUvj/TxmR0mriNOMl5HUlFe9YqrJ9i0pN06WgGXrLLtxjW6JfjF i+Gt6jtgSL2+Yn9yYEZL77yOyBt6SmpBLpfxjwkRlVxi0tR1/0AFrniRMEcuwn/dqiBg N/uSRjc1u1CubaEo0LW/stuzNKD6VD+8db0E1IsqJQSjGNdy+1aqPicezVBM6iqjReL6 gpQep08x88R4QKnoXBZApr5a2sx3jyoqzH7FEoVQvBOyxk0km694n9x0LcDowj1uvCv0 +Pd5agrpd5iha86c0mKABZI1RZbZHqIXAtZUuWhKQojSWJzmjO3nL32NUGEfJtyhpa3m IYGw== X-Gm-Message-State: AOAM531gM9581O0dO7qtvbI0XzLGdCy7aJ60FhtHhZtF66CZq840Tpdc KAoGZNQr7EHrN1Xl2rgvd484Zw== X-Google-Smtp-Source: ABdhPJxEiAeVa66A6smNF2oImo2X8TfJpMFC5Ia7rzUA6Mu5ujbCfk8T+XkaVik5JQL7C6EsJsyEww== X-Received: by 2002:adf:f608:: with SMTP id t8mr3023154wrp.308.1592818889179; Mon, 22 Jun 2020 02:41:29 -0700 (PDT) Received: from localhost.localdomain (lfbn-nic-1-65-232.w2-15.abo.wanadoo.fr. [2.15.156.232]) by smtp.gmail.com with ESMTPSA id j24sm14392652wrd.43.2020.06.22.02.41.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 02:41:28 -0700 (PDT) From: Bartosz Golaszewski To: Andrew Lunn , Florian Fainelli , Heiner Kallweit , Russell King , "David S . Miller" , Jakub Kicinski , Rob Herring , Matthias Brugger , Microchip Linux Driver Support , Vladimir Oltean , Claudiu Manoil , Alexandre Belloni , Vivien Didelot , Tom Lendacky , Yisen Zhuang , Salil Mehta , Jassi Brar , Ilias Apalodimas , Iyappan Subramanian , Keyur Chudgar , Quan Nguyen , Frank Rowand , Philipp Zabel , Liam Girdwood , Mark Brown Subject: [PATCH 04/15] net: mdio: add a forward declaration for reset_control to mdio.h Date: Mon, 22 Jun 2020 11:37:33 +0200 Message-Id: <20200622093744.13685-5-brgl@bgdev.pl> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200622093744.13685-1-brgl@bgdev.pl> References: <20200622093744.13685-1-brgl@bgdev.pl> MIME-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:442 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Stephane Le Provost , Bartosz Golaszewski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Fabien Parent , linux-mediatek@lists.infradead.org, Andrew Perepech , Pedro Tsai , linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org From: Bartosz Golaszewski This header refers to struct reset_control but doesn't include any reset header. The structure definition is probably somehow indirectly pulled in since no warnings are reported but for the sake of correctness add the forward declaration for struct reset_control. Signed-off-by: Bartosz Golaszewski --- include/linux/mdio.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/mdio.h b/include/linux/mdio.h index 36d2e0673d03..9ac5e7ff6156 100644 --- a/include/linux/mdio.h +++ b/include/linux/mdio.h @@ -17,6 +17,7 @@ #define MII_REGADDR_C45_MASK GENMASK(15, 0) struct gpio_desc; +struct reset_control; struct mii_bus; /* Multiple levels of nesting are possible. However typically this is From patchwork Mon Jun 22 09:37:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 11618087 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A41C613B1 for ; Mon, 22 Jun 2020 15:09:17 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7C3BF20656 for ; Mon, 22 Jun 2020 15:09:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="3l25tyCh"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="A2nZUOgn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7C3BF20656 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=HwXChY8WTrNzZVfDEDyTZX1QIfFvrUG6CMzpn2SRsl0=; b=3l25tyChU0G8P5aQAocSIsOYq lEmplmjlMErtQfcs/NbJHF42B/gpiwfALx3/fnz5BC1m8j8hFXGMbgrI1PeXYwQX+G9elQ0cC+vbW aZNe5eb5M5og9H5NZCXdcsXhHVDD4/exrddT1Uxjk0Wu1cfXsaTwTPVWw69uBxefcfo7eMVVArcNm x6TLItCnpwubHN2TLjpfgwwuOJQuv11a/Kdawc4L0hCNFY/2xCkNZ2o0XLdggYb8XYYEn4Tj2WBxo lEykLo4tR/oPIxLz0VbcAl1OtbrfUsbuDQIUaSBZVt3zRdDnHaYg0IyHtYYUU0kIQLb4xQxMaV8ra W3P23AgOw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnO4S-0005L1-TE; Mon, 22 Jun 2020 15:09:16 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnIyF-0007ia-Qu for linux-mediatek@lists.infradead.org; Mon, 22 Jun 2020 09:42:32 +0000 Received: by mail-wr1-x444.google.com with SMTP id g18so6882132wrm.2 for ; Mon, 22 Jun 2020 02:42:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cfUc+TkUAgqz9MdoL32AGr8CBlEvrLInm5v62775Pps=; b=A2nZUOgnmx1UP+ORv6aiykQQt+lLSQ1KO7Odnx9nMWmPGWBB/9zwG2qDldAgXJmqFF xP5a4eGOadOLgU5l8x7N7j9+z2XQcTH/rFKkU1WWhZmJmVhXF2hTLLfHyQ5etAtMHKmX GzjJGiUtKBqAj3ZO+9U33Aqe6H7sc3uFms0oEry7uZGxugnSgJBjckjsDuq2/0a7BeEq I4qul8QuxKe+CEztgYEFZDIF1pwVYkuHKS4ZkApg+YQ/TcNclWYBEankibn6cVK3MPY7 ZU+9DUlAqUZCkiO9dP4Q1H37N9frUcXcUiOti5AX0YjukaK8I91Rvini9mJsIrmoYDWK Og9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cfUc+TkUAgqz9MdoL32AGr8CBlEvrLInm5v62775Pps=; b=Lb5Ik6LsS4beLh15aGqVwWLy9v5JF/3rZAGr02JtThRdI4JxzwX9l89Jc4UwCJjxip 9F2vPWHwpOc4MzCnXkHwB8C/zIUjRalDrJtYQBduDqbTphZdvGY4LYunrVaNUNZQQ8sU 7Iv6jnaCZgWu6XnOrB+pPzx/ZUlYQoY6cREvatq7pab2TB3bnemSkxLeA8GppgkJwX/K 1tXS1VlvbE6PQKeFjubMUdqQZY1+JgDkZiWyhC2/e3f88zh6LoeDHSkVZZ+nAiIk2Chs UgIVpPeUPK0PNQJVEl8X29mCEmCTFXde1SnvkxBJ7Ac8B0hxdhys6/WEvK5GkGkImgxr CqFA== X-Gm-Message-State: AOAM531wSaLJnbcqGNR1sUgf7kNQ+sBexmV53GzPLVO4Ag59cF0EA7iQ sWjJcyNesCCQQhtY7Bgh33UJnQ== X-Google-Smtp-Source: ABdhPJzkmYuQpu0uNoygH8mU35nl1Z6nB3WJ2gtz2NCWG24AiJQNaa6UhDtUjU6DEUC2R04sQUctyQ== X-Received: by 2002:a5d:470a:: with SMTP id y10mr5777035wrq.405.1592818890889; Mon, 22 Jun 2020 02:41:30 -0700 (PDT) Received: from localhost.localdomain (lfbn-nic-1-65-232.w2-15.abo.wanadoo.fr. [2.15.156.232]) by smtp.gmail.com with ESMTPSA id j24sm14392652wrd.43.2020.06.22.02.41.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 02:41:30 -0700 (PDT) From: Bartosz Golaszewski To: Andrew Lunn , Florian Fainelli , Heiner Kallweit , Russell King , "David S . Miller" , Jakub Kicinski , Rob Herring , Matthias Brugger , Microchip Linux Driver Support , Vladimir Oltean , Claudiu Manoil , Alexandre Belloni , Vivien Didelot , Tom Lendacky , Yisen Zhuang , Salil Mehta , Jassi Brar , Ilias Apalodimas , Iyappan Subramanian , Keyur Chudgar , Quan Nguyen , Frank Rowand , Philipp Zabel , Liam Girdwood , Mark Brown Subject: [PATCH 05/15] net: phy: reset the PHY even if probe() is not implemented Date: Mon, 22 Jun 2020 11:37:34 +0200 Message-Id: <20200622093744.13685-6-brgl@bgdev.pl> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200622093744.13685-1-brgl@bgdev.pl> References: <20200622093744.13685-1-brgl@bgdev.pl> MIME-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:444 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Stephane Le Provost , Bartosz Golaszewski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Fabien Parent , linux-mediatek@lists.infradead.org, Andrew Perepech , Pedro Tsai , linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org From: Bartosz Golaszewski Currently we only call phy_device_reset() if the PHY driver implements the probe() callback. This is not mandatory and many drivers (e.g. realtek) don't need probe() for most devices but still can have reset GPIOs defined. There's no reason to depend on the presence of probe() here so pull the reset code out of the if clause. Signed-off-by: Bartosz Golaszewski --- drivers/net/phy/phy_device.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 1b4df12c70ad..f6985db08340 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -2690,16 +2690,13 @@ static int phy_probe(struct device *dev) mutex_lock(&phydev->lock); - if (phydev->drv->probe) { - /* Deassert the reset signal */ - phy_device_reset(phydev, 0); + /* Deassert the reset signal */ + phy_device_reset(phydev, 0); + if (phydev->drv->probe) { err = phydev->drv->probe(phydev); - if (err) { - /* Assert the reset signal */ - phy_device_reset(phydev, 1); + if (err) goto out; - } } /* Start out supporting everything. Eventually, @@ -2761,6 +2758,10 @@ static int phy_probe(struct device *dev) phydev->state = PHY_READY; out: + /* Assert the reset signal */ + if (err) + phy_device_reset(phydev, 1); + mutex_unlock(&phydev->lock); return err; @@ -2779,12 +2780,12 @@ static int phy_remove(struct device *dev) sfp_bus_del_upstream(phydev->sfp_bus); phydev->sfp_bus = NULL; - if (phydev->drv && phydev->drv->remove) { + if (phydev->drv && phydev->drv->remove) phydev->drv->remove(phydev); - /* Assert the reset signal */ - phy_device_reset(phydev, 1); - } + /* Assert the reset signal */ + phy_device_reset(phydev, 1); + phydev->drv = NULL; return 0; From patchwork Mon Jun 22 09:37:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 11617655 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9DB6190 for ; Mon, 22 Jun 2020 13:03:15 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 455A82073E for ; Mon, 22 Jun 2020 13:03:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ExTsD5wX"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="oGuKlwah"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="swtzTFmL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 455A82073E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=4s/4koyeeSeD29fQqNtcXvUBLycm0SBfMCNgwkRrzgk=; b=ExTsD5wX4TNlXTt52w8vJSMHg 9ltGLp2Z+2Kbk4CeSaxzCbjop8Ci2nju4hEQJ+M1aA5cAAj9jB+3zGRkFzTFI9USnaWDWovHKMon5 3r9gYFi78PI36oVaEhzLecM22eg+SAYd6JsM3C3HFuOEDluhothZHW3kIk6PvHA4fHprmAKborKeN TtC5BkvrnFuS5FqiepHQ/HBIjP6E9PhOkCKnaFq60di+bff3w1eFhaxyZ6oubs/bDYsTOPVdI9IsV TFAQ2mvttDMj2IW2W52OCUWefJRrp3bzrfzyHSpMJgukGnQmn0vZXMEu9BG7nyLtcdpgL3lFLPpmW 0C1/k9b0w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnM6Q-0008IN-2I; Mon, 22 Jun 2020 13:03:10 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnLth-0003AJ-TN for linux-mediatek@merlin.infradead.org; Mon, 22 Jun 2020 12:50:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=nC0F5ZT+Ll5OOGkPAd3mIJIStND0frPBkptlTCmDLJg=; b=oGuKlwahMGoP2SXP2S9fZqcXUW tGAH48dqxA1qmrMY7j983/D1AetazT0pF0OC5FGhmPiECLaTMuazYn8+FFQHCR7ZQF120BHNaBj37 qXmjOorPOpFxwK3+24tuhM3YLJOdnvQEG8ALZSlrpHvNPw0B6pcC5BHMKorkqF98uBfLrhEfTd5qd 1ixYLz9zT6ikhchnhdXt8wtqtd/3YpSacbrcqEyUenM/xIQx9Fl4fg538orrOo2NN9o81L5qqj3Ds GcikfdZiRJKbvFGxzRvUwgX0I3pjI/gM5MXPa9SMVJEUUNgaxyMzB9KEzNZyJILFTPRSmaDFz6CyM jt70uGDw==; Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnIxK-00049e-6D for linux-mediatek@lists.infradead.org; Mon, 22 Jun 2020 09:41:38 +0000 Received: by mail-wr1-x443.google.com with SMTP id l11so15971559wru.0 for ; Mon, 22 Jun 2020 02:41:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nC0F5ZT+Ll5OOGkPAd3mIJIStND0frPBkptlTCmDLJg=; b=swtzTFmLVIWLX97Ka8BE4T1dWXPt5l1jiTgEty4wbnCrweWQw3HbeTXNza6y2qcCXR iIu5WIxWbsQs51WOv19l2MOnnx9biFYV7/MbY0YMlQ/cSE0G+PyDXwmHvUYyHhrnNdUq xAHqSoVXMheRLlPuN1KpgliIQIXbuBOHq+PCzME+TGn0K+/URvl99z5NPSrgSbWHtdpH 2XLpBaTp7Jhs4GFXZGq+gopioO0XNjhy5k4P+p0oSTll4HgmIBiAnRFMRF6aTZi4O2og vYAAkHtdQXctioWsdumoNSuMfzhqraPeWT6gTazq92hFSwkJkMSYyr7hlCsjXk1eVqPx 7WHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nC0F5ZT+Ll5OOGkPAd3mIJIStND0frPBkptlTCmDLJg=; b=qD5Z6nZ32H5IO1RA9M8q/XsWBkFEYw02jPmAA6KXkNRMW+Rz0yYUooCqIWcczdIMwu kUQdvRhz3NKdcm+coea7dDju6l+A0nRCVf0o9gru+eaVqXIEqqs5ro6I5/BewInDaRTO OADpSnNI1PWtaYAZf4fjDyC2p7Jf9lAQy6Yf9bjVt33iLu7CdJJU7RHWRBDweBZp5zJy 0HtitLTjRyNXyJg/rw2X8u13QL680WYaDbzRrIN+i/NX/i0YUnMW4H29LbdAuAE6hkOx WN9g90+JX1KHekPD0s7gs7+R1vO/LSRbSc4EHG6a/7iyw3F0Wegy41J1zyD6zgpgo6rD paNg== X-Gm-Message-State: AOAM532aRkBrBrH6ib2OA1r2AlwHUaZLmuqRGqvtJh7g3uxV4L1sAf64 6c7jbuPGUSWIkH19+C8akBQDbQ== X-Google-Smtp-Source: ABdhPJzxHCym+Ub6CuSXGJUTfH6gp7OLN1NQWcaww2Sg2sQLihShVVzipPqZpx45p1tV4dBze4Q9ew== X-Received: by 2002:a5d:6802:: with SMTP id w2mr18207943wru.68.1592818892680; Mon, 22 Jun 2020 02:41:32 -0700 (PDT) Received: from localhost.localdomain (lfbn-nic-1-65-232.w2-15.abo.wanadoo.fr. [2.15.156.232]) by smtp.gmail.com with ESMTPSA id j24sm14392652wrd.43.2020.06.22.02.41.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 02:41:32 -0700 (PDT) From: Bartosz Golaszewski To: Andrew Lunn , Florian Fainelli , Heiner Kallweit , Russell King , "David S . Miller" , Jakub Kicinski , Rob Herring , Matthias Brugger , Microchip Linux Driver Support , Vladimir Oltean , Claudiu Manoil , Alexandre Belloni , Vivien Didelot , Tom Lendacky , Yisen Zhuang , Salil Mehta , Jassi Brar , Ilias Apalodimas , Iyappan Subramanian , Keyur Chudgar , Quan Nguyen , Frank Rowand , Philipp Zabel , Liam Girdwood , Mark Brown Subject: [PATCH 06/15] net: phy: mdio: reset MDIO devices even if probe() is not implemented Date: Mon, 22 Jun 2020 11:37:35 +0200 Message-Id: <20200622093744.13685-7-brgl@bgdev.pl> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200622093744.13685-1-brgl@bgdev.pl> References: <20200622093744.13685-1-brgl@bgdev.pl> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200622_104134_714890_2A3226F7 X-CRM114-Status: GOOD ( 15.89 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-1.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:443 listed in] [list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Stephane Le Provost , Bartosz Golaszewski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Fabien Parent , linux-mediatek@lists.infradead.org, Andrew Perepech , Pedro Tsai , linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org From: Bartosz Golaszewski Similarily to PHY drivers - there's no reason to require probe() to be implemented in order to call mdio_device_reset(). MDIO devices can have resets defined without needing to do anything in probe(). Signed-off-by: Bartosz Golaszewski Reviewed-by: Andrew Lunn --- drivers/net/phy/mdio_device.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/net/phy/mdio_device.c b/drivers/net/phy/mdio_device.c index f60443e48622..be615504b829 100644 --- a/drivers/net/phy/mdio_device.c +++ b/drivers/net/phy/mdio_device.c @@ -150,10 +150,10 @@ static int mdio_probe(struct device *dev) struct mdio_driver *mdiodrv = to_mdio_driver(drv); int err = 0; - if (mdiodrv->probe) { - /* Deassert the reset signal */ - mdio_device_reset(mdiodev, 0); + /* Deassert the reset signal */ + mdio_device_reset(mdiodev, 0); + if (mdiodrv->probe) { err = mdiodrv->probe(mdiodev); if (err) { /* Assert the reset signal */ @@ -170,12 +170,11 @@ static int mdio_remove(struct device *dev) struct device_driver *drv = mdiodev->dev.driver; struct mdio_driver *mdiodrv = to_mdio_driver(drv); - if (mdiodrv->remove) { + if (mdiodrv->remove) mdiodrv->remove(mdiodev); - /* Assert the reset signal */ - mdio_device_reset(mdiodev, 1); - } + /* Assert the reset signal */ + mdio_device_reset(mdiodev, 1); return 0; } From patchwork Mon Jun 22 09:37:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 11617609 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 79E09912 for ; Mon, 22 Jun 2020 12:40:39 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 500EC20720 for ; Mon, 22 Jun 2020 12:40:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="WaIMQA1q"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="vYGC7/p8"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="A0YsIPLN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 500EC20720 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=UNqCHd+vpdgi6qR1/3mjO971KDRFpzQ9bk9/PMyXQXw=; b=WaIMQA1q/V646AngK/VGpdZLZ xx8fWN6JQVmQT0/9bgauBQ+u18KCdptPW90Hu81Li9f4Q5tvkxemFCZzoQpkmdP7M7FE6a/uod+NG HNvo804yM1Gj4n+x4n9s/4k4WtGPUeWm1CKxGX1Zg/m+D1S1BY0oUsFPdmzqC9yGNk0JwGOXm527+ JHiV7gbiVvQv2/St01AVgGBHW51B78kpfmSkv804m9wy8UvWLNEGeuoSjA03TyAHJ8tDJu22xKyhF 0d4nCWrWF9N2mdh14Mu/7i36JRHnfMQgMCpMXwiAgzMpEOJv+1hO9qH5wTQutdezRuwrkGjPhQWJa wkAns5d6w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnLkc-0006WG-HT; Mon, 22 Jun 2020 12:40:38 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnLkJ-0006ML-NJ for linux-mediatek@merlin.infradead.org; Mon, 22 Jun 2020 12:40:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=GfxRtzTQEG/5B2vcAI0+WR3x7R55kmvGCSrvKLTEK2Q=; b=vYGC7/p80Yht8yCLAa5U0t88BD GwtfVjopG0ZazFTc7TJZTjGJvK3qa0MvVYhSlcSp9U9+jPaUH7uKFlXgFOcid0RavIIkXVseRoJzJ /nqTj5e08ya8SZ1PP0eREnKOKSnORxIf9E9/6qzB6ZBSGBg2GeDoe0oSi/0/BLqQ+NgzU9ul+Rfcc cywbMatSp4/0syXFkkoowJR8D1GiDnuWudguRvRWYdOe6X1NaIA5CPIg9uvjlpXW9FKYEDD8+/O+O Vy42MUJ5X28ICN2uuRLQfEId9J7bmVZ0HVZRzdZtdf2Nw//KnCteGepmmYtrc07CEG16td2YXbPTH 9NBKM6Uw==; Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnIxr-0004CP-OH for linux-mediatek@lists.infradead.org; Mon, 22 Jun 2020 09:42:10 +0000 Received: by mail-wr1-x441.google.com with SMTP id q5so3552750wru.6 for ; Mon, 22 Jun 2020 02:42:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GfxRtzTQEG/5B2vcAI0+WR3x7R55kmvGCSrvKLTEK2Q=; b=A0YsIPLNyYjq0ssEvXKicqSfckLBHv0GVryALC9d+AV98+m0KCKKpxY0AwyeTaC/SV 4ewNSwSYjUQsP4yxHm8UWF9gryWmZ5NreLHL6eNRWjMmIjJRCWiNutTjs4Dj5nQbR/al xKYExJnhmZzF3ijNBmLN0+9cPyr9XfVrG4iIqj5hbRDxQ5onbhon50y62e0SSGhWhkuw rmocxlBQDpuSpCL4KghX633TaDScTSjnEqyd5R5g43WJlC81zN4EIN3Bn8mQId8I8MeF 8+2wsc96b1npN8idQoXobDeawhU/GfrNBYEANPkdYosOat1y3XLGX18/UsW4P4z0HqDS YNGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GfxRtzTQEG/5B2vcAI0+WR3x7R55kmvGCSrvKLTEK2Q=; b=l/az6JMLJjitjNw4Ilg7fc+lW2cEuThTKR9alNsngCBGxUcOvfChfE+n7S8oHMzbXJ e6uwgV3dh8qMKTzfieShivp584E4pM7rs38PBlvHolRaYcXDg7ZxGXk934pTtJikAkHx gPrT1q1VfCxK8zce0LQrq/hjNr8Ju9GBosn4uChcF4UKbii6S4unMgn6kLqUtYVIab4P uV0ywzUuqty39REg85lRzxopMM3jkwzgDdsI8Tpob7E28D1uyJhVzzTIcA++21D8g7Sr 1SlBlwyaUC1Owq1l+kGE8L1iIdiG7zSnNaCWpviuM9RfeeKXOdc2WdlQLkgGvAtM3CQw hGUg== X-Gm-Message-State: AOAM530ykMDuuAH2aqbH6Adj6rUctCHqWkkPWcg3kM0aRiY1RFAVQ06j gfbPZsj/xtinM+qNA9Y+orSh3w== X-Google-Smtp-Source: ABdhPJwe0PlqLfQqK/nfnfTmRDAPWRDDBJzvm26MZsgDYSHOQIM+GwOvMWfHdMQjezh7QNqFssNhEA== X-Received: by 2002:a5d:4bd2:: with SMTP id l18mr400661wrt.119.1592818894547; Mon, 22 Jun 2020 02:41:34 -0700 (PDT) Received: from localhost.localdomain (lfbn-nic-1-65-232.w2-15.abo.wanadoo.fr. [2.15.156.232]) by smtp.gmail.com with ESMTPSA id j24sm14392652wrd.43.2020.06.22.02.41.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 02:41:34 -0700 (PDT) From: Bartosz Golaszewski To: Andrew Lunn , Florian Fainelli , Heiner Kallweit , Russell King , "David S . Miller" , Jakub Kicinski , Rob Herring , Matthias Brugger , Microchip Linux Driver Support , Vladimir Oltean , Claudiu Manoil , Alexandre Belloni , Vivien Didelot , Tom Lendacky , Yisen Zhuang , Salil Mehta , Jassi Brar , Ilias Apalodimas , Iyappan Subramanian , Keyur Chudgar , Quan Nguyen , Frank Rowand , Philipp Zabel , Liam Girdwood , Mark Brown Subject: [PATCH 07/15] net: phy: split out the PHY driver request out of phy_device_create() Date: Mon, 22 Jun 2020 11:37:36 +0200 Message-Id: <20200622093744.13685-8-brgl@bgdev.pl> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200622093744.13685-1-brgl@bgdev.pl> References: <20200622093744.13685-1-brgl@bgdev.pl> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200622_104207_945126_CE3A5138 X-CRM114-Status: GOOD ( 22.39 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-1.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:441 listed in] [list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Stephane Le Provost , Bartosz Golaszewski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Fabien Parent , linux-mediatek@lists.infradead.org, Andrew Perepech , Pedro Tsai , linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org From: Bartosz Golaszewski Move the code requesting the PHY driver module out of phy_device_create() into a separate helper. This will be later reused when we delay the module loading. Signed-off-by: Bartosz Golaszewski --- drivers/net/phy/phy_device.c | 71 ++++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 32 deletions(-) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index f6985db08340..8037a9663a85 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -558,7 +558,7 @@ static const struct device_type mdio_bus_phy_type = { .pm = MDIO_BUS_PHY_PM_OPS, }; -static int phy_request_driver_module(struct phy_device *dev, u32 phy_id) +static int phy_do_request_driver_module(struct phy_device *dev, u32 phy_id) { int ret; @@ -578,6 +578,40 @@ static int phy_request_driver_module(struct phy_device *dev, u32 phy_id) return 0; } +static int phy_request_driver_module(struct phy_device *phydev) +{ + int ret; + + /* Request the appropriate module unconditionally; don't + * bother trying to do so only if it isn't already loaded, + * because that gets complicated. A hotplug event would have + * done an unconditional modprobe anyway. + * We don't do normal hotplug because it won't work for MDIO + * -- because it relies on the device staying around for long + * enough for the driver to get loaded. With MDIO, the NIC + * driver will get bored and give up as soon as it finds that + * there's no driver _already_ loaded. + */ + if (phydev->is_c45) { + const int num_ids = ARRAY_SIZE(phydev->c45_ids.device_ids); + int i; + + for (i = 1; i < num_ids; i++) { + if (phydev->c45_ids.device_ids[i] == 0xffffffff) + continue; + + ret = phy_do_request_driver_module(phydev, + phydev->c45_ids.device_ids[i]); + if (ret) + break; + } + } else { + ret = phy_do_request_driver_module(phydev, phydev->phy_id); + } + + return ret; +} + struct phy_device *phy_device_create(struct mii_bus *bus, int addr, u32 phy_id, bool is_c45, struct phy_c45_device_ids *c45_ids) @@ -622,38 +656,11 @@ struct phy_device *phy_device_create(struct mii_bus *bus, int addr, u32 phy_id, mutex_init(&dev->lock); INIT_DELAYED_WORK(&dev->state_queue, phy_state_machine); + device_initialize(&mdiodev->dev); - /* Request the appropriate module unconditionally; don't - * bother trying to do so only if it isn't already loaded, - * because that gets complicated. A hotplug event would have - * done an unconditional modprobe anyway. - * We don't do normal hotplug because it won't work for MDIO - * -- because it relies on the device staying around for long - * enough for the driver to get loaded. With MDIO, the NIC - * driver will get bored and give up as soon as it finds that - * there's no driver _already_ loaded. - */ - if (is_c45 && c45_ids) { - const int num_ids = ARRAY_SIZE(c45_ids->device_ids); - int i; - - for (i = 1; i < num_ids; i++) { - if (c45_ids->device_ids[i] == 0xffffffff) - continue; - - ret = phy_request_driver_module(dev, - c45_ids->device_ids[i]); - if (ret) - break; - } - } else { - ret = phy_request_driver_module(dev, phy_id); - } - - if (!ret) { - device_initialize(&mdiodev->dev); - } else { - kfree(dev); + ret = phy_request_driver_module(dev); + if (ret) { + phy_device_free(dev); dev = ERR_PTR(ret); } From patchwork Mon Jun 22 09:37:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 11618077 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9B87B161F for ; Mon, 22 Jun 2020 14:57:11 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 643FF20708 for ; Mon, 22 Jun 2020 14:57:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="mOSxDX/Q"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="UtNEe+Y7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 643FF20708 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=zsOhIgoDWorWuDMnTzrP2lCey1rxBQNaddhkaruJzFY=; b=mOSxDX/QW7RlRtqL2wpKmBL5g dm0FbfQoScUMdbiVAcpP7IItD7q1gPp8OjQosZ5VmIiklS8OSkweKB3BJrF1MI+Thg258JLM0va5h JE3Kv3yfF3eMeeA1tkn7TpwtMbBL3BVK1SQh0St/+6Osu5EjsI/RYXyDSteWJJgyP725QA1NOhCAW w6A7bk28rtVBvW0paKN/MOw916ItQQutf+NGeTRaUKXhzg06BL26czyuRmoQiU7YAZ+j5GBXjvCvW dDOj+bCadpoiN4gYIIiQrqjVOfwUw3S2zsby8ONNNN0xG9GGpcV4vt+6b8B4i6sBYXcyYOjsxn13v Vda8LaDOQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnNsj-0003Ok-3m; Mon, 22 Jun 2020 14:57:09 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnIxN-0007h3-Lp for linux-mediatek@lists.infradead.org; Mon, 22 Jun 2020 09:41:38 +0000 Received: by mail-wr1-x444.google.com with SMTP id k6so3483380wrn.3 for ; Mon, 22 Jun 2020 02:41:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yy6XgmLu+rdPXztYG22qHG3UQylFLO0aZanRZZZSG+U=; b=UtNEe+Y7D5ArH7Qe/vs7TUd5yHPcILffWoYh4wTCQdtMBq36DtKsydxvi6z3a7HbGS FB2blBliY4Y+cVZyVIBbNCz/TMBZbmhI+WrSDUrAZc+nT9RqNVT9ahaolMbn+oxd3MXf 1G7L1Tcb6rs72hInUAFR8sZDDUZyVq9WQ8aEF0wR9UhVHcEeuUBRsA99mkWAfVG8D7Fm zKsJUFL1xKBJ0gZxZlQvxrVGukdEa54zY4pSR0TYGGrqagLXr4OzxpZFMV8ttxXXVHQU uiUpPpCNqmeepGbSEiBWxIRbMBVFfKFJKOIFmK8bRZsbBYVxA3/rlPTyqTaIaGU38MYj ac8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yy6XgmLu+rdPXztYG22qHG3UQylFLO0aZanRZZZSG+U=; b=qxL4hwk50tPdh5E6OoJmCRitTeW/p/crBSeIlZZF5aucXE/jj5ORdDyQV29lMq25bs KcRq61Dx1VVA9gdpMYmhTzpGwQvLBhHtMAxyr0IsSWXzdN+0i9SygEROMqEvdxLCOTYl ejMFqhTMNBSGAn8t08hxW/dgaPn/zfF953IX69mEgskM/GAqIEPglQZloxtYKPopnBAP mNs687Ms9v29+smVjWbz6yKAK+9HxW+JlMkkv6oIX2h1t4g0GpXzFvlEbAE3f3b/cZ70 0yXMPkijkpgHhATaM8RWOjRNvYIfCLfDWkAhLowWrrKe1kHnH2KYGDFm/eNpxBBhTgay ItGw== X-Gm-Message-State: AOAM532WExjwQ4oxxHRFefl3l9wfXCV4EAToAhXbSD6nSgTCEtXBRtTO UNgO1oN/VFZYNg5Tq+jgFsiupA== X-Google-Smtp-Source: ABdhPJyFGfPZiEZAaPA05Oy9u/8YECmNenqKkrnMxPg4aIkaLDansk5+kyg8mkF5tPJf9KrUB0gUSQ== X-Received: by 2002:a5d:6987:: with SMTP id g7mr17998302wru.79.1592818896247; Mon, 22 Jun 2020 02:41:36 -0700 (PDT) Received: from localhost.localdomain (lfbn-nic-1-65-232.w2-15.abo.wanadoo.fr. [2.15.156.232]) by smtp.gmail.com with ESMTPSA id j24sm14392652wrd.43.2020.06.22.02.41.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 02:41:35 -0700 (PDT) From: Bartosz Golaszewski To: Andrew Lunn , Florian Fainelli , Heiner Kallweit , Russell King , "David S . Miller" , Jakub Kicinski , Rob Herring , Matthias Brugger , Microchip Linux Driver Support , Vladimir Oltean , Claudiu Manoil , Alexandre Belloni , Vivien Didelot , Tom Lendacky , Yisen Zhuang , Salil Mehta , Jassi Brar , Ilias Apalodimas , Iyappan Subramanian , Keyur Chudgar , Quan Nguyen , Frank Rowand , Philipp Zabel , Liam Girdwood , Mark Brown Subject: [PATCH 08/15] net: phy: check the PHY presence in get_phy_id() Date: Mon, 22 Jun 2020 11:37:37 +0200 Message-Id: <20200622093744.13685-9-brgl@bgdev.pl> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200622093744.13685-1-brgl@bgdev.pl> References: <20200622093744.13685-1-brgl@bgdev.pl> MIME-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:444 listed in] [list.dnswl.org] X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Stephane Le Provost , Bartosz Golaszewski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Fabien Parent , linux-mediatek@lists.infradead.org, Andrew Perepech , Pedro Tsai , linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org From: Bartosz Golaszewski get_phy_id() is only called from get_phy_device() so the check for the 0x1fffffff value can be pulled into the former. This way it'll be easier to remove get_phy_device() later on. Signed-off-by: Bartosz Golaszewski --- drivers/net/phy/phy_device.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 8037a9663a85..eccbf6aea63d 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -806,6 +806,10 @@ static int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id, *phy_id |= phy_reg; + /* If the phy_id is mostly Fs, there is no device there */ + if ((*phy_id & 0x1fffffff) == 0x1fffffff) + return -ENODEV; + return 0; } @@ -832,10 +836,6 @@ struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45) if (r) return ERR_PTR(r); - /* If the phy_id is mostly Fs, there is no device there */ - if ((phy_id & 0x1fffffff) == 0x1fffffff) - return ERR_PTR(-ENODEV); - return phy_device_create(bus, addr, phy_id, is_c45, &c45_ids); } EXPORT_SYMBOL(get_phy_device); From patchwork Mon Jun 22 09:37:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 11617765 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9A6DB138C for ; Mon, 22 Jun 2020 13:41:58 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6D2CB2073E for ; Mon, 22 Jun 2020 13:41:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="1MsZEzpi"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="RrQhEME9"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="16VBF2La" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6D2CB2073E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=bbFkZ/Gc98nryCrYfusXoGcpfAJ6LgsWnzG+skEhT6Y=; b=1MsZEzpijzH440Si5vgmrZJRV awniDaOZ5VXHx+ipemD8vC8q7A18LRti6TzoBmf6JXwPNMZxKBqtQi91QVVldWjyCw2w/UVQKZla9 WFygdh/nlULhU9cHaOrftP4fDPosBrS4wZs4AwnqGVZXiV51Esuh5cEmPQDcoop1Kc/0B2gblHtEE jUJFb/49BR70KNsEjSQ9x/B29l5CL11ZjxvpD8dp/tOEHH6iKmnQ2jz6BkOO0mah2ji3Nf48t3BKT OnROPmPHxq+0iOJpOefnn1aeaGMRsK2tUDPvkELaNB3k5VEsw0XJ2MLOcnWtYGTouZyyqc8etW0qk hfGulZDng==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnMhu-0007C4-Qa; Mon, 22 Jun 2020 13:41:54 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnLxO-0004t5-4A for linux-mediatek@merlin.infradead.org; Mon, 22 Jun 2020 12:53:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=iUydfUf825zuTrP/3rZhTozCzOm5XJhrM7EVYTY3Zy4=; b=RrQhEME90q1RGVsJKDVShowrwU 5BPl1AU2SPTd1LD6BXzvWKuipGpT0/uNHca3PPQ4I4hsioViJr/FNaJxNGHksmHDsIbb+SQi3vJ9a D4+msVrPlCZRW430WsOnVa0wrLgnuMdtvpe4G5KTHiSKoQtC0Wf7hy1DExJKOW2eyOnp6v5iZv09T 8s7fzvaIUYhI2xRrGS4PZ3bz8OwIACwBEd23exyAgVR4OP/xBZvf5DEvFYJJCS8W440flGP0Apj4k 61Keg53uGBJ9NdneuT0Yq22YRRUcPrZe1Nl2LWY7h8w2dsBeoxIgYkZxHryax54zrvBmk6TKRhhu8 R9HtVQ2g==; Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnIxQ-0004AX-BI for linux-mediatek@lists.infradead.org; Mon, 22 Jun 2020 09:41:43 +0000 Received: by mail-wr1-x441.google.com with SMTP id g18so6882556wrm.2 for ; Mon, 22 Jun 2020 02:41:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iUydfUf825zuTrP/3rZhTozCzOm5XJhrM7EVYTY3Zy4=; b=16VBF2LawpzpJUoGplW1VMeRQBY+6kIReg/qh3Of8JJozgK7KV3a/y36LFnx7JJaGG +hsOoIVXR9n9Bwou+9lQTjVGf6VkErBZk56xecuHPO9LNdA3N6A87+7oJpGaJZr91+Ep BI6yveOiwM810Bvvg/LZCi0sL3+aPo8rBLYFEgvj1FYJqgvMM+hLxuy3zExLOJZWyH7g i9vpiSlC5Y0qhPNWicv+/56I51GI/LMpey2/OgWMvENvikCSExdgLe04MjH5nquwHbgt vxVipAPH8T2Nok3B4y9B9ucBQNKyRuG9bYn8DcPmhCNY+VwarjwpEe+1IYtpzERMpzWD 8lyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iUydfUf825zuTrP/3rZhTozCzOm5XJhrM7EVYTY3Zy4=; b=Td0gNgq+pd+bec+9gmVgLoEcYg+XzQG+wp7CS55rQfPVPXBsgZA/kqZkXMXOf+RJAa xPb3CZmbSHcKfWsJrvTlNtDg5aytm/DNagMuuZGWav4PNBUuoE+dHTQhOzZIrdtM2M9Y Db9IMGs8HamZ30qE6dUDK6Q3ylZuf12o1sub9zT5uTzgNL927WasrcFZKyfMTo4GozOv reKwxA6nwuV6GAyjT10mCvA1ymaB5jieBNNB60G7a4l3UgoRlt0YZ0os3OJCTZmbZvLX yM428uKlEy+iovCsR1NXWC/oAvnWlEuqjnRoYViZU95DnLEp9r6uNQ8Yi24L2iiVC9Rn Jx6w== X-Gm-Message-State: AOAM531gy2gQeYb7c/pGVitbyj4317Ac1LWyDEcAl9DBcCDWyjiSz78Y fKPwqSwp75AHtLbrzkYbZZcOMA== X-Google-Smtp-Source: ABdhPJw/YDc8BRLdz6R7EQpjrH3iix+fo/75QLcqChmbsRSUxGbc0J2kOfOhJKAo3W+XevgouG/a8A== X-Received: by 2002:adf:8168:: with SMTP id 95mr17445453wrm.104.1592818898066; Mon, 22 Jun 2020 02:41:38 -0700 (PDT) Received: from localhost.localdomain (lfbn-nic-1-65-232.w2-15.abo.wanadoo.fr. [2.15.156.232]) by smtp.gmail.com with ESMTPSA id j24sm14392652wrd.43.2020.06.22.02.41.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 02:41:37 -0700 (PDT) From: Bartosz Golaszewski To: Andrew Lunn , Florian Fainelli , Heiner Kallweit , Russell King , "David S . Miller" , Jakub Kicinski , Rob Herring , Matthias Brugger , Microchip Linux Driver Support , Vladimir Oltean , Claudiu Manoil , Alexandre Belloni , Vivien Didelot , Tom Lendacky , Yisen Zhuang , Salil Mehta , Jassi Brar , Ilias Apalodimas , Iyappan Subramanian , Keyur Chudgar , Quan Nguyen , Frank Rowand , Philipp Zabel , Liam Girdwood , Mark Brown Subject: [PATCH 09/15] net: phy: delay PHY driver probe until PHY registration Date: Mon, 22 Jun 2020 11:37:38 +0200 Message-Id: <20200622093744.13685-10-brgl@bgdev.pl> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200622093744.13685-1-brgl@bgdev.pl> References: <20200622093744.13685-1-brgl@bgdev.pl> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200622_104140_601796_A84B02AC X-CRM114-Status: GOOD ( 24.02 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-1.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:441 listed in] [list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Stephane Le Provost , Bartosz Golaszewski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Fabien Parent , linux-mediatek@lists.infradead.org, Andrew Perepech , Pedro Tsai , linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org From: Bartosz Golaszewski Currently the PHY ID is read without taking the PHY out of reset. This can only work if no resets are defined. This change delays the ID read until we're actually registering the PHY device - this is needed because earlier (when creating the device) we don't have a struct device yet with resets already configured. While we could use the of_ helpers for GPIO and resets, we will be adding PHY regulator support layer on and there are no regulator APIs that work without struct device. This means that phy_device_create() now only instantiates the device but doesn't request the relevant driver. If no phy_id is passed to phy_device_create() (for that we introduce a new define: PHY_ID_NONE) then the ID will be read inside phy_device_register(). Signed-off-by: Bartosz Golaszewski --- drivers/net/phy/phy_device.c | 47 +++++++++++++++++++----------------- include/linux/phy.h | 1 + 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index eccbf6aea63d..94944fffa9bb 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -658,12 +658,6 @@ struct phy_device *phy_device_create(struct mii_bus *bus, int addr, u32 phy_id, INIT_DELAYED_WORK(&dev->state_queue, phy_state_machine); device_initialize(&mdiodev->dev); - ret = phy_request_driver_module(dev); - if (ret) { - phy_device_free(dev); - dev = ERR_PTR(ret); - } - return dev; } EXPORT_SYMBOL(phy_device_create); @@ -813,30 +807,29 @@ static int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id, return 0; } +static int phy_device_read_id(struct phy_device *phydev) +{ + struct mdio_device *mdiodev = &phydev->mdio; + + phydev->c45_ids.devices_in_package = 0; + memset(phydev->c45_ids.device_ids, 0xff, + sizeof(phydev->c45_ids.device_ids)); + + return get_phy_id(mdiodev->bus, mdiodev->addr, &phydev->phy_id, + phydev->is_c45, &phydev->c45_ids); +} + /** - * get_phy_device - reads the specified PHY device and returns its @phy_device - * struct + * get_phy_device - create a phy_device withoug PHY ID * @bus: the target MII bus * @addr: PHY address on the MII bus * @is_c45: If true the PHY uses the 802.3 clause 45 protocol * - * Description: Reads the ID registers of the PHY at @addr on the - * @bus, then allocates and returns the phy_device to represent it. + * Allocates a new phy_device for @addr on the @bus. */ struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45) { - struct phy_c45_device_ids c45_ids; - u32 phy_id = 0; - int r; - - c45_ids.devices_in_package = 0; - memset(c45_ids.device_ids, 0xff, sizeof(c45_ids.device_ids)); - - r = get_phy_id(bus, addr, &phy_id, is_c45, &c45_ids); - if (r) - return ERR_PTR(r); - - return phy_device_create(bus, addr, phy_id, is_c45, &c45_ids); + return phy_device_create(bus, addr, PHY_ID_NONE, is_c45, NULL); } EXPORT_SYMBOL(get_phy_device); @@ -855,6 +848,16 @@ int phy_device_register(struct phy_device *phydev) /* Deassert the reset signal */ phy_device_reset(phydev, 0); + if (phydev->phy_id == PHY_ID_NONE) { + err = phy_device_read_id(phydev); + if (err) + goto err_unregister_mdio; + } + + err = phy_request_driver_module(phydev); + if (err) + goto err_unregister_mdio; + /* Run all of the fixups for this PHY */ err = phy_scan_fixups(phydev); if (err) { diff --git a/include/linux/phy.h b/include/linux/phy.h index 8c05d0fb5c00..2a695cd90c7c 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -742,6 +742,7 @@ struct phy_driver { #define PHY_ANY_ID "MATCH ANY PHY" #define PHY_ANY_UID 0xffffffff +#define PHY_ID_NONE 0 #define PHY_ID_MATCH_EXACT(id) .phy_id = (id), .phy_id_mask = GENMASK(31, 0) #define PHY_ID_MATCH_MODEL(id) .phy_id = (id), .phy_id_mask = GENMASK(31, 4) From patchwork Mon Jun 22 09:37:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 11619541 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 51157138C for ; Tue, 23 Jun 2020 01:31:04 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1B01620720 for ; Tue, 23 Jun 2020 01:31:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="JU4QbMgU"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="XpSDFkYe" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1B01620720 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=lOyvSv5QzX3BZmBrVbkPqktPtLkZSoeTVouBDxdOuXg=; b=JU4QbMgUb98n+HZvIs3fm6R1t LiXiNEva/l84xi1j4JE/4MKdL9hFX3/yYdFQbCQyKhODdRBV1JGLJuLMWADO3cFse6x9ObUk3wibT QfLErxJM3kMfwvZebPsebMw2lMtyF4P7OazNx66+cx+KbwzhKxzcREnaBeywN+b/Enal0Xf/dYbSt J1AM/lVKHKNxCZuPlZtnzPXAxBO8MJMEmjYmR3d9RFpAwm6Kdja3LViUkr3GBW7bOS1wtPeQxp2Rn DS8XhpmFtZM64KtSsE67Az3AZi5lqxT4ZrrHscqG/m8na39RHBHYpSKk98BjOvaJk6uxrlXeTqwWF 1H8JzAFjw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnXmA-0002kM-7R; Tue, 23 Jun 2020 01:31:02 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnIyO-0007it-Qw for linux-mediatek@lists.infradead.org; Mon, 22 Jun 2020 09:42:41 +0000 Received: by mail-wr1-x441.google.com with SMTP id a6so13984415wrm.4 for ; Mon, 22 Jun 2020 02:42:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=r7nW5+M2kh3cyRyjmx7rE7/COR4QWlNL8CdVe/fIbIs=; b=XpSDFkYeVraxiwg/39otpkkJoHtYP4sFAfXMCtKdQJw1oTQbFoKREJWtbqNON3jfWc EGdzjWhRvetEZZlr/I5j+Y99sKov/il4jFxNvZDmEZqLsj05w9DscD2q2xxItOV7NEn0 Ks0NxdCoBxv9IqVnzDoXUtuX3V4Tmr4PdQyGyVC2ZsCreOyID+ag5NQdk+BuXbrM9LaI BGdjyyH7GCr2qq1OPt17TJtEH06ciHZSyAqQx0XLoZ5bSNK1Mi5eNtUeINHTvTKl8gSE eNqCc3eEQOEUxA3S0GBF2Mfp+PTfRWQbgIYVM7JWIsVaP5PiUOxf3ffTQdRFjltEHbpn c0vQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=r7nW5+M2kh3cyRyjmx7rE7/COR4QWlNL8CdVe/fIbIs=; b=flwfuuZ18Tu77vGlWCohaciiowA9nwi+C4B7l3N0xrPXFhzJGqb3wHf35X3Kggc0wA iuxcboG1hG2fYY+rKviP/A1V8JOHbdAHZPK5xbuN90Q2Spdq8+TJN65cCYGXT1WwsA9L L/7jmBZz72K4I0gho9nFdjy3o67Mn323nhmuRdMPiYj0XqciFzO6MfHOeObZZII5TXgh vJAwZ7RNJIFP+O9UGJ9Zmuc/37jombK54hLc9Lsb3IebVC4HTjbVO0CQwJDAgi/WiT1Z m/ukP8llzw5lWCc07EGbaJz5fUi6VBDuZ2+cZH0bGcrjpnGLeE1lxGPq+QsZWyvS6PLi h+EA== X-Gm-Message-State: AOAM5305nN8ffi2q9zDRpOM6EwBORZ9CYrWOzd84rH9U8TSHuUi6vTgN KEbTdC6Vf56I+J634un1FjyVPg== X-Google-Smtp-Source: ABdhPJziJYcTjk6jm0fDfnLPlChK17pDk1Ty5W2fRkaBHu9dXXGiCcXlDIMMSfver6mQJh4kbChvSQ== X-Received: by 2002:adf:a34d:: with SMTP id d13mr17477047wrb.270.1592818899871; Mon, 22 Jun 2020 02:41:39 -0700 (PDT) Received: from localhost.localdomain (lfbn-nic-1-65-232.w2-15.abo.wanadoo.fr. [2.15.156.232]) by smtp.gmail.com with ESMTPSA id j24sm14392652wrd.43.2020.06.22.02.41.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 02:41:39 -0700 (PDT) From: Bartosz Golaszewski To: Andrew Lunn , Florian Fainelli , Heiner Kallweit , Russell King , "David S . Miller" , Jakub Kicinski , Rob Herring , Matthias Brugger , Microchip Linux Driver Support , Vladimir Oltean , Claudiu Manoil , Alexandre Belloni , Vivien Didelot , Tom Lendacky , Yisen Zhuang , Salil Mehta , Jassi Brar , Ilias Apalodimas , Iyappan Subramanian , Keyur Chudgar , Quan Nguyen , Frank Rowand , Philipp Zabel , Liam Girdwood , Mark Brown Subject: [PATCH 10/15] net: phy: simplify phy_device_create() Date: Mon, 22 Jun 2020 11:37:39 +0200 Message-Id: <20200622093744.13685-11-brgl@bgdev.pl> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200622093744.13685-1-brgl@bgdev.pl> References: <20200622093744.13685-1-brgl@bgdev.pl> MIME-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:441 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Stephane Le Provost , Bartosz Golaszewski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Fabien Parent , linux-mediatek@lists.infradead.org, Andrew Perepech , Pedro Tsai , linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org From: Bartosz Golaszewski The last argument passed to phy_device_create() (c45_ids) is never used in current mainline outside of the core PHY code - it can only be configured when reading the PHY ID from phy_device_read_id(). Let's drop this argument treewide. Signed-off-by: Bartosz Golaszewski --- drivers/net/phy/nxp-tja11xx.c | 2 +- drivers/net/phy/phy_device.c | 8 +++----- drivers/of/of_mdio.c | 2 +- include/linux/phy.h | 3 +-- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/net/phy/nxp-tja11xx.c b/drivers/net/phy/nxp-tja11xx.c index a72fa0d2e7c7..b98b620ef88c 100644 --- a/drivers/net/phy/nxp-tja11xx.c +++ b/drivers/net/phy/nxp-tja11xx.c @@ -507,7 +507,7 @@ static void tja1102_p1_register(struct work_struct *work) } /* Real PHY ID of Port 1 is 0 */ - phy = phy_device_create(bus, addr, PHY_ID_TJA1102, false, NULL); + phy = phy_device_create(bus, addr, PHY_ID_TJA1102, false); if (IS_ERR(phy)) { dev_err(dev, "Can't create PHY device for Port 1: %i\n", addr); diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 94944fffa9bb..ad7c4cd9d357 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -613,8 +613,7 @@ static int phy_request_driver_module(struct phy_device *phydev) } struct phy_device *phy_device_create(struct mii_bus *bus, int addr, u32 phy_id, - bool is_c45, - struct phy_c45_device_ids *c45_ids) + bool is_c45) { struct phy_device *dev; struct mdio_device *mdiodev; @@ -647,8 +646,7 @@ struct phy_device *phy_device_create(struct mii_bus *bus, int addr, u32 phy_id, dev->is_c45 = is_c45; dev->phy_id = phy_id; - if (c45_ids) - dev->c45_ids = *c45_ids; + dev->irq = bus->irq[addr]; dev_set_name(&mdiodev->dev, PHY_ID_FMT, bus->id, addr); @@ -829,7 +827,7 @@ static int phy_device_read_id(struct phy_device *phydev) */ struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45) { - return phy_device_create(bus, addr, PHY_ID_NONE, is_c45, NULL); + return phy_device_create(bus, addr, PHY_ID_NONE, is_c45); } EXPORT_SYMBOL(get_phy_device); diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c index a04afe79529c..63843037673c 100644 --- a/drivers/of/of_mdio.c +++ b/drivers/of/of_mdio.c @@ -121,7 +121,7 @@ static int of_mdiobus_register_phy(struct mii_bus *mdio, "ethernet-phy-ieee802.3-c45"); if (!is_c45 && !of_get_phy_id(child, &phy_id)) - phy = phy_device_create(mdio, addr, phy_id, 0, NULL); + phy = phy_device_create(mdio, addr, phy_id, 0); else phy = get_phy_device(mdio, addr, is_c45); if (IS_ERR(phy)) { diff --git a/include/linux/phy.h b/include/linux/phy.h index 2a695cd90c7c..662919c1dd27 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -1213,8 +1213,7 @@ int phy_modify_paged(struct phy_device *phydev, int page, u32 regnum, u16 mask, u16 set); struct phy_device *phy_device_create(struct mii_bus *bus, int addr, u32 phy_id, - bool is_c45, - struct phy_c45_device_ids *c45_ids); + bool is_c45); #if IS_ENABLED(CONFIG_PHYLIB) struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45); int phy_device_register(struct phy_device *phy); From patchwork Mon Jun 22 09:37:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 11617825 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5F71B618 for ; Mon, 22 Jun 2020 13:57:25 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F17D620706 for ; Mon, 22 Jun 2020 13:57:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="TnC5gDur"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="nHZDq84v" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F17D620706 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=HgJqld+8fPoVLiLqvasraXu1+ssyiZ98WYeMQax98fk=; b=TnC5gDur3uRpFvKGc9ppaysiD HbtUaVYdvdvz7guu0hnOhpkd+gISPB5Cd7RiXX5HQ5xbj3HBufYyd4KMc4x/54GVJ3RnkfHb/zsuG Y1a4/Nv96PiTKwyKp7oU20Smi4x3JeZMcQ/lDtG4WBOLOVOZb9sb0MoIeMoJqIF7kZl7F0W3H1XbN JKzm1FfdWaE1wOFPm0KraeOOgD5nKtsWjzhrelIU3eDTy4TyHMC1ag+uz7ohtADBB+CwqH/uYj4uR IvjGMIBpD5NqbAl8QCZl21zk9Lcn9iWMg94SBvM2UkNa+U0U9rLcjEA5e2JUrVnkt5PlkETfge/I1 V0adccmQA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnMwp-0002p9-Li; Mon, 22 Jun 2020 13:57:20 +0000 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnIxW-0007ha-Ru for linux-mediatek@lists.infradead.org; Mon, 22 Jun 2020 09:41:47 +0000 Received: by mail-wm1-x342.google.com with SMTP id r9so14206695wmh.2 for ; Mon, 22 Jun 2020 02:41:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=l2sxOAERFa0J25cQccVz8/lQJT3JNRbkHzrHyMtlOx8=; b=nHZDq84vKrJqy5xXpj2+rJ5h5VIM3n4oN76Uizc9jBhIW16xOrH3B0Km9mgWsk8Lu6 yvA1XNXVkC07+Pg/8MKlE82O8Zr8pe+ZvkBUKPDwUpNwKEh7ddGCtrK03jbkSOhkA97n 64Op9mOQmTRVdF209L3WgAXdk3JQpz6prmFcnirM5Mh85gqh4wj4HfX8Dj95q3jZ4lEF /r+V+9jWRk4x4oJaqpBir5uBrXH2h5nhtFaRbptwV37IBb0FqLh8jpU7Qs3q7UwE/NC6 FhTF3jLXUrGYuZgpSgC5QM7D/g7YPowxLmIGSyrPG0S+JZ6ohlL8NFMJuPMP9exEStSR efPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=l2sxOAERFa0J25cQccVz8/lQJT3JNRbkHzrHyMtlOx8=; b=h/TzVgn/f3anxtgbFvC6x7n6YjhzDg6bBcmg/OEnGfIaM7mPd9p82DDeYS+Ota/xyq aIWQSTE2fK4T6ORpLKRCcN+lisSGomVEUDgL6L/BYYi/NaduZo3y3cgZNc3xmVHUUe2g ESryOcvhLhLJWaGylQCFCfEk3D+aYZNNn4dhfYMHfzbr1E1xUH3HC9JxdiO/u6/muqaf oNpp0nEaz3VYDDfMifr2p3sjsS+iUIKDIqvwQCyHgE7OBVwPqRkJMgWusrD+3jNbfmvH IfhOzYRBaKpF+PHG7NT9F4dKZ35TdairaHMVbXVIMt+wZXSFlckWK3vJAEj8KqUrsJMw xj/A== X-Gm-Message-State: AOAM533jpresPIeXW9YmJJnOlP7lyl7p+uPcMlYzFFb7kYXjJ5Pi+LD2 ZB7m1o1c5RvzSgS9By1AUOBbGw== X-Google-Smtp-Source: ABdhPJzJR6KO8zeK/627bqE1LbuigMS0KsI1hp+YnRpdEX+tkt6lyQYjVo/pPkpTRjLvTnpZhm+r2Q== X-Received: by 2002:a7b:c156:: with SMTP id z22mr16903035wmi.43.1592818901772; Mon, 22 Jun 2020 02:41:41 -0700 (PDT) Received: from localhost.localdomain (lfbn-nic-1-65-232.w2-15.abo.wanadoo.fr. [2.15.156.232]) by smtp.gmail.com with ESMTPSA id j24sm14392652wrd.43.2020.06.22.02.41.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 02:41:41 -0700 (PDT) From: Bartosz Golaszewski To: Andrew Lunn , Florian Fainelli , Heiner Kallweit , Russell King , "David S . Miller" , Jakub Kicinski , Rob Herring , Matthias Brugger , Microchip Linux Driver Support , Vladimir Oltean , Claudiu Manoil , Alexandre Belloni , Vivien Didelot , Tom Lendacky , Yisen Zhuang , Salil Mehta , Jassi Brar , Ilias Apalodimas , Iyappan Subramanian , Keyur Chudgar , Quan Nguyen , Frank Rowand , Philipp Zabel , Liam Girdwood , Mark Brown Subject: [PATCH 11/15] net: phy: drop get_phy_device() Date: Mon, 22 Jun 2020 11:37:40 +0200 Message-Id: <20200622093744.13685-12-brgl@bgdev.pl> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200622093744.13685-1-brgl@bgdev.pl> References: <20200622093744.13685-1-brgl@bgdev.pl> MIME-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:342 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Stephane Le Provost , Bartosz Golaszewski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Fabien Parent , linux-mediatek@lists.infradead.org, Andrew Perepech , Pedro Tsai , linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org From: Bartosz Golaszewski get_phy_device() has now become just a wrapper for phy_device_create() with the phy_id argument set to PHY_ID_NONE. Let's remove this function treewide and replace it with opencoded phy_device_create(). This has the advantage of being more explicit about the PHY not having the ID set when being created. Signed-off-by: Bartosz Golaszewski --- drivers/net/dsa/ocelot/felix_vsc9959.c | 3 ++- drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 5 +++-- drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c | 2 +- drivers/net/ethernet/socionext/netsec.c | 3 ++- drivers/net/phy/fixed_phy.c | 2 +- drivers/net/phy/mdio-xgene.c | 2 +- drivers/net/phy/mdio_bus.c | 2 +- drivers/net/phy/phy_device.c | 14 -------------- drivers/net/phy/sfp.c | 2 +- drivers/of/of_mdio.c | 11 +++++++---- include/linux/phy.h | 7 ------- 11 files changed, 19 insertions(+), 34 deletions(-) diff --git a/drivers/net/dsa/ocelot/felix_vsc9959.c b/drivers/net/dsa/ocelot/felix_vsc9959.c index 1dd9e348152d..40c868382e03 100644 --- a/drivers/net/dsa/ocelot/felix_vsc9959.c +++ b/drivers/net/dsa/ocelot/felix_vsc9959.c @@ -1183,7 +1183,8 @@ static int vsc9959_mdio_bus_alloc(struct ocelot *ocelot) if (ocelot_port->phy_mode == PHY_INTERFACE_MODE_USXGMII) is_c45 = true; - pcs = get_phy_device(felix->imdio, port, is_c45); + pcs = phy_device_create(felix->imdio, port, + PHY_ID_NONE, is_c45); if (IS_ERR(pcs)) continue; diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c index 46c3c1ca38d6..1117ed468abf 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c @@ -1017,8 +1017,9 @@ static int xgbe_phy_find_phy_device(struct xgbe_prv_data *pdata) } /* Create and connect to the PHY device */ - phydev = get_phy_device(phy_data->mii, phy_data->mdio_addr, - (phy_data->phydev_mode == XGBE_MDIO_MODE_CL45)); + phydev = phy_device_create(phy_data->mii, phy_data->mdio_addr, + PHY_ID_NONE, + phy_data->phydev_mode == XGBE_MDIO_MODE_CL45); if (IS_ERR(phydev)) { netdev_err(pdata->netdev, "get_phy_device failed\n"); return -ENODEV; diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c index 9a907947ba19..75fa6a855727 100644 --- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c +++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c @@ -703,7 +703,7 @@ hns_mac_register_phydev(struct mii_bus *mdio, struct hns_mac_cb *mac_cb, else return -ENODATA; - phy = get_phy_device(mdio, addr, is_c45); + phy = phy_device_create(mdio, addr, PHY_ID_NONE, is_c45); if (!phy || IS_ERR(phy)) return -EIO; diff --git a/drivers/net/ethernet/socionext/netsec.c b/drivers/net/ethernet/socionext/netsec.c index 328bc38848bb..48c405d81000 100644 --- a/drivers/net/ethernet/socionext/netsec.c +++ b/drivers/net/ethernet/socionext/netsec.c @@ -1935,7 +1935,8 @@ static int netsec_register_mdio(struct netsec_priv *priv, u32 phy_addr) return ret; } - priv->phydev = get_phy_device(bus, phy_addr, false); + priv->phydev = phy_device_create(bus, phy_addr, + PHY_ID_NONE, false); if (IS_ERR(priv->phydev)) { ret = PTR_ERR(priv->phydev); dev_err(priv->dev, "get_phy_device err(%d)\n", ret); diff --git a/drivers/net/phy/fixed_phy.c b/drivers/net/phy/fixed_phy.c index c4641b1704d6..9019f0035ef0 100644 --- a/drivers/net/phy/fixed_phy.c +++ b/drivers/net/phy/fixed_phy.c @@ -254,7 +254,7 @@ static struct phy_device *__fixed_phy_register(unsigned int irq, return ERR_PTR(ret); } - phy = get_phy_device(fmb->mii_bus, phy_addr, false); + phy = phy_device_create(fmb->mii_bus, phy_addr, PHY_ID_NONE, false); if (IS_ERR(phy)) { fixed_phy_del(phy_addr); return ERR_PTR(-EINVAL); diff --git a/drivers/net/phy/mdio-xgene.c b/drivers/net/phy/mdio-xgene.c index 34990eaa3298..6698e7caaf78 100644 --- a/drivers/net/phy/mdio-xgene.c +++ b/drivers/net/phy/mdio-xgene.c @@ -264,7 +264,7 @@ struct phy_device *xgene_enet_phy_register(struct mii_bus *bus, int phy_addr) { struct phy_device *phy_dev; - phy_dev = get_phy_device(bus, phy_addr, false); + phy_dev = phy_device_create(bus, phy_addr, PHY_ID_NONE, false); if (!phy_dev || IS_ERR(phy_dev)) return NULL; diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index 296cf9771483..53e2fb0be7b9 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c @@ -742,7 +742,7 @@ struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr) struct phy_device *phydev; int err; - phydev = get_phy_device(bus, addr, false); + phydev = phy_device_create(bus, addr, PHY_ID_NONE, false); if (IS_ERR(phydev)) return phydev; diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index ad7c4cd9d357..58923826838b 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -817,20 +817,6 @@ static int phy_device_read_id(struct phy_device *phydev) phydev->is_c45, &phydev->c45_ids); } -/** - * get_phy_device - create a phy_device withoug PHY ID - * @bus: the target MII bus - * @addr: PHY address on the MII bus - * @is_c45: If true the PHY uses the 802.3 clause 45 protocol - * - * Allocates a new phy_device for @addr on the @bus. - */ -struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45) -{ - return phy_device_create(bus, addr, PHY_ID_NONE, is_c45); -} -EXPORT_SYMBOL(get_phy_device); - /** * phy_device_register - Register the phy device on the MDIO bus * @phydev: phy_device structure to be added to the MDIO bus diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c index 73c2969f11a4..0b165d928762 100644 --- a/drivers/net/phy/sfp.c +++ b/drivers/net/phy/sfp.c @@ -1431,7 +1431,7 @@ static int sfp_sm_probe_phy(struct sfp *sfp, bool is_c45) struct phy_device *phy; int err; - phy = get_phy_device(sfp->i2c_mii, SFP_PHY_ADDR, is_c45); + phy = phy_device_create(sfp->i2c_mii, SFP_PHY_ADDR, PHY_ID_NONE, is_c45); if (phy == ERR_PTR(-ENODEV)) return PTR_ERR(phy); if (IS_ERR(phy)) { diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c index 63843037673c..af576d056e45 100644 --- a/drivers/of/of_mdio.c +++ b/drivers/of/of_mdio.c @@ -120,10 +120,13 @@ static int of_mdiobus_register_phy(struct mii_bus *mdio, is_c45 = of_device_is_compatible(child, "ethernet-phy-ieee802.3-c45"); - if (!is_c45 && !of_get_phy_id(child, &phy_id)) - phy = phy_device_create(mdio, addr, phy_id, 0); - else - phy = get_phy_device(mdio, addr, is_c45); + if (!is_c45) { + rc = of_get_phy_id(child, &phy_id); + if (rc) + phy_id = PHY_ID_NONE; + } + + phy = phy_device_create(mdio, addr, phy_id, is_c45); if (IS_ERR(phy)) { if (mii_ts) unregister_mii_timestamper(mii_ts); diff --git a/include/linux/phy.h b/include/linux/phy.h index 662919c1dd27..01d24a934ad1 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -1215,16 +1215,9 @@ int phy_modify_paged(struct phy_device *phydev, int page, u32 regnum, struct phy_device *phy_device_create(struct mii_bus *bus, int addr, u32 phy_id, bool is_c45); #if IS_ENABLED(CONFIG_PHYLIB) -struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45); int phy_device_register(struct phy_device *phy); void phy_device_free(struct phy_device *phydev); #else -static inline -struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45) -{ - return NULL; -} - static inline int phy_device_register(struct phy_device *phy) { return 0; From patchwork Mon Jun 22 09:37:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 11618099 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 551DB13B1 for ; Mon, 22 Jun 2020 15:12:35 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2DF6A206FA for ; Mon, 22 Jun 2020 15:12:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NfUNdYuR"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="fwhLeGUT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2DF6A206FA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=JOmc5jWZdi3DtFQN4YINH70iT6JiH4z4ltB5l0Z3LWA=; b=NfUNdYuR1v/lwNEDkWB5gqdBM fmB+7hCt2SnkTQbEZTZugRkdrUJttDsqY54wkVAoq1NVZhJShroHcCdltzXHTy7j8vEpVceTT8fjQ 04ld8UXmR7yp97Mf8sMq5gjwuue8R0Ms66ZYTfBPr3fXLDQiL2bTjpeHwnvXDt+GOmedUe+KuO62X WUq1vrDEEicJGKS2NOeQWkQpMcJsxnlHIZ0mwpkcK+EJnauw7fMUfTxQAn4u8eQv53kE1gqu+f+ba r3hkT7QCwDALbHYkE82WIW16HasowRmuBZ+92x8P+MAEpeMRa7wMoUk+/q/fNX/7OpX3rshEXsiPZ zslFeAJjQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnO7e-0006Cv-GI; Mon, 22 Jun 2020 15:12:34 +0000 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnIyS-0007j8-Iy for linux-mediatek@lists.infradead.org; Mon, 22 Jun 2020 09:42:45 +0000 Received: by mail-wm1-x341.google.com with SMTP id u26so13127065wmn.1 for ; Mon, 22 Jun 2020 02:42:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=H6LOSRZxGizpxzfF22Sv14N1k+l2XBln54kSc7WXTbU=; b=fwhLeGUTHzaOn5r0hKFAxOrI/4bP6cRMLAZ9vxuMsWmVTbLCLBfuv2c3zx2K+9WkzC 4510agGDHbhXy4FxLo2y6wSgQ64p20rVWdVPiqvbTzNx3rKJ0wAQIRkSuhTdzUPDyq33 EGJ7dP781SaoA69mOAe2VG//Mj+PraeucVuHaZFWBoluRKQxOPm81fI00ykep20zlmSB RPZYYFefMuTBJhmo6T+gCbA2sk4rO/dFZ8SsuCQmoiiBtm5IHQMXEHE2Tj3zbDGXmqd+ 33R1jARght4O0k5GCattCXLy0yW2yV908NCQr9OgF+g3eygrEUkhQhtDWFMWiBtAcU50 OBog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=H6LOSRZxGizpxzfF22Sv14N1k+l2XBln54kSc7WXTbU=; b=U13XNr/7PgOJlVHHS4y9aBXAWE8ATaSdLAagy0G35+aHiVVFwOMS6JJol5DnnXxtcs igKVxZOXwesFGCh1vVmolgZHI/dUiFaM+CvqXTXjVZaO3U3dp2hfL7ee1k13BkA4uGwP rSgUEKKEVCrCbI8uv6ZKSaCEz7wiTb7TNNdkIq0T5HoZEOpa1EySQjg5FOoUQGLvWFLh V86U7pCaEXjFQNtDuGl0bqg1r3jUoDqGqnrds0dHP4xDaOhKblrRUD446eghEctdr0fw kCzJv2uYu7hpenPTUzAvMpGiuiDKTg/7M3mRb6P7o4A+hduSkpSo+IbAafz+gf/pplZ9 xVFg== X-Gm-Message-State: AOAM530qoULMpvLp90WNaQDC7xQfK7MfxbB5e6BVArsq8w5coMwt7b+x 63lhrtVDkdUrjHNTKiFMnzQntQ== X-Google-Smtp-Source: ABdhPJxKaZTzwaRgXjyD3lQOmmZEDuZrxf5WMvWd8aJTlxKoe6V5StaOUPB2OradOOO/ubvV2pVenA== X-Received: by 2002:a1c:1fd1:: with SMTP id f200mr17253456wmf.162.1592818903618; Mon, 22 Jun 2020 02:41:43 -0700 (PDT) Received: from localhost.localdomain (lfbn-nic-1-65-232.w2-15.abo.wanadoo.fr. [2.15.156.232]) by smtp.gmail.com with ESMTPSA id j24sm14392652wrd.43.2020.06.22.02.41.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 02:41:43 -0700 (PDT) From: Bartosz Golaszewski To: Andrew Lunn , Florian Fainelli , Heiner Kallweit , Russell King , "David S . Miller" , Jakub Kicinski , Rob Herring , Matthias Brugger , Microchip Linux Driver Support , Vladimir Oltean , Claudiu Manoil , Alexandre Belloni , Vivien Didelot , Tom Lendacky , Yisen Zhuang , Salil Mehta , Jassi Brar , Ilias Apalodimas , Iyappan Subramanian , Keyur Chudgar , Quan Nguyen , Frank Rowand , Philipp Zabel , Liam Girdwood , Mark Brown Subject: [PATCH 12/15] dt-bindings: mdio: add phy-supply property to ethernet phy node Date: Mon, 22 Jun 2020 11:37:41 +0200 Message-Id: <20200622093744.13685-13-brgl@bgdev.pl> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200622093744.13685-1-brgl@bgdev.pl> References: <20200622093744.13685-1-brgl@bgdev.pl> MIME-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:341 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Stephane Le Provost , Bartosz Golaszewski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Fabien Parent , linux-mediatek@lists.infradead.org, Andrew Perepech , Pedro Tsai , linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org From: Bartosz Golaszewski The phy-supply property is often added to MAC nodes but this is wrong conceptually. These supplies should be part of the PHY node on the MDIO bus. Add phy-supply property at PHY level to mdio.yaml. Signed-off-by: Bartosz Golaszewski --- Documentation/devicetree/bindings/net/mdio.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/net/mdio.yaml b/Documentation/devicetree/bindings/net/mdio.yaml index d6a3bf8550eb..9c10012c2093 100644 --- a/Documentation/devicetree/bindings/net/mdio.yaml +++ b/Documentation/devicetree/bindings/net/mdio.yaml @@ -90,6 +90,10 @@ patternProperties: Delay after the reset was deasserted in microseconds. If this property is missing the delay will be skipped. + phy-supply: + description: + Phandle to the regulator that provides the supply voltage to the PHY. + required: - reg From patchwork Mon Jun 22 09:37:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 11617817 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1ABA2618 for ; Mon, 22 Jun 2020 13:56:40 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E72CC20706 for ; Mon, 22 Jun 2020 13:56:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="TBxOK86E"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="p3puFYEO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E72CC20706 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=rTFfl9TSqzEPgBpglZkIJZIUz1Q/BJ5OPSsxUXEXbGY=; b=TBxOK86E66ceC51L+cK1eVWWn 36Lud8FfQZlOFt2MnkojER6EcegTVerBhIBqgKU9oGm0coE1t47mJnOc7B3BmWeGojMg0FbTu7DKq oIFSatXpMGsRX1cU8T8v7NB3Ts6xKEQhxxZXpnXAA0v48MLdjhP+FE3yh0YRibhazRtDNQK2Mm2Yk bEpE1m9H0/KKJU1oZAMEdPr5LJ6q4QasFjlkyFaGNqI4jnWe6dT2wq/UFuP7oa+ZHaIV2gGLpZuK5 zk4Ix6aZ9JICCTDbT3PYYcDrajkzX2/N98yZW6N7rx+Qjw4ljEn4EgLSDpi/m2sBLmvYDcyXiAeNa iENcE7zcA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnMwA-0002GD-OY; Mon, 22 Jun 2020 13:56:38 +0000 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnIxW-0007hb-Ot for linux-mediatek@lists.infradead.org; Mon, 22 Jun 2020 09:41:47 +0000 Received: by mail-wm1-x341.google.com with SMTP id u26so13127134wmn.1 for ; Mon, 22 Jun 2020 02:41:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0paM6XhitgV7f9qC2QMsgtm0qUC+Vh9Zw/7wnTkRdCU=; b=p3puFYEON7LkHbRRFDYqexUJADfzkEU/dUHjBAt/PbcDJGO0LiqnjjeqsIrnr/DVi8 TrFkDpUdHsOTJT23y3iLd0/FPbAVUhoTCnRBnGU2vTS0/89DVGkpzmy+t4hbbzqoDU3B KNlg5bNbRUucNBZgy88A9ZU09qNs5k/J6vh5JqNU5yWXSVkkc9yOsVgS02mQpY90/8V6 0oOVcA0uD5HC67mpqZzgj7Sw1oNu0MzvwMK7PgFS2M7LqNfuY/VGRHUtM65hVZ7AfhGx 9iE+ygyaLVwY/ZH++VpS+UD/5Poz5Tu6HHyjGXcqFdVGwfKkqG/ZHgm0AIs5WEiNvL2j Bv5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0paM6XhitgV7f9qC2QMsgtm0qUC+Vh9Zw/7wnTkRdCU=; b=N73WHcTq1fDM/HsC709FOVf/MO2UAYXyyzeE/s8yr6XlHOU5cnPECjqp+yLRiQ5cdW 09kis8eBZrxJOr//EcSTfipHZGpFmAWOFkZxzSB7f5BCVWwmEaDopuDCup6bvpinJHZb 6Me32K6gIuOg/iAM6gnqOEof10bMD3z8yyGraAvFYGo3NB/CTrH0hXjkXpPKrNDPWExI y6aQ5mM2W+AcoJJ19XbUvuDBn3IMn28ANehIn/HrywyBOl3L74sgTwX/261LxulwW8Zj yCmW9k+PW4p3TAx1BP2jfsFhexofaeceZsNMRtP5EAOR+pvadgTp+HqTGUHhMic0ooYs CGcQ== X-Gm-Message-State: AOAM533LKHjhFRZkuXe29DDclSsw3tXUJsYGcd+zbu5ij+pbzv4QtGeL oaIbGE2S8TC0e64EA/mJadKoSw== X-Google-Smtp-Source: ABdhPJzv5Re1aj4/hOY+M8/oLHAxe0wxNqcRaQ+JBsEotMr3fSKVkarmVoP6v3N5vfsL/r8R8lxAzQ== X-Received: by 2002:a1c:a3c5:: with SMTP id m188mr17122520wme.152.1592818905480; Mon, 22 Jun 2020 02:41:45 -0700 (PDT) Received: from localhost.localdomain (lfbn-nic-1-65-232.w2-15.abo.wanadoo.fr. [2.15.156.232]) by smtp.gmail.com with ESMTPSA id j24sm14392652wrd.43.2020.06.22.02.41.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 02:41:44 -0700 (PDT) From: Bartosz Golaszewski To: Andrew Lunn , Florian Fainelli , Heiner Kallweit , Russell King , "David S . Miller" , Jakub Kicinski , Rob Herring , Matthias Brugger , Microchip Linux Driver Support , Vladimir Oltean , Claudiu Manoil , Alexandre Belloni , Vivien Didelot , Tom Lendacky , Yisen Zhuang , Salil Mehta , Jassi Brar , Ilias Apalodimas , Iyappan Subramanian , Keyur Chudgar , Quan Nguyen , Frank Rowand , Philipp Zabel , Liam Girdwood , Mark Brown Subject: [PATCH 13/15] net: phy: mdio: add support for PHY supply regulator Date: Mon, 22 Jun 2020 11:37:42 +0200 Message-Id: <20200622093744.13685-14-brgl@bgdev.pl> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200622093744.13685-1-brgl@bgdev.pl> References: <20200622093744.13685-1-brgl@bgdev.pl> MIME-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:341 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Stephane Le Provost , Bartosz Golaszewski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Fabien Parent , linux-mediatek@lists.infradead.org, Andrew Perepech , Pedro Tsai , linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org From: Bartosz Golaszewski Currently many MAC drivers control the regulator supplying the PHY but this is conceptually wrong. The regulator should be defined as a property of the PHY node on the MDIO bus and controlled by the MDIO sub-system. Add support for an optional PHY regulator which will be enabled before optional deasserting of the reset signal. Signed-off-by: Bartosz Golaszewski --- drivers/net/phy/mdio_bus.c | 21 ++++++++++++++++++++ drivers/net/phy/mdio_device.c | 36 +++++++++++++++++++++++++++++++++++ include/linux/mdio.h | 3 +++ 3 files changed, 60 insertions(+) diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index 53e2fb0be7b9..19f0b9664fe3 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -67,6 +68,22 @@ static int mdiobus_register_reset(struct mdio_device *mdiodev) return 0; } +static int mdiobus_register_regulator(struct mdio_device *mdiodev) +{ + struct regulator *phy_supply; + + phy_supply = regulator_get_optional(&mdiodev->dev, "phy"); + if (IS_ERR(phy_supply)) { + if (PTR_ERR(phy_supply) == -EPROBE_DEFER) + return -EPROBE_DEFER; + phy_supply = NULL; + } + + mdiodev->phy_supply = phy_supply; + + return 0; +} + int mdiobus_register_device(struct mdio_device *mdiodev) { int err; @@ -83,6 +100,10 @@ int mdiobus_register_device(struct mdio_device *mdiodev) if (err) return err; + err = mdiobus_register_regulator(mdiodev); + if (err) + return err; + /* Assert the reset signal */ mdio_device_reset(mdiodev, 1); } diff --git a/drivers/net/phy/mdio_device.c b/drivers/net/phy/mdio_device.c index be615504b829..0f698d7a770b 100644 --- a/drivers/net/phy/mdio_device.c +++ b/drivers/net/phy/mdio_device.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -136,6 +137,32 @@ void mdio_device_reset(struct mdio_device *mdiodev, int value) } EXPORT_SYMBOL(mdio_device_reset); +int mdio_device_power_on(struct mdio_device *mdiodev) +{ + int ret = 0; + + if (mdiodev->phy_supply) + /* TODO We may need a delay here just like reset_assert_delay + * but since no user currently needs it, I'm not adding it just + * yet. + */ + ret = regulator_enable(mdiodev->phy_supply); + + return ret; +} +EXPORT_SYMBOL(mdio_device_power_on); + +int mdio_device_power_off(struct mdio_device *mdiodev) +{ + int ret = 0; + + if (mdiodev->phy_supply) + ret = regulator_disable(mdiodev->phy_supply); + + return ret; +} +EXPORT_SYMBOL(mdio_device_power_off); + /** * mdio_probe - probe an MDIO device * @dev: device to probe @@ -150,6 +177,11 @@ static int mdio_probe(struct device *dev) struct mdio_driver *mdiodrv = to_mdio_driver(drv); int err = 0; + /* Enable the power supply */ + err = mdio_device_power_on(mdiodev); + if (err) + return err; + /* Deassert the reset signal */ mdio_device_reset(mdiodev, 0); @@ -158,6 +190,8 @@ static int mdio_probe(struct device *dev) if (err) { /* Assert the reset signal */ mdio_device_reset(mdiodev, 1); + /* Disable the power supply */ + mdio_device_power_off(mdiodev); } } @@ -175,6 +209,8 @@ static int mdio_remove(struct device *dev) /* Assert the reset signal */ mdio_device_reset(mdiodev, 1); + /* Disable the power supply */ + mdio_device_power_off(mdiodev); return 0; } diff --git a/include/linux/mdio.h b/include/linux/mdio.h index 9ac5e7ff6156..0ae07365a6ca 100644 --- a/include/linux/mdio.h +++ b/include/linux/mdio.h @@ -46,6 +46,7 @@ struct mdio_device { int flags; struct gpio_desc *reset_gpio; struct reset_control *reset_ctrl; + struct regulator *phy_supply; unsigned int reset_assert_delay; unsigned int reset_deassert_delay; }; @@ -92,6 +93,8 @@ struct mdio_device *mdio_device_create(struct mii_bus *bus, int addr); int mdio_device_register(struct mdio_device *mdiodev); void mdio_device_remove(struct mdio_device *mdiodev); void mdio_device_reset(struct mdio_device *mdiodev, int value); +int mdio_device_power_on(struct mdio_device *mdiodev); +int mdio_device_power_off(struct mdio_device *mdiodev); int mdio_driver_register(struct mdio_driver *drv); void mdio_driver_unregister(struct mdio_driver *drv); int mdio_device_bus_match(struct device *dev, struct device_driver *drv); From patchwork Mon Jun 22 09:37:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 11617803 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 06A26618 for ; Mon, 22 Jun 2020 13:51:54 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C1B4020716 for ; Mon, 22 Jun 2020 13:51:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="B3fDl6rD"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="L18aNuz3"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="rox8r/P9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C1B4020716 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=1paeSoCHPllenqWSkDM/8V8BrVL2ihyg2p9oiLWptsE=; b=B3fDl6rDEwbA+r8iiDF5e2run sjyNDAlVukWue13Tx1dFZb4N4RUvDShnGI41VM9YhRz3chotbDqETTcpy7+prxXmebXfpELcAhS41 QA137365642RajRg/m7z4FIVmriwU9kME14xRMJ7CgiYxI58hKrRCEtY9Ro2s9UTscofLhgVzd6gA ajz0mZW5b19YEFgXX3pr0KT0xrnLONN/9O+iPBpxYdvq+pfr1YbKa9dmnEwps2+1eQZRvKEriQ5lk PBrJKqpiwyYCBsQhe0ptUS5jp3tivwYXfqw4VL3iZsHFEZVTtbNzpVzTZ8XZCXAuk/L1BbT4BnyX3 /lhp5/B+w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnMrX-00044B-2c; Mon, 22 Jun 2020 13:51:51 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnLyF-0005E2-HO for linux-mediatek@merlin.infradead.org; Mon, 22 Jun 2020 12:54:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=39tcT1sImiChTRqBAQCitq8OvfITErWq/Xk+xRkWTtw=; b=L18aNuz378xXP83nMMmSLw+RbM WwIlBEXTGQAfUA1Nyly8W8JvkFWwhdgtgJd/JSogUp+sGOrGvRUfixQ/nyxD3G1cSSUnkkWy1pE7J U+FoY8+30DR4eAXX2CIX9xiywtxsoVQAO5ojJwAjIX7WkJaE1hxp2zLa6PIlgTAWmYBFkCTF868tv 1YgEFlBJCVJPrTuMNDQ4yJL34P+8dtcXAs9wLm0UjyAviNtfsmCX+z9PALrUKX9/pJH0ZqDahMctj CX2pohH/9AW1EVvhY3sNttt+ZnuG0dSrvTkuGcWK4epvn1jDzPE1Jn6ZAb3VldGdDiw+OKzabIQpd 7m2A6KUQ==; Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnIxZ-0004BB-BV for linux-mediatek@lists.infradead.org; Mon, 22 Jun 2020 09:41:52 +0000 Received: by mail-wm1-x343.google.com with SMTP id l17so14221663wmj.0 for ; Mon, 22 Jun 2020 02:41:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=39tcT1sImiChTRqBAQCitq8OvfITErWq/Xk+xRkWTtw=; b=rox8r/P9m0M75MrSrW0gaefUbBrzsyQiQQ+nuSUyw7jmgK72RdIrEAET+9NDW80nJV 6NoN3fQgrn8u3TAuYWY9vEZmFhT+PYmy+pixzcxBMoxFYd2WlDCvoisyxCnl9XIvgl4L 2UaUBXGdTuKrvDtQtBHE5L7odP4nDBB7nbDPbFnH6FoanY0lq1FWTQXI+whJq1jJA2hU Ot3SzrgslqAj4dfBjZPmBbOgClucsuSk5FJIDeFu2gEMTSGwLi4/f1DXekQJh5ClPfdx IiB0mjGPZS7Om5sXsEMBsr/HJQuJgLUO0T+W94WaGsZzXwZOeddJTllPhKS2Nil1ZvIb szOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=39tcT1sImiChTRqBAQCitq8OvfITErWq/Xk+xRkWTtw=; b=SkWpdFNGvw7mXB5Qg4F6iwS8POELevcPJJYTu+2mv3S1d/I3Owq4SaWWrtIRetRtkZ 1AKmoXo4uDGzUlGGRPBtYVejMpUeqU3Zxe58pTbzR96jGq4tvuQV7hOKzYAlP2s1Z26m j9Qe0dEBSV6Sk6CqfVQ5Q7LsvBJkCgNTNoc7tNztfoc0AvuKek847sGcaarYSWeXwSXC nDFSot7Hu+VBc0uom5Wu8eQc3SVhDOGx4o7cquZq6g2+6zH5IluPQU2h/kg+UL2j0cdo EsF9g0O5yifHBBFpg9Xe3Ni8evY26sw4wS/FJlLpD9zgNlwnvZHNJIqoDwxieuO/VQTR rxcA== X-Gm-Message-State: AOAM5318vptLNR891fnuU32hEMuIuiIvTTpsoF5xAPWmcIOr7YsuuX+n bu0lHIVGhfnIDeusB9Gkc6TeJw== X-Google-Smtp-Source: ABdhPJxuZnlfHnNwpXMmEqVCYAbLPujZmk1SV/mDkcx4Z73yrAJcet27yegyTxUrUHZ6wyfJf9ZIqA== X-Received: by 2002:a1c:2d54:: with SMTP id t81mr18695221wmt.154.1592818907355; Mon, 22 Jun 2020 02:41:47 -0700 (PDT) Received: from localhost.localdomain (lfbn-nic-1-65-232.w2-15.abo.wanadoo.fr. [2.15.156.232]) by smtp.gmail.com with ESMTPSA id j24sm14392652wrd.43.2020.06.22.02.41.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 02:41:46 -0700 (PDT) From: Bartosz Golaszewski To: Andrew Lunn , Florian Fainelli , Heiner Kallweit , Russell King , "David S . Miller" , Jakub Kicinski , Rob Herring , Matthias Brugger , Microchip Linux Driver Support , Vladimir Oltean , Claudiu Manoil , Alexandre Belloni , Vivien Didelot , Tom Lendacky , Yisen Zhuang , Salil Mehta , Jassi Brar , Ilias Apalodimas , Iyappan Subramanian , Keyur Chudgar , Quan Nguyen , Frank Rowand , Philipp Zabel , Liam Girdwood , Mark Brown Subject: [PATCH 14/15] net: phy: add PHY regulator support Date: Mon, 22 Jun 2020 11:37:43 +0200 Message-Id: <20200622093744.13685-15-brgl@bgdev.pl> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200622093744.13685-1-brgl@bgdev.pl> References: <20200622093744.13685-1-brgl@bgdev.pl> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200622_104149_508323_D3E8549C X-CRM114-Status: GOOD ( 18.07 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-1.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:343 listed in] [list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Stephane Le Provost , Bartosz Golaszewski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Fabien Parent , linux-mediatek@lists.infradead.org, Andrew Perepech , Pedro Tsai , linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org From: Bartosz Golaszewski The MDIO sub-system now supports PHY regulators. Let's reuse the code to extend this support over to the PHY device. Signed-off-by: Bartosz Golaszewski --- drivers/net/phy/phy_device.c | 49 ++++++++++++++++++++++++++++-------- include/linux/phy.h | 10 ++++++++ 2 files changed, 48 insertions(+), 11 deletions(-) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 58923826838b..d755adb748a5 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -827,7 +827,12 @@ int phy_device_register(struct phy_device *phydev) err = mdiobus_register_device(&phydev->mdio); if (err) - return err; + goto err_out; + + /* Enable the PHY regulator */ + err = phy_device_power_on(phydev); + if (err) + goto err_unregister_mdio; /* Deassert the reset signal */ phy_device_reset(phydev, 0); @@ -846,22 +851,25 @@ int phy_device_register(struct phy_device *phydev) err = phy_scan_fixups(phydev); if (err) { phydev_err(phydev, "failed to initialize\n"); - goto out; + goto err_reset; } err = device_add(&phydev->mdio.dev); if (err) { phydev_err(phydev, "failed to add\n"); - goto out; + goto err_reset; } return 0; - out: +err_reset: /* Assert the reset signal */ phy_device_reset(phydev, 1); - + /* Disable the PHY regulator */ + phy_device_power_off(phydev); +err_unregister_mdio: mdiobus_unregister_device(&phydev->mdio); +err_out: return err; } EXPORT_SYMBOL(phy_device_register); @@ -883,6 +891,8 @@ void phy_device_remove(struct phy_device *phydev) /* Assert the reset signal */ phy_device_reset(phydev, 1); + /* Disable the PHY regulator */ + phy_device_power_off(phydev); mdiobus_unregister_device(&phydev->mdio); } @@ -1064,6 +1074,11 @@ int phy_init_hw(struct phy_device *phydev) { int ret = 0; + /* Enable the PHY regulator */ + ret = phy_device_power_on(phydev); + if (ret) + return ret; + /* Deassert the reset signal */ phy_device_reset(phydev, 0); @@ -1644,6 +1659,8 @@ void phy_detach(struct phy_device *phydev) /* Assert the reset signal */ phy_device_reset(phydev, 1); + /* Disable the PHY regulator */ + phy_device_power_off(phydev); } EXPORT_SYMBOL(phy_detach); @@ -2684,13 +2701,18 @@ static int phy_probe(struct device *dev) mutex_lock(&phydev->lock); + /* Enable the PHY regulator */ + err = phy_device_power_on(phydev); + if (err) + goto out; + /* Deassert the reset signal */ phy_device_reset(phydev, 0); if (phydev->drv->probe) { err = phydev->drv->probe(phydev); if (err) - goto out; + goto out_reset; } /* Start out supporting everything. Eventually, @@ -2708,7 +2730,7 @@ static int phy_probe(struct device *dev) } if (err) - goto out; + goto out_reset; if (!linkmode_test_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, phydev->supported)) @@ -2751,11 +2773,16 @@ static int phy_probe(struct device *dev) /* Set the state to READY by default */ phydev->state = PHY_READY; -out: - /* Assert the reset signal */ - if (err) - phy_device_reset(phydev, 1); + mutex_unlock(&phydev->lock); + + return 0; +out_reset: + /* Assert the reset signal */ + phy_device_reset(phydev, 1); + /* Disable the PHY regulator */ + phy_device_power_off(phydev); +out: mutex_unlock(&phydev->lock); return err; diff --git a/include/linux/phy.h b/include/linux/phy.h index 01d24a934ad1..585ce8db32cf 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -1291,6 +1291,16 @@ static inline void phy_device_reset(struct phy_device *phydev, int value) mdio_device_reset(&phydev->mdio, value); } +static inline int phy_device_power_on(struct phy_device *phydev) +{ + return mdio_device_power_on(&phydev->mdio); +} + +static inline int phy_device_power_off(struct phy_device *phydev) +{ + return mdio_device_power_off(&phydev->mdio); +} + #define phydev_err(_phydev, format, args...) \ dev_err(&_phydev->mdio.dev, format, ##args) From patchwork Mon Jun 22 09:37:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 11617807 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C836513A0 for ; Mon, 22 Jun 2020 13:54:01 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9F0EB20716 for ; Mon, 22 Jun 2020 13:54:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="K1IMdKM8"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="BawkCjWm"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="t16Wut0y" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9F0EB20716 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=pOcXBAMwcS3+tNfcB2VCX/gRjQkxl2R7pii88gVZq7Q=; b=K1IMdKM8JezRCrQdc83jsGgYO lv0IJQZdlw2//0Lc2pzBfMXrkz0TIXCq+xku9uokljy0LSMKJRDKQNrim/ISCLpOM7ZbUpynhOtIR Fvd/1hc9MOeBJqPxBfetZmuRNW/wSTEQcFQx3QQ2zN9B/8cEKH662u665DXCxCJteOUI9X4fHflyE ME2ym96HUXACajq8LBlqS6f0GfDzCmpDD4oJ2QkoAGW8cnGpGBpZxRT01sftpL7pnKraA8Gx1jOaH 6bZ0sgf/rtMlG6dM3O6eJLrjWgw/mB1nqgkOCiMy3PVtgBz9E5qA6BC2IfRdY0J+Imv7FuuDTa943 R6fRjtp8Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnMtc-0000Nt-R9; Mon, 22 Jun 2020 13:54:00 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnLyh-0005MR-0a for linux-mediatek@merlin.infradead.org; Mon, 22 Jun 2020 12:55:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=hWTSazz+MH8fIE1pxN8/udTqpqfFld3u9PzBFouqA2o=; b=BawkCjWmBu2OYIoPDvYFC9s0uB Fm0Qdg4ZPhpefmrv2JebWHDZH8BOfVxfTljV1yDsP9xy9XrJVIHmSfix+u3y6vKkKyNUAJiAdYCpH nkHMvQvz7GIiqkxBbbagQd0CdOTv2PhY+3G3L1LiI3DH/VPu53GJ/7VhwPtKq9g1o7WJkDLrhGlDw nCPE0OhPPu7PjGOppTok+ozK0WdJpL+9uywtNwQuyQV2FEa4KrGw14buUl7iGkr/hOU9Fdzf/9JjJ Ao32XQoa5m7ld35lxAURZScSES2bf3IGd8BOOj8jLfmoI9J+RzdzkzBkwM6f7GrLQXnzvtkM8MgW7 Ip+67OTw==; Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnIyX-0004Dg-L6 for linux-mediatek@lists.infradead.org; Mon, 22 Jun 2020 09:42:51 +0000 Received: by mail-wm1-x344.google.com with SMTP id g21so10586761wmg.0 for ; Mon, 22 Jun 2020 02:42:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hWTSazz+MH8fIE1pxN8/udTqpqfFld3u9PzBFouqA2o=; b=t16Wut0yPJpepbHcpqARVKDpzBMGDxgc7F1z6nRGLUey6JiRiIkb9NbOTM45ahU623 AC7aMzDns4FT3n4nUTZGvVzerkg/ZvATWL2ugj0j1n43aWrHWCoJGMpHWAiSVhrlaDqe opttE6VqLvuNr7qLM6l6kbpsm7ZUKZUNO7MvE/EUsi7ztdZgkj7icEOUHoe0nL++ursA EkiCVMSE2m5SFwOcdT37fnP2nHjMC7+/7892TlqZrNOEkiyZP6OLCqA7u08kQYXOC1kP PVs4I3n+JcIFdm5UdFuB4ua1UvQ/mcbIuxlzt1q5Zybg3U4LsuPSY3nV25bLhmQ9qanr +rYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hWTSazz+MH8fIE1pxN8/udTqpqfFld3u9PzBFouqA2o=; b=g7bP2AX2AULjZr3KqbIHjypZWQQCzXKlK2HXH4JfSrj5tmMGi2y3JK+nikjaYpeRP0 GWCFpzIfVQfypLooaiadDoa4L8UFE/zNTpA+zTOsmRcligWCevZR8qUyXUNVbhReeqmX QtmKmidaWanBLGSagr6gJw8v4UaA0IOuYod5p3nWc3616MHrNeY3144gFGhZ7hKW70Jv lCU1Nh11tzr+GX6p4XtPPooSzd0Ne8PAZf+VnaPEtONRDgeb2pyeT2jDlH63MuqogvzS iagS40p1vg3Nuhng1ddDiSYtfsQJzAQwAw/AY8+XmAGoFx75PFfeaouit4j3vfsiiElm VoKw== X-Gm-Message-State: AOAM533wisxogmJpazrHiubppaqSC6JyJyy7pYxrzHZMZsl8J5ykys4v qCEw36CdirRaUY3uPT8MO4r3pw== X-Google-Smtp-Source: ABdhPJy9sIiwuZldm3Z2QGhtksB0AjdTqLAwTXV+hFjc1BN1cQmzZ22mvJNgWLCUXRVjCMY3/bgKMw== X-Received: by 2002:a1c:9942:: with SMTP id b63mr17312428wme.34.1592818909166; Mon, 22 Jun 2020 02:41:49 -0700 (PDT) Received: from localhost.localdomain (lfbn-nic-1-65-232.w2-15.abo.wanadoo.fr. [2.15.156.232]) by smtp.gmail.com with ESMTPSA id j24sm14392652wrd.43.2020.06.22.02.41.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 02:41:48 -0700 (PDT) From: Bartosz Golaszewski To: Andrew Lunn , Florian Fainelli , Heiner Kallweit , Russell King , "David S . Miller" , Jakub Kicinski , Rob Herring , Matthias Brugger , Microchip Linux Driver Support , Vladimir Oltean , Claudiu Manoil , Alexandre Belloni , Vivien Didelot , Tom Lendacky , Yisen Zhuang , Salil Mehta , Jassi Brar , Ilias Apalodimas , Iyappan Subramanian , Keyur Chudgar , Quan Nguyen , Frank Rowand , Philipp Zabel , Liam Girdwood , Mark Brown Subject: [PATCH 15/15] ARM64: dts: mediatek: add a phy regulator to pumpkin-common.dtsi Date: Mon, 22 Jun 2020 11:37:44 +0200 Message-Id: <20200622093744.13685-16-brgl@bgdev.pl> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200622093744.13685-1-brgl@bgdev.pl> References: <20200622093744.13685-1-brgl@bgdev.pl> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200622_104249_830049_53E25313 X-CRM114-Status: GOOD ( 11.78 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-1.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:344 listed in] [list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Stephane Le Provost , Bartosz Golaszewski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Fabien Parent , linux-mediatek@lists.infradead.org, Andrew Perepech , Pedro Tsai , linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org From: Bartosz Golaszewski Add the appropriate supply to the PHY child-node on the MDIO bus. Signed-off-by: Bartosz Golaszewski --- arch/arm64/boot/dts/mediatek/pumpkin-common.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/mediatek/pumpkin-common.dtsi b/arch/arm64/boot/dts/mediatek/pumpkin-common.dtsi index 1a6998570db2..0f5fdc5d390b 100644 --- a/arch/arm64/boot/dts/mediatek/pumpkin-common.dtsi +++ b/arch/arm64/boot/dts/mediatek/pumpkin-common.dtsi @@ -206,6 +206,7 @@ mdio { eth_phy: ethernet-phy@0 { reg = <0>; + phy-supply = <&mt6392_vmch_reg>; }; }; };