Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp774129rdb; Sun, 18 Feb 2024 11:02:59 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX0XGEO0rVgcVzR8OMeBG4RoggcurxvWQTPiMaHuz1X4aDm3+WelQmjPB3ZXyf8U4ciMSuMWQ5pL4UQtYKgwDE7ymqWPXRNc99JVWkmHA== X-Google-Smtp-Source: AGHT+IFuEs/7qC2F6tR3Zl1uRgOl/zyx90Hcwvyx2cHUB/kuQH4Ye5pDTmLmT222oHvWi1pakAVL X-Received: by 2002:a17:90b:3118:b0:299:1d33:846c with SMTP id gc24-20020a17090b311800b002991d33846cmr6654068pjb.39.1708282978996; Sun, 18 Feb 2024 11:02:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708282978; cv=pass; d=google.com; s=arc-20160816; b=KgNQhA27HEh+ONHOOxC7sU5lEGHr0fw/ay73vhLF4w4aaOE1VJB5zn3lLpfHrLRXEG FUIEM4br63QmNdBjtAh1mcbeSFvN6cYbi2W/CrOd2OiZCWFZLUPvRr4RuR7RFM/m+Hmj 0xAlAoTG+Tzt0J3pM0Hi7KICPywEoESrX0+rhJijpljQo+q0kwXTBVaQUtju9dTeaP3c gwH93FjTeHI1JyqL9yft+FtGXW+iZ1kkaLFi8naXqUaMfT7piazTumZCAkrJNIW9r4lS wW0TXDc8gWbsgEkzRhbFppNKyhsL07Ni8XdB7wJc0c4b7HXbtLfsWefDUe+ArRyfYa2t +vcg== 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:to:from :dkim-signature; bh=Ugw282irBh1ZorGeTnwJP2X/5ka0Fa/kP4DGUbl7TpM=; fh=fbtO0vk5+/3uPdM5KJHrDkVb8BS/46voLPSHmXFw8zo=; b=m1C0mS0Nx6nowYXEjtySjzTuhQ2V5wix1HAr9ZJavy5EfzrAN/I/uJNd6vIOaMEZQH 7700oR5Hmp4U4aypxrackHWXCd18pkCYJVtZ+p8BqByCI1oETtwwGYhsvmCIkhMxweHp dZu/Xv8py3V1JDRpqwyi3N8Xy4m5pUsbPRhRgNG+dBuMbFOEO7h7zb4Rshzd4W1sSPe7 YIxs8wqTiczeHhHenYqC7BGHhmHc13lgb3X65TX2HwUP3zFKyjVRPn2epQZymVOq0O8Q sTDFI3saQEwSQ0vWSDD8pSFKAEzzeXQcaQGiuiF0mrvspNN6j9hFtcpyKuZqoVMauSTP STSw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=J01y7xoj; 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-70521-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70521-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id pj1-20020a17090b4f4100b00296eabf9e08si3302285pjb.97.2024.02.18.11.02.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Feb 2024 11:02:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-70521-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=J01y7xoj; 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-70521-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70521-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 5BF9A281F83 for ; Sun, 18 Feb 2024 19:02:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E6DD16F538; Sun, 18 Feb 2024 19:00:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="J01y7xoj" Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) (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 0C9726F064; Sun, 18 Feb 2024 19:00:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708282847; cv=none; b=a0nWKNtNjONpj16/eMkk7WShfrMe/vPU7MMmMALLAvhU9CQBt3UpgnUZHWH3/6uzzhzN4bmQLeFs9a7/t5hPXjfWaDJEtqZgAp9Xw7DNzUNshDd/I2y9pBCl1Q9WBClyT22AYOSYuRsS4xCZzRkfu2DZXX34hySNjsPLifrS2RI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708282847; c=relaxed/simple; bh=+fN+q98VpY8IjI1MBMjHL55COKOUOcO50sgpN3QZVSs=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=jYr0jOZTzQx43qBj8wDwrNvVbH5gI2O0YqmybFkalrS5HPXn8tDVG/sQpGLy0zkH4uLZL/HDa2XCF3D0/b12Z9q7PUgicit33wrG1KiOeXPmuZCMBP8RoC3Z4W8Z1oW/aAs+7IPcUUZK2FG25Kfm5cI9eWcJ4bp1XAOPTJOQZ7g= 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=J01y7xoj; arc=none smtp.client-ip=209.85.208.174 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-lj1-f174.google.com with SMTP id 38308e7fff4ca-2d23473a563so7926581fa.3; Sun, 18 Feb 2024 11:00:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708282843; x=1708887643; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=Ugw282irBh1ZorGeTnwJP2X/5ka0Fa/kP4DGUbl7TpM=; b=J01y7xojVtxrP/5K0KvdLRUKoyBhtGhbGuLb7bppXBla9Y9a5FZ6zgdnHumzHUKO1A kqCw8zz6OSQTVFT2d59Ix6/b2xwu9wGG0CBp5fgHJ/FoH+QkuinSNzTpKa9lphIDioxi 5YwPhaVhgLFDk1vgqQ0OEx1KH2trfvqpBoeYGQmiSaHKOROGE3vhIyQrugbjPwZwdOgO prvEOMXv2AeothD6BeKxiON0Ix/CDr6kl6E7n4XUr02tDdNZKScrlP5K8W7WvjoiXlra YT+6V8p+QbNtNAhzWeyjdxnJORsOaBmhefNJGyZvJntPPMwtuA6UFtYRoH3tO3h89Wsi jHmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708282843; x=1708887643; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Ugw282irBh1ZorGeTnwJP2X/5ka0Fa/kP4DGUbl7TpM=; b=jvN3P1gf8lQItyJ0nI3vWrXH6LHBkAezr4oJiyPduuRdgpd9fSX8fXhnBZoAf+whNU 0Uos0NZzseDy0A5G5+7laMsxIn72izYwuoI9VQLJwtrC96MK6JhFR1AlOR3QAIjolZxi eX6ZyZL45c4PFZE+6gS30RA4UDSH4g0GtNd7Y+NcMfVTsnYoQFFyWTY+D55jP+brfns3 sWWMJLEpVUV2AbGPU7LhJENWsbhY4kJsbbeDxJxactGqLAzAwIJbYKMxEJyfXSQPWYOX C0enlMERjEE13njH6IaNFKW2H3fw83tJpkmghvKQK9SnK5BkmV62lsr6EFtO1frVN0pt NTpw== X-Forwarded-Encrypted: i=1; AJvYcCWIHI9fYgKI+VA/DZSsvZSE0vexqyAto+D4n5yXyY06XG3GBYGOu/piXReTUBYvtC4DJED4OPYpy+NeBbuMgIL/J530Nepkm5gwXKVx5zOswRrwFJ1BaVL3jc3PsthK/6AHU/Bw X-Gm-Message-State: AOJu0YywhNpAtsMKEjlG31zu2HNoBpHtPu1pO3kAar0PjdBONKpQWH8Q 7Dg2bjfTdgtz7aui1bWKrLW+OxUiSI8snGufiFbvxBlxyn+l0/HI X-Received: by 2002:a2e:9956:0:b0:2d2:3018:6eda with SMTP id r22-20020a2e9956000000b002d230186edamr2274750ljj.39.1708282842871; Sun, 18 Feb 2024 11:00:42 -0800 (PST) Received: from localhost.localdomain (93-34-89-13.ip49.fastwebnet.it. [93.34.89.13]) by smtp.googlemail.com with ESMTPSA id m15-20020a056000008f00b0033b728190c1sm8115762wrx.79.2024.02.18.11.00.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Feb 2024 11:00:42 -0800 (PST) From: Christian Marangi To: Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Florian Fainelli , Broadcom internal kernel review list , Christian Marangi , Robert Marko , "Russell King (Oracle)" , Greg Kroah-Hartman , Pieter Jansen van Vuuren , Nipun Gupta , Andy Shevchenko , Puneet Gupta , Abhijit Gangurde , Umang Jain , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [net-next RFC PATCH 0/6] net: phy: support multi PHY in phy_driver Was: net: phy: detach PHY driver OPs from phy_driver struct Date: Sun, 18 Feb 2024 20:00:26 +0100 Message-ID: <20240218190034.15447-1-ansuelsmth@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 This is an alternative implementation of "net: phy: detach PHY driver OPs from phy_driver struct" with the same object in mind. As was pointed out in the previous series, deatching OPs is a way too big change (although IMHO needed, but I understand the problem with downstream and ugly code). As suggested and was already an idea discussed privately, a more easier approach is introduce an alternative way in phy_driver struct to declare PHY with the use of an array of IDs. Some small changes were needed to mod_devicetable to make mdio_device_id more suitable for the task. This implementation keep the single way to declare PHY ID in phy_driver but also indotruce .ids where a table of mdio_device_id can be defined. Each entry can optionally have a .name variable to define a more specific PHY name (for phydev_info/err.. usage) that if detected will overwrite the dev name. An example of this name is a phy_driver with a .name "Aquantia 107/102" and .ids with single mdio_device_id with "Aquantia 107" and "Aquantia 102" "Aquantia 107/102" will be used for early PHY driver probe and the more specific name will be used as soon as the phydev dev_id is populated. Aquantia driver is reworked to this implementation and BCM7xxx driver table is rewritten to greatly benefits from this implementation. While at it I also notice a strange problem with detected PHY ID and C45 PHYs. Probably i will have to drop it, but including in this series just to make someone aware and maybe discuss about it too? Christian Marangi (6): net: phy: add support for defining multiple PHY IDs in PHY driver net: phy: fill phy_id with C45 PHY mod_devicetable: permit to define a name for an mdio_device_id net: phy: support named mdio_device_id PHY IDs net: phy: aquantia: group common OPs for PHYs where possible net: phy: bcm7xxx: rework phy_driver table to new multiple PHY ID format drivers/net/phy/aquantia/aquantia_main.c | 170 +++++++++-------------- drivers/net/phy/bcm7xxx.c | 140 +++++++++++-------- drivers/net/phy/phy_device.c | 104 +++++++++++--- include/linux/mod_devicetable.h | 2 + include/linux/phy.h | 8 +- 5 files changed, 243 insertions(+), 181 deletions(-) -- 2.43.0