Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp870022rdb; Fri, 20 Oct 2023 01:34:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGaZxkXkZNa+9A296F+lm09bOAD1QtYvRkHm95I/oGHmxI0ti66yGa72Bw0NQNJeA1V6lWz X-Received: by 2002:a17:903:11d2:b0:1c5:76b6:d94f with SMTP id q18-20020a17090311d200b001c576b6d94fmr1370344plh.31.1697790899309; Fri, 20 Oct 2023 01:34:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697790899; cv=none; d=google.com; s=arc-20160816; b=WBf6bqMrnqt8YEF1962v+AmBBcfvf2+K77fjEXfroQlid4j049PWePtejO2vYCqPmr J/SfTKabvaOHofqqTJXaBnqWgq0zxRqBHBkoJz7vHhVroz3eii6720UwGF3VIFrQmZpq aJpcJhZbLYzK2AsNzYbbVx5TZJ0UROcyCoCI/3QCm/gjByB8nFrdJeywtUdDjPXAAhYw Rv56h8BiKQ1+3AdYDHTMNhMVoj6Twi4YLv9zrmY5Gpx+Cl2X2HW6bZ2TrtIm56/6nSY5 3GR32Ysnod46z4b3AbsHnkB3lxE5T0qryv38ajlZZ9vY6K5yZ2LAaLGMUeB26YR/7A/P wRhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=vNmM3o92YMteLOp//wwYmWrhbwcMhDqqLtk+AVSs+gw=; fh=NLf9vPTaB/jARIg25oDzql+3qzc1oC/bceGPvLTJeos=; b=OKf3NSxDgv10f8H/5gkhhB5UPjP42MeG2OpRhoY65UK72KrXNzG5VYkH7hGVew0+Zd jbciUMWcU2DzFObvgDFt8wlEWs4r4DuKXCZ1RKJlkkNO9t4SwFC1lv5TAy7ecxtxloHu aHe/51/ZvOHZ4wVXU2bAbuxxSVeQ6brGUhJUZm1tQ/1vh2ygJO+MiazRsPw/vSNBsEZ6 omdV4AugTe8ztURuP717e6VJsf0rnIFeU6zxpUXTNUh/Gb7ko9eAdU1cU0uJXFOJOXcp W8QCU2eQMtmZTP/Ni49xzdgNTF66O4B+OcORtzfUDD6U4hkyDi9lh29kT1YkYaLoDseU DB+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id t21-20020a1709028c9500b001c3e9170068si1249624plo.61.2023.10.20.01.34.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 01:34:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 808D082069DF; Fri, 20 Oct 2023 01:34:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376486AbjJTIes (ORCPT + 99 others); Fri, 20 Oct 2023 04:34:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376433AbjJTIer (ORCPT ); Fri, 20 Oct 2023 04:34:47 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CA731A8 for ; Fri, 20 Oct 2023 01:34:46 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkxs-0002nG-8p; Fri, 20 Oct 2023 10:34:40 +0200 Received: from [2a0a:edc0:2:b01:1d::c0] (helo=ptx.whiteo.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkxq-002z2N-QK; Fri, 20 Oct 2023 10:34:38 +0200 Received: from ore by ptx.whiteo.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1qtkxq-00FPk0-NI; Fri, 20 Oct 2023 10:34:38 +0200 Date: Fri, 20 Oct 2023 10:34:38 +0200 From: Oleksij Rempel To: Vladimir Oltean Cc: Woojung Huh , Andrew Lunn , Arun Ramadoss , Florian Fainelli , kernel@pengutronix.de, devicetree@vger.kernel.org, "Russell King (Oracle)" , netdev@vger.kernel.org, Conor Dooley , linux-kernel@vger.kernel.org, UNGLinuxDriver@microchip.com, Eric Dumazet , Rob Herring , Krzysztof Kozlowski , Jakub Kicinski , Paolo Abeni , "David S. Miller" Subject: Re: [PATCH net-next v6 5/9] net: dsa: microchip: ksz9477: Add Wake on Magic Packet support Message-ID: <20231020083438.GD3637381@pengutronix.de> References: <20231019122850.1199821-1-o.rempel@pengutronix.de> <20231019122850.1199821-1-o.rempel@pengutronix.de> <20231019122850.1199821-6-o.rempel@pengutronix.de> <20231019122850.1199821-6-o.rempel@pengutronix.de> <20231019172953.ajqtmnnthohnlek7@skbuf> <20231020050856.GB3637381@pengutronix.de> <20231020082350.f3ttjnn6qfcmskno@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20231020082350.f3ttjnn6qfcmskno@skbuf> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Fri, 20 Oct 2023 01:34:56 -0700 (PDT) On Fri, Oct 20, 2023 at 11:23:50AM +0300, Vladimir Oltean wrote: > On Fri, Oct 20, 2023 at 07:08:56AM +0200, Oleksij Rempel wrote: > > On Thu, Oct 19, 2023 at 08:29:53PM +0300, Vladimir Oltean wrote: > > > I don't get it, why do you release the reference on the MAC address as > > > soon as you successfully get it? Without a reference held, the > > > programmed address still lingers on, but the HSR offload code, on a > > > different port with a different MAC address, can change it and break WoL. > > > > It is ksz9477_get_wol() function. We do not actually need to program > > here the MAC address, we only need to test if we would be able to get > > it. To show the use more or less correct information on WoL > > capabilities. For example, instead showing the user that Wake on Magic > > is supported, where we already know that is not the case, we can already > > show correct information. May be it will be better to have > > extra option for ksz_switch_macaddr_get() to not allocate and do the > > refcounting or have a separate function. > > Ah, yes, it is from get_wol(). Maybe a ksz_switch_macaddr_tryget(ds, port) > which returns bool (true if dev->switch_macaddr is NULL, or if non-NULL > and ether_addr_equal(dev->switch_macaddr->addr, port addr))? Ack, something like this. I'll send new version later. -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |