[PATCH] libertas: call into generic suspend code before turning off power

2018-10-08 Thread Daniel Mack
ertas: fix suspend and resume for SDIO connected cards") Signed-off-by: Daniel Mack --- If possible, this should go in for 4.19. drivers/net/wireless/marvell/libertas/if_sdio.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/net/wireless/marvell/libertas/if_sdio.c b/drivers/ne

Re: [PATCH v3 00/11] NFC: A bunch of cleanups for st95hf

2018-09-18 Thread Daniel Mack
Hi Samuel, On 6/8/2018 12:38 PM, Daniel Mack wrote: On Tuesday, July 24, 2018 11:59 AM, Daniel Mack wrote: This v3 of a series of patches for the ST95HF driver. Patch #1 reverts a change that I have submitted earlier and which is sitting in nfc-next already. Given that the tree hasn't

Re: [PATCH v3 00/11] NFC: A bunch of cleanups for st95hf

2018-08-06 Thread Daniel Mack
Hi Samuel, On Tuesday, July 24, 2018 11:59 AM, Daniel Mack wrote: This v3 of a series of patches for the ST95HF driver. Patch #1 reverts a change that I have submitted earlier and which is sitting in nfc-next already. Given that the tree hasn't been sent out for being merged yet, it could

[PATCH v3 11/11] NFC: st95hf: add of match table

2018-07-24 Thread Daniel Mack
Add a match table for device tree compatible strings. Interestingly, a document describing the bindings already exists since a while, but users currently rely on the implicit matching in the drivers core. Let's be explicit and add a real match table. Signed-off-by: Daniel Mack Cc: de

[PATCH v3 10/11] NFC: st95hf: two small style nits

2018-07-24 Thread Daniel Mack
Address two minor style issues that I came across while working on the driver. Signed-off-by: Daniel Mack --- drivers/nfc/st95hf/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/st95hf/core.c index 10321dba15dc..ccb1f1456871

[PATCH v3 07/11] NFC: st95hf: ignore spurious interrupts

2018-07-24 Thread Daniel Mack
e through the antenna, and need to be handled gracefully. Signed-off-by: Daniel Mack --- drivers/nfc/st95hf/core.c | 19 +-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/st95hf/core.c index 99f84ddfdfef..7fdad67b1a4d 100644 ---

[PATCH v3 08/11] NFC: st95hf: re-order command defines

2018-07-24 Thread Daniel Mack
Just a small cleanup to bring the command defines in a numerical order. Signed-off-by: Daniel Mack --- drivers/nfc/st95hf/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/st95hf/core.c index 7fdad67b1a4d..53447394666b 100644

[PATCH v3 09/11] NFC: st95hf: unify sync/async flags

2018-07-24 Thread Daniel Mack
Keep the information whether a command is asynchronous in a boolean flag like it is done elsewhere in the code. This way, the enum can go away. No function change intended. Signed-off-by: Daniel Mack --- drivers/nfc/st95hf/core.c | 38 -- drivers/nfc/st95hf

[PATCH v3 06/11] NFC: st95hf: move skb allocation to ISR

2018-07-24 Thread Daniel Mack
tched, and no further communication with device is possible. To fix this, move the call to nfc_alloc_recv_skb() from st95hf_in_send_cmd() to st95hf_irq_thread_handler() and always read back the interrupt reason. Signed-off-by: Daniel Mack --- drivers/nfc/st95hf/core.c

[PATCH v3 05/11] NFC: st95hf: remove exchange_lock

2018-07-24 Thread Daniel Mack
this, nullify the `skb_resp' pointer in the callback context after it was sent back to the NFC core. Signed-off-by: Daniel Mack --- drivers/nfc/st95hf/core.c | 52 +++ 1 file changed, 9 insertions(+), 43 deletions(-) diff --git a/drivers/nfc/st95hf/core

[PATCH v3 04/11] NFC: st95hf: remove logging from spi functions

2018-07-24 Thread Daniel Mack
The callers of these functions already log on errors, and there's no need to do it from two places. Signed-off-by: Daniel Mack --- drivers/nfc/st95hf/spi.c | 19 --- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/nfc/st95hf/spi.c b/drivers/nfc/s

[PATCH v3 02/11] NFC: st95hf: drop nfcdev_free

2018-07-24 Thread Daniel Mack
This flag is unneccesary. We can just nullify `ddev' instead after we freed it and check for that in the ISR. Signed-off-by: Daniel Mack --- drivers/nfc/st95hf/core.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/s

[PATCH v3 03/11] NFC: st95hf: drop illegal kfree_skb() in IRQ handler

2018-07-24 Thread Daniel Mack
In the error path of the IRQ handler, don't free the skb in flight. The callback in the digital core will do that for us. Doing it from both places causes a memory corruption. Signed-off-by: Daniel Mack --- drivers/nfc/st95hf/core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/driver

[PATCH v3 01/11] Revert "NFC: st95hf: drop illegal kfree_skb()"

2018-07-24 Thread Daniel Mack
ll in turn lead to activated targets not being cleaned up, even after stopping userspace processes. The memory corruption that I was hunting was caused by another kfree_skb(). This will be fixed in a later commit. Signed-off-by: Daniel Mack Fixes: c99f996b2ba49 ("NFC: st95hf: drop il

[PATCH v3 00/11] NFC: A bunch of cleanups for st95hf

2018-07-24 Thread Daniel Mack
elog: v1 → v2: * Improved commit logs, identical patch content. v2 → v3: * Added another patch titled "NFC: st95hf: ignore spurious interrupts" Daniel Mack (11): Revert "NFC: st95hf: drop illegal kfree_skb()" NFC: st95hf: drop nfcdev_free NFC: st95hf: drop illegal k

[PATCH v2 06/10] NFC: st95hf: move skb allocation to ISR

2018-07-24 Thread Daniel Mack
tched, and no further communication with device is possible. To fix this, move the call to nfc_alloc_recv_skb() from st95hf_in_send_cmd() to st95hf_irq_thread_handler() and always read back the interrupt reason. Signed-off-by: Daniel Mack --- drivers/nfc/st95hf/core.c

[PATCH v2 08/10] NFC: st95hf: unify sync/async flags

2018-07-24 Thread Daniel Mack
Keep the information whether a command is asynchronous in a boolean flag like it is done elsewhere in the code. This way, the enum can go away. No function change intended. Signed-off-by: Daniel Mack --- drivers/nfc/st95hf/core.c | 38 -- drivers/nfc/st95hf

[PATCH v2 05/10] NFC: st95hf: remove exchange_lock

2018-07-24 Thread Daniel Mack
this, nullify the `skb_resp' pointer in the callback context after it was sent back to the NFC core. Signed-off-by: Daniel Mack --- drivers/nfc/st95hf/core.c | 52 +++ 1 file changed, 9 insertions(+), 43 deletions(-) diff --git a/drivers/nfc/st95hf/core

[PATCH v2 03/10] NFC: st95hf: drop illegal kfree_skb() in IRQ handler

2018-07-24 Thread Daniel Mack
In the error path of the IRQ handler, don't free the skb in flight. The callback in the digital core will do that for us. Doing it from both places causes a memory corruption. Signed-off-by: Daniel Mack --- drivers/nfc/st95hf/core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/driver

[PATCH v2 04/10] NFC: st95hf: remove logging from spi functions

2018-07-24 Thread Daniel Mack
The callers of these functions already log on errors, and there's no need to do it from two places. Signed-off-by: Daniel Mack --- drivers/nfc/st95hf/spi.c | 19 --- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/nfc/st95hf/spi.c b/drivers/nfc/s

[PATCH v2 01/10] Revert "NFC: st95hf: drop illegal kfree_skb()"

2018-07-24 Thread Daniel Mack
ll in turn lead to activated targets not being cleaned up, even after stopping userspace processes. The memory corruption that I was hunting was caused by another kfree_skb(). This will be fixed in a later commit. Signed-off-by: Daniel Mack Fixes: c99f996b2ba49 ("NFC: st95hf: drop il

[PATCH v2 09/10] NFC: st95hf: two small style nits

2018-07-24 Thread Daniel Mack
Address two minor style issues that I came across while working on the driver. Signed-off-by: Daniel Mack --- drivers/nfc/st95hf/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/st95hf/core.c index 835a1e61c817..4db3c020921c

[PATCH v2 00/10] NFC: A bunch of cleanups for st95hf

2018-07-24 Thread Daniel Mack
elog: v1 → v2: * Improved commit logs, identical patch content. Daniel Mack (10): Revert "NFC: st95hf: drop illegal kfree_skb()" NFC: st95hf: drop nfcdev_free NFC: st95hf: drop illegal kfree_skb() in IRQ handler NFC: st95hf: remove logging from spi functions NFC: st95hf:

[PATCH v2 07/10] NFC: st95hf: re-order command defines

2018-07-24 Thread Daniel Mack
Just a small cleanup to bring the command defines in a numerical order. Signed-off-by: Daniel Mack --- drivers/nfc/st95hf/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/st95hf/core.c index 99f84ddfdfef..e7ecc57dde8f 100644

[PATCH v2 02/10] NFC: st95hf: drop nfcdev_free

2018-07-24 Thread Daniel Mack
This flag is unneccesary. We can just nullify `ddev' instead after we freed it and check for that in the ISR. Signed-off-by: Daniel Mack --- drivers/nfc/st95hf/core.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/s

[PATCH v2 10/10] NFC: st95hf: add of match table

2018-07-24 Thread Daniel Mack
Add a match table for device tree compatible strings. Interestingly, a document describing the bindings already exists since a while, but users currently rely on the implicit matching in the drivers core. Let's be explicit and add a real match table. Signed-off-by: Daniel Mack Cc: de

[PATCH 04/10] NFC: st95hf: remove logging from spi functions

2018-07-23 Thread Daniel Mack
The callers of these functions already log errors, so there's no need to do it from two places. Signed-off-by: Daniel Mack --- drivers/nfc/st95hf/spi.c | 19 --- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/nfc/st95hf/spi.c b/drivers/nfc/st95hf/

[PATCH 03/10] NFC: st95hf: drop illegal kfree_skb() in IRQ handler

2018-07-23 Thread Daniel Mack
In the error path of the IRQ handler, don't free the skb in flight. The callback in the digital core will do that for us. Doing it from both places causes memory corruptions. Signed-off-by: Daniel Mack --- drivers/nfc/st95hf/core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/driver

[PATCH 02/10] NFC: st95hf: drop nfcdev_free

2018-07-23 Thread Daniel Mack
This flag is unneccesary. We can just nullify `ddev' instead after we freed it. Signed-off-by: Daniel Mack --- drivers/nfc/st95hf/core.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/st95hf/core.c index bc1a207

[PATCH 09/10] NFC: st95hf: two small style nits

2018-07-23 Thread Daniel Mack
Address two minor style issues that I came across while working on the driver. Signed-off-by: Daniel Mack --- drivers/nfc/st95hf/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/st95hf/core.c index 835a1e61c817..4db3c020921c

[PATCH 08/10] NFC: st95hf: unify sync/async flags

2018-07-23 Thread Daniel Mack
Keep the information whether a command is asynchronous in a boolean flag everywhere in the code. This way, the enum can go away. Signed-off-by: Daniel Mack --- drivers/nfc/st95hf/core.c | 38 -- drivers/nfc/st95hf/spi.c | 12 +--- drivers/nfc/st95hf

[PATCH 10/10] NFC: st95hf: add of match table

2018-07-23 Thread Daniel Mack
Add a match table for device tree compatible strings. Interestingly, a document describing the bindings already exists since a while, but users currently reply on the implicit matching in the drivers core. Signed-off-by: Daniel Mack Cc: devicet...@vger.kernel.org --- drivers/nfc/st95hf/core.c

[PATCH 07/10] NFC: st95hf: re-order command defines

2018-07-23 Thread Daniel Mack
Just a small cleanup to bring the command defines in a numerical order. Signed-off-by: Daniel Mack --- drivers/nfc/st95hf/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/st95hf/core.c index 99f84ddfdfef..e7ecc57dde8f 100644

[PATCH 06/10] NFC: st95hf: move skb allocation to ISR

2018-07-23 Thread Daniel Mack
tched, and no further communication with device is possible. To fix this, move the call to nfc_alloc_recv_skb() from st95hf_in_send_cmd() to st95hf_irq_thread_handler() so we can always read back the interrupt reason. Signed-off-by: Daniel Mack --- drivers/nfc/st95hf/core.c

[PATCH 05/10] NFC: st95hf: remove exchange_lock

2018-07-23 Thread Daniel Mack
this, nullify the `skb_resp' pointer in the callback context. Signed-off-by: Daniel Mack --- drivers/nfc/st95hf/core.c | 52 +++ 1 file changed, 9 insertions(+), 43 deletions(-) diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/st95hf/core.c index d85

[PATCH 01/10] Revert "NFC: st95hf: drop illegal kfree_skb()"

2018-07-23 Thread Daniel Mack
ll in turn lead to activated targets not being cleaned up, even after stopping userspace processes. The memory corruption that I was hunting was caused by another kfree_skb(). This will be fixed in a later commit. Signed-off-by: Daniel Mack Fixes: c99f996b2ba49 ("NFC: st95hf: drop il

[PATCH 00/10] NFC: A bunch of cleanups for st95hf

2018-07-23 Thread Daniel Mack
ry of course. The changes are all rather simple and are explained in their individual commit logs. Note that this series builds upon the patch titled "nfc: st95hf: remove redundant pointers 'dev' and 'nfcddev'" that Colin posted the other day. Thanks, Daniel Dani

Re: [PATCH 2/2] nfc: st95hf: drop another illegal kfree_skb()

2018-07-17 Thread Daniel Mack
Hi, I'll resend the two patches in this series as part of a bigger series soon, please ignore them for now. Thanks, Daniel On Friday, June 29, 2018 02:47 PM, Daniel Mack wrote: In the error path of the IRQ handler, don't free the skb in flight. The callback in the digital co

Re: [PATCH v2] libertas: fix suspend and resume for SDIO connected cards

2018-06-29 Thread Daniel Mack
On Friday, June 29, 2018 05:39 PM, Ulf Hansson wrote: On 27 June 2018 at 20:58, Daniel Mack wrote: Prior to commit 573185cc7e64 ("mmc: core: Invoke sdio func driver's PM callbacks from the sdio bus"), the MMC core used to call into the power management functions of SDIO cli

[PATCH 2/2] nfc: st95hf: drop another illegal kfree_skb()

2018-06-29 Thread Daniel Mack
en. Drop it. Signed-off-by: Daniel Mack --- drivers/nfc/st95hf/core.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/st95hf/core.c index ef91ca8b53a4..e651e1aae5a3 100644 --- a/drivers/nfc/st95hf/core.c +++ b/drivers/nfc/st95hf/core.c @@ -868,8 +868,6 @

[PATCH 1/2] nfc: st95hf: drop nfcdev_free

2018-06-29 Thread Daniel Mack
This flag is unneccesary. We can just nullify `ddev' instead after we freed it. Signed-off-by: Daniel Mack --- drivers/nfc/st95hf/core.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/st95hf/core.c index a50a95c

[PATCH] wcn36xx: drop unnecessary initialization of variables

2018-06-29 Thread Daniel Mack
Initialization is unneccessary when the variable is written before it is read. There were some occasions in which the driver would initialize `ret' during declaration without need. Purely a cosmetic change with no functional impact. Signed-off-by: Daniel Mack --- drivers/net/wireles

[PATCH v2] libertas: fix suspend and resume for SDIO connected cards

2018-06-27 Thread Daniel Mack
e card explicitly in if_sdio_suspend() when we know we're about to lose power and return success. Also set a flag in these cases, and power up the card again in if_sdio_resume(). Signed-off-by: Daniel Mack Cc: Ulf Hansson Cc: Chris Ball --- v1 → v2: * Reworded patch subject * Added wait_event(card

Re: [PATCH] libertas: fix return codes in if_sdio_suspend()

2018-06-27 Thread Daniel Mack
On Wednesday, June 27, 2018 09:54 AM, Ulf Hansson wrote: On 26 June 2018 at 22:50, Daniel Mack wrote: On Tuesday, June 26, 2018 10:48 PM, Daniel Mack wrote: @@ -1321,7 +1334,7 @@ static int if_sdio_suspend(struct device *dev) if (ret) return ret; - ret

Re: [PATCH] libertas: fix return codes in if_sdio_suspend()

2018-06-26 Thread Daniel Mack
Ah, the subject line of this patch could actually be improved. Let me know if you're happy with the contents of this patch, so I can resend. Thanks, Daniel On Tuesday, June 26, 2018 10:48 PM, Daniel Mack wrote: Prior to commit 573185cc7e64 ("mmc: core: Invoke sdio func driver'

[PATCH] libertas: fix return codes in if_sdio_suspend()

2018-06-26 Thread Daniel Mack
e card explicitly in if_sdio_suspend() when we know we're about to lose power and return success. Also set a flag in these cases, and power up the card again in if_sdio_resume(). Signed-off-by: Daniel Mack Cc: Ulf Hansson Cc: Chris Ball --- drivers/net/wireless/marvell/libertas/dev.h | 1 +

Re: [PATCH 1/2] NFC: st95hf: initialize semaphore and mutex earlier

2018-05-28 Thread Daniel Mack
On Monday, May 28, 2018 04:50 PM, Samuel Ortiz wrote: Hi Daniel, On Mon, May 28, 2018 at 04:35:15PM +0200, Daniel Mack wrote: On Wednesday, May 16, 2018 03:32 PM, Daniel Mack wrote: 'rm_lock' and 'exchange_lock' need to be ready before the IRQ handler has a chance to f

Re: [PATCH 1/2] NFC: st95hf: initialize semaphore and mutex earlier

2018-05-28 Thread Daniel Mack
On Wednesday, May 16, 2018 03:32 PM, Daniel Mack wrote: 'rm_lock' and 'exchange_lock' need to be ready before the IRQ handler has a chance to fire. This fixes the oops below. Nobody seems to be interested in these. Davem, can you take them through your tree or is there an

Re: [PATCH 00/10] Some more patches for wcn36xx

2018-05-24 Thread Daniel Mack
Hi Kalle, On Thursday, May 24, 2018 10:44 AM, Kalle Valo wrote: Daniel Mack writes: On Friday, May 18, 2018 01:28 PM, Kalle Valo wrote: Also I would recommend to file a bug to bugzilla.kernel.org so that all the information is one place and it can be easily updated. Now it's p

Re: wcn36xx: bug #538: stuck tx management frames

2018-05-24 Thread Daniel Mack
On Thursday, May 24, 2018 01:48 PM, Kalle Valo wrote: Daniel Mack writes: On Thursday, May 24, 2018 10:44 AM, Kalle Valo wrote: Daniel Mack writes: It seems that once a network is successfully joined, the network stability is fine. I haven't seen any starvation of streams lately, at

Re: [PATCH 00/10] Some more patches for wcn36xx

2018-05-23 Thread Daniel Mack
Hi Kalle, On Friday, May 18, 2018 01:28 PM, Kalle Valo wrote: Daniel Mack writes: On Wednesday, May 16, 2018 04:08 PM, Daniel Mack wrote: Hence I believe that some sort of firmware internal buffer is overrun if too many SMD requests fly in in a short amount of time. The firmware does

Re: [PATCH 00/10] Some more patches for wcn36xx

2018-05-18 Thread Daniel Mack
On Wednesday, May 16, 2018 04:08 PM, Daniel Mack wrote: Hence I believe that some sort of firmware internal buffer is overrun if too many SMD requests fly in in a short amount of time. The firmware does, however, still ack all packets just fine on the SMD channels, and also the DXE communication

[PATCH 02/10] wcn36xx: set DMA mask explicitly

2018-05-16 Thread Daniel Mack
The device takes 32-bit addresses only, so inform the DMA API about it. This is the default on msm8016, so that doesn't change anything, but it's best practice to be explicit. Signed-off-by: Daniel Mack --- drivers/net/wireless/ath/wcn36xx/main.c | 6 ++ 1 file changed, 6

[PATCH 09/10] wcn36xx: simplify wcn36xx_smd_open()

2018-05-16 Thread Daniel Mack
Drop the extra warning about failed allocations, both the core and the only caller of this function will warn loud enough in such cases. Signed-off-by: Daniel Mack --- drivers/net/wireless/ath/wcn36xx/smd.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers

[PATCH 10/10] wcn36xx: improve debug and error messages for SMD

2018-05-16 Thread Daniel Mack
Add a missing newline in wcn36xx_smd_send_and_wait() and also log the command request and response type that was processed. Signed-off-by: Daniel Mack --- drivers/net/wireless/ath/wcn36xx/smd.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/net

[PATCH 08/10] wcn36xx: drain pending indicator messages on shutdown

2018-05-16 Thread Daniel Mack
When the interface is shut down, wcn36xx_smd_close() potentially races against the queue worker. Make sure to cancel the work, and then free all the remnants in hal_ind_queue manually. This is again just a theoretical issue, not something that was triggered in the wild. Signed-off-by: Daniel

[PATCH 04/10] wcn36xx: clear all masks in RX interrupt

2018-05-16 Thread Daniel Mack
arguments. Signed-off-by: Daniel Mack --- drivers/net/wireless/ath/wcn36xx/dxe.c | 62 ++ 1 file changed, 40 insertions(+), 22 deletions(-) diff --git a/drivers/net/wireless/ath/wcn36xx/dxe.c b/drivers/net/wireless/ath/wcn36xx/dxe.c index d6dd47b211ba..d11c9c536627

[PATCH 07/10] wcn36xx: set PREASSOC and IDLE stated when BSS info changes

2018-05-16 Thread Daniel Mack
When a BSSID is joined, set the link status to 'preassoc', and set it to 'idle' when the BSS is deleted. This is what the downstream driver is doing, and it seems to improve the reliability during connect/disconnect stress tests. Signed-off-by: Daniel Mack --- drivers/net/

[PATCH 05/10] wcn36xx: only handle packets when ED or DONE bit is set

2018-05-16 Thread Daniel Mack
driver is doing. While at it, also log the interrupt reason. Signed-off-by: Daniel Mack --- drivers/net/wireless/ath/wcn36xx/dxe.c | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/wcn36xx/dxe.c b/drivers/net/wireless/ath/wcn36xx

[PATCH 06/10] wcn36xx: consider CTRL_EOP bit when looking for valid descriptors

2018-05-16 Thread Daniel Mack
In reap_tx_dxes(), when we iterate over the linked descriptors, only consider such valid that have WCN36xx_DXE_CTRL_EOP set. This is what the prima downstream driver is doing as well. Signed-off-by: Daniel Mack --- drivers/net/wireless/ath/wcn36xx/dxe.c | 4 +++- 1 file changed, 3 insertions

[PATCH 00/10] Some more patches for wcn36xx

2018-05-16 Thread Daniel Mack
#x27;s virtually impossible to grok what's going on and how to work around whatever is causing it. If anyone has an idea on how to debug this frustrating issue any further, please let me know. A reproducer is described in the bug reported linked to above. Thanks, Daniel Daniel Mack (10): wcn

[PATCH 01/10] wcn36xx: fix buffer commit logic on TX path

2018-05-16 Thread Daniel Mack
iptor. Memory barriers are added to ensure coherency of shared memory areas. Signed-off-by: Daniel Mack --- drivers/net/wireless/ath/wcn36xx/dxe.c | 75 +- 1 file changed, 38 insertions(+), 37 deletions(-) diff --git a/drivers/net/wireless/ath/wcn36xx/dxe.c b/driver

[PATCH 03/10] wcn36xx: don't disable RX IRQ from handler

2018-05-16 Thread Daniel Mack
There's no need to disable the IRQ from inside its handler. Instead just grab the spinlock of the channel that is being processed. Signed-off-by: Daniel Mack --- drivers/net/wireless/ath/wcn36xx/dxe.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/dr

[PATCH 2/2] NFC: st95hf: drop illegal kfree_skb()

2018-05-16 Thread Daniel Mack
The skb that is passed in to ->in_send_cmd() is freed by the core when the function returns. Calling kfree_skb() on it from the driver callback will hence lead to a double-free. Signed-off-by: Daniel Mack --- drivers/nfc/st95hf/core.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/driv

[PATCH 1/2] NFC: st95hf: initialize semaphore and mutex earlier

2018-05-16 Thread Daniel Mack
3008] Code: aa1603e0 f9403675 940d010f aa1303e0 (f94066a1) [1.308307] ---[ end trace d058c1b88aad74d8 ]--- Signed-off-by: Daniel Mack --- drivers/nfc/st95hf/core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/st95hf/core.

Re: [PATCH 1/1 RFC] wcn36xx: fix buffer commit logic on TX path

2018-04-24 Thread Daniel Mack
Hi Loic, On Wednesday, April 11, 2018 03:30 PM, Loic Poulain wrote: >> /* Move the head of the ring to the next empty descriptor */ >> -ch->head_blk_ctl = ctl->next; >> +ch->head_blk_ctl = ctl_skb->next; >> + >> + /* Commit all previous writes and set descriptors to V

[PATCH v2 4/5] wcn36xx: send bss_type in scan requests

2018-04-17 Thread Daniel Mack
Pass the bss_type of the currently configured BSS in the message for the scan request. Therefore, that setting needs to be kept in struct wcn36xx_vif. This seems to be only interesting when scanning for a specific SSID and doesn't matter for regular wildcard scans. Signed-off-by: Daniel

[PATCH v2 5/5] wcn36xx: pass information elements in scan requests

2018-04-17 Thread Daniel Mack
27;t fix a bug that was observed. The change is merely done for the sake of completeness as the hardware supports appending IEs in scans. Tests show that network scans work fine with this patch applied. Some defines were moved around to avoid cyclic include dependencies. Signed-off-by: D

[PATCH v2 3/5] wcn36xx: handle scan cancellation when firmware support is missing

2018-04-17 Thread Daniel Mack
For firmwares that don't have the SCAN_OFFLOAD feature bit set, do not call into wcn36xx_smd_stop_hw_scan(). Instead, stop the asynchronous work and call into ieee80211_scan_completed() immediately. Signed-off-by: Daniel Mack --- drivers/net/wireless/ath/wcn36xx/main.c | 14 +++-

[PATCH v2 0/5] wcn36xx: scan related patches

2018-04-17 Thread Daniel Mack
Here's another series of 5 patches for wcn36xx that address some issues with scanning. The first one is the most important one. Daniel v1 → v2: * Moved one hunk from 5/5 to 4/5 so the series becomes bisectable * Add more commit log context to 5/5 Daniel Mack (5): wcn36xx: abort scan re

[PATCH v2 1/5] wcn36xx: abort scan request when 'dequeued' indicator is sent

2018-04-17 Thread Daniel Mack
: ERROR hal_stop_scan_offload response failed err=5 Interpreting this indicator message as scan abortion fixes this. While at it, add a newline to a debug print. Signed-off-by: Daniel Mack --- drivers/net/wireless/ath/wcn36xx/smd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[PATCH v2 2/5] wcn36xx: cancel pending scan request when interface goes down

2018-04-17 Thread Daniel Mack
this by explicitly completing pending scan requests in wcn36xx_stop(). Signed-off-by: Daniel Mack --- drivers/net/wireless/ath/wcn36xx/main.c | 13 + 1 file changed, 13 insertions(+) diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index 749a

Re: [PATCH 5/5] wcn36xx: pass information elements in scan requests

2018-04-16 Thread Daniel Mack
On Monday, April 16, 2018 04:41 PM, Kalle Valo wrote: > Daniel Mack writes: > >> On Monday, April 16, 2018 04:13 PM, Kalle Valo wrote: >>> Daniel Mack writes: >>>> On Monday, April 16, 2018 04:03 PM, Kalle Valo wrote: >>>>> Daniel Mack writes: &g

Re: [PATCH 5/5] wcn36xx: pass information elements in scan requests

2018-04-16 Thread Daniel Mack
On Monday, April 16, 2018 04:13 PM, Kalle Valo wrote: > Daniel Mack writes: >> On Monday, April 16, 2018 04:03 PM, Kalle Valo wrote: >>> Daniel Mack writes: >>>> them to the firmware message. The driver currently tells the core that >>>> it is capable

Re: [PATCH 5/5] wcn36xx: pass information elements in scan requests

2018-04-16 Thread Daniel Mack
On Monday, April 16, 2018 04:03 PM, Kalle Valo wrote: > Daniel Mack writes: > >> When the ieee8022 core passes IE elements in the scan request, append > > You mean mac80211? > > And yeah, the ieee80211_ prefix is confusing. Many many years I > started to change th

[PATCH 2/5] wcn36xx: cancel pending scan request when interface goes down

2018-04-16 Thread Daniel Mack
this by explicitly completing pending scan requests in wcn36xx_stop(). Signed-off-by: Daniel Mack --- drivers/net/wireless/ath/wcn36xx/main.c | 13 + 1 file changed, 13 insertions(+) diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index 1b17

[PATCH 3/5] wcn36xx: handle scan cancellation when firmware support is missing

2018-04-16 Thread Daniel Mack
For firmwares that don't have the SCAN_OFFLOAD feature bit set, do not call into wcn36xx_smd_stop_hw_scan(). Instead, stop the asynchronous work and call into ieee80211_scan_completed() immediately. Signed-off-by: Daniel Mack --- drivers/net/wireless/ath/wcn36xx/main.c | 14 +++-

[PATCH 4/5] wcn36xx: send bss_type in scan requests

2018-04-16 Thread Daniel Mack
Pass the bss_type of the currently configured BSS in the message for the scan request. Therefore, that setting needs to be kept in struct wcn36xx_vif. This seems to be only interesting when scanning for a specific SSID and doesn't matter for regular wildcard scans. Signed-off-by: Daniel

[PATCH 1/5] wcn36xx: abort scan request when 'dequeued' indicator is sent

2018-04-16 Thread Daniel Mack
: ERROR hal_stop_scan_offload response failed err=5 Interpreting this indicator message as scan abortion fixes this. While at it, add a newline to a debug print. Signed-off-by: Daniel Mack --- drivers/net/wireless/ath/wcn36xx/smd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[PATCH 5/5] wcn36xx: pass information elements in scan requests

2018-04-16 Thread Daniel Mack
avoid cyclic include dependencies. Signed-off-by: Daniel Mack --- drivers/net/wireless/ath/wcn36xx/hal.h | 8 +++- drivers/net/wireless/ath/wcn36xx/smd.c | 12 drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 6 -- 3 files changed, 19 insertions(+), 7 deletions(-)

[PATCH 0/5] wcn36xx: scan related patches

2018-04-16 Thread Daniel Mack
Here's another series of 5 patches for wcn36xx that address some issues with scanning. The first one is the most important one. Daniel Daniel Mack (5): wcn36xx: abort scan request when 'dequeued' indicator is sent wcn36xx: cancel pending scan request when interface goes

[PATCH v2] wcn36xx: pass correct BSS index when deleting BSS keys

2018-04-12 Thread Daniel Mack
eys associated with it. Trying to remove the key explicitly afterwards will hence lead to the following message: wcn36xx: ERROR hal_remove_bsskey response failed err=16 This is now suppressed with an extra check for the BSS index validity. Signed-off-by: Daniel Mack --- v2: mention the vif_p

Re: [PATCH] wcn36xx: pass correct BSS index when deleting BSS keys

2018-04-12 Thread Daniel Mack
On Thursday, April 12, 2018 02:14 PM, Kalle Valo wrote: > Daniel Mack writes: > >> On Thursday, April 12, 2018 01:46 PM, Loic Poulain wrote: >>> Hi Daniel, >>> >>>> @@ -564,10 +565,13 @@ static int wcn36xx_set_key(struct ieee80211_hw *hw, >>>

Re: [PATCH] wcn36xx: pass correct BSS index when deleting BSS keys

2018-04-12 Thread Daniel Mack
On Thursday, April 12, 2018 01:46 PM, Loic Poulain wrote: > Hi Daniel, > >> @@ -564,10 +565,13 @@ static int wcn36xx_set_key(struct ieee80211_hw *hw, >> enum set_key_cmd cmd, >> break; >> case DISABLE_KEY: >> if (!(IEEE80211_KEY_FLAG_PAIRWISE & key_conf->fl

[PATCH] wcn36xx: pass correct BSS index when deleting BSS keys

2018-04-12 Thread Daniel Mack
with it. Trying to remove the key explicitly afterwards will hence lead to the following message: wcn36xx: ERROR hal_remove_bsskey response failed err=16 This is now suppressed with an extra check for the BSS index validity. Signed-off-by: Daniel Mack --- drivers/net/wireless/ath/wcn36xx

Re: [PATCH 1/1 RFC] wcn36xx: fix buffer commit logic on TX path

2018-04-11 Thread Daniel Mack
Hi Loic, On Wednesday, April 11, 2018 03:30 PM, Loic Poulain wrote: >> /* Move the head of the ring to the next empty descriptor */ >> -ch->head_blk_ctl = ctl->next; >> +ch->head_blk_ctl = ctl_skb->next; >> + >> + /* Commit all previous writes and set descriptors to V

Re: [PATCH] wcn36xx: use READ_ONCE() to access desc->ctrl

2018-04-10 Thread Daniel Mack
On Tuesday, April 10, 2018 08:17 PM, Ramon Fried wrote: > On 10 April 2018 at 20:35, Daniel Mack wrote: >> When accessing shared memory to check for the stat of submitted >> descriptors, make sure to use READ_ONCE(). This will guarantee the >> compiler treats these memory

Re: [PATCH 0/1] RFC: memory coherency and data races on TX path

2018-04-10 Thread Daniel Mack
Hi Ramon, On Tuesday, April 10, 2018 08:11 PM, Ramon Fried wrote: > On 10 April 2018 at 20:42, Daniel Mack wrote: >> I found something that I believe might be an issue, and I have an >> idea on how to correct this, but unfortunately, this doesn't solve >> the issues I

[PATCH 0/1] RFC: memory coherency and data races on TX path

2018-04-10 Thread Daniel Mack
27;t really say this improves anything, sadly, so I might be mistaken entirely. But I'll leave this here for further discussion. Ideally, somebody with access to the firmware sources could give an assessment whether this is an issue at all or not. Thanks, Daniel Daniel Mack (1): wcn36xx:

[PATCH 1/1 RFC] wcn36xx: fix buffer commit logic on TX path

2018-04-10 Thread Daniel Mack
iptor. Memory barriers are added to ensure coherency of shared memory areas. Signed-off-by: Daniel Mack --- drivers/net/wireless/ath/wcn36xx/dxe.c | 75 +- 1 file changed, 38 insertions(+), 37 deletions(-) diff --git a/drivers/net/wireless/ath/wcn36xx/dxe.c b/driver

[PATCH] wcn36xx: use READ_ONCE() to access desc->ctrl

2018-04-10 Thread Daniel Mack
practice to do it this way. Note that this patch also removes the superflous extra condition check in the do-while loop in reap_tx_dxes(), as the loop will break instantly anyway in that case. Signed-off-by: Daniel Mack --- drivers/net/wireless/ath/wcn36xx/dxe.c | 7 +++ 1 file changed, 3 i

Re: [PATCH 3/3] wcn36xx: don't delete invalid bss indices

2018-04-03 Thread Daniel Mack
On Wednesday, April 04, 2018 07:40 AM, Ramon Fried wrote: > On 4/3/2018 7:51 PM, Daniel Mack wrote: >> The firmware code cannot cope with requests to remove BSS indices that have >> not previously been added. This primarily happens when the device is >> suspe

[PATCH 1/3] wcn36xx: check for DMA mapping errors in wcn36xx_dxe_tx_frame()

2018-04-03 Thread Daniel Mack
Bail out if the mapping fails. Even though this hasn't occured during tests, this unlikely case should still be handled. Signed-off-by: Daniel Mack --- drivers/net/wireless/ath/wcn36xx/dxe.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/net/wireless/ath/wcn36xx/dxe

[PATCH 2/3] wcn36xx: don't keep reference to skb if transmission failed

2018-04-03 Thread Daniel Mack
only happens when the transmission is successful. Signed-off-by: Daniel Mack --- drivers/net/wireless/ath/wcn36xx/dxe.c | 6 +++--- drivers/net/wireless/ath/wcn36xx/txrx.c | 15 ++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/wcn36xx/dxe.c

[PATCH 3/3] wcn36xx: don't delete invalid bss indices

2018-04-03 Thread Daniel Mack
for all bss that have not been configured in the firmware, and don't call into the firmware with invalid indices. Signed-off-by: Daniel Mack --- drivers/net/wireless/ath/wcn36xx/main.c | 1 + drivers/net/wireless/ath/wcn36xx/smd.c | 6 ++ 2 files changed, 7 insertions(+) diff --git a/dr

Re: [PATCH] wcn36xx: allocate skbs with GFP_KERNEL during init

2018-03-29 Thread Daniel Mack
On Monday, March 19, 2018 07:30 AM, Daniel Mack wrote: > GFP_ATOMIC should only be used when the allocation is done from atomic > context. Introduce a new flag to wcn36xx_dxe_fill_skb() and use GFP_KERNEL > when pre-allocating buffers during init. > > This doesn't fix an iss

[PATCH] wcn36xx: allocate skbs with GFP_KERNEL during init

2018-03-18 Thread Daniel Mack
under memory pressure. Signed-off-by: Daniel Mack --- drivers/net/wireless/ath/wcn36xx/dxe.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/wcn36xx/dxe.c b/drivers/net/wireless/ath/wcn36xx/dxe.c index 5672154948c3..3e180828fbfa 100644

[PATCH v2] wcn36xx: dequeue all pending indicator messages

2018-03-18 Thread Daniel Mack
x27;s empty. This issue was found during a review of the driver. In my tests, that race never actually occured. Signed-off-by: Daniel Mack Reviewed-by: Bjorn Andersson --- v2: amended the commit log slightly to state that this issue hasn't occured in the wild. drivers/net/wireless/a

Re: [PATCH] wcn36xx: dequeue all pending indicator messages

2018-03-16 Thread Daniel Mack
On Friday, March 16, 2018 11:22 AM, Kalle Valo wrote: > Daniel Mack writes: > >> Hi, >> >> On Friday, March 16, 2018 10:09 AM, Ramon Fried wrote: >>> On 3/16/2018 12:37 AM, Daniel Mack wrote: >>>> In case wcn36xx_smd_rsp_process() is called more than

Re: [PATCH] wcn36xx: dequeue all pending indicator messages

2018-03-16 Thread Daniel Mack
Hi, On Friday, March 16, 2018 10:09 AM, Ramon Fried wrote: > On 3/16/2018 12:37 AM, Daniel Mack wrote: >> In case wcn36xx_smd_rsp_process() is called more than once before >> hal_ind_work was dispatched, the messages will end up in hal_ind_queue, >> but wcn36xx_ind_smd_wor

  1   2   >