From: Richard Cochran <richardcochran@gmail.com>
To: "N, Mugunthan V" <mugunthanvnm@ti.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"davem@davemloft.net" <davem@davemloft.net>
Subject: Re: [PATCH 1/6] drivers: net: ethernet: cpsw: add support for CPSW register offset changes in different IP version
Date: Mon, 22 Oct 2012 13:23:34 +0200 [thread overview]
Message-ID: <20121022112334.GB2285@netboy.at.omicron.at> (raw)
In-Reply-To: <EB1619762EAF8B4E97A227FB77B7E0293E9FD69E@DBDE01.ent.ti.com>
On Mon, Oct 22, 2012 at 10:39:51AM +0000, N, Mugunthan V wrote:
> > This is wasting memory with unused static stables. There is a better
> > way to handle this issue.
>
> I have taken the code reference from the following driver.
> drivers/i2c/busses/i2c-omap.c
Can't speak for that driver.
BTW the ALE driver is also horribly wasting space with the "struct
ale_control_info ale_controls[ALE_NUM_CONTROLS]" thing.
> Can you refer other better solution to handle this?
Yes, I can think of two different ways. Maybe you can think of yet
other ways.
1. For those few registers that are not aligned the same way but have
the same bit layout (and you actually use in the driver), keep a
separate pointer in your driver's private struct.
2. Make two different declarations of structs corresponding to two
register layouts and use a cast in the access function based on
version.
I object to the tables of offsets because these take up twice the
memory of the registers themselves, even if you don't use all of the
registers.
> > You didn't provide a way to even use this code, like a dts for a
> > non-am335x board with the older version.
> >
> > I think it would be better to start off supporting one version and
> > have that fully working, and then add the older version, but *really*
> > add it so that it is actually working.
> >
>
> Since version info from hardware registers can be used to differentiate between
> the CPSW versions so I don't think there is a need to provide the same through DT.
I did not say to put the versions into the DT.
What I meant was that there is no need to add code that tests the
version and acts differently, if there are no users of the special
cases.
Thanks,
Richard
next prev parent reply other threads:[~2012-10-22 11:23 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-16 22:45 [PATCH 0/6] Add CPTS PTP driver support Mugunthan V N
2012-10-16 22:45 ` [PATCH 1/6] drivers: net: ethernet: cpsw: add support for CPSW register offset changes in different IP version Mugunthan V N
2012-10-18 2:45 ` Richard Cochran
2012-10-22 10:39 ` N, Mugunthan V
2012-10-22 11:23 ` Richard Cochran [this message]
2012-10-22 12:19 ` N, Mugunthan V
2012-10-22 12:25 ` Richard Cochran
2012-10-16 22:45 ` [PATCH 2/6] drivers: net: ethernet: davinci_cpdma: add clear api for statistics interrupt Mugunthan V N
2012-10-18 2:48 ` Richard Cochran
2012-10-22 10:42 ` N, Mugunthan V
2012-10-22 11:31 ` Richard Cochran
2012-10-16 22:45 ` [PATCH 3/6] drivers: net: ethernet: cpsw: add multicast address to ALE table Mugunthan V N
2012-10-18 2:49 ` Richard Cochran
2012-10-21 11:26 ` Richard Cochran
2012-10-22 10:46 ` N, Mugunthan V
2012-10-16 22:45 ` [PATCH 4/6] ptp: add api to get ptp seq id and event type from skb Mugunthan V N
2012-10-16 23:10 ` Ben Hutchings
2012-10-17 13:48 ` N, Mugunthan V
2012-10-18 2:55 ` Richard Cochran
2012-10-22 10:46 ` N, Mugunthan V
2012-10-22 11:36 ` Richard Cochran
2012-10-22 12:32 ` N, Mugunthan V
2012-10-22 12:37 ` Richard Cochran
2012-10-16 22:45 ` [PATCH 5/6] drivers: net: ethernet: cpts: implement cpts hardware clock Mugunthan V N
2012-10-20 13:43 ` Richard Cochran
2012-10-22 10:55 ` N, Mugunthan V
2012-10-22 11:41 ` Richard Cochran
2012-10-22 11:44 ` Richard Cochran
2012-10-22 12:38 ` N, Mugunthan V
2012-10-22 11:46 ` Richard Cochran
2012-10-22 12:42 ` N, Mugunthan V
2012-10-16 22:45 ` [PATCH 6/6] drivers: net: ethernet: cpsw: implement timestamping capabilities in cpsw Mugunthan V N
2012-10-21 18:11 ` Richard Cochran
2012-10-21 18:46 ` [PATCH 0/6] Add CPTS PTP driver support Richard Cochran
2012-10-22 10:51 ` N, Mugunthan V
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=20121022112334.GB2285@netboy.at.omicron.at \
--to=richardcochran@gmail.com \
--cc=davem@davemloft.net \
--cc=mugunthanvnm@ti.com \
--cc=netdev@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.