From: Justin Chen <justinpopo6@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: "Florian Fainelli" <f.fainelli@gmail.com>,
netdev@vger.kernel.org,
bcm-kernel-feedback-list <bcm-kernel-feedback-list@broadcom.com>,
"David S. Miller" <davem@davemloft.net>,
"Jakub Kicinski" <kuba@kernel.org>,
"Rob Herring" <robh+dt@kernel.org>,
"Doug Berger" <opendmb@gmail.com>,
"Heiner Kallweit" <hkallweit1@gmail.com>,
"Russell King" <linux@armlinux.org.uk>,
"Sumit Semwal" <sumit.semwal@linaro.org>,
"Christian König" <christian.koenig@amd.com>,
"Rafał Miłecki" <rafal@milecki.pl>,
"Randy Dunlap" <rdunlap@infradead.org>,
"Arnd Bergmann" <arnd@arndb.de>,
"Michael Chan" <michael.chan@broadcom.com>,
"Geert Uytterhoeven" <geert+renesas@glider.be>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@vger.kernel.org>,
"open list" <linux-kernel@vger.kernel.org>,
"open list:DMA BUFFER SHARING FRAMEWORK"
<linux-media@vger.kernel.org>,
"open list:DMA BUFFER SHARING FRAMEWORK"
<dri-devel@lists.freedesktop.org>,
"moderated list:DMA BUFFER SHARING FRAMEWORK"
<linaro-mm-sig@lists.linaro.org>
Subject: Re: [PATCH net-next 3/5] net: bcmasp: Add support for ASP2.0 Ethernet controller
Date: Wed, 29 Sep 2021 16:04:53 -0700 [thread overview]
Message-ID: <CAJx26kVw8iJD_wJXypF4gjx697z_ErOdogWNNQffis19pt6y_w@mail.gmail.com> (raw)
In-Reply-To: <YVB8ef3aMpJTEvgF@lunn.ch>
On Sun, Sep 26, 2021 at 6:58 AM Andrew Lunn <andrew@lunn.ch> wrote:
>
> > > > +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?
>
Yup that can work. We can enable it for WAKE_FILTER type wol and leave
it disabled otherwise.
> > > > + /* 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?
>
Yup. That can be removed
> Andrew
Thanks for the review.
Justin
next prev parent reply other threads:[~2021-09-29 23:05 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-24 21:44 [PATCH net-next 0/5] brcm ASP 2.0 Ethernet controller Justin Chen
2021-09-24 21:44 ` [PATCH net-next 1/5] dt-bindings: net: Brcm " Justin Chen
2021-09-25 22:16 ` Rob Herring
2021-09-24 21:44 ` [PATCH net-next 2/5] dt-bindings: net: brcm,unimac-mdio: Add asp-v2.0 Justin Chen
2021-09-25 22:16 ` Rob Herring
2021-10-04 17:50 ` Rob Herring
2021-09-24 21:44 ` [PATCH net-next 3/5] net: bcmasp: Add support for ASP2.0 Ethernet controller Justin Chen
2021-09-25 0:05 ` Jakub Kicinski
2021-09-25 1:05 ` Justin Chen
2021-09-25 16:45 ` Andrew Lunn
2021-09-26 2:39 ` Florian Fainelli
2021-09-26 13:58 ` Andrew Lunn
2021-09-29 23:04 ` Justin Chen [this message]
2021-09-24 21:44 ` [PATCH net-next 4/5] net: phy: mdio-bcm-unimac: Add asp v2.0 support Justin Chen
2021-09-24 21:44 ` [PATCH net-next 5/5] MAINTAINERS: ASP 2.0 Ethernet driver maintainers Justin Chen
2021-09-25 14:25 ` [PATCH net-next 0/5] brcm ASP 2.0 Ethernet controller Andrew Lunn
2021-09-26 2:22 ` Florian Fainelli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAJx26kVw8iJD_wJXypF4gjx697z_ErOdogWNNQffis19pt6y_w@mail.gmail.com \
--to=justinpopo6@gmail.com \
--cc=andrew@lunn.ch \
--cc=arnd@arndb.de \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=christian.koenig@amd.com \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=f.fainelli@gmail.com \
--cc=geert+renesas@glider.be \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=michael.chan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=opendmb@gmail.com \
--cc=rafal@milecki.pl \
--cc=rdunlap@infradead.org \
--cc=robh+dt@kernel.org \
--cc=sumit.semwal@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).