* Fix phy_init for Marvell network eth driver
@ 2013-01-10 10:04 Kosta Zertsekel
0 siblings, 0 replies; 11+ messages in thread
From: Kosta Zertsekel @ 2013-01-10 10:04 UTC (permalink / raw)
To: netdev; +Cc: benavi, alior, linux-arm-kernel, andrew
Hi all,
Please review and incorporate (if looks ok) small fix for Marvell mv643xx driver.
Thanks,
--- KostaZ
^ permalink raw reply [flat|nested] 11+ messages in thread
* Fix phy_init for Marvell network eth driver
@ 2013-01-10 12:00 Kosta Zertsekel
2013-01-10 12:00 ` [PATCH 1/2] " Kosta Zertsekel
` (3 more replies)
0 siblings, 4 replies; 11+ messages in thread
From: Kosta Zertsekel @ 2013-01-10 12:00 UTC (permalink / raw)
To: netdev; +Cc: zertsekel, andrew, benavi, linux-arm-kernel, alior
Hi all,
resubmitting the patch for Marvell mv643xx driver (patch 1/2) adding the below explanation (thanks to Florian F.):
The D-Link DNS323_REV_C1 board has a specific PHY device fixup using the flag MARVELL_PHY_M1118_DNS323_LEDS which is set by the architecture code in arch/arm/mach-orion5x/dns323-setup.c. This flag is unfortunately lost during the call to phy_attach() in mv643xx_eth and therefore, the underlying Marvell PHY driver cannot make use of this flag to fixup the PHY device LEDs. This patch ensures the phy->dev_flags value is passed to the phy_attach() function such that the PHY device driver can
actually use it.
Also submitting new patch 2/2 using the same (or at least very close in meaning) explanation.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 1/2] Fix phy_init for Marvell network eth driver
2013-01-10 12:00 Fix phy_init for Marvell network eth driver Kosta Zertsekel
@ 2013-01-10 12:00 ` Kosta Zertsekel
2013-01-10 13:22 ` Sergei Shtylyov
2013-01-10 12:00 ` [PATCH 2/2] Fix phy_attach - forward dev_flags for phy_attach Kosta Zertsekel
` (2 subsequent siblings)
3 siblings, 1 reply; 11+ messages in thread
From: Kosta Zertsekel @ 2013-01-10 12:00 UTC (permalink / raw)
To: netdev; +Cc: zertsekel, andrew, benavi, linux-arm-kernel, alior,
Kosta Zertsekel
At least it fixes DNS323_REV_C1 board case (mach-orion5x/dsn323-setup.c file).
Change-Id: I37d64795f79c358f66a211a150cec2263e40e295
---
drivers/net/ethernet/marvell/mv643xx_eth.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index 84c1326..7b8c1ac 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -2789,7 +2789,7 @@ static void phy_init(struct mv643xx_eth_private *mp, int speed, int duplex)
phy_reset(mp);
- phy_attach(mp->dev, dev_name(&phy->dev), 0, PHY_INTERFACE_MODE_GMII);
+ phy_attach(mp->dev, dev_name(&phy->dev), phy->dev_flags, PHY_INTERFACE_MODE_GMII);
if (speed == 0) {
phy->autoneg = AUTONEG_ENABLE;
--
1.8.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 2/2] Fix phy_attach - forward dev_flags for phy_attach
2013-01-10 12:00 Fix phy_init for Marvell network eth driver Kosta Zertsekel
2013-01-10 12:00 ` [PATCH 1/2] " Kosta Zertsekel
@ 2013-01-10 12:00 ` Kosta Zertsekel
2013-01-10 14:40 ` Florian Fainelli
2013-01-10 12:17 ` Fix phy_init for Marvell network eth driver Jason Cooper
2013-01-10 12:24 ` Andrew Lunn
3 siblings, 1 reply; 11+ messages in thread
From: Kosta Zertsekel @ 2013-01-10 12:00 UTC (permalink / raw)
To: netdev; +Cc: zertsekel, andrew, benavi, linux-arm-kernel, alior,
Kosta Zertsekel
Change-Id: Ie3191f95c36eada6d0c673460de5393641128182
---
drivers/net/ethernet/marvell/pxa168_eth.c | 2 +-
net/dsa/slave.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/marvell/pxa168_eth.c b/drivers/net/ethernet/marvell/pxa168_eth.c
index 10d678d..63baa3b 100644
--- a/drivers/net/ethernet/marvell/pxa168_eth.c
+++ b/drivers/net/ethernet/marvell/pxa168_eth.c
@@ -1391,7 +1391,7 @@ static void phy_init(struct pxa168_eth_private *pep, int speed, int duplex)
struct phy_device *phy = pep->phy;
ethernet_phy_reset(pep);
- phy_attach(pep->dev, dev_name(&phy->dev), 0, PHY_INTERFACE_MODE_MII);
+ phy_attach(pep->dev, dev_name(&phy->dev), phy->dev_flags, PHY_INTERFACE_MODE_MII);
if (speed == 0) {
phy->autoneg = AUTONEG_ENABLE;
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index e32083d..bf09902 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -391,7 +391,7 @@ dsa_slave_create(struct dsa_switch *ds, struct device *parent,
if (p->phy != NULL) {
phy_attach(slave_dev, dev_name(&p->phy->dev),
- 0, PHY_INTERFACE_MODE_GMII);
+ phy->dev_flags, PHY_INTERFACE_MODE_GMII);
p->phy->autoneg = AUTONEG_ENABLE;
p->phy->speed = 0;
--
1.8.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: Fix phy_init for Marvell network eth driver
2013-01-10 12:00 Fix phy_init for Marvell network eth driver Kosta Zertsekel
2013-01-10 12:00 ` [PATCH 1/2] " Kosta Zertsekel
2013-01-10 12:00 ` [PATCH 2/2] Fix phy_attach - forward dev_flags for phy_attach Kosta Zertsekel
@ 2013-01-10 12:17 ` Jason Cooper
2013-01-10 12:24 ` Andrew Lunn
3 siblings, 0 replies; 11+ messages in thread
From: Jason Cooper @ 2013-01-10 12:17 UTC (permalink / raw)
To: Kosta Zertsekel
Cc: alior, andrew, netdev, benavi, zertsekel, linux-arm-kernel
On Thu, Jan 10, 2013 at 02:00:32PM +0200, Kosta Zertsekel wrote:
> Hi all,
> resubmitting the patch for Marvell mv643xx driver (patch 1/2) adding the below explanation (thanks to Florian F.):
> The D-Link DNS323_REV_C1 board has a specific PHY device fixup using the flag MARVELL_PHY_M1118_DNS323_LEDS which is set by the architecture code in arch/arm/mach-orion5x/dns323-setup.c. This flag is unfortunately lost during the call to phy_attach() in mv643xx_eth and therefore, the underlying Marvell PHY driver cannot make use of this flag to fixup the PHY device LEDs. This patch ensures the phy->dev_flags value is passed to the phy_attach() function such that the PHY device driver can
> actually use it.
>
> Also submitting new patch 2/2 using the same (or at least very close in meaning) explanation.
Could you please put the above description in the patch commit log for
both patches? Other than that,
Acked-by: Jason Cooper <jason@lakedaemon.net>
thx,
Jason.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Fix phy_init for Marvell network eth driver
2013-01-10 12:00 Fix phy_init for Marvell network eth driver Kosta Zertsekel
` (2 preceding siblings ...)
2013-01-10 12:17 ` Fix phy_init for Marvell network eth driver Jason Cooper
@ 2013-01-10 12:24 ` Andrew Lunn
2013-01-10 12:27 ` Kosta Zertsekel
3 siblings, 1 reply; 11+ messages in thread
From: Andrew Lunn @ 2013-01-10 12:24 UTC (permalink / raw)
To: Kosta Zertsekel
Cc: netdev, zertsekel, andrew, benavi, linux-arm-kernel, alior
On Thu, Jan 10, 2013 at 02:00:32PM +0200, Kosta Zertsekel wrote:
> Hi all,
> resubmitting the patch for Marvell mv643xx driver (patch 1/2) adding the below explanation (thanks to Florian F.):
> The D-Link DNS323_REV_C1 board has a specific PHY device fixup using the flag MARVELL_PHY_M1118_DNS323_LEDS which is set by the architecture code in arch/arm/mach-orion5x/dns323-setup.c. This flag is unfortunately lost during the call to phy_attach() in mv643xx_eth and therefore, the underlying Marvell PHY driver cannot make use of this flag to fixup the PHY device LEDs. This patch ensures the phy->dev_flags value is passed to the phy_attach() function such that the PHY device driver can
> actually use it.
>
> Also submitting new patch 2/2 using the same (or at least very close in meaning) explanation.
>
Hi Kosta
This comment is supposed to be in the header of the patch.
Since this comment is about a bug for the D-Link DNS323_REV_C1, the
fix to DSA should be in a separate patch, again with a comment about
the patch, why its needed, what if fixes etc.
I suggest you take a look at Documentation/SubmittingPatches
Thanks
Andrew
^ permalink raw reply [flat|nested] 11+ messages in thread
* RE: Fix phy_init for Marvell network eth driver
2013-01-10 12:24 ` Andrew Lunn
@ 2013-01-10 12:27 ` Kosta Zertsekel
0 siblings, 0 replies; 11+ messages in thread
From: Kosta Zertsekel @ 2013-01-10 12:27 UTC (permalink / raw)
To: Andrew Lunn
Cc: Lior Amsalem, netdev@vger.kernel.org, Eran Ben-Avi,
linux-arm-kernel@lists.infradead.org, zertsekel@gmail.com
> This comment is supposed to be in the header of the patch.
> Since this comment is about a bug for the D-Link DNS323_REV_C1, the fix to DSA should be in a separate patch, again with a comment about the patch, why its needed, what if fixes etc.
> I suggest you take a look at Documentation/SubmittingPatches
Oh, I know. I am really sorry for the mess with 'git sendemail' (forgot --compose flag or something).
I'll resend the patch "locally" with patch header email and then repost the both patches again on netdev and linux-arm-kernel.
Sorry again.
Thanks,
--- KostaZ
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/2] Fix phy_init for Marvell network eth driver
2013-01-10 12:00 ` [PATCH 1/2] " Kosta Zertsekel
@ 2013-01-10 13:22 ` Sergei Shtylyov
0 siblings, 0 replies; 11+ messages in thread
From: Sergei Shtylyov @ 2013-01-10 13:22 UTC (permalink / raw)
To: Kosta Zertsekel
Cc: netdev, alior, andrew, benavi, zertsekel, linux-arm-kernel
Hello.
On 10-01-2013 16:00, Kosta Zertsekel wrote:
> At least it fixes DNS323_REV_C1 board case (mach-orion5x/dsn323-setup.c file).
> Change-Id: I37d64795f79c358f66a211a150cec2263e40e295
This line has no place in the upstream commit, please remove it. Also, the
patch misses your signoff, so couldn't be applied anyway. Same about the next
patch.
WBR, Sergei
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] Fix phy_attach - forward dev_flags for phy_attach
2013-01-10 12:00 ` [PATCH 2/2] Fix phy_attach - forward dev_flags for phy_attach Kosta Zertsekel
@ 2013-01-10 14:40 ` Florian Fainelli
2013-01-10 15:57 ` Kosta Zertsekel
0 siblings, 1 reply; 11+ messages in thread
From: Florian Fainelli @ 2013-01-10 14:40 UTC (permalink / raw)
To: Kosta Zertsekel
Cc: netdev, zertsekel, andrew, benavi, linux-arm-kernel, alior
Le 01/10/13 13:00, Kosta Zertsekel a écrit :
> Change-Id: Ie3191f95c36eada6d0c673460de5393641128182
> ---
> drivers/net/ethernet/marvell/pxa168_eth.c | 2 +-
> net/dsa/slave.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
I think that you should have actually two patches, one for pxa168_eth
and one for net/dsa/slave.c.
Also, please prefix your patches with what was usually used on these
files before: "pxa168_eth:" and "net: dsa:" respectively.
By the way, most, if not all of the phy_connect() users in
drivers/net/ethernet/ also do not ensure they pass the phy device flags,
so you might want to fix this globally and not just for Marvell driver.
Thanks.
--
Florian
^ permalink raw reply [flat|nested] 11+ messages in thread
* RE: [PATCH 2/2] Fix phy_attach - forward dev_flags for phy_attach
2013-01-10 14:40 ` Florian Fainelli
@ 2013-01-10 15:57 ` Kosta Zertsekel
2013-01-10 17:12 ` Florian Fainelli
0 siblings, 1 reply; 11+ messages in thread
From: Kosta Zertsekel @ 2013-01-10 15:57 UTC (permalink / raw)
To: Florian Fainelli
Cc: netdev@vger.kernel.org, zertsekel@gmail.com, andrew@lunn.ch,
Eran Ben-Avi, linux-arm-kernel@lists.infradead.org, Lior Amsalem
> By the way, most, if not all of the phy_connect() users in drivers/net/ethernet/ also do not ensure they pass the phy device flags, so you might
want to fix this globally and not just for Marvell driver.
Indeed, phy_connect() mostly just pass zero intead of phy_dev->dev_flags.
But, I think, the guy that calls phy_connect() in its driver should know what he does, and,
probably, we should rely on him knowing his stuff.
The only evidence of the bug is when phy_dev->dev_flags was actually changed by PHY fixup callback
(see dns323-setup.c for example) and was *not* propagated to phy_connect() or phy_attach() as in pxa168_eth.c phy_init().
The code conforming to the former should be fixed IMHO.
Thanks,
--- KostaZ
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] Fix phy_attach - forward dev_flags for phy_attach
2013-01-10 15:57 ` Kosta Zertsekel
@ 2013-01-10 17:12 ` Florian Fainelli
0 siblings, 0 replies; 11+ messages in thread
From: Florian Fainelli @ 2013-01-10 17:12 UTC (permalink / raw)
To: Kosta Zertsekel
Cc: netdev@vger.kernel.org, zertsekel@gmail.com, andrew@lunn.ch,
Eran Ben-Avi, linux-arm-kernel@lists.infradead.org, Lior Amsalem
Le 01/10/13 16:57, Kosta Zertsekel a écrit :
>> By the way, most, if not all of the phy_connect() users in drivers/net/ethernet/ also do not ensure they pass the phy device flags, so you might
> want to fix this globally and not just for Marvell driver.
> Indeed, phy_connect() mostly just pass zero intead of phy_dev->dev_flags.
> But, I think, the guy that calls phy_connect() in its driver should know what he does, and,
> probably, we should rely on him knowing his stuff.
> The only evidence of the bug is when phy_dev->dev_flags was actually changed by PHY fixup callback
> (see dns323-setup.c for example) and was *not* propagated to phy_connect() or phy_attach() as in pxa168_eth.c phy_init().
> The code conforming to the former should be fixed IMHO.
Actually, I wonder if we should not rather remove entirely the flags
argument, let the phy_connect() or phy_attach() callers modify the phy
device dev_flags like it does today (e.g: tg3) and modify phy_connect()
and phy_attach() to pass phy->dev_flags to phy_attach_direct().
--
Florian
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2013-01-10 17:15 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-10 12:00 Fix phy_init for Marvell network eth driver Kosta Zertsekel
2013-01-10 12:00 ` [PATCH 1/2] " Kosta Zertsekel
2013-01-10 13:22 ` Sergei Shtylyov
2013-01-10 12:00 ` [PATCH 2/2] Fix phy_attach - forward dev_flags for phy_attach Kosta Zertsekel
2013-01-10 14:40 ` Florian Fainelli
2013-01-10 15:57 ` Kosta Zertsekel
2013-01-10 17:12 ` Florian Fainelli
2013-01-10 12:17 ` Fix phy_init for Marvell network eth driver Jason Cooper
2013-01-10 12:24 ` Andrew Lunn
2013-01-10 12:27 ` Kosta Zertsekel
-- strict thread matches above, loose matches on Subject: below --
2013-01-10 10:04 Kosta Zertsekel
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).