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:   Sun, 22 Dec 2019 11:43:12 +0200
From:   Baruch Siach <baruch@...s.co.il>
To:     Vivien Didelot <vivien.didelot@...il.com>
Cc:     Andrew Lunn <andrew@...n.ch>,
        Marek BehĂșn <marek.behun@....cz>,
        netdev@...r.kernel.org,
        Denis Odintsov <d.odintsov@...viangames.com>
Subject: Re: [PATCH] net: dsa: mv88e6xxx: force cmode write on 6141/6341

Hi Vivien,

On Fri, Dec 20 2019, Vivien Didelot wrote:
> On Thu, 19 Dec 2019 11:48:22 +0200, Baruch Siach <baruch@...s.co.il> wrote:
>> mv88e6xxx_port_set_cmode() relies on cmode stored in struct
>> mv88e6xxx_port to skip cmode update when the requested value matches the
>> cached value. It turns out that mv88e6xxx_port_hidden_write() might
>> change the port cmode setting as a side effect, so we can't rely on the
>> cached value to determine that cmode update in not necessary.
>> 
>> Force cmode update in mv88e6341_port_set_cmode(), to make
>> serdes configuration work again. Other mv88e6xxx_port_set_cmode()
>> callers keep the current behaviour.
>> 
>> This fixes serdes configuration of the 6141 switch on SolidRun Clearfog
>> GT-8K.
>> 
>> Fixes: 7a3007d22e8 ("net: dsa: mv88e6xxx: fully support SERDES on Topaz family")
>> Reported-by: Denis Odintsov <d.odintsov@...viangames.com>
>> Signed-off-by: Baruch Siach <baruch@...s.co.il>
>
> Andrew,
>
> We tend to avoid caching values in the mv88e6xxx driver the more we can and
> query the hardware instead to avoid errors like this. We can consider calling a
> new mv88e6xxx_port_get_cmode() helper when needed (e.g. in higher level callers
> like mv88e6xxx_serdes_power() and mv88e6xxx_serdes_irq_thread_fn()) and pass
> the value down to the routines previously accessing chip->ports[port].cmode,
> as a new argument. I can prepare a patch doing this. What do you think?

I'm not sure that cmode read would always give a valid value. On 6141 I
see an invalid 0x6 value after mv88e6xxx_port_hidden_write().

As I understand, this cache elimination work would target v5.6+. Would
you ack this patch for v5.5-rc to fix currently broken setup?

Thanks,
baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch@...s.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ