From: Mark Rutland <mark.rutland@arm.com>
To: Byungho An <bh74.an@samsung.com>, grant.likely@linaro.org
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-samsung-soc@vger.kernel.org"
<linux-samsung-soc@vger.kernel.org>,
"davem@davemloft.net" <davem@davemloft.net>,
"siva.kallam@samsung.com" <siva.kallam@samsung.com>,
"vipul.pandya@samsung.com" <vipul.pandya@samsung.com>,
"ks.giri@samsung.com" <ks.giri@samsung.com>,
"ilho215.lee@samsung.com" <ilho215.lee@samsung.com>
Subject: Re: [PATCH V2 1/7] net: sxgbe: add basic framework for Samsung 10Gb ethernet driver
Date: Mon, 17 Mar 2014 09:59:52 +0000 [thread overview]
Message-ID: <20140317095941.GA8070@e106331-lin.cambridge.arm.com> (raw)
In-Reply-To: <005701cf41a4$eee0ddf0$cca299d0$@samsung.com>
On Mon, Mar 17, 2014 at 05:51:21AM +0000, Byungho An wrote:
> Mark Rutland <mark.rutland@arm.com> :
> > On Wed, Mar 12, 2014 at 01:28:00PM +0000, Byungho An wrote:
> > > From: Siva Reddy <siva.kallam@samsung.com>
> > >
> > > This patch adds support for Samsung 10Gb ethernet driver(sxgbe).
> > >
> > > - sxgbe core initialization
> > > - Tx and Rx support
> > > - MDIO support
> > > - ISRs for Tx and Rx
> > > - ifconfig support to driver
> > >
> > > Signed-off-by: Siva Reddy Kallam <siva.kallam@samsung.com>
> > > Signed-off-by: Vipul Pandya <vipul.pandya@samsung.com>
> > > Signed-off-by: Girish K S <ks.giri@samsung.com>
> > > Neatening-by: Joe Perches <joe@perches.com>
> > > Signed-off-by: Byungho An <bh74.an@samsung.com>
[...]
> > > +static int sxgbe_probe_config_dt(struct platform_device *pdev,
> > > + struct sxgbe_plat_data *plat,
> > > + const char **mac) {
> > > + struct device_node *np = pdev->dev.of_node;
> > > + struct sxgbe_dma_cfg *dma_cfg;
> > > + u32 phy_addr;
> > > +
> > > + if (!np)
> > > + return -ENODEV;
> > > +
> > > + *mac = of_get_mac_address(np);
> >
> > I see that of_get_mac_address returns a *void rather than *char, but it's
> > always a string of hex digits. Would it make sense to change the
> > of_get_mac_address prototype to return a char* ?
> This implementation is of_ specific, our driver only uses it.
Sure, this was a general observation that wasn't specific to this
driver.
>
> >
> > > + plat->interface = of_get_phy_mode(np);
> > > +
> > > + plat->bus_id = of_alias_get_id(np, "ethernet");
> > > + if (plat->bus_id < 0)
> > > + plat->bus_id = 0;
> >
> > This wasn't mentioned in the binding.
> It doesn't need to be in the binding document, because we get the alias id
> by passing the node name. Here ethernet is not a property it is the dt node
> name
> e.g.
> ethernet@xxxxx {
>
> };
Huh?
The acquisition of the alias ID is not performed based on the node name,
but rather the node and stem of the entry in the /alias node that points
to it.
Consider this dts fragment:
/ {
...
alias {
ethernet5 = "/bus/arbitrarily_named_sxgbe@deadbeef";
};
bus {
...
arbtirarily_named_sxgbe@0xdeadbeef {
compatible = "samsung,sxgbe-v2.0a";
reg = <0xdeadbeef 0>, ... ;
...
};
};
}
The above call to of_alias_get_id(np, "ethernet") would return 5 for the
sxgbe node, despite the node name being completely arbitrary. While the
node should probably be named "ethernet", this doesn't matter for the
purpose of alias id handling.
If your binding has a particular form of alias, please document it so DT
authors can be aware of it and make use of it.
That said we probably need better guidance on the use of aliases. The
usage model is undocumented beyond aliases being informational, which is
somewhat vague. Unfortunately the description in ePAPR also glosses over
the expected usage.
Grant, would you be able to elaborate on the expected usage of aliases?
Should alias names always be from a standard set (e.g. "ethernet",
"serial", "pci" per ePAPR), or are binding-specific names (e.g. the
Exynos S-Scalar's "gsc") something we're happy with?
Are aliases allowed to be required, or are they always supposed to be an
optional hint to the OS?
Cheers,
Mark.
prev parent reply other threads:[~2014-03-17 9:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-12 13:28 [PATCH V2 1/7] net: sxgbe: add basic framework for Samsung 10Gb ethernet driver Byungho An
2014-03-12 15:10 ` Mark Rutland
2014-03-17 5:51 ` Byungho An
2014-03-17 9:59 ` Mark Rutland [this message]
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=20140317095941.GA8070@e106331-lin.cambridge.arm.com \
--to=mark.rutland@arm.com \
--cc=bh74.an@samsung.com \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=grant.likely@linaro.org \
--cc=ilho215.lee@samsung.com \
--cc=ks.giri@samsung.com \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=siva.kallam@samsung.com \
--cc=vipul.pandya@samsung.com \
/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).