From patchwork Sun May 22 13:38:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Trimarchi X-Patchwork-Id: 1980 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 555983F05D for ; Sun, 22 May 2022 15:38:19 +0200 (CEST) Received: by mail-ed1-f69.google.com with SMTP id v1-20020a056402348100b0042b4442b954sf2622996edc.22 for ; Sun, 22 May 2022 06:38:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1653226699; cv=pass; d=google.com; s=arc-20160816; b=ueFQR/9OcRcga9Y+PZrSKaew+8ilZsdkSpiWLZ2eNun+A0qmvcHNzozbYiJBvgygMG VrU/ll8Uw92t2Ahwq18dc8JEFoFWn7IYihGi2UDRoSrwMj+OgG8XdmcJFzYF9DC1+wJu IEYDgoy5gcjYPALsjGi7t4fOE9NYg2BTTuwfyPQV2Ozcpzynnb2c8r3yqoPWaDVcDZOK xchldTvsYrIGyV5LXf2wRRR0cdPwOOPiHx8rcAK7eql99C9wcGgH144Lge/WbcyEvca9 3EckJCSrCeqjOzy717WMIBLcvb83nYkMax5xcRw6I67+y/YWxYDL0q0Q/eEs2fKXLlFm +x3g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=hy0zCqDGoNPCR7akjiSI5c1LEY0KvhtZOaHBsauY0No=; b=a5vSheE0NtQob399EzWKqE5mAvpr6cY2V2jDERczIlI1DTXH2CVFhtM8/jhEW0rw07 Y7pfozM4lo88GambR7/12sx7iNIK/7rCpPjzt+bG33TQBKWrgS4sug4Pr+DT1sE316bw TZYwdv0rEcga32P8ezrBEJ4AjZJEaT+a0+mantH8pfJIjhyu9nFw4RRj/rIemYg1rntG w0T7TjWdMfCE97/92pGUySVwMtmjGNVEspbFzHDO2E+uIUqy4UFx4ObnKK/Lvg/4Qry4 0Kw7odBwknodUnbDogFP2X5gA7BdWgZoAxGt+HnhUTkYBO7OIznA0iH7rWocd5pA2PcG +NmQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=qD+w4MC7; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=hy0zCqDGoNPCR7akjiSI5c1LEY0KvhtZOaHBsauY0No=; b=KB1xcclSrSEKLZw/yY4ZZoCN7sMxKk3/oX32V0RmrD3q+bO5nmdRj13a9C1Bek5S+5 nXKFHOJvzHe3FV9VkHMWldUQXnJcAC5k9RvYP+7WBFiDxyywM0jLRgBHauRTBaZS0QEP bLYC/ZAJZYlozUBMyfUFbF0f/ds+ED/c5DFxQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=hy0zCqDGoNPCR7akjiSI5c1LEY0KvhtZOaHBsauY0No=; b=qMjeliJWssGHrhPGooTPhZTZZ+KUWjpvCxM+we5UlouX7iG/q/abUy3nqR6Bg6WviO QoszgAck4Wk+R+nQGSxsUYLdASArr/0+9DVABiMKdJ4GRvToBdzea5v5A7WUo78yrTor YOuxlY+yhiDh4VZjMK33XU3LE/FtPN/0Tdj2DNtjXjyJ25yEMDuHC+5eWscZADZCZuVA UXsPQXT32P+x+zerwzjurmO/sm9lb7bl5hiGvEX8VXdTgdKQWTacKvZv/fCy7Cvw0Gsu zwVIiZQkF7+v/4Zecv4S3f+Trpgpmm9jNC59YrIcEBZOCvBaaiMauIo8d9HhcpNznkUq GaQg== X-Gm-Message-State: AOAM531DdcHUYdiVtjObrAjgHksU9lBLL68zxbL/o+RYpm0Tk+1fW8dv VzzSK8SP1u5Wz3VDf7T8qsB7vgQ7 X-Google-Smtp-Source: ABdhPJyRYVUQ6xKnt4cTa66bVSqeM6FJcwbA1v8Iwn8jPWfWBZSrFWPlH/HXkpziVgRkakW9MMvTFA== X-Received: by 2002:a05:6402:274c:b0:42b:394e:c7b2 with SMTP id z12-20020a056402274c00b0042b394ec7b2mr8875792edd.338.1653226699257; Sun, 22 May 2022 06:38:19 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:906:70cf:b0:6fe:d027:3c1f with SMTP id g15-20020a17090670cf00b006fed0273c1fls440498ejk.2.gmail; Sun, 22 May 2022 06:38:18 -0700 (PDT) X-Received: by 2002:a17:906:e202:b0:6fe:478b:7c1 with SMTP id gf2-20020a170906e20200b006fe478b07c1mr15746627ejb.419.1653226697879; Sun, 22 May 2022 06:38:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653226697; cv=none; d=google.com; s=arc-20160816; b=KENi0lYQt03SExZPm1tbsMsRRYuuSzpjjHb6mcad1mwFPCkKldvVbFVBVr6JwPLXDH 8sktVHXGNMa+2AzMGenTpYGChTcabhTKdKLaqSw+anQUmYJYoBnaIDtOX1enDJr6CjoA 4//LbpyTIvmniHYdvlHofeWcbAc9hvlPaL0//zJYM9WeGc/YGsrW0BYfUXBqiTYhPvie Lidlu6e9q289aD/or2ZqT7HPyRwz20csfQ1p1aUMvr4lm66MpQJq9WUcRDBm04OCoi1s X6h6B9cwNsACXpeKj/S81t/OVbKDPwhJSZptHGcz2vQWjt9x6w51uuh3G9l3Nyy4uc/F hqcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=R3n9Nsmy/N48v4Cd5t4AJgEfSEvDIjuBATI3Pkj/ifM=; b=qdIymRCmZh8ErSG0OQoopGvWlRFvFOYDb/pbxKpyBgEYXhmTaGwMSVO6l5437gMjCU gs71wOkbK59DMF2FAtkzS91Hb9ZuSpzUZITC88TjfMD25KKZtwp+bQnT8EWskVJuBPjw zlVxD3WW6e9vkaLsoE+p6W+BKbPZt9BX0I82G8ETyRBpVSsGnbfVN4XYL3AZr2FRebfs UP4vBTXkpOO5FkJk/ORNym/uso8mkUwa1xGugPtUUlFpTSCGqDxwAGcR5CTZh2UY1asI SepR22UiMMk0uLNrYyxKakqxa4t2L/glc8XBnNJDLkYPub7uISzJaLqbVxazzuI7OHeM WcRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=qD+w4MC7; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id h41-20020a0564020ea900b0042aa06922f4sor6881504eda.32.2022.05.22.06.38.17 for (Google Transport Security); Sun, 22 May 2022 06:38:17 -0700 (PDT) Received-SPF: pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6402:40ce:b0:42b:9d1:96e6 with SMTP id z14-20020a05640240ce00b0042b09d196e6mr16386132edb.262.1653226697560; Sun, 22 May 2022 06:38:17 -0700 (PDT) Received: from panicking.amarulasolutions.com (host-80-21-24-253.business.telecomitalia.it. [80.21.24.253]) by smtp.gmail.com with ESMTPSA id md17-20020a170906ae9100b006feaf472637sm2696906ejb.53.2022.05.22.06.38.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 May 2022 06:38:16 -0700 (PDT) From: Michael Trimarchi To: Tommaso Merciai Cc: linux-amarula@amarulasolutions.com Subject: [PATCH 3/3] net: phy: DP83822: check for supported interface modes in config_init Date: Sun, 22 May 2022 15:38:13 +0200 Message-Id: <20220522133813.119729-3-michael@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220522133813.119729-1-michael@amarulasolutions.com> References: <20220522133813.119729-1-michael@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: michael@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=qD+w4MC7; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Let config_init check for unsupported interface modes Signed-off-by: Michael Trimarchi --- drivers/net/phy/dp83822.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/phy/dp83822.c b/drivers/net/phy/dp83822.c index 89887a05f23d..2741081d6988 100644 --- a/drivers/net/phy/dp83822.c +++ b/drivers/net/phy/dp83822.c @@ -387,6 +387,11 @@ static int dp83822_config_init(struct phy_device *phydev) int err = 0; int bmcr; + if (!phy_interface_is_rgmii(phydev) && + phy->interface != PHY_INTERFACE_MODE_RMII && + phy->interface != PHY_INTERFACE_MODE_MII) + return -ENODEV; + if (phy_interface_is_rgmii(phydev)) { trx_int_delay = phy_get_internal_delay(phydev, dev, NULL, 0, true);