All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Pavel Machek <pavel@denx.de>,
	Woojung.Huh@microchip.com, nathan.leigh.conrad@gmail.com
Cc: vivien.didelot@savoirfairelinux.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, Tristram.Ha@micrel.com,
	andrew@lunn.ch, pavel@denx.de
Subject: Re: [PATCH] DSA support for Micrel KSZ8895
Date: Sun, 27 Aug 2017 09:56:17 -0700	[thread overview]
Message-ID: <0D360298-6B3C-42BA-8E56-9F56E9B29BE4@gmail.com> (raw)
In-Reply-To: <20170827123658.GA727@amd>

On August 27, 2017 5:36:58 AM PDT, Pavel Machek <pavel@denx.de> wrote:
>Hi!
>
>So I fought with the driver a bit more, and now I have something that
>kind-of-works.
>
>"great great hack" belows worries me.
>
>Yeah, disabled code needs to be removed before merge.
>
>No, tag_ksz part probably is not acceptable. Do you see solution
>better than just copying it into tag_ksz1 file?

You could have all Micrel tag implementations live under net/dsa/tag_ksz.c and have e.g: DSA_TAG_PROTO_KSZ for the current (newer) switches and DSA_TAG_PROTO_KSZ_LEGACY (or any other name) for the older switches and you would provide two sets of function pointers depending on which protocol is requested by the switch.

Considering the minor difference needed in tagging here, it might be acceptable to actually keep the current functions and just have the xmit() call check what get_tag_protocol returns and use word 1 or 0 based on that. Even though that's a fast path it shouldn't hurt performance too much. If it does, we can always copy the tagging protocol into dsa_slave_priv so you have a fast access to it.

>
>Any more comments, etc?

The MII emulation bits are interesting, was it not sufficient if you implemented phy_read and phy_write operations that perform the necessary internal PHY accesses or maybe you don't get access to standard MII registers? b53 does such a thing and we merely just need to do a simple shift to access the MII register number, thus avoiding the translation.

>
>Help would be welcome.

I concur with Andrew, try to get a patch series, even an RFC one together so we can review things individually. 

How functional is your driver so far? I'd say the basic stuff to get working: counters (debugging), link management (auto-negotiation, forced, etc.) and basic bridging: all ports separate by default and working port to port switching when brought together in a bridge. VLAN, FDB, MDB, other ethtool goodies can be added later on.

-- 
Florian

  parent reply	other threads:[~2017-08-27 16:56 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-16  7:55 DSA support for Micrel KSZ8895 Pavel Machek
2017-08-16 14:04 ` Andrew Lunn
2017-08-16 14:25   ` Woojung.Huh
2017-08-23  9:09     ` Pavel Machek
2017-08-23 12:42       ` Andrew Lunn
2017-08-23 21:48       ` Woojung.Huh
2017-08-28 10:14         ` Pavel Machek
2017-08-28 13:19           ` Andrew Lunn
2017-08-27 12:36     ` [PATCH] " Pavel Machek
2017-08-27 13:59       ` Andrew Lunn
2017-08-27 16:31       ` Andrew Lunn
2017-08-28  7:02         ` Pavel Machek
2017-08-28 14:09           ` Andrew Lunn
2017-08-28 14:47             ` Maxim Uvarov
2017-08-29  7:41               ` Pavel Machek
2017-08-29 12:26                 ` Andrew Lunn
2017-08-29 21:15                   ` Pavel Machek
2017-08-29 21:23                     ` Florian Fainelli
2017-08-30 10:06                       ` Maxim Uvarov
2017-08-29  7:45             ` Pavel Machek
2017-08-30 21:32               ` Tristram.Ha
2017-08-30 22:00                 ` Andrew Lunn
2017-09-01 12:15                 ` Pavel Machek
2017-09-01 22:18                   ` Florian Fainelli
2017-09-02 15:40                     ` Pavel Machek
2017-09-06  9:14                 ` Maxim Uvarov
2017-09-06 16:47                   ` Tristram.Ha
2017-09-06 17:09                     ` Andrew Lunn
2017-08-27 16:44       ` Andrew Lunn
2017-08-28  6:40         ` Pavel Machek
2017-08-27 16:56       ` Florian Fainelli [this message]
2017-08-28  6:47         ` Pavel Machek
2017-08-27 22:03       ` Woojung.Huh
2017-08-29 15:33       ` kbuild test robot
2017-08-16 18:32   ` Pavel Machek

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=0D360298-6B3C-42BA-8E56-9F56E9B29BE4@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=Tristram.Ha@micrel.com \
    --cc=Woojung.Huh@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nathan.leigh.conrad@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pavel@denx.de \
    --cc=vivien.didelot@savoirfairelinux.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 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.