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: <YfmomwMfRLe5t0nf@Ansuel-xps.localdomain>
Date:   Tue, 1 Feb 2022 22:39:39 +0100
From:   Ansuel Smith <ansuelsmth@...il.com>
To:     Florian Fainelli <f.fainelli@...il.com>
Cc:     Andrew Lunn <andrew@...n.ch>,
        Vivien Didelot <vivien.didelot@...il.com>,
        Vladimir Oltean <olteanv@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>, linux-kernel@...r.kernel.org,
        netdev@...r.kernel.org
Subject: Re: [RFC PATCH v7 13/16] net: dsa: qca8k: move page cache to driver
 priv

On Tue, Jan 25, 2022 at 07:50:47PM -0800, Florian Fainelli wrote:
> 
> 
> On 1/22/2022 5:33 PM, Ansuel Smith wrote:
> > There can be multiple qca8k switch on the same system. Move the static
> > qca8k_current_page to qca8k_priv and make it specific for each switch.
> > 
> > Signed-off-by: Ansuel Smith <ansuelsmth@...il.com>
> > ---
> >   drivers/net/dsa/qca8k.c | 47 +++++++++++++++++++++++------------------
> >   drivers/net/dsa/qca8k.h |  9 ++++++++
> >   2 files changed, 36 insertions(+), 20 deletions(-)
> > 
> > diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c
> > index e7bc0770bae9..c2f5414033d8 100644
> > --- a/drivers/net/dsa/qca8k.c
> > +++ b/drivers/net/dsa/qca8k.c
> > @@ -75,12 +75,6 @@ static const struct qca8k_mib_desc ar8327_mib[] = {
> >   	MIB_DESC(1, 0xac, "TXUnicast"),
> >   };
> > -/* The 32bit switch registers are accessed indirectly. To achieve this we need
> > - * to set the page of the register. Track the last page that was set to reduce
> > - * mdio writes
> > - */
> > -static u16 qca8k_current_page = 0xffff;
> > -
> >   static void
> >   qca8k_split_addr(u32 regaddr, u16 *r1, u16 *r2, u16 *page)
> >   {
> > @@ -134,11 +128,11 @@ qca8k_mii_write32(struct mii_bus *bus, int phy_id, u32 regnum, u32 val)
> >   }
> >   static int
> > -qca8k_set_page(struct mii_bus *bus, u16 page)
> > +qca8k_set_page(struct mii_bus *bus, u16 page, u16 *cached_page)
> >   {
>
> bus->priv is assigned a qca8k_priv pointer, so we can just de-reference it

I just checked this and no. The priv bus we have in qca8k_set_page,
points to the mdio ipq8064 priv struct. (or the gpio-bitbang driver I
assume)

> here from bus->priv and avoid changing a whole bunch of function signatures
> that are now getting both a qca8k_priv *and* a qca8k_mdio_cache set of
> pointers when you can just use back pointers to those.

Should we change the function to provide qca8k_priv directly? Or I just
didn't understand your suggestion on how we can reduce the changes in
this patch.

> -- 
> Florian

-- 
	Ansuel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ