[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20150113.163853.1503595006355422756.davem@davemloft.net>
Date: Tue, 13 Jan 2015 16:38:53 -0500 (EST)
From: David Miller <davem@...emloft.net>
To: f.fainelli@...il.com
Cc: netdev@...r.kernel.org, buytenh@...tstofly.org
Subject: Re: [PATCH net-next 2/8] net: dsa: make module builds work
From: Florian Fainelli <f.fainelli@...il.com>
Date: Mon, 12 Jan 2015 13:57:40 -0800
> Building any DSA driver as a module will work from a compilation/linking
> perspective, but the resulting modules produced are not functional.
>
> Any DSA driver references register_switch_driver and
> unregister_switch_driver which are provided by net/dsa/dsa.c, so loading
> any of these modules prior to dsa_core.ko being loaded will faill.
>
> Unfortunately, loading dsa_core.ko will make us call dsa_switch_probe()
> which will find no DSA switch driver and return an error so we are stuck
> there because there is no switch driver available. So this is getting us
> nowhere.
>
> This patch introduces a separate module, named dsa_lib which contains
> register_switch_driver, unregister_switch_driver and dsa_switch_probe
> (to avoid exposing the list and mutex used for walking switch drivers),
> such that the following can be done:
>
> - load dsa_lib
> - load the dsa switch driver, e.g: mv88e6060, bcm_sf2
> - load the dsa_core module
>
> Signed-off-by: Florian Fainelli <f.fainelli@...il.com>
This looks worse to me.
Really, the match table and probing should not be in dsa_core at all.
It should only be done in individual drivers.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists