Re: [RFC v2 02/12] rtw88: core files

2018-10-04 Thread Stanislaw Gruszka
On Thu, Oct 04, 2018 at 01:42:35PM +0200, Stanislaw Gruszka wrote: > On Wed, Oct 03, 2018 at 04:02:18PM +0800, yhchu...@realtek.com wrote: > > +static void rtw_restore_port_cfg(struct rtw_dev *rtwdev) > > +{ > > + struct rtw_vif *rtwvif; > > + u32 config = ~0;

Re: [PATCH 01/12] rtwlan: main files

2018-10-04 Thread Stanislaw Gruszka
On Thu, Oct 04, 2018 at 03:39:55PM +0300, Kalle Valo wrote: > >> Can we put the configuration file in the firmware directory? > >> Should we package them into binary files? Or just put the raw data. > >> > >> We can test the performance for it. After we got the result, we will make > >> a decision

Re: [RFC v2 03/12] rtw88: hci files

2018-10-04 Thread Stanislaw Gruszka
On Thu, Oct 04, 2018 at 03:02:13PM +0200, Stanislaw Gruszka wrote: > > + WARN(flag, "DBI write fail"); > We always print WARN, there is other return point in this function. > > > +static void rtw_mdio_write(struct rtw_dev *rtwdev, u8 addr, u16 data, bool > >

Re: [RFC v2 04/12] rtw88: trx files

2018-10-04 Thread Stanislaw Gruszka
On Wed, Oct 03, 2018 at 04:02:20PM +0800, yhchu...@realtek.com wrote: > +static void rtw_rx_rssi_add(struct rtw_dev *rtwdev, > + struct rtw_rx_pkt_stat *pkt_stat, > + struct ieee80211_hdr *hdr) > +{ > + struct ieee80211_vif *vif; > + struct rt

Re: [RFC v2 03/12] rtw88: hci files

2018-10-04 Thread Stanislaw Gruszka
On Wed, Oct 03, 2018 at 04:02:19PM +0800, yhchu...@realtek.com wrote: > +static inline u32 > +rtw_read_rf(struct rtw_dev *rtwdev, enum rtw_rf_path rf_path, > + u32 addr, u32 mask) > +{ > + unsigned long flags; > + u32 val; > + > + spin_lock_irqsave(&rtwdev->rf_lock, flags); > +

Re: [RFC v2 02/12] rtw88: core files

2018-10-04 Thread Stanislaw Gruszka
On Wed, Oct 03, 2018 at 04:02:18PM +0800, yhchu...@realtek.com wrote: > +static void rtw_restore_port_cfg(struct rtw_dev *rtwdev) > +{ > + struct rtw_vif *rtwvif; > + u32 config = ~0; > + > + rcu_read_lock(); > + list_for_each_entry(rtwvif, &rtwdev->vif_list, list) list_for_each_ent

Re: [RFC v2 06/12] rtw88: fw and efuse files

2018-10-04 Thread Stanislaw Gruszka
Hi On Wed, Oct 03, 2018 at 04:02:22PM +0800, yhchu...@realtek.com wrote: > +void rtw_fw_do_iqk(struct rtw_dev *rtwdev, struct rtw_iqk_para *para) > +{ > + u8 h2c_pkt[H2C_PKT_SIZE] = {0}; Not sure if '= {0}' work as expected for arrays, you want to nulify first byte or whole h2c_pkt ? > +void

[PATCH 1/5] mt76x0: print BBP version only for debug

2018-10-04 Thread Stanislaw Gruszka
Use dev_dbg to print BBP version. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76x0/phy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/phy.c b/drivers/net/wireless/mediatek/mt76/mt76x0/phy.c index

[PATCH 2/5] mt76x0: correct RF access via RF_CSR regiser.

2018-10-04 Thread Stanislaw Gruszka
PCIe version don't use MCU for RF regsisters access. We need to correct RF CSR method to support up to 127 RF registers. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76x0/phy.c | 6 ++ drivers/net/wireless/mediatek/mt76/mt76x02_regs.h | 4 ++-- 2 files ch

[PATCH 4/5] mt76x0: correct RF reg pairs write for PCIe

2018-10-04 Thread Stanislaw Gruszka
We have to use RF CSR method for PCIe. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76x0/phy.c | 19 --- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/phy.c b/drivers/net/wireless/mediatek

[PATCH 5/5] mt76x0: use bus helper to identify rf access method

2018-10-04 Thread Stanislaw Gruszka
Use mt76_is_usb() to identify RF access method instead of MT76_STATE_MCU_RUNNING flag and add warning since MCU has to be initialized before we can access RF registers via MCU. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76x0/phy.c | 8 ++-- 1 file changed, 6

[PATCH 3/5] mt76: allow to identify bus

2018-10-04 Thread Stanislaw Gruszka
Add helpers to identify bus type. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mmio.c | 1 + drivers/net/wireless/mediatek/mt76/mt76.h | 9 + drivers/net/wireless/mediatek/mt76/usb.c | 1 + 3 files changed, 11 insertions(+) diff --git a/drivers/net/wireless

[PATCH 0/5] mt76x0: phy/rf fixups for PCIe

2018-10-04 Thread Stanislaw Gruszka
Changes since RFC: - regbase on top of mt76x02_dev change - add patch to choose single reg RF access via mt76_is_usb() Stanislaw Gruszka (5): mt76x0: print BBP version only for debug mt76x0: correct RF access via RF_CSR regiser. mt76: allow to identify bus mt76x0: correct RF reg pairs

Re: [PATCH] net: wireless: iwlegacy: Fix possible data races in il4965_send_rxon_assoc()

2018-10-04 Thread Stanislaw Gruszka
On Wed, Oct 03, 2018 at 10:07:45PM +0800, Jia-Ju Bai wrote: > These possible races are detected by a runtime testing. > To fix these races, the mutex lock is used in il4965_send_rxon_assoc() > to protect the data. Really ? I'm surprised by that, see below. > @@ -1297,6 +1297,7 @@ il4965_send_rx

Re: new mt76 usb crashes on device removal

2018-10-03 Thread Stanislaw Gruszka
On Wed, Oct 03, 2018 at 04:09:06PM +0200, Lorenzo Bianconi wrote: > > It still crashes. You can not reproduce the problem ? > > It's 100% reproducible for me, when I unplug mt76x0u or mt76x2 device. > > Hi Stanislaw, > > any news about the latest patchset I sent to fix that issue? It fixed the p

Re: [PATCH 06/10] mt76x2: move mt76x2_dev in mt76x02_util.h

2018-10-03 Thread Stanislaw Gruszka
On Wed, Oct 03, 2018 at 03:51:32PM +0200, Felix Fietkau wrote: > >> > } > >> > > >> > put them into mt76xN_dev and still remove dupicated code ? > >> Quite often, mt76_dev would be needed as well for register access, which > >> means extra parameters for a lot of functions. > >> I think Lorenzo’s

Re: [PATCH 06/10] mt76x2: move mt76x2_dev in mt76x02_util.h

2018-10-03 Thread Stanislaw Gruszka
On Wed, Oct 03, 2018 at 01:49:23PM +0200, Felix Fietkau wrote: > > > > On 3. Oct 2018, at 13:12, Stanislaw Gruszka wrote: > > > > On Wed, Oct 03, 2018 at 01:01:40PM +0200, Lorenzo Bianconi wrote: > >>> > >>> On Tue, Oct 02, 2018 at 12:19

Re: [PATCH 06/10] mt76x2: move mt76x2_dev in mt76x02_util.h

2018-10-03 Thread Stanislaw Gruszka
On Wed, Oct 03, 2018 at 01:01:40PM +0200, Lorenzo Bianconi wrote: > > > > On Tue, Oct 02, 2018 at 12:19:04AM +0200, Lorenzo Bianconi wrote: > > > Move mt76x2_dev in mt76x02_util.h and rename it in mt76x02_dev > > > in order to be shared between mt76x2 and mt76x0 driver > > > > > +struct mt76x02_de

Re: [PATCH 06/10] mt76x2: move mt76x2_dev in mt76x02_util.h

2018-10-03 Thread Stanislaw Gruszka
On Tue, Oct 02, 2018 at 12:19:04AM +0200, Lorenzo Bianconi wrote: > Move mt76x2_dev in mt76x02_util.h and rename it in mt76x02_dev > in order to be shared between mt76x2 and mt76x0 driver > +struct mt76x02_dev { > + struct mt76_dev mt76; /* must be first */ > + > + struct mac_address macad

Re: new mt76 usb crashes on device removal

2018-10-03 Thread Stanislaw Gruszka
On Wed, Oct 03, 2018 at 11:15:37AM +0200, Lorenzo Bianconi wrote: > > After > > > > b11e19694dc9 "mt76x0: add ieee80211_ops ops pointer to mt76x0_alloc_device > > signature" > > > > I have new crashs when remove mt76x0u and mt76x2u devices. > > I can not provide calltrace because some other war

Re: [RFC 2/2] mt76: make frag_cache global per cpu structure

2018-10-03 Thread Stanislaw Gruszka
On Wed, Oct 03, 2018 at 11:38:54AM +0200, Lorenzo Bianconi wrote: > > +static DEFINE_PER_CPU(struct page_frag_cache, mt76_frag_cache); > > + > > +void *mt76_alloc_frag(unsigned int fragsz) > > +{ > > + struct page_frag_cache *fc; > > + unsigned long flags; > > + void *data; > > + > > + loca

Re: [PATCH] mt76: fix frag length allocation for usb

2018-10-03 Thread Stanislaw Gruszka
On Wed, Oct 03, 2018 at 11:12:07AM +0200, Lorenzo Bianconi wrote: > > This is correct fix for c12128ce44b0 ("mt76: use a per rx queue page > > fragment cache"). We use wrong length when we allocate segments for > > MCU transmissions, which require bigger segment size than e->buf_size. > > > > Comm

[RFC 2/2] mt76: make frag_cache global per cpu structure

2018-10-03 Thread Stanislaw Gruszka
ff-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/dma.c | 2 +- drivers/net/wireless/mediatek/mt76/usb.c | 10 +- drivers/net/wireless/mediatek/mt76/util.c | 16 drivers/net/wireless/mediatek/mt76/util.h | 1 + 4 files changed, 19 insertions(+), 10 dele

[RFC 1/2] mt76: remove rx_page_lock

2018-10-03 Thread Stanislaw Gruszka
Extra serializaion for protecting q->rx_page is not needed, we stop rx_tasklet before we nulify it in mt76u_free_rx(). Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76.h | 1 - drivers/net/wireless/mediatek/mt76/usb.c | 8 +--- 2 files changed, 1 insertion(+)

new mt76 usb crashes on device removal

2018-10-03 Thread Stanislaw Gruszka
After b11e19694dc9 "mt76x0: add ieee80211_ops ops pointer to mt76x0_alloc_device signature" I have new crashs when remove mt76x0u and mt76x2u devices. I can not provide calltrace because some other warning/traces show up instantly after the problem happen and mask prints for initall problem. Th

[PATCH] mt76: fix frag length allocation for usb

2018-10-03 Thread Stanislaw Gruszka
oduce crashes, during mt76 driver load or unload. Fixes: c12128ce44b0 ("mt76: use a per rx queue page fragment cache") Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireles

Re: [PATCH 01/12] rtwlan: main files

2018-10-02 Thread Stanislaw Gruszka
On Wed, Oct 03, 2018 at 03:25:37AM +, Tony Chuang wrote: > Can I add you as Reviewed-by in RFCv2 ? Not yet :-) I'm going to review all (v2) patches in detail, not just first one, but this will take time. I'll post Reviewed-by tag when done and if I will have no remarks. > You helped me a lot

Re: [PATCH 01/12] rtwlan: main files

2018-10-02 Thread Stanislaw Gruszka
On Fri, Sep 28, 2018 at 11:32:41AM +, Tony Chuang wrote: > > if (rtw_hci_tx(rtwdev, &pkt_info, skb)) > > dev_kfree_skb_any(skb) > > > > just to remove 'return;' and out label. > > > OK, but why not use ieee80211_free_txskb, should it be better for mac80211? Yes, it is better

Re: [PATCH 01/12] rtwlan: main files

2018-10-02 Thread Stanislaw Gruszka
Hi On Tue, Oct 02, 2018 at 09:35:35AM +, Tony Chuang wrote: > > Hi Kale & Stanislaw, > > I am working on the driver code and making some changes that Stanislaw > have mentioned. And I expected that I will finish them tomorrow, what > should I do after I finished them? > > Should I send an R

Re: [RFC 4/5] mt76: move mt76x02_mac_write_txwi in mt76x02-lib module

2018-10-01 Thread Stanislaw Gruszka
On Mon, Oct 01, 2018 at 12:06:56PM +0200, Lorenzo Bianconi wrote: > > All above looks mt76x2 specific, maybe would be beter to place this in > > in setup_txwi() calback i.e: > > > > if (dev->drv->setup_txwi) > > drv->drv->setup_txwi(...) > > > > or maybe you plan to implement get

Re: [RFC] mt76x2: move mt76x2 source files to mt76x2 folder

2018-09-30 Thread Stanislaw Gruszka
On Sat, Sep 29, 2018 at 01:08:19PM +0200, Lorenzo Bianconi wrote: > Move mt76x2 and mt76x2u drivers to mt76x2 subfolder and > leave just shared code in mt76 root folder I was waiting for that change :-) > Signed-off-by: Lorenzo Bianconi Acked-by: Stanislaw Gruszka

Re: [RFC 4/5] mt76: move mt76x02_mac_write_txwi in mt76x02-lib module

2018-09-30 Thread Stanislaw Gruszka
On Sat, Sep 29, 2018 at 07:44:55PM +0200, Lorenzo Bianconi wrote: > + spin_lock_bh(&dev->lock); > + if (wcid && (rate->idx < 0 || !rate->count)) { > + txwi->rate = wcid->tx_rate; > + max_txpwr_adj = wcid->max_txpwr_adj; > + nss = wcid->tx_rate_nss; > +

Re: [PATCH] mt76x0: init: intrduce MT_H2M_* definitions

2018-09-30 Thread Stanislaw Gruszka
On Sat, Sep 29, 2018 at 07:30:32PM +0200, Lorenzo Bianconi wrote: > Add MT_H2M_BBP_AGENT, MT_H2M_MAILBOX_CSR and MT_H2M_INT_SRC and > remove magic numbers > > > /* TODO: Probably not needed */ > - mt76_wr(dev, 0x7028, 0); > - mt76_wr(dev, 0x7010, 0); > - mt76_wr(dev, 0x7024, 0)

Re: [PATCH] mt76x0: pci: add mt76x0e_cleanup routine

2018-09-30 Thread Stanislaw Gruszka
Hi On Sat, Sep 29, 2018 at 07:26:41PM +0200, Lorenzo Bianconi wrote: > Add mt76x0e_cleanup routine to tidy up the device > during netdevice removal > > Signed-off-by: Lorenzo Bianconi > + mt76_wr(dev, MT_H2M_MAILBOX_CID, ~0); > + mt76_wr(dev, MT_H2M_MAILBOX_STATUS, ~0); I don't think th

Re: [PATCH 01/12] rtwlan: main files

2018-09-28 Thread Stanislaw Gruszka
Hi On Fri, Sep 28, 2018 at 03:20:45AM +, Tony Chuang wrote: > > > + rtw_tx_pkt_info_update(rtwdev, &pkt_info, control, skb); > > > + if (rtw_hci_tx(rtwdev, &pkt_info, skb)) > > > + goto out; > > > + > > > + return; > > > + > > > +out: > > > + dev_kfree_skb_any(skb); > > This can be sim

Re: [PATCH 01/12] rtwlan: main files

2018-09-28 Thread Stanislaw Gruszka
On Thu, Sep 27, 2018 at 10:40:44AM -0500, Larry Finger wrote: > On 9/27/18 8:50 AM, Stanislaw Gruszka wrote: > --snip > > > > > > +#define BIT_LEN_MASK_32(__bitlen) (0x >> (32 - (__bitlen))) > > > +#define BIT_O

Re: [PATCH v2 08/24] mt76: move mt76x2_wait_for_bbp in mt76x02-lib module

2018-09-28 Thread Stanislaw Gruszka
On Fri, Sep 28, 2018 at 08:40:01AM +0200, Lorenzo Bianconi wrote: > +static inline bool > +mt76x02_wait_for_txrx_active(struct mt76_dev *dev) > +{ > + return __mt76_poll_msec(dev, MT_MAC_STATUS, > + MT_MAC_STATUS_TX | MT_MAC_STATUS_RX, > +

Re: [PATCH 01/12] rtwlan: main files

2018-09-27 Thread Stanislaw Gruszka
Hi, Below is some more detailed review of first patch (with mostly nitpicks). On Fri, Sep 21, 2018 at 02:03:56PM +0800, yhchu...@realtek.com wrote: > +static void rtw_ops_tx(struct ieee80211_hw *hw, > +struct ieee80211_tx_control *control, > +struct sk_buff

Re: [PATCH 19/26] mt76x0: pci: add hw initialization at bootstrap

2018-09-27 Thread Stanislaw Gruszka
On Thu, Sep 27, 2018 at 11:01:48AM +0200, Lorenzo Bianconi wrote: > Add mt76x0e_register_device routine in pci_init.c > to initialize the device during hw probe. > > Signed-off-by: Lorenzo Bianconi > --- > .../wireless/mediatek/mt76/mt76x0/Makefile| 2 +- > .../net/wireless/mediatek/mt76/mt

Re: [PATCH 17/26] mt76: add mt76x02_mac_start routine

2018-09-27 Thread Stanislaw Gruszka
On Thu, Sep 27, 2018 at 11:01:46AM +0200, Lorenzo Bianconi wrote: > Introduce mt76x02_mac_start since the mac start code is shared between > mt76x0e and mt76x2 drivers. > > Signed-off-by: Lorenzo Bianconi > --- > drivers/net/wireless/mediatek/mt76/mt76x02_mac.c | 15 +++ > drivers/ne

Re: [PATCH 15/26] mt76x0: init: reset beacon offset during bootstrap

2018-09-27 Thread Stanislaw Gruszka
On Thu, Sep 27, 2018 at 11:01:44AM +0200, Lorenzo Bianconi wrote: > Add beacon offset reset in mt76x0e_init_hardware routine > > Signed-off-by: Lorenzo Bianconi > --- > drivers/net/wireless/mediatek/mt76/mt76x0/init.c | 8 +++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git

Re: [PATCH 08/26] mt76: move mt76x2_wait_for_bbp in mt76x02-lib module

2018-09-27 Thread Stanislaw Gruszka
On Thu, Sep 27, 2018 at 11:01:37AM +0200, Lorenzo Bianconi wrote: > Move mt76x2_wait_for_bbp utility routine in mt76x02_util.h > in order to be resued by mt76x0 driver > > Signed-off-by: Lorenzo Bianconi > --- > +static inline bool mt76x02_wait_for_bbp(struct mt76_dev *dev) > +{ > + return __

Re: [PATCH 06/26] mt76: move mt76x02_beacon_offset in mt76x02_core.c

2018-09-27 Thread Stanislaw Gruszka
On Thu, Sep 27, 2018 at 11:01:35AM +0200, Lorenzo Bianconi wrote: > Move mt76x02_beacon_offset utility routine in mt76x02-lib module > since it is shared between mt76x0 and mt76x2 driver and remove > duplicated code. Moreover move beacon_offset data structure in > mt76x02-lib module since it is sha

Re: [RFC 1/4] mt76x0: print BBP version only for debug

2018-09-27 Thread Stanislaw Gruszka
On Thu, Sep 27, 2018 at 11:34:39AM +0200, Lorenzo Bianconi wrote: > Please drop the comment, it is a different register. Maybe we can Too late :-) > generalize mt76x02_wait_for_mac instead? Seems BBP(CORE,0) is not used by mt76x2, so merging it into mt76x02 is not correct. Thanks Stanislaw

Re: [RFC 1/4] mt76x0: print BBP version only for debug

2018-09-27 Thread Stanislaw Gruszka
On Thu, Sep 27, 2018 at 11:26:30AM +0200, Lorenzo Bianconi wrote: > > Use dev_dbg to print BBP version. > > > > Signed-off-by: Stanislaw Gruszka > > --- > > drivers/net/wireless/mediatek/mt76/mt76x0/phy.c | 2 +- > > 1 file changed, 1 insertion(+), 1 delet

[RFC 4/4] mt76x0: correct RF reg pairs write for PCIe

2018-09-27 Thread Stanislaw Gruszka
We have to use RF CSR method for PCIe. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76x0/phy.c | 19 --- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/phy.c b/drivers/net/wireless/mediatek

[RFC 0/4] mt76x0: phy/rf fixups for PCIe

2018-09-27 Thread Stanislaw Gruszka
This is RFC for now, especially I'm interesting if patch 3 and 4 is direction we should go. This is on top of Lorenzo github mt7610ev5 branch. Stanislaw Gruszka (4): mt76x0: print BBP version only for debug mt76x0: correct RF access via RF_CSR regiser. mt76: allow to identify bus m

[RFC 2/4] mt76x0: correct RF access via RF_CSR regiser.

2018-09-27 Thread Stanislaw Gruszka
PCIe version don't use MCU for RF regsisters access. We need to correct RF CSR method to support up to 127 RF registers. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76x0/phy.c | 6 ++ drivers/net/wireless/mediatek/mt76/mt76x02_regs.h | 4 ++-- 2 files ch

[RFC 1/4] mt76x0: print BBP version only for debug

2018-09-27 Thread Stanislaw Gruszka
Use dev_dbg to print BBP version. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76x0/phy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/phy.c b/drivers/net/wireless/mediatek/mt76/mt76x0/phy.c index

[RFC 3/4] mt76: allow to identify bus

2018-09-27 Thread Stanislaw Gruszka
Add helpers to identify bus type. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mmio.c | 1 + drivers/net/wireless/mediatek/mt76/mt76.h | 9 + drivers/net/wireless/mediatek/mt76/usb.c | 1 + 3 files changed, 11 insertions(+) diff --git a/drivers/net/wireless

Re: [PATCH] mt76: fix building without CONFIG_MT76x0U

2018-09-26 Thread Stanislaw Gruszka
On Wed, Sep 26, 2018 at 02:51:59PM +0200, Arnd Bergmann wrote: > The recent rework of the mt76 driver caused build failures in > configurations that leave the mt76x0u support disabled: > > ERROR: "mt76u_mcu_deinit" > [drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0-common.ko] undefined! > ERROR:

[PATCH 5/5] rt2800: flush and txstatus rework for rt2800mmio

2018-09-26 Thread Stanislaw Gruszka
Implement custom rt2800mmio flush routine and change txstatus routine to read TX_STA_FIFO also in the tasklet. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 14 ++- drivers/net/wireless/ralink/rt2x00/rt2800mmio.c | 118 ++-- drivers

[PATCH 2/5] rt2800mmio: use txdone/txstatus routines from lib

2018-09-26 Thread Stanislaw Gruszka
interrupt was not to miss any tx status from 16 entries FIFO register. Now, since we check for tx status timeout, we can allow to miss some tx statuses. However this will be improved in further patch where I also implement read status FIFO register in the tasklet. Signed-off-by: Stanislaw Gruszka

[PATCH 3/5] rt2x00: do not check for txstatus timeout every time on tasklet

2018-09-26 Thread Stanislaw Gruszka
Do not check for tx status timeout everytime we perform txstatus tasklet. Perform check once per half a second. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 7 +++ drivers/net/wireless/ralink/rt2x00/rt2800mmio.c | 3 ++- drivers/net/wireless

[PATCH 1/5] rt2800: move usb specific txdone/txstatus routines to rt2800lib

2018-09-26 Thread Stanislaw Gruszka
In order to reuse usb txdone/txstatus routines for mmio, move them to common rt2800lib.c file. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 138 drivers/net/wireless/ralink/rt2x00/rt2800lib.h | 3 + drivers/net/wireless/ralink

[PATCH 4/5] rt2x00: use different txstatus timeouts when flushing

2018-09-26 Thread Stanislaw Gruszka
such bad conditions. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 31 +- drivers/net/wireless/ralink/rt2x00/rt2x00.h| 1 + drivers/net/wireless/ralink/rt2x00/rt2x00mac.c | 4 3 files changed, 26 insertions(+), 10 deletions

[PATCH 0/5] rt2800mmio txdone/interrupts/flush rework

2018-09-26 Thread Stanislaw Gruszka
when CPU is busy with other interrupts. It was tested by with positive feedback, some users report that patches make MT7620 routers workable for them. This is documented here: https://bugzilla.kernel.org/show_bug.cgi?id=82751 Stanislaw Gruszka (5): rt2800: move usb specific txdone/txstatus

Re: [PATCH] mt76x0: add quirk to disable 2.4GHz band for Archer T1U

2018-09-25 Thread Stanislaw Gruszka
On Tue, Sep 25, 2018 at 11:55:48AM +0200, Arend van Spriel wrote: > On 9/25/2018 11:48 AM, Stanislaw Gruszka wrote: > >On Tue, Sep 25, 2018 at 11:07:47AM +0200, Lorenzo Bianconi wrote: > >>On Sep 25, Felix Fietkau wrote: > >>>On 2018-09-25 09:54, Lorenzo Bianconi wrot

Re: [PATCH] mt76x0: add quirk to disable 2.4GHz band for Archer T1U

2018-09-25 Thread Stanislaw Gruszka
On Tue, Sep 25, 2018 at 11:07:47AM +0200, Lorenzo Bianconi wrote: > On Sep 25, Felix Fietkau wrote: > > On 2018-09-25 09:54, Lorenzo Bianconi wrote: > > >> > > >> diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/usb.c > > >> b/drivers/net/wireless/mediatek/mt76/mt76x0/usb.c > > >> index 76

[PATCH] mt76x0: add quirk to disable 2.4GHz band for Archer T1U

2018-09-24 Thread Stanislaw Gruszka
TP-LINK Archer T1U do not support 2.4GHz band despite EEPROM reports that. Add quirk to mask out 2.4GHz support. Reported-by: Sid Hayn Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.c | 5 + drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0.h | 2

Re: mt76x0 random crashes after c12128ce44b0

2018-09-24 Thread Stanislaw Gruszka
On Mon, Sep 24, 2018 at 04:27:59PM +0200, Lorenzo Bianconi wrote: > > > > hi > > > > On Mon, Sep 24, 2018 at 04:13:11PM +0200, Lorenzo Bianconi wrote: > > > On Sep 24, Stanislaw Gruszka wrote: > > > > Hi, after -next commit: > > > >

Re: mt76x0 random crashes after c12128ce44b0

2018-09-24 Thread Stanislaw Gruszka
hi On Mon, Sep 24, 2018 at 04:13:11PM +0200, Lorenzo Bianconi wrote: > On Sep 24, Stanislaw Gruszka wrote: > > Hi, after -next commit: > > > > commit c12128ce44b04a987c4eb0f733cc99c4dd50d45a > > Author: Felix Fietkau > > Date: Fri Jul 13 16:26:15 2018 +020

mt76x0 random crashes after c12128ce44b0

2018-09-24 Thread Stanislaw Gruszka
Hi, after -next commit: commit c12128ce44b04a987c4eb0f733cc99c4dd50d45a Author: Felix Fietkau Date: Fri Jul 13 16:26:15 2018 +0200 mt76: use a per rx queue page fragment cache I have random crashes when load or unlod mt76x0u module. When loading, it looks like this: [ 40.238936] usb

Re: [RFC 00/12] rtwlan: mac80211 driver for Realtek 802.11ac wireless network chips

2018-09-21 Thread Stanislaw Gruszka
On Fri, Sep 21, 2018 at 02:03:55PM +0800, yhchu...@realtek.com wrote: > From: Yan-Hsuan Chuang > > This is a new mac80211 driver for Realtek 802.11ac wireless network chips. > rtwlan supports 8822BE and 8822CE chips, and will be able to support > multi-vif combinations in run-time. > > For now,

Re: [PATCH 1/5] rt2x00: set registers based on current band

2018-09-19 Thread Stanislaw Gruszka
On Wed, Sep 19, 2018 at 02:47:18PM +0200, Stanislaw Gruszka wrote: > > Can you show us how will the problem trigger on dual band devices? > > When you switch from some 2.4GHz channel to 5GHz channel (or vice versa) > ->curr_band will point to old band not the new one. To fix t

Re: [PATCH 1/5] rt2x00: set registers based on current band

2018-09-19 Thread Stanislaw Gruszka
On Wed, Sep 19, 2018 at 02:17:30PM +0200, Tomislav Požega wrote: > On Wed, 19 Sep 2018 13:05:41 +0200, Stanislaw Gruszka wrote: > > >Driver should provide on what channels are supported to mac80211, but > >user space decide what channel to use and that imply band 2.4GHz or >

Re: [PATCH] mt76x0: run vco calibration for each channel configuration

2018-09-19 Thread Stanislaw Gruszka
On Tue, Sep 18, 2018 at 10:26:09AM -0400, Sid Hayn wrote: > mt76x0 isn't in 4.18 at all, it's being added in 4.19 isn't it? I'm > not sure you can call it a regression, but adding a new driver with a > known bug that breaks an entire use case (monitor mode) seems silly > when a small and tested fi

Re: mt76x0 bug report

2018-09-19 Thread Stanislaw Gruszka
On Tue, Sep 18, 2018 at 01:36:51PM -0400, Sid Hayn wrote: > On Tue, Sep 18, 2018 at 7:56 AM Stanislaw Gruszka wrote: > > > > On Mon, Sep 17, 2018 at 11:18:57PM -0400, Sid Hayn wrote: > > > Sorry to bump the one thing that we both agreed was low priority but > >

Re: [PATCH 1/5] rt2x00: set registers based on current band

2018-09-19 Thread Stanislaw Gruszka
On Tue, Sep 18, 2018 at 04:14:33PM +0200, Tomislav Požega wrote: > On Tue, 18 Sep 2018 14:20:16 +0200, Stanislaw Gruszka wrote: > > >On Mon, Sep 17, 2018 at 06:32:51PM +0200, Tomislav Požega wrote: > >> Use curr_band instead of rf->channel among various subroutines - >

Re: [PATCH 2/5] rt2x00: rework channel config function

2018-09-18 Thread Stanislaw Gruszka
On Mon, Sep 17, 2018 at 06:32:52PM +0200, Tomislav Požega wrote: > - switch (rt2x00dev->default_ant.tx_chain_num) { > - case 3: > - /* Turn on tertiary PAs */ > - rt2x00_set_field32(&tx_pin, TX_PIN_CFG_PA_PE_A2_EN, > -rf->channel > 14)

Re: [PATCH 1/5] rt2x00: set registers based on current band

2018-09-18 Thread Stanislaw Gruszka
On Mon, Sep 17, 2018 at 06:32:51PM +0200, Tomislav Požega wrote: > Use curr_band instead of rf->channel among various subroutines - > mostly for 2.4GHz band but in some circumstances for 5GHz band too. What is the reason for that change ? > @@ -9265,8 +9278,9 @@ static int rt2800_probe_hw_mode(st

Re: [PATCH] mt76x0: run vco calibration for each channel configuration

2018-09-18 Thread Stanislaw Gruszka
On Tue, Sep 18, 2018 at 01:43:56PM +0200, Stanislaw Gruszka wrote: > On Fri, Sep 07, 2018 at 11:13:12PM +0200, Lorenzo Bianconi wrote: > > According to vendor sdk, vco calibration has to be executed > > for each channel configuration whereas mcu calibration has to be > > per

Re: mt76x0 bug report

2018-09-18 Thread Stanislaw Gruszka
On Mon, Sep 17, 2018 at 11:18:57PM -0400, Sid Hayn wrote: > Sorry to bump the one thing that we both agreed was low priority but > > So was testing all of my dongles that use the driver you are working > on, and running them through my connect scripts. I moved the AP to > maybe <5ft from the

Re: [PATCH] mt76x0: run vco calibration for each channel configuration

2018-09-18 Thread Stanislaw Gruszka
ince in that configuration vco calibration > was never executed > > Fixes: 10de7a8b4ab9 ("mt76x0: phy files") > Tested-by: Sid Hayn > Signed-off-by: Lorenzo Bianconi Acked-by: Stanislaw Gruszka

Re: [PATCH 39/42] mt76: move some irq code to common mmio module

2018-09-06 Thread Stanislaw Gruszka
On Thu, Sep 06, 2018 at 11:33:55AM +0200, Felix Fietkau wrote: > On 2018-09-06 11:18, Stanislaw Gruszka wrote: > > Move some irq handling code to generic mmio module. > > > > Signed-off-by: Stanislaw Gruszka > Please drop this patch. This won't work on MT760

Re: [PATCH 39/42] mt76: move some irq code to common mmio module

2018-09-06 Thread Stanislaw Gruszka
On Thu, Sep 06, 2018 at 11:47:53AM +0200, Lorenzo Bianconi wrote: > > > > On 2018-09-06 11:37, Lorenzo Bianconi wrote: > > >> > > >> On 2018-09-06 11:18, Stanislaw Gruszka wrote: > > >> > Move some irq handling code to generic mmio module.

[PATCH] mt76: fix return value of mt76x02_wait_for_mac

2018-09-06 Thread Stanislaw Gruszka
We need to return bool value in mt76x02_wait_for_mac. Reported-by: Dan Carpenter Fixes: 2735a6dd7df3 ("mt76: unify wait_for_mac") Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76x02_mac.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: mt76x0 bug report

2018-09-06 Thread Stanislaw Gruszka
On Wed, Sep 05, 2018 at 08:52:18PM +, Sid Hayn wrote: > On Tue, Sep 4, 2018 at 5:11 PM Lorenzo Bianconi > wrote: > > > > > > > > I have one mt76x2u (Alfa AWUS036ACM) and a few mt76x0. > > > > > > I've noticed two additional issues in my testing. > > > > > > First issue, is that it appears the

[PATCH 36/42] mt76x0: use mt76_register_device for device registration

2018-09-06 Thread Stanislaw Gruszka
. Moreover remove following unused routines: - mt76_init_sband - mt76_init_sband_2g - mt76_init_sband_5g Signed-off-by: Lorenzo Bianconi Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.c | 13 +- drivers/net/wireless/mediatek/mt76/mt76x0/init.c | 187

[PATCH 41/42] mt76x0: remove some usb specific code from mt76x0_register_device

2018-09-06 Thread Stanislaw Gruszka
Initial effort to make mt76x0_register_device bus neutral. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76x0/init.c | 8 drivers/net/wireless/mediatek/mt76/mt76x0/usb.c | 12 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a

[PATCH 42/42] mt76x0: make device allocation bus neutral

2018-09-06 Thread Stanislaw Gruszka
Remove some USB specific code form mt76x0_alloc_device. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76x0/init.c | 11 +++ drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0.h | 3 ++- drivers/net/wireless/mediatek/mt76/mt76x0/pci.c| 2 +- drivers/net

[PATCH 37/42] mt76x0: inital split between pci and usb

2018-09-06 Thread Stanislaw Gruszka
For now pci driver can read ASIC version from the device :-) Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/Kconfig | 23 -- drivers/net/wireless/mediatek/mt76/Makefile| 2 +- drivers/net/wireless/mediatek/mt76/mt76x0/Makefile | 11 ++- drivers/net

[PATCH 40/42] mt76x0: remove unused mt76x0_wcid

2018-09-06 Thread Stanislaw Gruszka
We do not use mt76x0_wcid any longer. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0.h | 9 - 1 file changed, 9 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0.h b/drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0.h

[PATCH 39/42] mt76: move some irq code to common mmio module

2018-09-06 Thread Stanislaw Gruszka
Move some irq handling code to generic mmio module. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mmio.c| 15 +++ drivers/net/wireless/mediatek/mt76/mmio.h| 34 drivers/net/wireless/mediatek/mt76/mt76.h| 3

[PATCH 38/42] mt76: initial separation of mmio part

2018-09-06 Thread Stanislaw Gruszka
Create mt76_mmio module to contain generic mt76 PCEe/SOC code. Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/Kconfig | 8 ++- drivers/net/wireless/mediatek/mt76/Makefile | 8 +-- drivers/net/wireless/mediatek/mt76/dma.c| 68

[PATCH 01/42] mt76x2: change mt76x2_tx_complete routine signature

2018-09-06 Thread Stanislaw Gruszka
From: Lorenzo Bianconi Use mt76_dev instead of mt76x2_dev in mt76x2_tx_complete signature in order to be reused in mt76x0 driver Signed-off-by: Lorenzo Bianconi Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76x2.h | 2 +- drivers/net/wireless/mediatek

[PATCH 25/42] mt76x0: init hw capabilities

2018-09-06 Thread Stanislaw Gruszka
From: Lorenzo Bianconi Enable hw capabilities supported by mt76-usb layer - fast_xmit - tx/rx amsdu - MFP - non-linear tx skbs Signed-off-by: Lorenzo Bianconi Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76x0/init.c | 7 +++ 1 file changed, 7 insertions

[PATCH 23/42] mt76x0: remove unused stat_work

2018-09-06 Thread Stanislaw Gruszka
From: Lorenzo Bianconi Remove unused definition of stat_work delayed_work definition and related flush/cancel routines Signed-off-by: Lorenzo Bianconi Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76x0/init.c | 2 -- drivers/net/wireless/mediatek/mt76/mt76x0

[PATCH 32/42] mt76x0: move stop related routines in mt76x0_mac_stop

2018-09-06 Thread Stanislaw Gruszka
From: Lorenzo Bianconi Move tear-down routines in mt76x0_mac_stop function. mt76x0_mac_stop routines will be reused in mt76x0_suspend Signed-off-by: Lorenzo Bianconi Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76x0/init.c | 3 +++ drivers/net/wireless/mediatek

[PATCH 27/42] mt76: remove unused MT76_MORE_STATS state

2018-09-06 Thread Stanislaw Gruszka
From: Lorenzo Bianconi Remove no longer used hw state Signed-off-by: Lorenzo Bianconi Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek

[PATCH 26/42] mt76x0: trim rx skb to proper length

2018-09-06 Thread Stanislaw Gruszka
We need to truncate skb to proper length. This fix below message: wlan0: associating with AP with corrupt beacon and probe response Fixes: 9d87d9fad47e ("mt76x0: unify tx/rx datapath with mt76x2u driver") Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76x0

[PATCH 07/42] mt76x0: introduce mt76x0_tx_prepare_skb routine

2018-09-06 Thread Stanislaw Gruszka
From: Lorenzo Bianconi Add mt76x0_tx_prepare_skb routine as tx txwi handler. mt76x0_tx_prepare_skb will be used by mt76-usb layer Signed-off-by: Lorenzo Bianconi Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0.h | 5 - drivers/net/wireless/mediatek

[PATCH 29/42] mt76: move mt76 rate definitions in mt76x02-lib module

2018-09-06 Thread Stanislaw Gruszka
From: Lorenzo Bianconi Move mt76x2_rate definition in mt76x02-lib module and rename it in mt76x02_rates in order to be reused in mt76x0 driver. Moreover remove unused mt76_rate definition Signed-off-by: Lorenzo Bianconi Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76

[PATCH 30/42] mt76x0: alloc mcu buffers first in mt76x0_mcu_cmd_init

2018-09-06 Thread Stanislaw Gruszka
From: Lorenzo Bianconi swap mt76u_mcu_init_rx and mt76x0_mcu_function_select in mt76x0_mcu_cmd_init routine in order to allocate mcu buffers first and then send mcu commands Signed-off-by: Lorenzo Bianconi Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76x0/mcu.c

[PATCH 35/42] mt76x0: remove has_{2,5}ghz fields of mt76x0_eeprom_params

2018-09-06 Thread Stanislaw Gruszka
From: Lorenzo Bianconi Remove has_2ghz/has_5ghz fields of mt76x0_eeprom_params data structure and use mt76_dev ones. This is a preliminary patch to use shared routines for device allocation Signed-off-by: Lorenzo Bianconi Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek

[PATCH 34/42] mt76x0: do not free/alloc buffers during suspend/resume

2018-09-06 Thread Stanislaw Gruszka
From: Lorenzo Bianconi Do not free/alloc {tx,rx} buffers during suspend/resume phases but use the ones previously allocated during hw probe. Move {tx,rx}/mcu buffers allocation from mt76x0_init_hardware routine to mt76x0_register_device Signed-off-by: Lorenzo Bianconi Signed-off-by: Stanislaw

[PATCH 24/42] mt76x0: enable per-sta tx queueing

2018-09-06 Thread Stanislaw Gruszka
From: Lorenzo Bianconi Initialize wake_tx_queue function pointer in ieee80211_ops in order to enable per-sta tx queueing. Moreover set driver private txq size Signed-off-by: Lorenzo Bianconi Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76x0/init.c | 3

[PATCH 33/42] mt76x0: move mt76x0_init_hardware in mt76x0_register_device

2018-09-06 Thread Stanislaw Gruszka
From: Lorenzo Bianconi Move mt76x0_init_hardware routine in mt76x0_register_device during hw probe. This is a preliminary patch to avoid {tx/rx} buffer allocation during resume/suspend Signed-off-by: Lorenzo Bianconi Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76

[PATCH 31/42] mt76x0: fix memory leak during hw probe

2018-09-06 Thread Stanislaw Gruszka
From: Lorenzo Bianconi Fix memory leak during hw probe if mt76x0_register_device fails since MT76_STATE_INITIALIZED has not set yet and mt76x0_cleanup does not free tx/rx queues and mcu buffers Signed-off-by: Lorenzo Bianconi Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek

[PATCH 28/42] mt76x0: remove mt76x0_stop_hardware routine

2018-09-06 Thread Stanislaw Gruszka
From: Lorenzo Bianconi Since it is actually used in a single place and it just runs mt76x0_chip_onoff routine, remove mt76x0_stop_hardware and use mt76x0_chip_onoff directly Signed-off-by: Lorenzo Bianconi Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76x0/init.c

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