[LEDE-DEV] [PATCH] b53: allow ports with higher numbers than CPU port
Jonas Gorski
jonas.gorski at gmail.com
Wed Jul 27 05:35:12 PDT 2016
Hi,
On 27 July 2016 at 14:15, Rafał Miłecki <zajec5 at gmail.com> wrote:
> Our code was assuming CPU port uses the highest number. My BCM53573
> device has eth0 connected to port 8 and eth1 connected to port 5. While
> working on support for it I tried to:
> 1) Enable all ports (including port 8)
> 2) Set CPU port to 5
>
> I noticed port 8 is not accessible anymore. It was just a development
> process but it seems like something worth fixing anyway.
>
> Signed-off-by: Rafał Miłecki <zajec5 at gmail.com>
> ---
> target/linux/generic/files/drivers/net/phy/b53/b53_common.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_common.c b/target/linux/generic/files/drivers/net/phy/b53/b53_common.c
> index 676e301..e3d4f60 100644
> --- a/target/linux/generic/files/drivers/net/phy/b53/b53_common.c
> +++ b/target/linux/generic/files/drivers/net/phy/b53/b53_common.c
> @@ -1371,8 +1371,8 @@ static int b53_switch_init(struct b53_device *dev)
> }
>
> /* cpu port is always last */
This comment is then obsolete, please remove it as well (feel free to
fix it up locally before pushing yourself).
> - sw_dev->ports = sw_dev->cpu_port + 1;
> dev->enabled_ports |= BIT(sw_dev->cpu_port);
> + sw_dev->ports = fls(dev->enabled_ports);
>
> dev->ports = devm_kzalloc(dev->dev,
> sizeof(struct b53_port) * sw_dev->ports,
Apart from that
Acked-by: Jonas Gorski <jonas.gorski at gmail.com>
More information about the Lede-dev
mailing list