Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp866053rdb; Fri, 20 Oct 2023 01:24:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGMc/B7/i12SaExTFekHCLnCuzsBRbQWs+Vm5Uq3JhkR/jMTcc41193fTXGMnJ4Uw0p3fdg X-Received: by 2002:a05:6a21:498b:b0:17b:d39c:1d6 with SMTP id ax11-20020a056a21498b00b0017bd39c01d6mr965814pzc.30.1697790256845; Fri, 20 Oct 2023 01:24:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697790256; cv=none; d=google.com; s=arc-20160816; b=mEmfYGFb578vaW5q638bhDjnPI7an/hghiDM44/5SiNYW7nU6RnR0KYl0Rj0J28YpF SqlTP9aA5u/WcA/q/bi3PRfKT4YeKQwX73czfASl7JzfkE/A2KlF8A9pudGWL0QtM+J0 tMkj32nNF5xALDeH7qywdWYVDpAwTH2MLyiWffVfqw3zZDp7w2HxEyzXPxCeykURmV3d TmbuOLTZ3h4n25lOVvv+VF/C6BJoWrOQyF3c17HKG906/tzPsfUrLFi/kmBAyvIpxTnB mfwHRvzirbYeMRjdH3VmbD8fk5E/v0cbetyMsPfrfYelIoySAmiA0DfdEDtskkVSa2+r /FBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=4CpDwt0mIHXa5SjKWHCoaE9qIzOGUHJct+s3WKSwVDU=; fh=4w3Pqs5x2lCMSSUPACK3dMuO7uUmsmglpPHc5D/SCqY=; b=H4Pu6zsyAqyGhe5J0qcBuUlph/EmEtsLe8AuK27TsUHTMqiKSGkcXoLSFRHMAEzal8 v2MTpN1HtRBsEC1LAiaEbOdn7uZ6avm2qlpgAonXFsNI2LZ5xgf5PHidXMVmKC2bwDCm IOM/Y+AabAzXtgMIXdPblU704EKlkVzJ7Hzgra83ebR3vura+x8NrCi9ZrmJOPVjsHJg TG+UkDMUKk2DpUhaE7XVVz12kOz8a8BRkZqmKl/a0PTh5jM1mGOq+eb5nO9/0+BVyON5 8zFcm8rMrFUhCkd3m+vMrIeSL7OSfJvxLkb66sKVT1+Eq6Ud0lWo6y3Aa71AHk1VShDh 1VhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="YZZcR/b2"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id bj11-20020a170902850b00b001c42b2b02casi1256122plb.174.2023.10.20.01.24.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 01:24:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="YZZcR/b2"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id D23EE82A0BC3; Fri, 20 Oct 2023 01:24:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235709AbjJTIYD (ORCPT + 99 others); Fri, 20 Oct 2023 04:24:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235694AbjJTIYA (ORCPT ); Fri, 20 Oct 2023 04:24:00 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF724C0; Fri, 20 Oct 2023 01:23:54 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4083f61312eso4375525e9.3; Fri, 20 Oct 2023 01:23:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697790233; x=1698395033; darn=vger.kernel.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=4CpDwt0mIHXa5SjKWHCoaE9qIzOGUHJct+s3WKSwVDU=; b=YZZcR/b2XLpmxvb+WnuIB1QiG1U+1anE36FLntSWz6M0gqKat5x3e/3rFzX7Ax3GXW CXbGChWGTvkttaGb0GdGFIM6c59IMVsk1ZqvN+AYzf+35MxJt2W8C1od6jK3i46YyNRe dkdNL3axJ/EVTSY+WbWk4PyjgtYyb6dxA8mXliXrTVFnhsiIEYEr2FebUnexiqLjz2NZ 10YncTYJBRSfr2yeOOyF9Pf0HsIRsV50me7y1G85ADvqdvK86mlmox5d27/P3qL3hpqT z66++UPgnpg07vNqM5FSF8dlEwqWWwxQrOaieC9cD+GZuPYUjVAtB0YphY0UKOrbVVCv LrTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697790233; x=1698395033; 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=4CpDwt0mIHXa5SjKWHCoaE9qIzOGUHJct+s3WKSwVDU=; b=NHVvk39VEbPoobmRwbGzWIztUVjDdiN71JPkyytTZ/zWfOgJotzNpzxM8tLz1QAFp+ IV5QxbXqOSy6C5Hh3t9Svxd8xKNG4zQmVpggbrQOTDEwtMdULHNz3Q4k1S259y+FZ39V xOZULtW66eUi5GsNqlfBZfTXc4Ul3I2bgFgOR3/1450sp77Rd5WgWdLj4ws8ywZcxCKP 9bPPwuL4cZKqcr61QsIskfDB6ZAEpZ4XR2oZs4TV5UYYe0IqjG6JxJ5Rc/RUsWUHaAxU 84+bp7iyTx42C3IByG3efeKD+zUsTEhgI9yWKnSgWv0Xr6lGzOvQbn9C0Ie9yTGk8Yjv I0Sg== X-Gm-Message-State: AOJu0Yz9h1gX5qPZ1Fw3ma0/n6dphD4uZZhwEyWcWTm8qJedZgfTorLq KBfPNoMtJvA2P95YUStDqwYgug6bDZyTKQ== X-Received: by 2002:a05:600c:3147:b0:405:4a78:a892 with SMTP id h7-20020a05600c314700b004054a78a892mr806944wmo.9.1697790232887; Fri, 20 Oct 2023 01:23:52 -0700 (PDT) Received: from skbuf ([188.26.57.160]) by smtp.gmail.com with ESMTPSA id je20-20020a05600c1f9400b004063ea92492sm1607389wmb.22.2023.10.20.01.23.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 01:23:52 -0700 (PDT) Date: Fri, 20 Oct 2023 11:23:50 +0300 From: Vladimir Oltean To: Oleksij Rempel Cc: "David S. Miller" , Andrew Lunn , Eric Dumazet , Florian Fainelli , Jakub Kicinski , Paolo Abeni , Woojung Huh , Arun Ramadoss , Conor Dooley , Krzysztof Kozlowski , Rob Herring , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, UNGLinuxDriver@microchip.com, "Russell King (Oracle)" , devicetree@vger.kernel.org Subject: Re: [PATCH net-next v6 5/9] net: dsa: microchip: ksz9477: Add Wake on Magic Packet support Message-ID: <20231020082350.f3ttjnn6qfcmskno@skbuf> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231020050856.GB3637381@pengutronix.de> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Fri, 20 Oct 2023 01:24:16 -0700 (PDT) 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))?