From: "Andreas Irestål" <andreas.irestal-VrBV9hrLPhE@public.gmane.org>
To: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
Cc: "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org"
<grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
"robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org"
<robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
"davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org"
<davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>,
"maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org"
<maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
"abrodkin-HKixBCOQz3hWk0Htik3J/w@public.gmane.org"
<abrodkin-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>,
"jeffrey.t.kirsher-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org"
<jeffrey.t.kirsher-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
"ben-/+tVBieCtBitmTQ+vhA3Yw@public.gmane.org"
<ben-/+tVBieCtBitmTQ+vhA3Yw@public.gmane.org>,
"sr-ynQEQJNshbs@public.gmane.org"
<sr-ynQEQJNshbs@public.gmane.org>,
"jonas.jensen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"
<jonas.jensen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
"netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Jesper Nilsson <jespern-VrBV9hrLPhE@public.gmane.org>,
peppe.cavallaro-qxv4g6HH51o@public.gmane.org
Subject: Re: [RFC PATCH] net:Add basic DWC Ethernet QoS Driver
Date: Thu, 8 May 2014 16:18:04 +0200 [thread overview]
Message-ID: <201405081618.04475.Andreas.Irestal@axis.com> (raw)
In-Reply-To: <20248221.mJ8pFfyc5U@wuerfel>
> > Signed-off-by: Andreas Irestaal <Andreas.Irestal-VrBV9hrLPhE@public.gmane.org>
> > ---
> > drivers/net/ethernet/Kconfig | 1 +
> > drivers/net/ethernet/Makefile | 1 +
> > drivers/net/ethernet/synopsys/Kconfig | 24 +
> > drivers/net/ethernet/synopsys/Makefile | 5 +
> > drivers/net/ethernet/synopsys/dwc_eth_qos.c | 710 +++++++++++++++++++++++++++
> > drivers/net/ethernet/synopsys/dwc_eth_qos.h | 308 ++++++++++++
>
> Should we maybe move the dw_mac driver out of the stmicro directory into
> synopsys as a preparation, to keep them in the same place?
>
That sounds like a good idea since that driver uses the same IP. I'm not the
person to take that decision though.
> > +
> > + /* Set poll wait timeout to 2 seconds */
> > + dwc_wait = 200;
> > +
> > + while (lp->tx_descs[i].tdes3.wr.own) {
> > + mdelay(10);
> > + if (!dwc_wait--)
> > + break;
> > + }
>
> This is really evil: you are blocking the CPU for up to two seconds!
> You already mentioned that this is work-in-progress, but I guess it has
> to be a little better than this and do something that doesn't block
> out the CPU during TX.
>
It really is, but a 2s lockout is only happening upon TX failure. Anyway, this
won't be an issue in the final version, since it won't use polling for TX.
>
> > +/* Fields/constants */
> > +#define DWCEQOS_DMA_MODE_SWR 1
> > +#define DWCEQOS_DMA_MODE_TXPR (1 << 11)
> > +#define DWCEQOS_DMA_MODE_DA (1 << 1)
> > +#define DWCEQOS_DMA_SYSBUS_MB (1 << 14)
>
> I find it more readable to use hexadecimal notation here
>
> #define DWCEQOS_DMA_MODE_SWR 0x0001
> #define DWCEQOS_DMA_MODE_DA 0x0002
> #define DWCEQOS_DMA_MODE_TXPR 0x0800
> #define DWCEQOS_DMA_SYSBUS_MB 0x4000
>
I agree, but it's not 100% clear which one is preferred as there exist drivers
using the first notation style. Anyway, I'll use the hex notation in future
patches since you prefer it.
Thanks for all valuable input. This was exactly the kind of feedback i was looking for
/Andreas
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-05-08 14:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-08 11:49 [RFC PATCH] net:Add basic DWC Ethernet QoS Driver Andreas Irestal
2014-05-08 12:51 ` Arnd Bergmann
2014-05-08 14:18 ` Andreas Irestål [this message]
2014-05-08 14:26 ` Arnd Bergmann
-- strict thread matches above, loose matches on Subject: below --
2014-05-08 12:50 Andreas Irestal
[not found] ` <201405081450.14449.Andreas.Irestal-VrBV9hrLPhE@public.gmane.org>
2014-05-08 17:29 ` David Miller
2014-05-09 6:24 ` Andreas Irestål
2014-05-09 15:19 ` Tobias Klauser
2014-05-10 10:19 ` Anish Khurana
[not found] ` <20140509151946.GM6455-93Khv+1bN0NyDzI6CaY1VQ@public.gmane.org>
2014-05-10 10:38 ` Anish Khurana
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=201405081618.04475.Andreas.Irestal@axis.com \
--to=andreas.irestal-vrbv9hrlphe@public.gmane.org \
--cc=abrodkin-HKixBCOQz3hWk0Htik3J/w@public.gmane.org \
--cc=arnd-r2nGTMty4D4@public.gmane.org \
--cc=ben-/+tVBieCtBitmTQ+vhA3Yw@public.gmane.org \
--cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=jeffrey.t.kirsher-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=jespern-VrBV9hrLPhE@public.gmane.org \
--cc=jonas.jensen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=peppe.cavallaro-qxv4g6HH51o@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=sr-ynQEQJNshbs@public.gmane.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).