Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp544790rdh; Wed, 14 Feb 2024 04:56:46 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWQIhdsGDz5IMJDfQYmG3c0YqRCAfDChWOVshaniBWOYl+LaFHjmvv2CHSuzReyVvxmWRCBElAFhiOWhCzraSHL1nMIpE9jibH/tS173Q== X-Google-Smtp-Source: AGHT+IH4GRgh/ZWzgYIYHVGcpBAt0gNvOfGnmCPknB5VLqo/fHsRJ91hE6GtJSR6OdYLA0a2B6pX X-Received: by 2002:aa7:d3cc:0:b0:55f:63ac:2425 with SMTP id o12-20020aa7d3cc000000b0055f63ac2425mr1742624edr.41.1707915405980; Wed, 14 Feb 2024 04:56:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707915405; cv=pass; d=google.com; s=arc-20160816; b=TfvlyRUJw+1t0owCdAMvXbmUDcUq5wKzbHIXjy3ujEVMBCNWYLb9fecE1XEVF8YM4R yo+8UpFYRTdK8wrmKLiz+hsIhl4hgZTxY3dcylrfLu1aaTire/Vds/3gmJsbtw2v0oBZ 7KhuKRGTTeQpx71scZzTIyJAVU/7+Hi5kb8B5YZing2WxYWafMznmNaeRg6wE9NQLX8+ 0lLX7hswvPeBnCVSA3wXGgOi0htskVUCgy7RJqQ0KhzmOupjR71uLhLq/O9H5G5YEUap WggTX6xpdDjXY2aHEyzD8iA/wprWDb90WDBLlESEwc0AZttPerv4A6+Zj2K2aSqL1hJ3 UfaA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=5XHZsoNoLoEFnlnV78+Lk34bmjhSEU006PIr8jhyp/4=; fh=idsvmdIg3gDLAxADHWzjacpOEyRWR9bb0oayCK6+76w=; b=hWFASUr4zXWPA1mzDs9T6uANaEBWfkd0glBhdrTxzdDSYjlUktM6yX66xuIdRddXxE 0IDXqTlaFVlzhMqC1DwWETcdX0Te8INHV1zpQMwEapUYuqP/HthdXK9N/9AQVuzASPn/ 7NndPjxkJ3ek/+8D+ChGBIHRypszIqCJpB6RPWqd27ve+F+Lkn1AJHQOy3chga/0ntSw CsV5BsIRqJfdMP4ugbfaB85rkKZnXPa4lSq9ZDMDOUv1elxnVZzImFtstU4VAJrybljH 65tgk0KA56lVfGkZTv1w3xg9MR/I7xp5tWgT9k2ZgyV6hg7rAMz7qAUznjbR/L05POOi R3IA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=HLFZf1YE; 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-65232-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65232-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; AJvYcCWYuD1lw0LufzwOKTWdIZIZ3NNcIpEWYOy/QS4hEHdIaxNvbkuAyazBEgkRoh3JGJKZ5eVqVl7GtBPbUJ9kbW/qPYDlXUTwzQ6Kb8GSYw== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id j23-20020a508a97000000b00561b9a3296fsi2924533edj.609.2024.02.14.04.56.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 04:56:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-65232-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=HLFZf1YE; 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-65232-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65232-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 B78D21F244CA for ; Wed, 14 Feb 2024 12:56:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4F65E5338A; Wed, 14 Feb 2024 12:56:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HLFZf1YE" Received: from mail-ua1-f50.google.com (mail-ua1-f50.google.com [209.85.222.50]) (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 07E07524B2; Wed, 14 Feb 2024 12:56:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707915384; cv=none; b=FA51TUZu4B1uYJIXz3f4M5u+OV8ep3shfSt+l2qILFjBeVlpAfjZQCEd2EWIyUHJ/Eh/p9VXI4rx++NxpIfQXT4g9WSLjxMQwb83o8kNi76vBivcJ/wvOmD5KwLK1URwZ5SGF2KPZs/5Z3ezP3DipgfoxUSHDoVLgFCGrkGiAWc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707915384; c=relaxed/simple; bh=BvZiBFtd1/yR2YlF7wcWOokDKadIUElG7972GToHNVo=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=R5jDeWJPQW9alww/MUetu5PZll9oo59daNByCvEkvdLjMi57vTF2fCI5N+qaezjLIpvXxvwB1vblFJKDWl8rXNRrqV2J8QEVDRp01I2DrlKkmY7czKbnWJATqJs0XPcuLQsCMPpsR+p8w7+HxiRRPwbVIGcE/YmRynlpTWt3Ca0= 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=HLFZf1YE; arc=none smtp.client-ip=209.85.222.50 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-ua1-f50.google.com with SMTP id a1e0cc1a2514c-7d2e16b552dso2845702241.1; Wed, 14 Feb 2024 04:56:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707915382; x=1708520182; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=5XHZsoNoLoEFnlnV78+Lk34bmjhSEU006PIr8jhyp/4=; b=HLFZf1YEhhbQPgrCkVhhXBYj4uPF03NCN8w4Ee9prwU07wsoIHi+MmyInxQbnfeC4i y0NkKPPuR48dj49CM689n0wKuH+RFCwCxOYIxv3Jy9qK5CHpzlmHpO5YMNdhFXCZeizf ZV+9BaP3gFwAk5FdGupIAEy2g2AmLrsOL9OgLFzdT+nf3jJfD9Iwq5aAkgzw2XXHEVx6 eGMLCID13kLiH9aP0wojEpGl4tv9+iAgjikkRLFjvYxdnxL6U00pYR6jGy2U6up+V2kq IWAcTimOmKvdy8N6Nipv39s/O6xGkb1fYltWAXJcpPYOK3NRDggF/Tjla249C+RdCI2J K/JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707915382; x=1708520182; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5XHZsoNoLoEFnlnV78+Lk34bmjhSEU006PIr8jhyp/4=; b=MEz6s50T0MdkrndBijlhsR7vCZ2fo4BgwKJxMeT0+0FgnIP2lipspHe8aoYMBMrXKJ +vtwVlFXZuyaJhn0+CVANsKOhzENF2yR7BFIuyfLGJTlBlIUsk16D3unqmdPrVpv6DdS hHQEPGGkG2geVrWcO1zElgywiMRAzD//8t8rl3jDKsD1LRxVK5pO//5CrEIda+wrYX9i +Bn8bQJZU3hbXSrYKyT/UvAWTrHoHO4imCr97mFI3EbhbcBIEykyRy5J90AmAjudcZcE y4/yOWxdd9XyDRhrlVNpRCRJ6oJrkrRkh0upEkU7MfAO1Y7ZfRQyUH8NDlqqQILyQQ2U e4Bw== X-Forwarded-Encrypted: i=1; AJvYcCX6piNWLm5jbB82HgCnwAGtcCL8lfufJtlQcdGpbcqlCCwvUZcRTXtTp6scuQySX7bedpnNIRISD0QwJ4oZ12lRivyF8invbv9Y+4FV X-Gm-Message-State: AOJu0YxlM62V5raFBXKS37pzzrvJ1dUYXmQBEE/4Xw25mA+kik9lqE+t Gn0/luZIW/0F6CMrMn2NXDDZg+fEeKeXf1hJk4PuO4nzlz+gdd5YTvfMgfVtXdEl/4B6Cfji5K3 s2ICmQ0v7EgNew2zhoJLJ4HlPJAk= X-Received: by 2002:a05:6102:942:b0:46e:c78e:380c with SMTP id a2-20020a056102094200b0046ec78e380cmr3224519vsi.1.1707915381929; Wed, 14 Feb 2024 04:56:21 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240213220331.239031-1-paweldembicki@gmail.com> <20240213220331.239031-3-paweldembicki@gmail.com> <6db0fd10-556d-47ec-b15a-d03e805b2621@gmail.com> In-Reply-To: <6db0fd10-556d-47ec-b15a-d03e805b2621@gmail.com> From: =?UTF-8?Q?Pawe=C5=82_Dembicki?= Date: Wed, 14 Feb 2024 13:56:10 +0100 Message-ID: Subject: Re: [PATCH net-next v4 02/15] net: dsa: vsc73xx: convert to PHYLINK To: Florian Fainelli Cc: netdev@vger.kernel.org, linus.walleij@linaro.org, Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Russell King , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable =C5=9Br., 14 lut 2024 o 00:19 Florian Fainelli napis= a=C5=82(a): > > On 2/13/24 14:03, Pawel Dembicki wrote: > > This patch replaces the adjust_link api with the phylink apis that prov= ide > > equivalent functionality. > > > > The remaining functionality from the adjust_link is now covered in the > > phylink_mac_link_* and phylink_mac_config. > > > > Removes: > > .adjust_link > > Adds: > > .phylink_mac_config > > .phylink_mac_link_up > > .phylink_mac_link_down > > The implementation of phylink_mac_link_down() strictly mimics what had > been done by adjust_link() in the phydev->link =3D=3D 0 case, but it real= ly > makes me wonder whether some bits do not logically belong to > phylink_mac_link_up(), like "Accept packets again" for instance. > > Are we certain there was not an assumption before that we would get > adjust_link() called first with phydev->link =3D 0, and then phydev->link > =3D1 and that this specific sequence would program things just the way we > want? Yes, it was the simplest conversion possible, without any improvements. Some part is implementation of datasheet (description of ARBEMPTY register)= : /* Discard packets */ vsc73xx_update_bits(vsc, VSC73XX_BLOCK_ARBITER, 0, VSC73XX_ARBDISC, BIT(port), BIT(port)); /* Wait until queue is empty */ ret =3D read_poll_timeout(vsc73xx_read, err, err < 0 || (val & BIT(= port)), 1000, 10000, false, vsc, VSC73XX_BLOCK_ARBI= TER, 0, VSC73XX_ARBEMPTY, &val); if (ret) dev_err(vsc->dev, "timeout waiting for block arbiter\n"); else if (err < 0) dev_err(vsc->dev, "error reading arbiter\n"); /* Put this port into reset */ vsc73xx_write(vsc, VSC73XX_BLOCK_MAC, port, VSC73XX_MAC_CFG, VSC73XX_MAC_CFG_RESET); I agree that VSC73XX_ARBDISC should be moved to phylink_mac_link_up. Other things could be optimised and it needs more care. (eg. This implementation doesn't disable phy when the interface goes down.) I plan to tweak it after the driver becomes usable. Please let me know if it should be fixed in this patch. --=20 Best Regards, Pawel Dembicki