Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1248965rwb; Thu, 10 Nov 2022 13:23:38 -0800 (PST) X-Google-Smtp-Source: AMsMyM7jxANXaCrmtKmiMmjJ3TyQyXXaEB13iz5ZrHcdU3YPrAE8+YM0AlfpyMz5Uh9S9AM8c0wx X-Received: by 2002:a17:90a:df8c:b0:20b:cd9:be6d with SMTP id p12-20020a17090adf8c00b0020b0cd9be6dmr2121227pjv.198.1668115417705; Thu, 10 Nov 2022 13:23:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668115417; cv=none; d=google.com; s=arc-20160816; b=YIoXJzCf9/4MErK1oMYz2WeqfO4SMwByjq6g918PauR2jnZ0rwS1gp3HJnW8XRGNYn V85E2ZE3S4/MSEgvgNFyWhJMiLpneg7JOlAMSj2nmMs+O9gQ5AcDKHSUqk8UijxRrL/a WaQe+T4Z1X2VvVEuXnvkXQk+EthIhytSlHfNFiA3Dye/QKWIR3/CnNT3gijv/D9VtSeO SEIiq22UgQvlHNapEwQnqonvQcJvN89xI4VjUIKyBPEDJnDxZtAu2m3iXGGH4ti/VR+C umtHg+u4+cHGeN92DEUe9XqgCS5ehZm5JubK+jTwCJdUo53+pyniC1jFFIrTt1VZw7xN LsxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=1Riyyphp9T5sNi96tTfYwqbeDS+TQOPurEbqQ/tZWHk=; b=Qva1puI+0+f9vrGO5e1H0Jr+H9DjfuG6nxoMUGN6ObWN85kvqoj47IWTssWpfZtAf0 BhKUUsIajM2FHGozTR5poqLWenSrQKj2noy3H1VEB2ftRLkcdKfs/QDhmam4h2otBf7L JtFnH9hgCFBJFnuVfSQtvvUH2WhCSYxu0f14oTBbtLjePNVgqxSugZzN4q9JfTFQ9/vB DjYHX2ES42htZadL9CG+a4yEFDq+z4SiiSF6VosBo/SSngMjBTgs9NBboJXpvxr83+n3 kvaA+DZARzOFYgPmB63WvWLTeEUe80ISFYbGhFSBFJy8tlQMotZT0JtrkOg+NymN7YP2 PdWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iXAbIe8q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k1-20020a056a00168100b0056b4dc35164si302792pfc.243.2022.11.10.13.23.25; Thu, 10 Nov 2022 13:23:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iXAbIe8q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231587AbiKJUdD (ORCPT + 92 others); Thu, 10 Nov 2022 15:33:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231820AbiKJUc6 (ORCPT ); Thu, 10 Nov 2022 15:32:58 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1396E1D330; Thu, 10 Nov 2022 12:32:52 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A6E7061E38; Thu, 10 Nov 2022 20:32:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B7A02C433D6; Thu, 10 Nov 2022 20:32:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668112371; bh=FAwxMVXEMCAcS5uby63ed6orJtZrfmYhYcYpN6PuPrI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=iXAbIe8qFQnagQ5siMYMEYtmnyY7pKqQkhT1164Uv1Nxs5YcfFkTzJtE7Pz3hF20o Fz/CFvkcfS97k+YvDTASeXPu9d4slw3UM09GEkXxEDnHRUmYlxUkzKDYATtImU8vmz vZuKVDaz+L5U+effJeDL5j/KyfvsbKTq3+hVY3rfTCeu/a2bzIkvTOKtn+IndjKy18 a7klHzIGJ+1p39ZYBgPCS7dypgYE98nUFPIWBylSZulwWi9rfLyp4rdU1ZKuNd+QsV CuiS4NsdstMxXQMhU/RqWvTeae1jBz8hIqiuBdfFoha0sIT77vmW8z9G5ENnOFM/Pm k6oTzr5iCcrlA== Date: Thu, 10 Nov 2022 12:32:49 -0800 From: Jakub Kicinski To: Roger Quadros , Vladimir Oltean , Ido Schimmel , Nikolay Aleksandrov Cc: davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, vigneshr@ti.com, srk@ti.com, linux-omap@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: ethernet: ti: cpsw_ale: optimize cpsw_ale_restore() Message-ID: <20221110123249.5f0e19df@kernel.org> In-Reply-To: <32eacc9d-3866-149a-579a-41f8e405123f@kernel.org> References: <20221108135643.15094-1-rogerq@kernel.org> <20221109191941.6af4f71d@kernel.org> <32eacc9d-3866-149a-579a-41f8e405123f@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 On Thu, 10 Nov 2022 11:39:47 +0200 Roger Quadros wrote: > > Maybe my tree is old but I see we clear only if there is a netdev that > > This patch depends on this series > https://lore.kernel.org/netdev/20221104132310.31577-3-rogerq@kernel.org/T/ I do have those in my tree. > > needs to be opened but then always call ale_restore(). Is that okay? > > If netdev is closed and opened ale_restore() is not called. > ale_restore() is only called during system suspend/resume path > since CPSW-ALE might have lost context during suspend and we want to restore > all valid ALE entries. Ack, what I'm referring to is the contents of am65_cpsw_nuss_resume(). I'm guessing that ALE_CLEAR is expected to be triggered by cpsw_ale_start(). Assuming above is true and that ALE_CLEAR comes from cpsw_ale_start(), the call stack is: cpsw_ale_start() am65_cpsw_nuss_common_open() am65_cpsw_nuss_ndo_slave_open() am65_cpsw_nuss_resume() but resume() only calls ndo_slave_open under certain conditions: for (i = 0; i < common->port_num; i++) { if (netif_running(ndev)) { rtnl_lock(); ret = am65_cpsw_nuss_ndo_slave_open(ndev); Is there another path? Or perhaps there's nothing to restore if all netdevs are down? > I have a question here. How should ageable entries be treated in this case? Ah, no idea :) Let's me add experts to To: