lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 9 Sep 2014 12:37:51 -0700
From:	Alexander Duyck <alexander.duyck@...il.com>
To:	Florian Fainelli <f.fainelli@...il.com>
Cc:	Netdev <netdev@...r.kernel.org>,
	David Miller <davem@...emloft.net>,
	John Linville <linville@...driver.com>,
	Jamal Hadi Salim <jhs@...atatu.com>
Subject: Re: [PATCH net-next v5 11/13] net: dsa: add Broadcom SF2 switch driver

On Wed, Aug 27, 2014 at 5:04 PM, Florian Fainelli <f.fainelli@...il.com> wrote:
> Add support for the Broadcom Starfigther 2 switch chip using a DSA
> driver. This switch driver supports the following features:
>
> - configuration of the external switch port interface: MII, RevMII,
>   RGMII and RGMII_NO_ID are supported
> - support for the per-port MIB counters
> - support for link interrupts for special ports (e.g: MoCA)
> - powering up/down of switch memories to conserve power when ports are
>   unused
>
> Finally, update the compatible property for the DSA core code to match
> our switch top-level compatible node.
>
> Signed-off-by: Florian Fainelli <f.fainelli@...il.com>
> ---
> Changes in v4:
> - fixed typo on the word Starfighter
> - fixed a few checkpatch.pl warnings
>
> No changes in v3
>
> Changes in v2:
> - add support for reading to special MDIO phys (0 and 30)
> - added more power down optimization
> - added VLAN separation
>
>  drivers/net/dsa/Kconfig        |  11 +
>  drivers/net/dsa/Makefile       |   1 +
>  drivers/net/dsa/bcm_sf2.c      | 626 +++++++++++++++++++++++++++++++++++++++++
>  drivers/net/dsa/bcm_sf2.h      | 140 +++++++++
>  drivers/net/dsa/bcm_sf2_regs.h | 227 +++++++++++++++
>  net/dsa/dsa.c                  |   1 +
>  6 files changed, 1006 insertions(+)
>  create mode 100644 drivers/net/dsa/bcm_sf2.c
>  create mode 100644 drivers/net/dsa/bcm_sf2.h
>  create mode 100644 drivers/net/dsa/bcm_sf2_regs.h

[...]

> diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c
> new file mode 100644
> index 000000000000..bb7cb8e283b1
> --- /dev/null
> +++ b/drivers/net/dsa/bcm_sf2.c

[...]

> +static char *bcm_sf2_sw_probe(struct mii_bus *bus, int sw_addr)
> +{
> +       return "Broadcom Starfighter 2";
> +}
> +

I hadn't noticed before but with this driver it seems like you could
potentially load on any DSA enabled device could you not?  It seems
like this would be problematic since you could end up registering
before another DSA driver and prevent it from being able to load since
you always return success.  Isn't there any test you could run to
determine if the switch is actually there or not?

Thanks,

Alex
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ