From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH] ARM: shmobile: r8a7740: Fix ethernet device name in clock definition
Date: Wed, 17 Jul 2013 14:48:10 +0000 [thread overview]
Message-ID: <1393174.j2kHiLHKJZ@avalon> (raw)
In-Reply-To: <1373966374-15716-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com>
Hi Sergei,
On Wednesday 17 July 2013 18:20:48 Sergei Shtylyov wrote:
> Hello.
>
> On 17-07-2013 18:04, Laurent Pinchart wrote:
> >>>>>>>> The ethernet device is named r8a7740-gether, fix the clock
> >>>>>>>> definition
> >>>>>>>> accordingly.
> >>>>>>>>
> >>>>>>>> Signed-off-by: Laurent Pinchart
> >>>>>>>> <laurent.pinchart+renesas@ideasonboard.com>
> >>>>>>>> ---
> >>>>>>>>
> >>>>>>>> arch/arm/mach-shmobile/clock-r8a7740.c | 2 +-
> >>>>>>>> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>>>>>>>
> >>>>>>>> diff --git a/arch/arm/mach-shmobile/clock-r8a7740.c
> >>>>>>>> b/arch/arm/mach-shmobile/clock-r8a7740.c
> >>>>>>>> index de10fd7..e1e8710 100644
> >>>>>>>> --- a/arch/arm/mach-shmobile/clock-r8a7740.c
> >>>>>>>> +++ b/arch/arm/mach-shmobile/clock-r8a7740.c
> >>>>>>>> @@ -595,7 +595,7 @@ static struct clk_lookup lookups[] = {
> >>>>>>>>
> >>>>>>>> CLKDEV_DEV_ID("sh_mmcif", &mstp_clks[MSTP312]),
> >>>>>>>> CLKDEV_DEV_ID("e6bd0000.mmcif",
> >>>>>>>> &mstp_clks[MSTP312]),
> >>>>>>>> CLKDEV_DEV_ID("r8a7740-gether",
> >>>>>>>> &mstp_clks[MSTP309]),
> >>>>>>>>
> >>>>>>>> - CLKDEV_DEV_ID("e9a00000.sh-eth", &mstp_clks[MSTP309]),
> >>>>>>>> + CLKDEV_DEV_ID("e9a00000.r8a7740-gether", &mstp_clks[MSTP309]),
> >>>>>>>>
> >>>>>>> Al Ethernet devices should be named "ethernet", according to ePAPR
> >>>>>>> spec.
> >>>>>>
> >>>>>> BTW, I'm not seeing a patch to r8a7740.dtsi, describing this device.
> >>>>>
> >>>>> Let's delay this patch until the device gets added to r8a7740.dtsi
> >>>>> then.
> >>>>
> >>>> I don't see a use for this line even then. sh-eth.c can't be converted
> >>>> to device tree due to procedural platform data, so I'm planning to use
> >>>> OF_DEV_AUXDATA() for it which doesn't require defining an extra clock.
> >>>
> >>> The usage of OF_DEV_AUXDATA() is discouraged. A quick grep shows that
> >>> the only
> >>
> >> We have the case where it's the only resort. And the other platforms use
> >> it quite often, even if only to support [devm_]clk_get() in the drivers.
> >>
> >>> board code callback in sh_eth_plat_data (.set_mdio_gate) isn't used on
> >>> ARM platforms, so the driver should support pure DT bindings without
> >>> auxiliary data.
> >>
> >> Maybe it isn't used on ARM but it exists. IMO that's enough reason not to
> >> convert the platform data to the DT properties.
> >
> > I don't agree. The proper fix would be to fix the SuperH platform that
> > uses that callback (there's one only) to replace the callback function
> > with a proper kernel framework.
>
> At least suggest such framework first.
I would first need to understand what the board code implementes in the
set_mdio_gate() callback. The callback is used by the SH7757LCR board only, do
you have access to the board schematics and SH7757 datasheet ?
> > As arch/sh/ has seen very little activity lately I don't think that will
> > happen soon,
>
> I can take this in my own hands, if you get any ideas.
That would be great.
> > so we'll need to keep support for the .set_mdio_gate() callback in the sh-
> > eth driver, but new platforms should not use it, and it shouldn't be a
> > reason not to implement proper DT bindings.
>
> What if they have to use it again?
Then we'll need to use a proper abstraction in the kernel, and possibly create
one if none exists. We've created many abstractions layers in the past (GPIO,
regulators, CCF, ...) to get rid of platform callbacks, a new one can be added
if needed.
> Besides, it's not the only obstacle on this way: the platform data includes
> some fields which should really be inside the driver's data structures, as
> they're SoC, not board specific...
Those should then be moved to the sh_eth_cpu_data structure, referenced from
the data field of both the struct platform_device_id and struct of_device_id
arrays.
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2013-07-17 14:48 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-16 9:19 [PATCH] ARM: shmobile: r8a7740: Fix ethernet device name in clock definition Laurent Pinchart
2013-07-16 12:27 ` Sergei Shtylyov
2013-07-16 14:26 ` Sergei Shtylyov
2013-07-17 10:47 ` Laurent Pinchart
2013-07-17 13:05 ` Sergei Shtylyov
2013-07-17 13:11 ` Laurent Pinchart
2013-07-17 13:40 ` Sergei Shtylyov
2013-07-17 14:04 ` Laurent Pinchart
2013-07-17 14:20 ` Sergei Shtylyov
2013-07-17 14:48 ` Laurent Pinchart [this message]
2013-07-17 23:04 ` Simon Horman
2013-07-18 20:28 ` Sergei Shtylyov
2013-07-18 20:57 ` Laurent Pinchart
2013-07-19 4:30 ` Shimoda, Yoshihiro
2013-07-19 12:17 ` Sergei Shtylyov
2013-07-22 9:15 ` Shimoda, Yoshihiro
2013-07-22 11:47 ` Sergei Shtylyov
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=1393174.j2kHiLHKJZ@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=linux-sh@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox