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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3E489C433F5 for ; Sun, 26 Sep 2021 13:58:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1906861090 for ; Sun, 26 Sep 2021 13:58:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231791AbhIZOAb (ORCPT ); Sun, 26 Sep 2021 10:00:31 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:60840 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231777AbhIZOAa (ORCPT ); Sun, 26 Sep 2021 10:00:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=HjivBkUchm6JkPW5fbVo3EwXigbe6lkdP6wwmdWVHlI=; b=RwGCs+IqoHQ39s/L8ivaNLfIMT szIKmvdRaeuZmcGYEVS/T7r3RAVDntYMkasIMgVELoebCQc01I7zlSvI7e+6JGibBAevDlt1h6lw8 vCS3GkxRFw04ADKyfK0xGeJ6xtZ/Yra4aG/GusMl7QEXan93UFq0qWmcricQr0NDH5oA=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1mUUfZ-008Jwy-P3; Sun, 26 Sep 2021 15:58:17 +0200 Date: Sun, 26 Sep 2021 15:58:17 +0200 From: Andrew Lunn To: Florian Fainelli Cc: Justin Chen , netdev@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, "David S. Miller" , Jakub Kicinski , Rob Herring , Doug Berger , Heiner Kallweit , Russell King , Sumit Semwal , Christian =?iso-8859-1?Q?K=F6nig?= , =?utf-8?B?UmFmYcWCIE1pxYJlY2tp?= , Randy Dunlap , Arnd Bergmann , Michael Chan , Geert Uytterhoeven , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , open list , "open list:DMA BUFFER SHARING FRAMEWORK" , "open list:DMA BUFFER SHARING FRAMEWORK" , "moderated list:DMA BUFFER SHARING FRAMEWORK" Subject: Re: [PATCH net-next 3/5] net: bcmasp: Add support for ASP2.0 Ethernet controller Message-ID: References: <1632519891-26510-1-git-send-email-justinpopo6@gmail.com> <1632519891-26510-4-git-send-email-justinpopo6@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org > > > +static int bcmasp_set_priv_flags(struct net_device *dev, u32 flags) > > > +{ > > > + struct bcmasp_intf *intf = netdev_priv(dev); > > > + > > > + intf->wol_keep_rx_en = flags & BCMASP_WOL_KEEP_RX_EN ? 1 : 0; > > > + > > > + return 0; > > > > Please could you explain this some more. How can you disable RX and > > still have WoL working? > > Wake-on-LAN using Magic Packets and network filters requires keeping the > UniMAC's receiver turned on, and then the packets feed into the Magic Packet > Detector (MPD) block or the network filter block. In that mode DRAM is in > self refresh and there is local matching of frames into a tiny FIFO however > in the case of magic packets the packets leading to a wake-up are dropped as > there is nowhere to store them. In the case of a network filter match (e.g.: > matching a multicast IP address plus protocol, plus source/destination > ports) the packets are also discarded because the receive DMA was shut down. > > When the wol_keep_rx_en flag is set, the above happens but we also allow the > packets that did match a network filter to reach the small FIFO (Justin > would know how many entries are there) that is used to push the packets to > DRAM. The packet contents are held in there until the system wakes up which > is usually just a few hundreds of micro seconds after we received a packet > that triggered a wake-up. Once we overflow the receive DMA FIFO capacity > subsequent packets get dropped which is fine since we are usually talking > about very low bit rates, and we only try to push to DRAM the packets of > interest, that is those for which we have a network filter. > > This is convenient in scenarios where you want to wake-up from multicast DNS > (e.g.: wake on Googlecast, Bonjour etc.) because then the packet that > resulted in the system wake-up is not discarded but is then delivered to the > network stack. Thanks for the explanation. It would be easier for the user if you automate this. Enable is by default for WoL types which have user content? > > > + /* Per ch */ > > > + intf->tx_spb_dma = priv->base + TX_SPB_DMA_OFFSET(intf); > > > + intf->res.tx_spb_ctrl = priv->base + TX_SPB_CTRL_OFFSET(intf); > > > + /* > > > + * Stop gap solution. This should be removed when 72165a0 is > > > + * deprecated > > > + */ > > > > Is that an internal commit? > > Yes this is a revision of the silicon that is not meant to see the light of > day. So this can all be removed? Andrew