Re: [PATCH] mt76: usb: grab rx_page_lock for legacy mode in mt76u_refill_rx

2019-02-28 Thread Stanislaw Gruszka
On Thu, Feb 28, 2019 at 12:37:48PM +0100, Lorenzo Bianconi wrote: > > On Thu, Feb 28, 2019 at 12:08:45PM +0100, Lorenzo Bianconi wrote: > > > Grab rx_page_lock in mt76u_refill_rx allocating rx buffer for 'legacy' > > > mode. Remove gfp from mt76u_refill_rx signature since we need to > > > use GFP_A

Re: [PATCH] mt76: introduce q->stopped parameter

2019-02-28 Thread Stanislaw Gruszka
On Wed, Feb 27, 2019 at 10:40:41PM +0100, Lorenzo Bianconi wrote: > @@ -289,9 +290,14 @@ mt76_tx(struct mt76_dev *dev, struct ieee80211_sta *sta, > dev->queue_ops->tx_queue_skb(dev, q, skb, wcid, sta); > dev->queue_ops->kick(dev, q); > > - if (q->queued > q->ndesc - 8) > -

Re: [PATCH] mt76: usb: grab rx_page_lock for legacy mode in mt76u_refill_rx

2019-02-28 Thread Stanislaw Gruszka
On Thu, Feb 28, 2019 at 12:08:45PM +0100, Lorenzo Bianconi wrote: > Grab rx_page_lock in mt76u_refill_rx allocating rx buffer for 'legacy' > mode. Remove gfp from mt76u_refill_rx signature since we need to > use GFP_ATOMIC > > Signed-off-by: Lorenzo Bianconi I'm doing some cleanup/optimization w

Re: MT76x2U crashes XHCI driver on AMD Ryzen system

2019-02-28 Thread Stanislaw Gruszka
On Thu, Feb 28, 2019 at 10:04:12AM +0100, Stanislaw Gruszka wrote: > On Tue, Feb 26, 2019 at 12:24:08PM +0100, Stanislaw Gruszka wrote: > > On Tue, Feb 26, 2019 at 11:44:13AM +0100, Joerg Roedel wrote: > > > On Tue, Feb 26, 2019 at 11:34:51AM +0100, Stanislaw Gruszka wrote: >

Re: MT76x2U crashes XHCI driver on AMD Ryzen system

2019-02-28 Thread Stanislaw Gruszka
On Tue, Feb 26, 2019 at 12:24:08PM +0100, Stanislaw Gruszka wrote: > On Tue, Feb 26, 2019 at 11:44:13AM +0100, Joerg Roedel wrote: > > On Tue, Feb 26, 2019 at 11:34:51AM +0100, Stanislaw Gruszka wrote: > > > On Tue, Feb 26, 2019 at 11:05:36AM +0100, Joerg Roedel wrote: &

[RFC 12/12] mt76x02: remove set_tim

2019-02-28 Thread Stanislaw Gruszka
set_tim callback is not used by mac80211 if AP_LINK_PS hw flag is set. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76x0/pci.c | 8 drivers/net/wireless/mediatek/mt76/mt76x2/pci_main.c | 7 --- 2 files changed, 15 deletions(-) diff --git a/drivers

[RFC 09/12] mt76x02u: implement pre TBTT work for USB

2019-02-28 Thread Stanislaw Gruszka
TXWI is properly configured. mt76x02_mac_set_beacon() already handle this and free no longer used frames. Signed-off-by: Stanislaw Gruszka --- .../wireless/mediatek/mt76/mt76x02_beacon.c | 2 ++ .../wireless/mediatek/mt76/mt76x02_usb_core.c | 36 +-- 2 files changed, 35

[RFC 10/12] mt76x02u: add mt76_release_buffered_frames

2019-02-28 Thread Stanislaw Gruszka
Create software MT_TXQ_PSD queue for USB and map it to MT_TXQ_VO since we do not have USB endpoint for PSD. This should make mt76_release_buffered_frames() work by sending released frames via MT_TXQ_VO. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76x0/usb.c

[RFC 11/12] mt76x02: enable AP mode for USB

2019-02-28 Thread Stanislaw Gruszka
Enable AP mode. For now without multi-vif support, this will require more testing and investigation. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76x02_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76

[RFC 08/12] mt76x02: disable HW encryption for group frames

2019-02-28 Thread Stanislaw Gruszka
This is required to sent multicast/broadcast frames in USB AP mode just after beacon. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76x02_util.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_util.c b

[RFC 07/12] mt76x02: fix hdr pointer in write txwi for USB

2019-02-28 Thread Stanislaw Gruszka
Since we add txwi at the begining of skb->data, it no longer point to ieee80211_hdr. This breaks settings TS bit for probe response and beacons. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76x02_usb_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 delet

[RFC 03/12] mt76x02: introduce beacon_ops

2019-02-28 Thread Stanislaw Gruszka
Enabling/disableing TBTT and beacon will be diffrent for USB. Introduce beacon_ops to encapsulate that and implement it for MMIO. USB implementation is noop for now. Signed-off-by: Stanislaw Gruszka --- .../net/wireless/mediatek/mt76/mt76x0/main.c | 8 +++ drivers/net/wireless/mediatek

[RFC 01/12] mt76x02: introduce mt76x02_beacon.c

2019-02-28 Thread Stanislaw Gruszka
Move most of beaconing code into separate file and separate beacon initialization for USB and MMIO as pre TBTT implementation for USB will be different. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/Makefile | 2 +- .../net/wireless/mediatek/mt76/mt76x0/init.c

[RFC 06/12] mt76x02u: add sta_ps

2019-02-28 Thread Stanislaw Gruszka
Add sta_ps callback but dont set WCID drop sicne registers for USB can not be accessed from tasklet context. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76x0/usb.c | 1 + drivers/net/wireless/mediatek/mt76/mt76x02_util.c | 3 ++- drivers/net/wireless/mediatek

[RFC 00/12] mt76x02: AP support for with PS

2019-02-28 Thread Stanislaw Gruszka
have not tested on MMIO hardware, but for this only code movement was done so things should not break. Stanislaw Gruszka (12): mt76x02: introduce mt76x02_beacon.c mt76x02: add hrtimer for pre TBTT for USB mt76x02: introduce beacon_ops mt76x02u: implement beacon_ops mt76x02: generalize

[RFC 02/12] mt76x02: add hrtimer for pre TBTT for USB

2019-02-28 Thread Stanislaw Gruszka
Add timer and work for pre TBTT for USB devices. For now code doesn't do anyting useful, just add hrtimer which synchronize with hardware MT_TBTT_TIMER. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76x02.h | 3 + .../net/wireless/mediatek/mt76/mt76x02_regs.h

[RFC 05/12] mt76x02: generalize some mmio beaconing functions

2019-02-28 Thread Stanislaw Gruszka
Move some TBTT mmio functions to mt76x02_beacon.c and create new ones in order to be reused by USB pre-TBTT. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76x02.h | 11 ++ .../wireless/mediatek/mt76/mt76x02_beacon.c | 102 ++ .../net/wireless

[RFC 04/12] mt76x02u: implement beacon_ops

2019-02-28 Thread Stanislaw Gruszka
Add implementation of beacon_ops for USB and exit function to stop the timer if running when device is removed. Still no actual work on pre tbtt event. Signed-off-by: Stanislaw Gruszka --- .../net/wireless/mediatek/mt76/mt76x0/usb.c | 5 +-- .../net/wireless/mediatek/mt76/mt76x02_usb.h | 1

Re: MT76x2U crashes XHCI driver on AMD Ryzen system

2019-02-26 Thread Stanislaw Gruszka
On Tue, Feb 26, 2019 at 11:44:13AM +0100, Joerg Roedel wrote: > On Tue, Feb 26, 2019 at 11:34:51AM +0100, Stanislaw Gruszka wrote: > > On Tue, Feb 26, 2019 at 11:05:36AM +0100, Joerg Roedel wrote: > > If sg->offset > PAGE_SIZE is fine then most likely we have problem with &g

Re: MT76x2U crashes XHCI driver on AMD Ryzen system

2019-02-26 Thread Stanislaw Gruszka
On Tue, Feb 26, 2019 at 11:05:36AM +0100, Joerg Roedel wrote: > On Mon, Feb 18, 2019 at 03:37:48PM +0100, Stanislaw Gruszka wrote: > > 0001-mt76x02u-use-usb_bulk_msg-to-upload-firmware.patch > > 0002-mt76usb-do-not-use-compound-head-page-for-SG-I-O.patch > > > > Or pr

Re: [PATCH v3 2/3] mt76usb: use synchronous msg for mcu command responses

2019-02-22 Thread Stanislaw Gruszka
x possible problems with rx data buffers > > not being aligned and contained within single page. After doing > > page_frag_alloc(1024) consecutive page_frag_alloc(PAGE_SIZE) will > > alloc PAGE_SIZE buffer at PAGE_SIZE - 1024 offset. > > > > Signed-off-by: Stanislaw Gruszka

Re: [BUG] mt76x0u: Probing issues on Raspberry Pi 3 B+

2019-02-20 Thread Stanislaw Gruszka
On Wed, Feb 20, 2019 at 05:22:18PM +0100, Lorenzo Bianconi wrote: > > On Wed, Feb 20, 2019 at 02:22:08PM +0100, Lorenzo Bianconi wrote: > > > > On Tue, Feb 19, 2019 at 01:19:26PM +0100, Felix Fietkau wrote: > > > > > >> >> The way I see it, we have two choices. > > > > > >> >> 1. Fix dwc2 to do its

[PATCH v3 3/3] mt76usb: remove usb_mcu.c

2019-02-20 Thread Stanislaw Gruszka
Don't need separate file just for kmalloc/kfree. Signed-off-by: Stanislaw Gruszka --- v2: use dev_kmalloc() v3: fix Makefile drivers/net/wireless/mediatek/mt76/Makefile| 2 +- drivers/net/wireless/mediatek/mt76/mt76.h | 2 -- drivers/net/wireless/mediatek/mt76/mt76x0/

[PATCH v3 1/3] mt76usb: allow mt76u_bulk_msg be used for reads

2019-02-20 Thread Stanislaw Gruszka
Extend mt76u_bulk_msg() such it can be used for synchronous bulk reads. Signed-off-by: Stanislaw Gruszka --- v2: pass NULL actual_len to usb_bulk_msg drivers/net/wireless/mediatek/mt76/mt76.h| 12 drivers/net/wireless/mediatek/mt76/mt76x02_usb_mcu.c | 4 ++-- 2 files

[PATCH v3 2/3] mt76usb: use synchronous msg for mcu command responses

2019-02-20 Thread Stanislaw Gruszka
alloc(1024) consecutive page_frag_alloc(PAGE_SIZE) will alloc PAGE_SIZE buffer at PAGE_SIZE - 1024 offset. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76.h | 3 +- drivers/net/wireless/mediatek/mt76/mt76x0/usb.c| 11 .../net/wireless/med

Re: [BUG] mt76x0u: Probing issues on Raspberry Pi 3 B+

2019-02-20 Thread Stanislaw Gruszka
On Wed, Feb 20, 2019 at 02:22:08PM +0100, Lorenzo Bianconi wrote: > > On Tue, Feb 19, 2019 at 01:19:26PM +0100, Felix Fietkau wrote: > > > >> >> The way I see it, we have two choices. > > > >> >> 1. Fix dwc2 to do its alignment quirk for the urb->sg != NULL case > > > >> >> 2. Rely on urb->transfer

Re: [BUG] mt76x0u: Probing issues on Raspberry Pi 3 B+

2019-02-20 Thread Stanislaw Gruszka
ow related code is now tangled. Would be ok to send this patch with proper changelog as fix for RPI against wireless-drivers and cc:stable (assuming it works and really fix things on RPI) and revert Lorenzo's patches in -next ? Stanislaw >From 4f8d7d3f4031b0a97b3bb147cb7e52533886e7cc M

[PATCH v2 3/3] mt76usb: remove usb_mcu.c

2019-02-20 Thread Stanislaw Gruszka
Don't need separate file just for kmalloc/kfree. Signed-off-by: Stanislaw Gruszka --- v2: use dev_kmalloc() drivers/net/wireless/mediatek/mt76/mt76.h | 2 -- drivers/net/wireless/mediatek/mt76/mt76x0/usb.c| 5 .../net/wireless/mediatek/mt76/mt76x2/usb_init.c

[PATCH v2 1/3] mt76usb: allow mt76u_bulk_msg be used for reads

2019-02-20 Thread Stanislaw Gruszka
Extend mt76u_bulk_msg() such it can be used for synchronous bulk reads. Signed-off-by: Stanislaw Gruszka --- v2: pass NULL actual_len to usb_bulk_msg drivers/net/wireless/mediatek/mt76/mt76.h| 12 drivers/net/wireless/mediatek/mt76/mt76x02_usb_mcu.c | 4 ++-- 2 files

[PATCH v2 2/3] mt76usb: use synchronous msg for mcu command responses

2019-02-20 Thread Stanislaw Gruszka
alloc(1024) consecutive page_frag_alloc(PAGE_SIZE) will alloc PAGE_SIZE buffer at PAGE_SIZE - 1024 offset. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76.h | 3 +- drivers/net/wireless/mediatek/mt76/mt76x0/usb.c| 11 .../net/wireless/med

Re: [PATCH 1/3] mt76usb: allow mt76u_bulk_msg be used for reads

2019-02-20 Thread Stanislaw Gruszka
On Wed, Feb 20, 2019 at 12:28:38PM +0100, Lorenzo Bianconi wrote: > [3.476492] mt76x0u: probe of 1-1:1.0 failed with error -12 During rework of patch 3 I made silly mistake in + if (usb->mcu.data) + return -ENOMEM; and seems I did not reload modules properly and only test

Re: [BUG] mt76x0u: Probing issues on Raspberry Pi 3 B+

2019-02-20 Thread Stanislaw Gruszka
On Tue, Feb 19, 2019 at 10:40:47AM -0500, Alan Stern wrote: > On Tue, 19 Feb 2019, Stanislaw Gruszka wrote: > > > It would be interesting why urb->num_sgs = 0 & urb->sg cause > > the troubles. This is how usb_sg_init() submit urbs for sg_tablesize = 0 > > control

[PATCH 3/3] mt76usb: remove usb_mcu.c

2019-02-20 Thread Stanislaw Gruszka
Don't need separate file just for kmalloc/kfree. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76.h | 2 -- drivers/net/wireless/mediatek/mt76/mt76x0/usb.c| 5 .../net/wireless/mediatek/mt76/mt76x2/usb_init.c | 5 drivers/net/wir

[PATCH 1/3] mt76usb: allow mt76u_bulk_msg be used for reads

2019-02-20 Thread Stanislaw Gruszka
Extend mt76u_bulk_msg() such it can be used for synchronous bulk reads. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76.h| 13 ++--- drivers/net/wireless/mediatek/mt76/mt76x02_usb_mcu.c | 4 ++-- 2 files changed, 12 insertions(+), 5 deletions

[PATCH 2/3] mt76usb: use synchronous msg for mcu command responses

2019-02-20 Thread Stanislaw Gruszka
alloc(1024) consecutive page_frag_alloc(PAGE_SIZE) will alloc PAGE_SIZE buffer at PAGE_SIZE - 1024 offset. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76.h | 3 +- drivers/net/wireless/mediatek/mt76/mt76x0/usb.c| 11 .../net/wireless/med

Re: MT76x2U crashes XHCI driver on AMD Ryzen system

2019-02-19 Thread Stanislaw Gruszka
On Mon, Feb 18, 2019 at 05:01:59PM +, Robin Murphy wrote: > On 18/02/2019 14:37, Stanislaw Gruszka wrote: > [...] > >Another issue is that dma_map_sg() & dma_map_page() may require some > >constraints. I'm not sure about that and I want to clarify that with > >

Re: [BUG] mt76x0u: Probing issues on Raspberry Pi 3 B+

2019-02-19 Thread Stanislaw Gruszka
On Mon, Feb 18, 2019 at 11:19:40PM +0100, Stefan Wahren wrote: > Hi, > > > Stanislaw Gruszka hat am 18. Februar 2019 um 14:52 > > geschrieben: > > > > > > On Sat, Feb 16, 2019 at 08:17:07PM +0100, Stefan Wahren wrote: > > > this is a misunderstand

Re: [BUG] mt76x0u: Probing issues on Raspberry Pi 3 B+

2019-02-19 Thread Stanislaw Gruszka
On Mon, Feb 18, 2019 at 07:52:27PM +0100, Felix Fietkau wrote: > On 2019-02-18 16:03, Stanislaw Gruszka wrote: > > On Mon, Feb 18, 2019 at 03:43:26PM +0100, Felix Fietkau wrote: > >> On 2019-02-18 14:52, Stanislaw Gruszka wrote: > >> > On Sat, Feb 16, 2019 at 08:17:0

Re: [BUG] mt76x0u: Probing issues on Raspberry Pi 3 B+

2019-02-18 Thread Stanislaw Gruszka
On Mon, Feb 18, 2019 at 03:43:26PM +0100, Felix Fietkau wrote: > On 2019-02-18 14:52, Stanislaw Gruszka wrote: > > On Sat, Feb 16, 2019 at 08:17:07PM +0100, Stefan Wahren wrote: > >> this is a misunderstanding. The warning is about memory alignment to 32 > >> bi

Re: [BUG] mt76x0u: Probing issues on Raspberry Pi 3 B+

2019-02-18 Thread Stanislaw Gruszka
On Mon, Feb 18, 2019 at 03:25:28PM +0100, Lorenzo Bianconi wrote: > > commit 0d9813319b40399a0d8fd761d2fcfedee5701487 > > Author: Lorenzo Bianconi > > Date: Fri Sep 7 23:13:12 2018 +0200 > > [...] > > > diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_util.c > > b/drivers/net/wireless/

Re: MT76x2U crashes XHCI driver on AMD Ryzen system

2019-02-18 Thread Stanislaw Gruszka
(cc: IOMMU & page_frag_alloc maintainers) On Tue, Jan 15, 2019 at 10:04:01AM +0100, Lorenzo Bianconi wrote: > > On Mon, Jan 14, 2019 at 1:18 AM Lorenzo Bianconi > > wrote: > > > > > > > On Sun, Jan 13, 2019 at 11:00 AM Lorenzo Bianconi > > > > wrote: > > > > > > > > > > > > > > > > > > > > > > >

Re: [BUG] mt76x0u: Probing issues on Raspberry Pi 3 B+

2019-02-18 Thread Stanislaw Gruszka
d8fd761d2fcfedee5701487 Author: Lorenzo Bianconi Date: Fri Sep 7 23:13:12 2018 +0200 mt76x0: run vco calibration for each channel configuration It's possible that without this vco calibration fix, MT7610U device does not see AP if it's signal is weak. Stanislaw >From d4

Re: [BUG] mt76x0u: Probing issues on Raspberry Pi 3 B+

2019-02-16 Thread Stanislaw Gruszka
this, plese test, thanks in advance. > Btw i can confirm a regression was introduced after 4.19, because in 4.19 > there was no firmware timeout but even no working wifi: You ment 'no working wifi' or 'working wifi'? Stanislaw >From 35dadd09bd3193b33b10f56e0210da680c

Re: [BUG] mt76x0u: Probing issues on Raspberry Pi 3 B+

2019-02-14 Thread Stanislaw Gruszka
On Thu, Feb 14, 2019 at 10:48:15AM +0100, Stefan Wahren wrote: > Hi Stanislaw, > > Am 14.02.19 um 10:25 schrieb Stanislaw Gruszka: > > On Thu, Feb 14, 2019 at 07:49:57AM +0100, Stefan Wahren wrote: > >> Hi Stanislaw, > >> > >>> Stanis

Re: [BUG] mt76x0u: Probing issues on Raspberry Pi 3 B+

2019-02-14 Thread Stanislaw Gruszka
On Thu, Feb 14, 2019 at 10:48:15AM +0100, Stefan Wahren wrote: > Hi Stanislaw, > > Am 14.02.19 um 10:25 schrieb Stanislaw Gruszka: > > On Thu, Feb 14, 2019 at 07:49:57AM +0100, Stefan Wahren wrote: > >> Hi Stanislaw, > >> > >>> Stanis

Re: [BUG] mt76x0u: Probing issues on Raspberry Pi 3 B+

2019-02-14 Thread Stanislaw Gruszka
On Thu, Feb 14, 2019 at 07:49:57AM +0100, Stefan Wahren wrote: > Hi Stanislaw, > > > Stanislaw Gruszka hat am 12. Februar 2019 um 10:30 > > geschrieben: > > > > > > > > In usb_sg_init() urb->num_sgs is set 0 for sg_tablesize = 0 controllers. >

Re: [PATCH 0/4] do not use sg if not properly supported by usb controller

2019-02-13 Thread Stanislaw Gruszka
On Wed, Feb 13, 2019 at 12:00:42PM +0100, Lorenzo Bianconi wrote: > On Feb 13, Stanislaw Gruszka wrote: > > On Tue, Feb 12, 2019 at 11:09:03PM +0100, Lorenzo Bianconi wrote: > > > > > On Tue, Feb 12, 2019 at 04:08:37PM +0100, Lorenzo Bianconi wrote: > > > >

[PATCH v5 5/5] rt2800: comment and simplify AGC init for RT6352

2019-02-13 Thread Stanislaw Gruszka
We do not need separate lines for calculating register values. Also add comment that value is different than in vendor driver. Suggested-by: Daniel Golle Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 9 ++--- 1 file changed, 6 insertions(+), 3

[PATCH v5 4/5] rt2800: enable TX_PIN_CFG_RFRX_EN only for MT7620

2019-02-13 Thread Stanislaw Gruszka
The TX_PIN_CFG_RFRX_EN bit was not set on other devices than MT7620, restore old behavaviour since setting this bit maight not be correct for older devices. Fixes: 41977e86c984 ("rt2x00: add support for MT7620") Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/ralink/rt2x00/r

[PATCH v5 2/5] rt2x00: remove confusing AGC register

2019-02-13 Thread Stanislaw Gruszka
From: Tomislav Požega Register 66 was causing issues on RT6352 if set to the same value as in MTK driver. With 1c reg value device was working fine in both HT20 and HT40 modes. Signed-off-by: Tomislav Požega Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/ralink/rt2x00/rt2800lib.c

[PATCH v5 0/5] rt2800: register programing tweaks and clean ups

2019-02-13 Thread Stanislaw Gruszka
This is repost of https://lore.kernel.org/linux-wireless/1539334591-9965-1-git-send-email-sgrus...@redhat.com/ with controversial patches removed. I will work on them letter. Stanislaw Gruszka (3): rt2800: enable TX_PIN_CFG_LNA_PE_ bits per band rt2800: enable TX_PIN_CFG_RFRX_EN only for

[PATCH v5 1/5] rt2x00: remove unneeded check

2019-02-13 Thread Stanislaw Gruszka
From: Tomislav Požega Remove band check from rf53xx channel config routine since all chips using it are single band. Signed-off-by: Tomislav Požega Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 103 - 1 file changed, 50

[PATCH v5 3/5] rt2800: enable TX_PIN_CFG_LNA_PE_ bits per band

2019-02-13 Thread Stanislaw Gruszka
Do not enable TX_PIN_CFG_LNA_PE_A* bits for 2.4GHz band and vice versa TX_PIN_CFG_LNA_PE_G* bits for 5GHz. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/net

Re: [PATCH 0/4] do not use sg if not properly supported by usb controller

2019-02-13 Thread Stanislaw Gruszka
On Tue, Feb 12, 2019 at 11:09:03PM +0100, Lorenzo Bianconi wrote: > > > On Tue, Feb 12, 2019 at 04:08:37PM +0100, Lorenzo Bianconi wrote: > > > > > > > What unnecessary operation ? > > > > > > > > > > > > the ones in mt76u_fill_bulk_urb() > > > > > > > > > > Your patches also add extra operations

Re: [PATCH 0/4] do not use sg if not properly supported by usb controller

2019-02-12 Thread Stanislaw Gruszka
On Tue, Feb 12, 2019 at 04:08:37PM +0100, Lorenzo Bianconi wrote: > > > > What unnecessary operation ? > > > > > > the ones in mt76u_fill_bulk_urb() > > > > Your patches also add extra operations on hotpath due to urb->num_sgs and > > dev->usb.sg_en checks. > > here I guess you should use mt76u_

Re: [PATCH v2 2/3] rt2x00: check number of EPROTO errors

2019-02-12 Thread Stanislaw Gruszka
On Tue, Jan 22, 2019 at 06:32:05PM +0100, Jeroen Roovers wrote: > > then triggered a kernel panic. Sadly I couldn't capture it in time but > > I did spot that more phyN (up to phy4) devices had been added. > > Yes, even when some rt2x00usb_vendor_request starts to fail but keeps > on trying, the W

Re: [PATCH 0/4] do not use sg if not properly supported by usb controller

2019-02-12 Thread Stanislaw Gruszka
On Tue, Feb 12, 2019 at 03:25:30PM +0100, Lorenzo Bianconi wrote: > > On Tue, Feb 12, 2019 at 03:09:53PM +0100, Lorenzo Bianconi wrote: > > > > > > > > (repost with corrected Lorenzo email) > > > > > > > > On Tue, Feb 12, 2019 at 02:45:50PM +0

Re: [PATCH 0/4] do not use sg if not properly supported by usb controller

2019-02-12 Thread Stanislaw Gruszka
On Tue, Feb 12, 2019 at 03:09:53PM +0100, Lorenzo Bianconi wrote: > > > > (repost with corrected Lorenzo email) > > > > On Tue, Feb 12, 2019 at 02:45:50PM +0100, Stanislaw Gruszka wrote: > > > On Tue, Feb 12, 2019 at 02:24:47PM +0100, > > > lorenzobian

Re: [PATCH 0/4] do not use sg if not properly supported by usb controller

2019-02-12 Thread Stanislaw Gruszka
(repost with corrected Lorenzo email) On Tue, Feb 12, 2019 at 02:45:50PM +0100, Stanislaw Gruszka wrote: > On Tue, Feb 12, 2019 at 02:24:47PM +0100, lorenzobianconilore...@kernel.org > wrote: > > From: Lorenzo Bianconi > > > > Use linear fragment and not a single usb

Re: [PATCH 0/4] do not use sg if not properly supported by usb controller

2019-02-12 Thread Stanislaw Gruszka
On Tue, Feb 12, 2019 at 02:24:47PM +0100, lorenzobianconilore...@kernel.org wrote: > From: Lorenzo Bianconi > > Use linear fragment and not a single usb scatter-gather buffer in mt76u > {tx,rx} datapath if the usb controller has sg data length constraints. > Moreover add disable_usb_sg module pa

Re: [BUG] mt76x0u: Probing issues on Raspberry Pi 3 B+

2019-02-12 Thread Stanislaw Gruszka
On Tue, Feb 12, 2019 at 12:58:43PM +0100, Lorenzo Bianconi wrote: > > + usb_fill_bulk_urb(buf->urb, udev, pipe, NULL, buf->len, complete_fn, > > + context); > > + > > + if (udev->bus->sg_tablesize > 0) { > > + buf->urb->num_sgs = buf->num_sgs; > > + } else { > >

Re: [BUG] mt76x0u: Probing issues on Raspberry Pi 3 B+

2019-02-12 Thread Stanislaw Gruszka
On Tue, Feb 12, 2019 at 01:06:00AM +0100, Lorenzo Bianconi wrote: > > > > On Mon, 11 Feb 2019, Stanislaw Gruszka wrote: > > > > > On Mon, Feb 11, 2019 at 10:12:57AM -0500, Alan Stern wrote: > > > > On Mon, 11 Feb 2019, Lorenzo Bianconi wrote: > > >

[PATCH] mt76x02u: remove bogus check and comment padding

2019-02-12 Thread Stanislaw Gruszka
In mt76x02u_skb_dma_info() pad is always non-zero. Patch removes bogus check and add comments to the function. Signed-off-by: Stanislaw Gruszka --- .../net/wireless/mediatek/mt76/mt76x02_usb_core.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net

Re: [BUG] mt76x0u: Probing issues on Raspberry Pi 3 B+

2019-02-11 Thread Stanislaw Gruszka
On Mon, Feb 11, 2019 at 04:27:40PM +0100, Stefan Wahren wrote: > >> All my results refers to the mainline kernel we all should talk about. I > >> started a gist which try to describe the mainline variant: > >> https://gist.github.com/lategoodbye/c7317a42bf7f9c07f5a91baed8c68f75 > > So to summarize:

[RFC] mt76x02u: correct pad for fragments

2019-02-11 Thread Stanislaw Gruszka
pad for at least four bytes what is needed by HW. Signed-off-by: Stanislaw Gruszka --- .../wireless/mediatek/mt76/mt76x02_usb_core.c | 22 +++ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_usb_core.c b/drivers/net/

[PATCH] mt76x02u: use usb_bulk_msg to upload firmware

2019-02-11 Thread Stanislaw Gruszka
We don't need to send firmware data asynchronously, much simpler is just use synchronous usb_bulk_msg(). Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76.h | 13 + .../wireless/mediatek/mt76/mt76x02_usb_mcu.c | 52 ++- drivers/net/wir

Re: [BUG] mt76x0u: Probing issues on Raspberry Pi 3 B+

2019-02-10 Thread Stanislaw Gruszka
On Sun, Feb 10, 2019 at 05:52:30PM +0100, Lorenzo Bianconi wrote: > Anyway we will need to avoid SG since dwc_otg controller does not support it What does it mean the dwc_otg does not support SG ? Please be more specific. Stanislaw

Re: [BUG] mt76x0u: Probing issues on Raspberry Pi 3 B+

2019-02-10 Thread Stanislaw Gruszka
On Sun, Feb 10, 2019 at 11:22:25AM +0100, Lorenzo Bianconi wrote: > > On Sat, Feb 09, 2019 at 09:29:05PM +0100, Stefan Wahren wrote: > > > > could you please test the following series: > > > > https://patchwork.kernel.org/cover/10764453/ > > > > > > yeah this fixed the probing timeout and the drive

Re: [PATCH v2 3/3] rt2x00: do not print error when queue is full

2019-02-10 Thread Stanislaw Gruszka
On Sat, Feb 09, 2019 at 01:28:32PM +0100, Tom Psyborg wrote: > On 09/02/2019, Stanislaw Gruszka wrote: > > On Sat, Feb 09, 2019 at 12:11:03PM +0100, Tom Psyborg wrote: > >> Can you reproduce interface freeze with this patch if you enable debug > >> option

Re: [BUG] mt76x0u: Probing issues on Raspberry Pi 3 B+

2019-02-10 Thread Stanislaw Gruszka
probe error (and possibly also address AMD IOMMU issue). We seems do not correctly set URB transfer length smaller than sg buffer length. Attached patch should correct that. Stanislaw >From bc09bc7fa604019a5ef90184390e7c2a3899869d Mon Sep 17 00:00:00 2001 From: Stanislaw Gruszka Date: Su

Re: [BUG] mt76x0u: Probing issues on Raspberry Pi 3 B+

2019-02-10 Thread Stanislaw Gruszka
On Sat, Feb 09, 2019 at 07:46:37PM +0100, Lorenzo Bianconi wrote: > > as already reported here [1], that there are probing issues of mt76 using > > TP-Link Archer T2UH (wifi USB dongle) on Raspberry Pi 3 B+. > > > > I retested it with recent linux-next 20190208 (aarch64 defconfig + enabling > > m

Re: [PATCH v2 3/3] rt2x00: do not print error when queue is full

2019-02-09 Thread Stanislaw Gruszka
On Sat, Feb 09, 2019 at 12:11:03PM +0100, Tom Psyborg wrote: > Can you reproduce interface freeze with this patch if you enable debug > options to print all dbg messages? Haven't tried that, but I expect enabling debug messages will cause troubles at hardware where printk make CPU hog. Stanislaw

[RFC/RFT 5/8] rt2800mmio: use timer and work for handling tx statuses timeouts

2019-02-09 Thread Stanislaw Gruszka
. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/ralink/rt2x00/rt2800mmio.c | 81 +++-- drivers/net/wireless/ralink/rt2x00/rt2800mmio.h | 1 + drivers/net/wireless/ralink/rt2x00/rt2800pci.c | 2 +- drivers/net/wireless/ralink/rt2x00/rt2800soc.c | 2 +- drivers

[RFC/RFT 3/8] rt2800: move txstatus pending routine

2019-02-09 Thread Stanislaw Gruszka
Move rt2800usb_txstatus_pending routine to rt2800lib. It will be reused by rt2800mmio code. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 17 + drivers/net/wireless/ralink/rt2x00/rt2800lib.h | 1 + drivers/net/wireless/ralink/rt2x00

[RFC/RFT 6/8] rt2x00: remove last_nostatus_check

2019-02-09 Thread Stanislaw Gruszka
We do not any longer check txstatus timeout from tasklet, so do not need this optimization. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 9 - drivers/net/wireless/ralink/rt2x00/rt2x00.h | 2 -- drivers/net/wireless/ralink/rt2x00

[RFC/RFT 8/8] rt2x00mmio: remove legacy comment

2019-02-09 Thread Stanislaw Gruszka
Remove comment about fields that ware removed. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/ralink/rt2x00/rt2x00mmio.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00mmio.h b/drivers/net/wireless/ralink/rt2x00/rt2x00mmio.h index

[RFC/RFT 7/8] rt2x00: remove not used entry field

2019-02-09 Thread Stanislaw Gruszka
Remove not used any longer queue_entry field and flag. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/ralink/rt2x00/rt2x00queue.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00queue.h b/drivers/net/wireless/ralink/rt2x00/rt2x00queue.h

[RFC/RFT 0/8] rt2x00: performance fixes for mmio

2019-02-09 Thread Stanislaw Gruszka
Patch series should fix performance regriession and do not reintroduce tx queue hungs. Stanislaw Gruszka (8): rt2800: partially restore old mmio txstatus behaviour rt2800: new flush implementation for SoC devices rt2800: move txstatus pending routine rt2800mmio: fetch tx status changes

[RFC/RFT 2/8] rt2800: new flush implementation for SoC devices

2019-02-09 Thread Stanislaw Gruszka
Use new flush_queue() calback for SoC devices, what was already done for PCIe devices. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/ralink/rt2x00/rt2800soc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800soc.c b

[RFC/RFT 4/8] rt2800mmio: fetch tx status changes

2019-02-09 Thread Stanislaw Gruszka
Prepare to use rt2800mmio_fetch_txstatus() in concurrent manner and drop return value since is not longer needed. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/ralink/rt2x00/rt2800mmio.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers

[RFC/RFT 1/8] rt2800: partially restore old mmio txstatus behaviour

2019-02-09 Thread Stanislaw Gruszka
xdone/txstatus routines from lib"). Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 4 ++-- drivers/net/wireless/ralink/rt2x00/rt2800lib.h | 2 +- drivers/net/wireless/ralink/rt2x00/rt2800mmio.c | 30 +++-- drivers/net/wireless/ral

Re: [PATCH v2 3/3] rt2x00: do not print error when queue is full

2019-02-09 Thread Stanislaw Gruszka
On Wed, Jan 02, 2019 at 09:19:34AM +0100, Stanislaw Gruszka wrote: > On Fri, Dec 28, 2018 at 01:45:27AM +0100, Tom Psyborg wrote: > > > > > > I move prints to debug level for for "arrived at non-free entry" from > > > "Dropping frame due to fu

[PATCH 5.0 v2] mt76x0u: fix suspend/resume

2019-02-06 Thread Stanislaw Gruszka
We need to reset MCU and do other initializations on resume otherwise MT7610U device will fail to initialize, what cause system hung due to USB requests timeouts. Patch fixes 4.19 -> 4.20 regression. Cc: sta...@vger.kernel.org # 4.20+ Signed-off-by: Stanislaw Gruszka --- v2: minor coding st

Re: [mt76x2e] minipcie card is not working

2019-02-05 Thread Stanislaw Gruszka
On Mon, Jan 28, 2019 at 12:14:49PM -0800, Rosen Penev wrote: > I have a full height production sample mt7612e card that does not work > in either Access Point or Client mode. Monitor mode does not work > either (no packets received/transmitted). > > dmesg shows everything to be fine: > > [5.8

Re: [PATCH v2 0/7] mt76x02: Beacon support for USB

2019-02-05 Thread Stanislaw Gruszka
On Wed, Jan 30, 2019 at 04:22:55PM +0100, Stanislaw Gruszka wrote: > On Wed, Jan 30, 2019 at 11:07:48AM +0100, Stanislaw Gruszka wrote: > > > >> We can support ps buffering in AP as well using a hrtimer. In this way > > > >> we > > > >> can reus

[PATCH 5.0] mt76x0u: fix suspend/resume

2019-02-05 Thread Stanislaw Gruszka
We need to reset MCU and do other initalizations on resume otherwise MT7610U device will fail to initalize, what cause system hung due to USB requests timeouts. Patch fixes 4.19 -> 4.20 regression. Cc: sta...@vger.kernel.org # 4.20+ Signed-off-by: Stanislaw Gruszka --- .../net/wirel

[PATCH v3 6/7] mt76: beaconing fixes for USB

2019-01-30 Thread Stanislaw Gruszka
Configure beaconing on USB devices without PS buffering support. Signed-off-by: Stanislaw Gruszka --- v3: - do not disable HOST_BROADCAST_PS_BUFFERING, we will not enable AP mode - allocate skb only when enabling beacon .../net/wireless/mediatek/mt76/mt76x02_mac.c | 29

[PATCH v3 7/7] mt76x02: enable support for IBSS and MESH

2019-01-30 Thread Stanislaw Gruszka
Since we implement beconing on USB now, similar interfaces should be supported for USB as are for MMIO. Tested only on IBSS mode and AP mode (not enabled due to lack of PS buffering). Signed-off-by: Stanislaw Gruszka --- v3: enable only IBSS and MESH, do not change iface_combinations .../net

[PATCH v3 5/7] mt76x02: init beacon config for mt76x2u

2019-01-30 Thread Stanislaw Gruszka
Initialize beaconing also on mt76x2u. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c b/drivers/net/wireless/mediatek/mt76

[PATCH v3 4/7] mt76x02: minor beaconing init changes

2019-01-30 Thread Stanislaw Gruszka
Disable BEACON timer during init and configure interrupt registers only for mmio devices. Signed-off-by: Stanislaw Gruszka --- v3: do not move code to individual drivers, just mask it in common code .../net/wireless/mediatek/mt76/mt76x02_util.c | 18 -- 1 file changed, 12

[PATCH v3 2/7] mt76x02: use commmon add interface for mt76x2u

2019-01-30 Thread Stanislaw Gruszka
Since we now support mt76x2u feature to allow set mac address when creating interface in common code we can use it for mt76x2u. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76x02.h | 3 +-- drivers/net/wireless/mediatek/mt76/mt76x02_util.c | 6 +++--- .../net

[PATCH v3 0/7] mt76x02: Beacon support for USB

2019-01-30 Thread Stanislaw Gruszka
We can configure beaconing, but without TBTT interrupt we can not support PS buffering. This can be added later using kernel hrtimer, if we can keep it in sync with device timer. I tested AP and IBSS modes. Stanislaw Gruszka (7): mt76x02: use mask for vifs mt76x02: use commmon add interface

[PATCH v3 3/7] mt76x02: initialize mutli bss mode when set up address

2019-01-30 Thread Stanislaw Gruszka
BSSID is not strtirct related with beaconing (for example we can have 2 STA vifs) and more related with MAC address, so initaize BSSID when setting MAC address. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76x02_mac.c | 15 ++- drivers/net/wireless

[PATCH v3 1/7] mt76x02: use mask for vifs

2019-01-30 Thread Stanislaw Gruszka
Use vif_mask to count interfaces to allow to set mac address in HW if there is only one interface and report error if we create interface with wrong BSSID resulting in already used index. Signed-off-by: Stanislaw Gruszka --- v2: - do not change vif index calculation - return error for already

Re: [PATCH v2 0/7] mt76x02: Beacon support for USB

2019-01-30 Thread Stanislaw Gruszka
On Wed, Jan 30, 2019 at 11:07:48AM +0100, Stanislaw Gruszka wrote: > > >> We can support ps buffering in AP as well using a hrtimer. In this way we > > >> can reuse most of the existing code > > > > > > Yes, but there is issue to address, since k

Re: [PATCH v2 0/7] mt76x02: Beacon support for USB

2019-01-30 Thread Stanislaw Gruszka
On Wed, Jan 30, 2019 at 10:16:34AM +0100, Felix Fietkau wrote: > On 2019-01-30 09:37, Stanislaw Gruszka wrote: > > On Tue, Jan 29, 2019 at 01:40:57PM +0100, Lorenzo Bianconi wrote: > >> > Felix Fietkau writes: > >> > > >> > > On 2019-01-29 13:07, K

Re: [PATCH v2 0/7] mt76x02: Beacon support for USB

2019-01-30 Thread Stanislaw Gruszka
On Tue, Jan 29, 2019 at 01:40:57PM +0100, Lorenzo Bianconi wrote: > > Felix Fietkau writes: > > > > > On 2019-01-29 13:07, Kalle Valo wrote: > > >> Felix Fietkau writes: > > >> > > >>> On 2019-01-29 12:47, Kalle Valo wrote: &g

Re: [PATCH v2 0/7] mt76x02: Beacon support for USB

2019-01-30 Thread Stanislaw Gruszka
On Tue, Jan 29, 2019 at 01:10:08PM +0100, Felix Fietkau wrote: > On 2019-01-29 13:07, Kalle Valo wrote: > > Felix Fietkau writes: > > > >> On 2019-01-29 12:47, Kalle Valo wrote: > >>> Stanislaw Gruszka writes: > >>> > >>>> We ca

Re: [PATCH v2 1/7] mt76x02: use mask for vifs

2019-01-28 Thread Stanislaw Gruszka
On Mon, Jan 28, 2019 at 02:35:39PM +0100, Lorenzo Bianconi wrote: > > > > Maybe we shoud grub dev->mt76.mutex here, since we can have multiple > processes trying > to add an interface Interface creation and deletion are protected by rtnl_lock(), can not be performed concurrently. > > @@ -318,

Re: [PATCH 1/7] mt76x02: use mask for vifs

2019-01-28 Thread Stanislaw Gruszka
On Mon, Jan 28, 2019 at 01:29:27PM +0100, Felix Fietkau wrote: > On 2019-01-28 12:16, Stanislaw Gruszka wrote: > > On Mon, Jan 28, 2019 at 10:02:01AM +0100, Stanislaw Gruszka wrote: > >> On Mon, Jan 28, 2019 at 09:41:45AM +0100, Felix Fietkau wrote: > >> > >>

<    1   2   3   4   5   6   7   8   9   10   >