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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230319110606.23e30050@thinkpad>
Date:   Sun, 19 Mar 2023 11:06:06 +0100
From:   Marek BehĂșn <marek.behun@....cz>
To:     Klaus Kudielka <klaus.kudielka@...il.com>
Cc:     Andrew Lunn <andrew@...n.ch>,
        Florian Fainelli <f.fainelli@...il.com>,
        Vladimir Oltean <olteanv@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Richard Cochran <richardcochran@...il.com>,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next v4 4/4] net: dsa: mv88e6xxx: mask apparently
 non-existing phys during probing

On Wed, 15 Mar 2023 17:38:46 +0100
Klaus Kudielka <klaus.kudielka@...il.com> wrote:

> To avoid excessive mdio bus transactions during probing, mask all phy
> addresses that do not exist (there is a 1:1 mapping between switch port
> number and phy address).
> 
> Suggested-by: Andrew Lunn <andrew@...n.ch>
> Signed-off-by: Klaus Kudielka <klaus.kudielka@...il.com>
> Reviewed-by: Andrew Lunn <andrew@...n.ch>
> ---
> 
> Notes:
>     v2: Patch is new
> 
>  drivers/net/dsa/mv88e6xxx/chip.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
> index 29b0f3bb1c..c52798d9ce 100644
> --- a/drivers/net/dsa/mv88e6xxx/chip.c
> +++ b/drivers/net/dsa/mv88e6xxx/chip.c
> @@ -3797,6 +3797,7 @@ static int mv88e6xxx_mdio_register(struct mv88e6xxx_chip *chip,
>  	bus->read_c45 = mv88e6xxx_mdio_read_c45;
>  	bus->write_c45 = mv88e6xxx_mdio_write_c45;
>  	bus->parent = chip->dev;
> +	bus->phy_mask = GENMASK(31, mv88e6xxx_num_ports(chip));

shouldnt this be
  GENMASK(31, mv88e6xxx_num_ports(chip) + chip->info->phy_base_addr) |
  GENMASK(chip->info->phy_base_addr, 0)
?
Or alternatively
  ~GENMASK(chip->info->phy_base_addr + mv88e6xxx_num_ports(chip),
           chip->info->phy_base_addr)

Marek

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ