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: <20220520070753.GC25578@pengutronix.de>
Date:   Fri, 20 May 2022 09:07:53 +0200
From:   "s.hauer@...gutronix.de" <s.hauer@...gutronix.de>
To:     Pkshih <pkshih@...ltek.com>
Cc:     "linux-wireless@...r.kernel.org" <linux-wireless@...r.kernel.org>,
        "johannes@...solutions.net" <johannes@...solutions.net>,
        "kernel@...gutronix.de" <kernel@...gutronix.de>,
        "neojou@...il.com" <neojou@...il.com>,
        "kvalo@...nel.org" <kvalo@...nel.org>,
        "tony0620emma@...il.com" <tony0620emma@...il.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "martin.blumenstingl@...glemail.com" 
        <martin.blumenstingl@...glemail.com>,
        "linux@...i-kroll.de" <linux@...i-kroll.de>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH 05/10] rtw88: Do not access registers while atomic

On Fri, May 20, 2022 at 06:06:05AM +0000, Pkshih wrote:
> On Wed, 2022-05-18 at 10:23 +0200, Sascha Hauer wrote:
> > The driver uses ieee80211_iterate_active_interfaces_atomic()
> > and ieee80211_iterate_stations_atomic() in several places and does
> > register accesses in the iterators. This doesn't cope with upcoming
>                                            ^^^^^^^ does?
> > USB support as registers can only be accessed non-atomically.
> > 
> > Split these into a two stage process: First use the atomic iterator
> > functions to collect all active interfaces or stations on a list, then
> > iterate over the list non-atomically and call the iterator on each
> > entry.
> 
> I think the subject could be "iterate over vif/sta list non-atomically"

Ok.

> > +void rtw_iterate_stas(struct rtw_dev *rtwdev,
> > +		      void (*iterator)(void *data,
> > +				       struct ieee80211_sta *sta),
> > +				       void *data)
> > +{
> > +	struct rtw_iter_stas_data iter_data;
> > +	struct rtw_stas_entry *sta_entry, *tmp;
> 
> lockdep_assert_held(&rtwdev->mutex);
> 
> > +
> > +	iter_data.rtwdev = rtwdev;
> > +	INIT_LIST_HEAD(&iter_data.list);
> > +
> > +	ieee80211_iterate_stations_atomic(rtwdev->hw, rtw_collect_sta_iter,
> > +					  &iter_data);
> > +
> > +	list_for_each_entry_safe(sta_entry, tmp, &iter_data.list,
> > +				 list) {
> > +		list_del_init(&sta_entry->list);
> > +		iterator(data, sta_entry->sta);
> > +		kfree(sta_entry);
> > +	}
> > +}
> > +
> 
> [...]
> 
> > +void rtw_iterate_vifs(struct rtw_dev *rtwdev,
> > +		      void (*iterator)(void *data, u8 *mac,
> > +				       struct ieee80211_vif *vif),
> > +		      void *data)
> > +{
> > +	struct rtw_iter_vifs_data iter_data;
> > +	struct rtw_vifs_entry *vif_entry, *tmp;
> 
> lockdep_assert_held(&rtwdev->mutex);

Ok, will add these. For what it's worth they didn't trigger in a short
test.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ