Re: [ath9k-devel] [PATCH] mac80211: ath9k: Use RCU protection calling ieee80211_get_tx_rates

2013-06-12 Thread Kalle Valo
Johannes Berg johan...@sipsolutions.net writes: Now the subject should no longer say mac80211: :) It did have a change to mac80211.h as well, but IMHO that should be in a separate patch. -- Kalle Valo ___ ath9k-devel mailing list

Re: [ath9k-devel] [PATCH] mac80211: ath9k: Use RCU protection calling ieee80211_get_tx_rates

2013-06-12 Thread Calvin Owens
On Tuesday 06/11 at 21:55 +0200, Johannes Berg wrote: Now the subject should no longer say mac80211: :) However... given that ieee80211_get_tx_rates() actually *copies* the rates into the parameter, I guess it should do the rcu_read_lock() internally. I guess I wasn't paying attention

[ath9k-devel] [PATCH] mac80211: Use RCU protection in ieee80211_get_tx_rates()

2013-06-12 Thread Calvin Owens
Copying the rate table should be done in an RCU read-side critical section. Signed-off-by: Calvin Owens jcalvinow...@gmail.com --- net/mac80211/rate.c | 4 1 file changed, 4 insertions(+) diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c index d3f414f..090d9b0 100644 ---

Re: [ath9k-devel] [PATCH] mac80211: Use RCU protection in ieee80211_get_tx_rates()

2013-06-12 Thread Felix Fietkau
On 2013-06-12 10:00 AM, Calvin Owens wrote: Copying the rate table should be done in an RCU read-side critical section. I think this approach is wrong. The sta entry is also under RCU protection (no locking for read access in that part of the code. In a normal driver tx path, no extra

[ath9k-devel] [PATCH 1/6] ath10k: embed HTC struct inside ath10k

2013-06-12 Thread Michal Kazior
This reduces number of allocations and simplifies memory managemnt. Signed-off-by: Michal Kazior michal.kaz...@tieto.com --- drivers/net/wireless/ath/ath10k/core.c | 28 drivers/net/wireless/ath/ath10k/core.h |2 +- drivers/net/wireless/ath/ath10k/htc.c

[ath9k-devel] [PATCH 4/6] ath10k: abort scan properly if wmi_scan_stop fails

2013-06-12 Thread Michal Kazior
Signed-off-by: Michal Kazior michal.kaz...@tieto.com --- drivers/net/wireless/ath/ath10k/mac.c |4 1 file changed, 4 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index def1e68..4867f30 100644 ---

[ath9k-devel] [PATCH 0/6] ath10k: fixes

2013-06-12 Thread Michal Kazior
This includes 2 patches from my previous patchset that had conflicts. It is now rebased and should apply cleanly on the github master branch. Michal Kazior (6): ath10k: embed HTC struct inside ath10k ath10k: embed HTT struct inside ath10k ath10k: improve locking ath10k: abort scan

[ath9k-devel] [PATCH 3/6] ath10k: improve locking

2013-06-12 Thread Michal Kazior
Add more lockdep asserts and a few conf_mutex locks. It's better to be on the safe side. Signed-off-by: Michal Kazior michal.kaz...@tieto.com --- drivers/net/wireless/ath/ath10k/mac.c | 57 +++-- 1 file changed, 55 insertions(+), 2 deletions(-) diff --git

[ath9k-devel] [PATCH 6/6] ath10k: add missing debug prints

2013-06-12 Thread Michal Kazior
Signed-off-by: Michal Kazior michal.kaz...@tieto.com --- drivers/net/wireless/ath/ath10k/wmi.c |6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index 681e941..b7e7e45 100644 ---

[ath9k-devel] [PATCH 2/6] ath10k: embed HTT struct inside ath10k

2013-06-12 Thread Michal Kazior
This reduces number of allocations and simplifies memory managemnt. Signed-off-by: Michal Kazior michal.kaz...@tieto.com --- drivers/net/wireless/ath/ath10k/core.c | 12 ++-- drivers/net/wireless/ath/ath10k/core.h |7 +++ drivers/net/wireless/ath/ath10k/htt.c| 25

[ath9k-devel] [PATCH 5/6] ath10k: wait for CE to drain when shutting down

2013-06-12 Thread Michal Kazior
ath10k_pci_process_ce() is used to process completions. Only one thread can do that though. If one thread starts handling completions then the other one (i.e. possibly PCI shutdown) would exit immediatelely and free up memory while completions are being processed leading to corruption.

[ath9k-devel] [PATCH v2 01/10] ath10k: decouple pci init/deinit logic

2013-06-12 Thread Michal Kazior
Split logic that prepares the device for BMI phase/cleans up related resources. This is necessary for ath10k to be able to restart hw on the fly without reloading the module. Signed-off-by: Michal Kazior michal.kaz...@tieto.com --- drivers/net/wireless/ath/ath10k/hif.h | 20 ++

[ath9k-devel] [PATCH v2 02/10] ath10k: decouple core start/stop logic

2013-06-12 Thread Michal Kazior
Enables code reuse for proper hw reconfiguration that is in turn required for proper suspend/hibernation/wowlan support. Signed-off-by: Michal Kazior michal.kaz...@tieto.com --- drivers/net/wireless/ath/ath10k/core.c | 44 +++- drivers/net/wireless/ath/ath10k/core.h

[ath9k-devel] [PATCH v2 00/10] ath10k: device setup refactor

2013-06-12 Thread Michal Kazior
This is a respin of my patchset that addresses hibernation issues. This is also groundwork for proper hw recovery that I'm going to post soon. I addressed review comments and some bugs I've found along. Note: this is not based on master branch but on my latest 'ath10k: fixes' patches. Split for

[ath9k-devel] [PATCH v2 03/10] ath10k: allow deferred regd update

2013-06-12 Thread Michal Kazior
Regulatory domain notification hook can be called regardless of the hw state (i.e. before start mac80211 callback). Signed-off-by: Michal Kazior michal.kaz...@tieto.com --- drivers/net/wireless/ath/ath10k/core.h |7 +++ drivers/net/wireless/ath/ath10k/mac.c | 26

[ath9k-devel] [PATCH v2 06/10] ath10k: move free_vdev_map initialization

2013-06-12 Thread Michal Kazior
This is necessary for hw reconfiguration to work. Since mac80211 is not calling remove_interface() is such case we must reset free_vdev_map. Signed-off-by: Michal Kazior michal.kaz...@tieto.com --- drivers/net/wireless/ath/ath10k/core.c |4 ++-- 1 file changed, 2 insertions(+), 2

[ath9k-devel] [PATCH v2 04/10] ath10k: reset BMI state upon init

2013-06-12 Thread Michal Kazior
This is necessary if we want to be able to restart hw on-the-fly. Signed-off-by: Michal Kazior michal.kaz...@tieto.com --- drivers/net/wireless/ath/ath10k/bmi.c |6 ++ drivers/net/wireless/ath/ath10k/bmi.h |1 + drivers/net/wireless/ath/ath10k/core.c |2 ++ 3 files changed, 9

[ath9k-devel] [PATCH v2 07/10] ath10k: make sure all resources are freed upon ath10k_stop()

2013-06-12 Thread Michal Kazior
This is necessary for proper hw reconfiguration and to avoid memory leaks. Signed-off-by: Michal Kazior michal.kaz...@tieto.com --- drivers/net/wireless/ath/ath10k/mac.c | 16 1 file changed, 16 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/mac.c

[ath9k-devel] [PATCH v2 05/10] ath10k: decouple suspend code

2013-06-12 Thread Michal Kazior
Split up fw-related and hw-related suspension code. Although we don't advertise WoW support to mac80211 yet it's useful to keep the code in suspend/resume hooks. At this point there's no need to keep pci pm ops. In case of WoW mac80211 calls ath10k_suspend() which should take care of entering

[ath9k-devel] [PATCH v2 08/10] ath10k: defer hw setup to start/stop mac80211 hooks

2013-06-12 Thread Michal Kazior
This fixes suspend-to-disk. The hardware is now re-initialized upon freeze/thaw properly. This also makes suspend/resume re-initialize the hardware as WoWLAN support is not done yet. With some little work it should be possible to support hw reconfiguration for hw/fw recovery. HW must be

[ath9k-devel] [PATCH v2 09/10] ath10k: skip updating some params during resume

2013-06-12 Thread Michal Kazior
ath10k handles some hw configuration per-vdev (i.e. per-vif). When resuming/restarting hw configuration vdevs may not be re-added yet. Setting vdev params for non existent vdevs crashes the firmware. The parameters are updated when interface is re-added. Signed-off-by: Michal Kazior

[ath9k-devel] [PATCH v2 10/10] ath10k: store firmware files in memory

2013-06-12 Thread Michal Kazior
Different FW versions may provide different functions thus mean different hw capabilities advertised to mac80211. It is safe to swap firmware files on disk during driver/device runtime without worries. Signed-off-by: Michal Kazior michal.kaz...@tieto.com ---

[ath9k-devel] [PATCH 0/3] ath10k: hardware recovery

2013-06-12 Thread Michal Kazior
There's one issue I've noticed. When associated to WPA network tx is discarded by the firmware after recovery (no idea why, yet). This can be fixed in a follow up patch perhaps. Note: this is not based on master branch. It is based on my latest 'ath10k: fixes' and 'ath10k: device setup refactor'.

[ath9k-devel] [PATCH 2/3] ath10k: implement fw crash simulation command

2013-06-12 Thread Michal Kazior
This can be useful to test FW crash handling. Signed-off-by: Michal Kazior michal.kaz...@tieto.com --- drivers/net/wireless/ath/ath10k/wmi.c | 19 +++ drivers/net/wireless/ath/ath10k/wmi.h | 19 +++ 2 files changed, 38 insertions(+) diff --git

[ath9k-devel] [PATCH 1/3] ath10k: implement device recovery

2013-06-12 Thread Michal Kazior
Restart the hardware if FW crashes. If FW crashes during recovery we leave the hardware in a wedged state to avoid recursive recoveries. When in wedged state userspace may bring interfaces down (to issue stop()) and then bring one interface (to issue start()) to reload hardware manually.

Re: [ath9k-devel] [PATCH 0/6] ath10k: fixes

2013-06-12 Thread Kalle Valo
Michal Kazior michal.kaz...@tieto.com writes: This includes 2 patches from my previous patchset that had conflicts. It is now rebased and should apply cleanly on the github master branch. Michal Kazior (6): ath10k: embed HTC struct inside ath10k ath10k: embed HTT struct inside ath10k