Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp588149rdb; Mon, 29 Jan 2024 11:20:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IFuhiu9d2341gH4wIj15GQp5SRdODEmS/f8GKB4nADIeu5LZuP6yuOUpDIfdBA+RWieZHPb X-Received: by 2002:a05:620a:1471:b0:783:fa44:b531 with SMTP id j17-20020a05620a147100b00783fa44b531mr2965578qkl.34.1706556020754; Mon, 29 Jan 2024 11:20:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706556020; cv=pass; d=google.com; s=arc-20160816; b=IWqbvcE3f564yYG12LqlTegIpoeOoUPvNzGxUu5RKdqsfgpolQLQVCGJ1zabYRihGW KL31Yl4slRBtv9NNvhNyhEV6/HL4xt8n7WB91XatDP8rQk0ZJH//a54Fl7x3JKBu/hhI BfdevpO+RnZZbKn7WWuumzfwER4s1tHkSkN2ZgSM/2rjD2IToW5GxSaOgzhJcKWLtjTF juK2lcAF2H0RtL9X7XowHCqiYG5VaBizbxiuE6ninTB7lDF2+ZZTbL1w4WigBbYeYxlK OjRHN4c7Scke2zepJBxqtsYXQxCddCe7OkPT0YQVxOfFL3EazEhqpP8H0YptAp/rSHmu LvSw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=Pd/yecyHAFTDh8qCbQ+Q19zkqlLUJ1YCiCGL/BFOT/g=; fh=iCjaxIBFXlrguOgYu9CRknkdcHTQtSwA5nqC1GWhodA=; b=wubs+Gsu0/bfeTbPF0bc4BzXc2lAZb+mqdbWYJ009hI3VeYc+cam/42CTXqSih1Ukg 8EIus6AjCp9oFU9A8NmZs8XjpTgJ6/Z6lfiHsV3Pj9whzUHZydNK+KRZObUhhaxsJecf eDlXHuC0bDlWwFRXaeI0L3r3Q+gjYCNqQVNle99JxRo3U5MZY+Kp4L75FUP2m/Z3fzLG Un5RkKwVKHy4dFV50+5JVmxb21+nyyPHrPI5bEkqH19fo/DQ5m40E53ZAPA1mDEQZAw5 qN/Lg9/dJSRPRyzWgLvGa732sAsbIoqaT0exTXz3Vjk9oKkGY0ChbODlH57rEtrkyQ9Q J1rg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=YC4DUsm8; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-42765-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42765-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id az19-20020a05620a171300b00783fd8be42dsi3147889qkb.562.2024.01.29.11.20.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 11:20:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-42765-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=YC4DUsm8; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-42765-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42765-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id C81311C24267 for ; Mon, 29 Jan 2024 13:12:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A9E8462A04; Mon, 29 Jan 2024 13:12:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="YC4DUsm8" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3F8BB6340E; Mon, 29 Jan 2024 13:12:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706533931; cv=none; b=SyltPVSF4DcuSm+t7jz4EoEwVka+xgihZnzYLVACpn8g9SWHWt1qa1aarNk+2evK1XLExZsfPEQBYnrg+h5+ePNetxYNmVMSNla/EqRo3nYhfHh04V92YTHRsdnIZfa9REwiYSdJ8ZPhkUHIVivx/Q6cuTQosS/dAojg98CrwWQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706533931; c=relaxed/simple; bh=+Ew5LUI3g/pPiKdhhQ2t8V+CzBXr7IlkIiYR6xaMc2Q=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=kfQVTkcLMPOEXnxS736OixosEW3sraKNhoV/6X+43Xjqi+mzJqTym17wEZoH0dRvGMh6ymA+ttwOwndBNt3B+WyR+Vqp9AOkdkRr8vH6yrdDEUbQpOKBIiW9E58EuYcVopk3vOY9aKTEYU8eYOHZxGr+VmlnzNw2VvVBOCJCMVM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=YC4DUsm8; arc=none smtp.client-ip=198.175.65.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706533931; x=1738069931; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=+Ew5LUI3g/pPiKdhhQ2t8V+CzBXr7IlkIiYR6xaMc2Q=; b=YC4DUsm8dK20MvP3ERW0YBTv1/EnztBrD/5OEmKRhfiHCZ4ncrtNCyNZ 82De0zanK/R2nKfktCf8GzU4eaIFvaz3NivKNesPQQWIQnHoeJgbL5Mg/ FMNeGdOdzqLaQCkJNExesZE2ORNqS7cWIffHMzWPEP/KQ6g/ccOCLpx5l iRd7Z8fFUCbm0ojisVCu+L3CuxWeXezalsK0umzyVf795jr9XPZPjqTqj zEqSUbZtR4BZ8/LAeP0WQ2F8WpdBhrNjEoZT7mpVkb6dptH9yZyOzwvZP px1lRD/hU7RlK5EqDCw4Np7ZFfao7otOytJCL3RWhxV5acqqJOah+xgmd A==; X-IronPort-AV: E=McAfee;i="6600,9927,10967"; a="10328222" X-IronPort-AV: E=Sophos;i="6.05,227,1701158400"; d="scan'208";a="10328222" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jan 2024 05:12:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10967"; a="878068136" X-IronPort-AV: E=Sophos;i="6.05,227,1701158400"; d="scan'208";a="878068136" Received: from choongyo-mobl.gar.corp.intel.com (HELO [10.247.122.111]) ([10.247.122.111]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jan 2024 05:11:56 -0800 Message-ID: Date: Mon, 29 Jan 2024 21:11:53 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next v2 0/5] TSN auto negotiation between 1G and 2.5G Content-Language: en-US To: "Russell King (Oracle)" , Andrew Lunn Cc: Rajneesh Bhardwaj , David E Box , Hans de Goede , Mark Gross , Jose Abreu , Heiner Kallweit , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , =?UTF-8?Q?Marek_Beh=C3=BAn?= , Jean Delvare , Guenter Roeck , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Richard Cochran , Philipp Zabel , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Wong Vee Khee , Jon Hunter , Jesse Brandeburg , Revanth Kumar Uppala , Shenwei Wang , Andrey Konovalov , Jochen Henneberg , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, platform-driver-x86@vger.kernel.org, linux-hwmon@vger.kernel.org, bpf@vger.kernel.org, Voon Wei Feng , Tan Tee Min , Michael Sit Wei Hong , Lai Peter Jun Ann References: <20230804084527.2082302-1-yong.liang.choong@linux.intel.com> <5bd05ba2-fd88-4e5c-baed-9971ff917484@lunn.ch> <37fe9352-ec84-47b8-bb49-9441987ca1b9@lunn.ch> <0098eaf3-717a-4b50-b2a0-4b28b75b0735@lunn.ch> From: Choong Yong Liang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 21/9/2023 10:55 pm, Russell King (Oracle) wrote: > On Thu, Sep 21, 2023 at 04:41:20PM +0200, Andrew Lunn wrote: >> On Thu, Sep 21, 2023 at 03:12:19PM +0100, Russell King (Oracle) wrote: >>> On Thu, Sep 21, 2023 at 03:21:00PM +0200, Andrew Lunn wrote: >>>>> Hi Andrew, >>>>> >>>>> After conducting a comprehensive study, it seems that implementing >>>>> out-of-band for all link modes might not be feasible. I may have missed some >>>>> key aspects during my analysis. >>>>> >>>>> Would you be open to sharing a high-level idea of how we could potentially >>>>> make this feasible? Your insights would be greatly appreciated. >>>> >>>> stmmac_mac_link_up() gets passed interface, speed and duplex. That >>>> tells you what the PHY has negotiated. Is there anything else you need >>>> to know? >>> >>> The problem is... the stmmac driver is utter bollocks - that information >>> is *not* passed to the BSP. Instead, stmmac parse and store information >>> such as the PHY interface mode at initialisation time. BSPs also re- >>> parse and store e.g. the PHY interface mode at initialisation time. >>> The driver ignores what it gets from phylink. >>> >>> The driver is basically utter crap. That's an area I _had_ patches to >>> clean up. I no longer do. stmmac is crap crap crap and will stay crap >>> until they become more receptive to patches to fix it, even if the >>> patches are not 100% to their liking but are in fact correct. Maybe >>> if I ever decide to touch that driver in the future. Which I doubt >>> given my recent experience. >> >> Hi Russell >> >> You pointed out the current proposal will break stuff. Do you see a >> way forward for this patchset which does not first involve actually >> cleaning up of this driver? > > As I said in one of my replies, it would really help if the author can > provide a table showing what is attempting to be achieved here. With > that, we should be able to work out exactly what is required, what > needs to change in stmmac, etc. > Thank you, Russell and Andrew for the comments. What I'm trying to achieve here is to enable interface mode switching between 2500basex and SGMII interfaces for Intel platforms. I did based on the DM7052 SFP module and BCM84881 PHY to make the necessary changes in the new version of my patch series. In the new patch series, the 'allow_switch_interface' flag was introduced, based on the 'allow_switch_interface' flag, the interface mode is configured to PHY_INTERFACE_MODE_NA within the 'phylink_validate_phy' function. This setting allows all ethtool link modes that are supported and advertised will be published. Then interface mode switching occurs based on the selection of different link modes. During the interface mode switching, the code will go through the `phylink_major_config` function and based on the interface mode to select PCS and PCS negotiation mode to configure PCS. Then, the MAC driver will perform SerDes configuration according to the interface mode. I did rewrite the description for the new patch series, hoping that it is clear to describe the whole intention of the changes.