Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2399536rdb; Mon, 12 Feb 2024 03:51:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IEBE8mJKfoN0BCCy5vPNPf9Q+9LfccOygACBGVH41ecGqth6+FFiLuv0OMESO2809Zr1UYw X-Received: by 2002:a50:f61c:0:b0:561:83e1:6774 with SMTP id c28-20020a50f61c000000b0056183e16774mr3967947edn.27.1707738664629; Mon, 12 Feb 2024 03:51:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707738664; cv=pass; d=google.com; s=arc-20160816; b=bbSuvvoBpr4xc19lzzHj9GV5p3D7xvkSI8EzDstW0Aytrpue95DqQr6pFCuMY1TSY5 7/31tVltaE+fISCMeTT5+MJuYwdaJqHAaOabRu3YPSsD+SowtU8j9GaEw3A9kQbPE5Y5 ZsnKyq80if4bWt6Vt2EYLwxXM+k/AAzewv7HQ1mrQeKAoWJlxXHMcj4sN682YGmyntb2 f+iSCTyEiTPLJAj1Gq6xF9fmIpCilTfm/17HermJ4XNvA2i6OOIuGKakwVqBRhHTZ0S3 QDGN7U8o/SJWqIb572HQNiU31sYww5eP4hdz93qIOCv8Xdaj566YpONdA6mRBJ/uoEVw VZYg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=DI/JPUx6NGwjBeuZnuCsSQdfuZnc/sODY2AjTvUNJeU=; fh=GLf1QGr/yaR3wbBh2o54H2qO5munk2jahF3EjvyRZg8=; b=ly70/9drSUILn79Q40fIbznyIDPLCa1zsN3JIF4a6GNx0By+2SqbIQO6ulhaupYzeQ nj6HL5opFTOfOol+uTXiGEbATuaOz7xQh2bOFYGwCb7N9CEiRmWGgeDIm5b7o2XJ5eDm 5RzCBnZ9N5OsFf9YwXkTz7cbIk07LoY/xO26laATh6D2Hpddt1jOV2MEfpCmcX7UJsIG bD4zUG0ImNwqkVcxwSzQ3zq0K7tjcuFLvS1/uV6FSVMxJAgiDWfIJ0jcjRDtKXqqNVbY 3D/g3ijw3iXyRt7HVpvvXBRe2c+hl2d7Z0hj4Wpkptr3fjh1wuuynQwsiRNypMlzNABM mxYQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=FTLBdJQ2; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-61455-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61455-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=2; AJvYcCVhA+xR8arKnRyXu8HGrCg+V1ymn9GObdubltbl0d2l6nB0GU2sH8pdmcDtoEBUE8eqr3IaIHMlL/QINBa17DHKMMYDy8jE8/wpUjK11w== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id b3-20020aa7d483000000b005613d97ffaasi2724028edr.610.2024.02.12.03.51.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 03:51:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61455-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=FTLBdJQ2; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-61455-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61455-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 5F0CE1F2269C for ; Mon, 12 Feb 2024 11:51:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 50AF639AE1; Mon, 12 Feb 2024 11:50:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FTLBdJQ2" Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EB84439AC5; Mon, 12 Feb 2024 11:50:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707738650; cv=none; b=GkboYvZlip2J9bBuIdIPYqYkoD58BhbP1ohocMF2iqohR58U5cRCxXVZz6Lx69Dioq6QKI1gIbHqEIy8ZqVnG4rRnZbbH+B6C7vfYHD406TdFHJsPjxq5kpBhKyE/gPVY35AQB/YU48qXMyYYZ5C94qg1QTnKYPwVdpHq03V0hI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707738650; c=relaxed/simple; bh=/kq5w1POb6DWCXoFZuLee/5Hf4I/xNQaA8461i2aYSA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=V1bg31JkKIFkvKMqkdpc5g4l15MPJFBRTYTB7kHxunr0DhRYKCowTngf6db3UypbupvdKaJqggY0pJOmMcsSuENO0ku6cT2g7DpnYpB61t3YyJCdszHyadZL/XZ0Pb3mkjditRlweJUFytDUrue2PjLZzzaMX+0UCKoCIaW4JSk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=FTLBdJQ2; arc=none smtp.client-ip=209.85.208.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-56003c97d98so3747899a12.3; Mon, 12 Feb 2024 03:50:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707738647; x=1708343447; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=DI/JPUx6NGwjBeuZnuCsSQdfuZnc/sODY2AjTvUNJeU=; b=FTLBdJQ283KTR3DsSkmPReJMxq+6GmAgDKfzHv58ydao6ChRYDucKmH57R5O6Cf06k fYWex8vEV+Z01Up50kAa1sPXAB/lPo/N0C6GSDItfSqifeIbGq4Vf7U+sCE0FX2e4lJl MZoFoH4U+DA1hhJJWwmqGdsbDKUxrI9FYkwEThX9MQBBVSces5AUDkboQDNL4Ljkst23 QOeL2szXyTTMW/O6lZgGSA2+yGVMY7XP7rzzQpk4S1ilCKyp7KXagtCVy5Rga16+4hEp vDO3QvORc6Km/66mYvobUnezm4VOnUtC4hFEyzu6VdQjubpFWSdYr4Y5bihP9RxdO9XT O2Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707738647; x=1708343447; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=DI/JPUx6NGwjBeuZnuCsSQdfuZnc/sODY2AjTvUNJeU=; b=jTQa4tWLjcZoDd0Yz/33y5ONVqPBuIf0v92sRdSjEFYdFU8HaJZf6ODL+E2W9KdDYu lcluKooKDN7RYOcLMMtGwJZpvzxx7qxuChWNfIN9w9XLXiWWVNlN6vt1DCjh6wfuhuV1 XrGJNFcNwQu7MQ1VfFN1bb/wDY48zKG7xMwf/XfCbEufnFFgshbkjthOkCTp+RciUJgJ 16Cg/XsFDgUmkLrkmVtCjlgQxYjwCD81yTAKcgzDbHktYlKO8+AmHGXAtxLqdMPutiTL pJBw23Ua7rNLlp7u/8L+VRF6bBkWiGW+noN14ZIA5L4sjjYsWrmJ9n3iqazqHViS1tJq qB5A== X-Gm-Message-State: AOJu0YxJ8chfxpTBZ6UKU76bh3BTZWi1MT4mjDhtShGrxXK7pIWK0Cfb Qi+kvHK11jFshxqBoc2t5To2H0suvGXEIXPB7y+NEH12hvBrIrpoN/20mkq2bpI= X-Received: by 2002:a17:906:2787:b0:a3c:c451:2115 with SMTP id j7-20020a170906278700b00a3cc4512115mr845655ejc.77.1707738646617; Mon, 12 Feb 2024 03:50:46 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUvVnYjwl1kXCkY6Q5HCHxosLviHu0mbZd4UfAyKqv/n4THscQ62fBfKS0esaHexyd7rx/jI8u3C4ruKxWli4Q/3iGG+VrFG6IOMgbY4mNC7CJ4YU1vAf9baLjz74PpeNf7ph4jCRpOvOQhGSxDvv5HUOrQGEC6a57CzVLBjACv6guMqWBVuf2SGTE8KqtJBvSDLYKj0mO3Iozednaii92VE5UZmu7C9TwJh5tGJiaE5NwhylMcoOPqtcH41jRzk96pKfZJJr+uQOwmpOSxlFf4cnBrBXfHlUIzmHgX8enw4w0RDuGX0kkGbV8mBD5aBxRg2wAcwrNwvqNVys5J4KR3jlvydQfwBsGwUJAE/Pj8g3UjuGEe6Vf+ICImwdeN+RvHvE03uecQLUG9IFfP4Js3k0TKvz7SjprkDf5Q1D4= Received: from fedora.. (cpe-109-60-83-183.zg3.cable.xnet.hr. [109.60.83.183]) by smtp.googlemail.com with ESMTPSA id n7-20020a170906118700b00a3845a75eb7sm126534eja.189.2024.02.12.03.50.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 03:50:46 -0800 (PST) From: Robert Marko To: andersson@kernel.org, konrad.dybcio@linaro.org, andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, ansuelsmth@gmail.com, linux-arm-msm@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Robert Marko Subject: [PATCH net-next] net: phy: qca807x: move interface mode check to .config_init_once Date: Mon, 12 Feb 2024 12:49:34 +0100 Message-ID: <20240212115043.1725918-1-robimarko@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Currently, we are checking whether the PHY package mode matches the individual PHY interface modes at PHY package probe time, but at that time we only know the PHY package mode and not the individual PHY interface modes as of_get_phy_mode() that populates it will only get called once the netdev to which PHY-s are attached to is being probed and thus this check will always fail and return -EINVAL. So, lets move this check to .config_init_once as at that point individual PHY interface modes should be populated. Fixes: d1cb613efbd3 ("net: phy: qcom: add support for QCA807x PHY Family") Signed-off-by: Robert Marko --- drivers/net/phy/qcom/qca807x.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/phy/qcom/qca807x.c b/drivers/net/phy/qcom/qca807x.c index 01815f947060..780c28e2e4aa 100644 --- a/drivers/net/phy/qcom/qca807x.c +++ b/drivers/net/phy/qcom/qca807x.c @@ -562,6 +562,11 @@ static int qca807x_phy_package_config_init_once(struct phy_device *phydev) struct qca807x_shared_priv *priv = shared->priv; int val, ret; + /* Make sure PHY follow PHY package mode if enforced */ + if (priv->package_mode != PHY_INTERFACE_MODE_NA && + phydev->interface != priv->package_mode) + return -EINVAL; + phy_lock_mdio_bus(phydev); /* Set correct PHY package mode */ @@ -718,11 +723,6 @@ static int qca807x_probe(struct phy_device *phydev) shared = phydev->shared; shared_priv = shared->priv; - /* Make sure PHY follow PHY package mode if enforced */ - if (shared_priv->package_mode != PHY_INTERFACE_MODE_NA && - phydev->interface != shared_priv->package_mode) - return -EINVAL; - priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; -- 2.43.0