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]
Date:   Wed, 6 Apr 2022 14:17:33 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     Potin Lai <potin.lai@...ntatw.com>
Cc:     Heiner Kallweit <hkallweit1@...il.com>,
        Russell King <linux@...linux.org.uk>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Joel Stanley <joel@....id.au>,
        Andrew Jeffery <andrew@...id.au>,
        Patrick Williams <patrick@...cx.xyz>, netdev@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org,
        linux-aspeed@...ts.ozlabs.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/3] net: mdio: aspeed: Introduce read write function
 for c22 and c45

> +static int aspeed_mdio_read(struct mii_bus *bus, int addr, int regnum)
> +{
> +	dev_dbg(&bus->dev, "%s: addr: %d, regnum: %d\n", __func__, addr,
> +		regnum);
> +
> +	if (regnum & MII_ADDR_C45)
> +		return aspeed_mdio_read_c45(bus, addr, regnum);
> +
> +	return aspeed_mdio_read_c22(bus, addr, regnum);
> +}
> +
>  static int aspeed_mdio_write(struct mii_bus *bus, int addr, int regnum, u16 val)
>  {
>  	dev_dbg(&bus->dev, "%s: addr: %d, regnum: %d, val: 0x%x\n",
>  		__func__, addr, regnum, val);
>  
> -	/* Just clause 22 for the moment */
>  	if (regnum & MII_ADDR_C45)
> -		return -EOPNOTSUPP;
> +		return aspeed_mdio_write_c45(bus, addr, regnum, val);
>  
> -	return aspeed_mdio_op(bus, ASPEED_MDIO_CTRL_ST_C22, MDIO_C22_OP_WRITE,
> -			      addr, regnum, val);
> +	return aspeed_mdio_write_c22(bus, addr, regnum, val);
>  }

Hi Portin

Nice structure. This will helper with future cleanup where C22 and C45
will be completely separated, and the c45 variants will be directly
passed dev_ad and reg, rather than have to extract them from regnum.

A few process issues.

Please read the netdev FAQ. The subject list should indicate the tree,
and there should be an patch 0/3 which explains the big picture of
what the patchset does. 0/3 will then be used for the merge commit.

     Andrew

Powered by blists - more mailing lists