From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 358FACDE006 for ; Thu, 26 Sep 2024 14:08:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=dnBN6W/2Yn8YL1xAQTroO/UvJGFrAyxdRIvWWWIPJng=; b=XqHrck2PlIwcL2iVFlYV1yi9be Wr6EyW6AcPW4/4qlIscNH5J6zsj4XU7uBgyeOCIo4gKs/E1uyKdGiJq3ufSQLuzeKv8KSCJDZpTw3 b5CMdhCGICK12HjTu5qn+SoFOf93zh6fke11vyanx6EsqQ/KL19WhRIifDJ2nsGBw8X+j6tpN5cv5 uzZvrqh7x6PhMB5U+b4n73qkNgHc4seSmerUYEM1sDpmi7CRpE6KhrdVGXZJjV9zfyp9AsehCU9R6 F4aEjeUXcZgY3pKjFI+3xnUGqBm2gbypIRSvNsQlIpH7lDp0asv9Yiny979mcAIbXd/pYAbqqHbBq UJxvBrFA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1stpA6-00000008XrE-2SFr; Thu, 26 Sep 2024 14:08:06 +0000 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1stp8w-00000008Xie-0Dki for linux-arm-kernel@lists.infradead.org; Thu, 26 Sep 2024 14:06:55 +0000 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-a8713b00219so16916066b.0 for ; Thu, 26 Sep 2024 07:06:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727359612; x=1727964412; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=dnBN6W/2Yn8YL1xAQTroO/UvJGFrAyxdRIvWWWIPJng=; b=QXtUWhoqNxwOXlkdikNK7zn/qWkYyOKNZCii5SLpk1MXTHZW0S7fGoEARuHQughNHW RlpbLgWFRFraqfKVXoBXw8TrsG01V9vf1h+h8kBUx2aR++1aQaT6ViCCVBJyLs46dXZN sYygDXrIThe2CZGwuCQh7hHvvFbEbd8eSf0UaeF3uHENuQFn28pgc5dWatyeQrsuc9mw ev8V284eaW5ui+DaW76tBXZfiadFnKl2rmvtWYDt1Xsd7DTJuoHO3h4NDldZVaiOM/eV ErC03qscZi0ajiys0aZB3mEzH8vLztrSu0p44OehAflKm2WQ+KN199KEaeWqUDZjMHMY 5YYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727359612; x=1727964412; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=dnBN6W/2Yn8YL1xAQTroO/UvJGFrAyxdRIvWWWIPJng=; b=cK6JE1t3zkHnjXD7CFgXe+Ad7Owaq6zMx7CVkndtDTnoG3+bg8fDNlQZzoL3z6U6yd a4nKFgU8VEKhsHvIPfW0g+hksuo9zW7M7ELQk8jQ+IlAnOoLyBPw9iot6jCFSURffWbZ YD7Ey2koRpSzSGsSzD3LA0AAm54hvWY/DRt2kT6lqJrQY64SnYiFyxcKAZi0+cG/iAk0 oNVs7J3URFPB71qRA84CNr2MUFt8QRNzDR8MC//uIZt+o5KA6ZLHDvN3rHxSmn/gGxjn B2BgBy9r3XbRXr0NbHQIpU0JpY9F+0BGEdmZitPiNuuZLt7ZrNm473GY1wEng7ftVLM4 a4QQ== X-Forwarded-Encrypted: i=1; AJvYcCXqFxraigK7UefC7gab5o9AzxRGZhVakGw0EE+s8SLpWS3+2ZKnINs+8uBVZenmdzm9SMKA5EBpuaY762XyzyUN@lists.infradead.org X-Gm-Message-State: AOJu0Yya5fa1pphR9EsjksMSXCMDQ1YXRFP5G6dhgYxOP9Yyuixmja4K Lat2/4KoFLoLtVyrlLEeCuo+PR9ak0TqwTl3NRu4wr9AvW+ga4/R X-Google-Smtp-Source: AGHT+IFvq+Q1MRytKOktEY4oDr+KD7iY0K65f5kEblT+8Z7cHRq/M6AykZXCgjHzqYpBKIWv2L2yRA== X-Received: by 2002:a17:907:d2a:b0:a8d:2623:cd4a with SMTP id a640c23a62f3a-a93a06b1221mr247104366b.12.1727359604576; Thu, 26 Sep 2024 07:06:44 -0700 (PDT) Received: from skbuf ([188.25.134.29]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a93c2775d23sm2027766b.4.2024.09.26.07.06.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2024 07:06:40 -0700 (PDT) Date: Thu, 26 Sep 2024 17:06:34 +0300 From: Vladimir Oltean To: "Russell King (Oracle)" Cc: Andrew Lunn , Heiner Kallweit , Alexandre Torgue , "David S. Miller" , Eric Dumazet , Florian Fainelli , Jakub Kicinski , Jiawen Wu , Jose Abreu , Jose Abreu , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin , Mengyuan Lou , netdev@vger.kernel.org, Paolo Abeni Subject: Re: [PATCH RFC net-next 06/10] net: dsa: sja1105: simplify static configuration reload Message-ID: <20240926140634.kpiwi7xjhkrq3kaq@skbuf> References: <20240925131517.s562xmc5ekkslkhp@skbuf> <20240925211613.lmi2kh6hublkutbb@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240926_070654_135026_2007F951 X-CRM114-Status: GOOD ( 32.27 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Sep 26, 2024 at 01:02:35PM +0100, Russell King (Oracle) wrote: > On Thu, Sep 26, 2024 at 12:16:13AM +0300, Vladimir Oltean wrote: > > On Wed, Sep 25, 2024 at 08:38:23PM +0100, Russell King (Oracle) wrote: > > > > There are 2 more changes which I believe should be made in sja1105_set_port_speed(): > > > > - since it isn't called from mac_config() anymore but from mac_link_up() > > > > (change which happened quite a while ago), it mustn't handle SPEED_UNKNOWN > > > > - we can trust that phylink will not call mac_link_up() with a speed > > > > outside what we provided in mac_capabilities, so we can remove the > > > > -EINVAL "default" speed_mbps case, and make this method return void, > > > > as it can never truly cause an error > > > > > > > > But I believe these are incremental changes which should be done after > > > > this patch. I've made a note of them and will create 2 patches on top > > > > when I have the spare time. > > > > > > ... if we were to make those changes prior to this patch, then the > > > dev_err() will no longer be there and thus this becomes a non-issue. > > > So I'd suggest a patch prior to this one to make the changes you state > > > here, thus eliminating the need for this hunk in this patch. > > > > That sounds good. Are you suggesting you will write up such a patch for v2? > > Actually, the three patches become interdependent. > > Let's say we want to eliminate SPEED_UNKNOWN. Prior to my patch in this > sub-thread, we have this: > > speed_mbps[i] = sja1105_port_speed_to_ethtool(priv, > mac[i].speed); > ... > rc = sja1105_adjust_port_config(priv, i, speed_mbps[i]); > > sja1105_port_speed_to_ethtool() can return SPEED_UNKNOWN if > mac[i].speed is not one of the four encodings. If we can't guarantee > that it is one of the four encodings, then SPEED_UNKNOWN may be > passed into sja1105_adjust_port_config(). > > Similarly, as for the default case, we can't simply delete that, > because that'll leave "speed" uninitialised and we'll get a build > warning without my changes. We could change the default case to > simply: > > default: > return 0; > > but that just looks perverse. > > So, I think rather than trying to do your suggestion before my patch, > my patch needs to stand as it currently is, and then your suggestion > must happen after it - otherwise we end up introducing more complexity > or weirdness. > > Hmm? Ok, if we're back to my original proposal, I'm implicitly okay with that.