From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 F244B3921D6 for ; Fri, 17 Jul 2026 11:11:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784286691; cv=none; b=GVlh4c3oP6Uqx4Ng2zPZn78zwM3K+VTKLfJs/oMrcziGXUkN93yve4G8MW/9CpmBNgc0O0a64ZiN4cMkdlHz4DSgeA/zPDFG81EAk3vyN4Eie/zDk8peZaEbCwAU1n6NCZ0M4Vz9UniJ6LELWXqgiqJrLslig4H9Eps4JEQybWc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784286691; c=relaxed/simple; bh=Wd3KSlAioJV/7oPp15oN/oAaKkVCnRLCkMXjFYtEoTE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=YCKTSsOkCt6dcpUlY53aFePqwCpe7y0l/2GtWHm7/9Lr9Clz6R7fTNk0KXfbN8swQ1J4OyHZEftzz6vzawFyBhwDHAOb9KaiaPooYj/tnIe8whhNEN+VK8EHOlYJZkQTE6NXCSvIYJoYh58zfrrMQdnMp0EnpE9gQEJMvN5hau4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Ct1Z1T1x; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=DR2zNMjC; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Ct1Z1T1x"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="DR2zNMjC" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1784286689; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BHIfBM0S8wL95GpNTxr+CMsZKZuRkWlh0xl4GFsFICM=; b=Ct1Z1T1xPBoyuoaT1kvKK8TUeAnd1+KThR8pRMEhhss++SjIY9FHc5VZ+cTDUqE7eU3aXd uegUd+2tSjLrKGENhuVFVFVE933y8vSh5uEKlFvNbX6IE18bXLOgw7doPjz2Jas+MSNtte XQoUAEp6BlPuFc/LqA5PfANCbx02YtA= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-113-VVRGZxlpPRihfVOMKfINcg-1; Fri, 17 Jul 2026 07:11:27 -0400 X-MC-Unique: VVRGZxlpPRihfVOMKfINcg-1 X-Mimecast-MFC-AGG-ID: VVRGZxlpPRihfVOMKfINcg_1784286686 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-4784d0fb9cfso3002895f8f.2 for ; Fri, 17 Jul 2026 04:11:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1784286686; x=1784891486; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:content-language :from:references:cc:to:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to:content-type; bh=BHIfBM0S8wL95GpNTxr+CMsZKZuRkWlh0xl4GFsFICM=; b=DR2zNMjCP+6RIeVlLtj5rHEYkoME3ZVcl6DaH1BsIf10AIH3Ay14qnGKf5fJSZ7CT0 zTfU9M4gCdjETciyLPm/REMm6pKO1zPZob2rROQ3mxEuZcdxx7pPRed/sSn46dEKM6qj w6A4GHQO040XTEflbWJHFJthZPUqhBkrhAi8xASkrsk2IXYWJaNQ+o6tekmIlSODOUVi p/q2eBT8eP06LMcir7ydrKd2mMmCJwBvvjhDYUyaB/LdDCWft+t828e/tyypX71hrkLN hYKz9BAakHZjElCwYl5AnP+prcxO06oyD5//t8h1kAaNZ2Qwcb7PBipzJ9VmH9TZAPIi E4wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784286686; x=1784891486; h=content-transfer-encoding:content-type:in-reply-to:content-language :from:references:cc:to:subject:user-agent:mime-version:date :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=BHIfBM0S8wL95GpNTxr+CMsZKZuRkWlh0xl4GFsFICM=; b=Axfd2XX7elFuwjacSdvHU15MSuCy5Fr+jagz6aYOq5BgW/DWP6+0dI7VprGL/FraF7 9XlKy8/gqkk4ZwRjwbn4iERsvUehnuMsE3m+BkYMThO5+RoyMZIi7uBv3rn5guYdVjTZ JQbQum4HPMYPnqf6/ERrIXNExPsSh5CViTnopFu9LnBYB8TueKGQQCGoz4ZNrS61/h3g 6Hypaftpb9FG19e/eN1Z0WEUsKp1ZPjyJWkN9wLWvqRe8WIO0QTMBBQp/lWIKks1zb+I GBo7m/Jqm41MP/NN0tp1RjVK+0JiKKW9JVj5ALDGo/KFd3D8fpX3rxKwglpsN+M1QxsQ gKFQ== X-Forwarded-Encrypted: i=1; AHgh+Rog7cVUdoYs2z5qjZJkPRYSgCvr1M7Thg9xFNfugvy1cECSC+7uFOv2ODZIQ75gW8kCgAWtJ/1MhGMh4AU=@vger.kernel.org X-Gm-Message-State: AOJu0YwyxpxGqdli5oyi48dS9lyeIpyz7qMwicdII7yzQf4Z7Imueeth wjB1pqhGUQG97UcCjDDQC6KXrrvPTXxGDKqrXYh8iaWXldjL3oKZuYhCMa3fEyha3WSHiUwEiDv sYsA5847J0DDpVN2aOhaDLBi0j4R9um93c6KKOrq4ubUtswGLpiTQVPYuAzqKeaKFLfc7M6B52Q == X-Gm-Gg: AfdE7cnEnHp/ys+zlAxNovFg60B8yNPdto/1Yt/pH+5QCBjr5vVQk8EyPKS0lPdiXKC N33QFJQS91h6qbSSetU4GSz4t0D4z4JsvNsH/BlO1Z3+YUZ94yVW1gxFy7euPF5uw2iPEG+n63D 9wRK9fihC0Q/jRR6n3jCJXBUw5nTib9aP+9L2myc4c1mWAoAeuDrwvigDbWkSmSaLe79jmJltL1 BD+lCWRngyi6n4Fs6ufl3J60h809iHAsNvEBDum6VYKW5eExu+c2KWVV8qbFS7Nj8/xt49xjXSP OIb4Ox48ysSknRPbcNJw3ktDszvdZo1nSq2NGO/nH/oUTzxkOL8Ei9alfehy5TDLxPFpzI9rL+N AXepF9f05xlGBXHGm+26TBNJ5GGr4Fkhhm8dvGR0/2Z7NaxmpZL88a+S08W0Ap2Uegc7MrNcoU0 SWpw== X-Received: by 2002:a05:6000:18a9:b0:478:33fe:f97c with SMTP id ffacd0b85a97d-47f62314fb3mr3114970f8f.26.1784286686029; Fri, 17 Jul 2026 04:11:26 -0700 (PDT) X-Received: by 2002:a05:6000:18a9:b0:478:33fe:f97c with SMTP id ffacd0b85a97d-47f62314fb3mr3114916f8f.26.1784286685412; Fri, 17 Jul 2026 04:11:25 -0700 (PDT) Received: from ?IPV6:2a0d:3344:5521:6b10:58fd:68f:7756:389d? ([2a0d:3344:5521:6b10:58fd:68f:7756:389d]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47f63ed2313sm2733376f8f.23.2026.07.17.04.11.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 17 Jul 2026 04:11:24 -0700 (PDT) Message-ID: <26cb3349-5344-48c0-b0b7-37133b4e0662@redhat.com> Date: Fri, 17 Jul 2026 13:11:23 +0200 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 v2] net: dpaa: fix mode setting To: Michael Walle , Sean Anderson , Madalin Bucur , Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Russell King Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260710143430.2276141-1-mwalle@kernel.org> <2c8f63f5-f04a-4abc-9508-4c47a80da543@redhat.com> From: Paolo Abeni Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 7/17/26 12:13 PM, Michael Walle wrote: > On Fri Jul 17, 2026 at 12:01 PM CEST, Paolo Abeni wrote: >> On 7/10/26 4:47 PM, Michael Walle wrote: >>> On Fri Jul 10, 2026 at 4:39 PM CEST, Sean Anderson wrote: >>>> On 7/10/26 10:22, Michael Walle wrote: >>>>> Before converting to the phylink interface, the init function would have >>>>> set the correct I/F mode depending on the maximum link speed of an >>>>> interface. After converting to phylink, the established link speed >>>>> is used to determine this setting and is set in the .link_up() >>>>> callback. The callback isn't called because the link is never >>>>> established between the PCS and a connected SGMII PHY. >>>>> To fix it, don't use the current speed, but set the mode depending on >>>>> the interface (which implies the maximum speed) in .mac_config(). >>>>> >>>>> Fixes: 5d93cfcf7360 ("net: dpaa: Convert to phylink") >>>>> Suggested-by: Sean Anderson >>>>> Signed-off-by: Michael Walle >>>>> --- >>>>> FWIW, I dropped setting a non-reserved mode in init(). The hardware >>>>> default is 0 and the mac_config() will set a valid mode anyway. >>>>> >>>>> Changes in v2: >>>>> - the setting is/was based on the maximum speed, not the current >>>>> speed. thus, move the setting into mac_config(). >>>>> - Link to v1: https://lore.kernel.org/r/20260706121011.1948906-1-mwalle@kernel.org/ >>>>> >>>>> .../net/ethernet/freescale/fman/fman_dtsec.c | 26 ++++++++++--------- >>>>> 1 file changed, 14 insertions(+), 12 deletions(-) >>>>> >>>>> diff --git a/drivers/net/ethernet/freescale/fman/fman_dtsec.c b/drivers/net/ethernet/freescale/fman/fman_dtsec.c >>>>> index fe35703c509e..7075f93bab49 100644 >>>>> --- a/drivers/net/ethernet/freescale/fman/fman_dtsec.c >>>>> +++ b/drivers/net/ethernet/freescale/fman/fman_dtsec.c >>>>> @@ -900,22 +900,28 @@ static void dtsec_mac_config(struct phylink_config *config, unsigned int mode, >>>>> { >>>>> struct mac_device *mac_dev = fman_config_to_mac(config); >>>>> struct dtsec_regs __iomem *regs = mac_dev->fman_mac->regs; >>>>> - u32 tmp; >>>>> + u32 ecntrl, maccfg2; >>>>> + >>>>> + maccfg2 = ioread32be(®s->maccfg2); >>>>> + maccfg2 &= ~(MACCFG2_NIBBLE_MODE | MACCFG2_BYTE_MODE); >>>>> >>>>> switch (state->interface) { >>>>> case PHY_INTERFACE_MODE_RMII: >>>>> - tmp = DTSEC_ECNTRL_RMM; >>>>> + ecntrl = DTSEC_ECNTRL_RMM; >>>>> + maccfg2 |= MACCFG2_NIBBLE_MODE; >>>>> break; >>>>> case PHY_INTERFACE_MODE_RGMII: >>>>> case PHY_INTERFACE_MODE_RGMII_ID: >>>>> case PHY_INTERFACE_MODE_RGMII_RXID: >>>>> case PHY_INTERFACE_MODE_RGMII_TXID: >>>>> - tmp = DTSEC_ECNTRL_GMIIM | DTSEC_ECNTRL_RPM; >>>>> + ecntrl = DTSEC_ECNTRL_GMIIM | DTSEC_ECNTRL_RPM; >>>>> + maccfg2 |= MACCFG2_BYTE_MODE; >>>>> break; >>>>> case PHY_INTERFACE_MODE_SGMII: >>>>> case PHY_INTERFACE_MODE_1000BASEX: >>>>> case PHY_INTERFACE_MODE_2500BASEX: >>>>> - tmp = DTSEC_ECNTRL_TBIM | DTSEC_ECNTRL_SGMIIM; >>>>> + ecntrl = DTSEC_ECNTRL_TBIM | DTSEC_ECNTRL_SGMIIM; >>>>> + maccfg2 |= MACCFG2_BYTE_MODE; >>>>> break; >>>>> default: >>>>> dev_warn(mac_dev->dev, "cannot configure dTSEC for %s\n", >>>>> @@ -923,7 +929,8 @@ static void dtsec_mac_config(struct phylink_config *config, unsigned int mode, >>>>> return; >>>>> } >>>>> >>>>> - iowrite32be(tmp, ®s->ecntrl); >>>>> + iowrite32be(ecntrl, ®s->ecntrl); >>>>> + iowrite32be(maccfg2, ®s->maccfg2); >>>>> } >>>>> >>>>> static void dtsec_link_up(struct phylink_config *config, struct phy_device *phy, >>>>> @@ -948,15 +955,10 @@ static void dtsec_link_up(struct phylink_config *config, struct phy_device *phy, >>>>> iowrite32be(tmp, ®s->ecntrl); >>>>> >>>>> tmp = ioread32be(®s->maccfg2); >>>>> - tmp &= ~(MACCFG2_NIBBLE_MODE | MACCFG2_BYTE_MODE | MACCFG2_FULL_DUPLEX); >>>>> - if (speed >= SPEED_1000) >>>>> - tmp |= MACCFG2_BYTE_MODE; >>>>> - else >>>>> - tmp |= MACCFG2_NIBBLE_MODE; >>>>> - >>>>> if (duplex == DUPLEX_FULL) >>>>> tmp |= MACCFG2_FULL_DUPLEX; >>>>> - >>>>> + else >>>>> + tmp &= ~MACCFG2_FULL_DUPLEX; >>>> >>>> Did you test this when forcing 10/100 speed? >>> >>> No I didn't. Well I can't. I have a very weird board which only >>> supports 1000base-X (and copper SFPs in 1000basex autoneg mode). On >>> top of that there is a Marvell 88E1112 in between the SFP and the >>> MAC, for which the PHY driver is completely broken. Long story >>> short, I'm not able to test that (yet/at all? Not sure). >> FTR, sashiko suspect this patch will broke such setup: >> https://sashiko.dev/#/patchset/20260710143430.2276141-1-mwalle%40kernel.org > > I've seen that, but.. that was the actual change between v1 and v2 > as suggested by Sean. It does not depend on the actual link speed, > but the maximum link speed. So it is not relevant if the link > negotiates to a slower speed or not. At least that now matches the > behavior prior to the phylink conversion. If that was working - > that I can't tell you. I'm sorry, following all cross revision discussion is a bit hard here. I don't understand if the 'link never established' is specific of your board, or it a constant with this driver. Could you please clarify? /P