* [PATCH - REGRESSION] mwifiex: don't enable/disable IRQ 0 during suspend/resume
From: Brian Norris @ 2017-02-10 21:55 UTC (permalink / raw)
To: Amitkumar Karwar, Nishant Sarmukadam, Kalle Valo
Cc: linux-kernel, linux-wireless, Rajat Jain, Brian Norris
If we don't have an out-of-band wakeup IRQ configured through DT (as
most platforms don't), then we fall out of this function with
'irq_wakeup == 0'. Other code (e.g., mwifiex_disable_wake() and
mwifiex_enable_wake()) treats 'irq_wakeup >= 0' as a valid IRQ, and so
we end up calling {enable,disable}_irq() on IRQ 0.
That seems bad, so let's not do that.
Same problem as fixed in this patch:
https://patchwork.kernel.org/patch/9531693/
[PATCH v2 2/3] btmrvl: set irq_bt to -1 when failed to parse it
with the difference that:
(a) this one is actually a regression and
(b) this affects both device tree and non-device-tree systems
While fixing the regression, also drop the verbosity on the parse
failure, so we don't see this when a DT node is present but doesn't have
an interrupt property (this is perfectly legal):
[ 21.999000] mwifiex_pcie 0000:01:00.0: fail to parse irq_wakeup from device tree
Fixes: 853402a00823 ("mwifiex: Enable WoWLAN for both sdio and pcie")
Signed-off-by: Brian Norris <briannorris@chromium.org>
---
This is a 4.10 regression. Not sure if it's critical to push quickly, or if it
should just be tagged -stable and pushed in 4.11.
drivers/net/wireless/marvell/mwifiex/main.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c
index e5c3a8aa3929..c246d8efb6fc 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.c
+++ b/drivers/net/wireless/marvell/mwifiex/main.c
@@ -1569,13 +1569,13 @@ static void mwifiex_probe_of(struct mwifiex_adapter *adapter)
struct device *dev = adapter->dev;
if (!dev->of_node)
- return;
+ goto err_exit;
adapter->dt_node = dev->of_node;
adapter->irq_wakeup = irq_of_parse_and_map(adapter->dt_node, 0);
if (!adapter->irq_wakeup) {
- dev_info(dev, "fail to parse irq_wakeup from device tree\n");
- return;
+ dev_dbg(dev, "fail to parse irq_wakeup from device tree\n");
+ goto err_exit;
}
ret = devm_request_irq(dev, adapter->irq_wakeup,
@@ -1595,7 +1595,7 @@ static void mwifiex_probe_of(struct mwifiex_adapter *adapter)
return;
err_exit:
- adapter->irq_wakeup = 0;
+ adapter->irq_wakeup = -1;
}
/*
--
2.11.0.483.g087da7b7c-goog
^ permalink raw reply related
* [PATCH] ath10k: fix the garage chars in board file name creation
From: ryanhsu @ 2017-02-10 20:27 UTC (permalink / raw)
To: ath10k, linux-wireless; +Cc: ryanhsu
From: Ryan Hsu <ryanhsu@qca.qualcomm.com>
The variant[] string will be valid only if the bdf_ext is set.
The string memory needs to be null-terminated to avoid the undefined garbage
appended by the subsequent board file name creation.
ath10k_pci 0000:04:00.0: failed to fetch board data for
"bus=pci,vendor=168c,device=003e,subsystem-vendor=168c,subsystem-device=3363��P�����"
from ath10k/QCA6174/hw3.0/board-2.bin
Fixes: f2593cb1b291 ("ath10k: Search SMBIOS for OEM board file extension")
Reported-by: Kalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: Ryan Hsu <ryanhsu@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index c27e7ea..014a87e 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -1122,7 +1122,7 @@ static int ath10k_core_create_board_name(struct ath10k *ar, char *name,
size_t name_len)
{
/* strlen(',variant=') + strlen(ar->id.bdf_ext) */
- char variant[9 + ATH10K_SMBIOS_BDF_EXT_STR_LENGTH];
+ char variant[9 + ATH10K_SMBIOS_BDF_EXT_STR_LENGTH] = { 0 };
if (ar->id.bmi_ids_valid) {
scnprintf(name, name_len,
--
1.9.1
^ permalink raw reply related
* Re: [PATCH] staging: wilc1000: remove unnecessary local array
From: Arend Van Spriel @ 2017-02-10 20:23 UTC (permalink / raw)
To: Franck Demathieu, linux-wireless, devel; +Cc: aditya.shankar, ganesh.krishna
In-Reply-To: <20170210150625.23343-1-fdemathieu@gmail.com>
On 10-2-2017 16:06, Franck Demathieu wrote:
> It fixes the following warning reported by sparse:
>
> drivers/staging/wilc1000/linux_wlan.c:67:33: warning: too long initializer-string for array of char(no space for nul char)
As this was already submitted this should probably say [PATCH V2] in the
subject.
> Signed-off-by: Franck Demathieu <fdemathieu@gmail.com>
> ---
And put a change log here, ie.:
V2:
- add devel@driverdev.osuosl.org
---
> drivers/staging/wilc1000/linux_wlan.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
> index 2eebc62..fc61f4e 100644
> --- a/drivers/staging/wilc1000/linux_wlan.c
> +++ b/drivers/staging/wilc1000/linux_wlan.c
> @@ -64,7 +64,6 @@ static int dev_state_ev_handler(struct notifier_block *this,
> u8 *ip_addr_buf;
> struct wilc_vif *vif;
> u8 null_ip[4] = {0};
> - char wlan_dev_name[5] = "wlan0";
You could have changed it to 'const char dev_name[] = "wlan0";'.
> if (!dev_iface || !dev_iface->ifa_dev || !dev_iface->ifa_dev->dev)
> return NOTIFY_DONE;
> @@ -113,7 +112,7 @@ static int dev_state_ev_handler(struct notifier_block *this,
> wilc_optaining_ip = false;
> }
>
> - if (memcmp(dev_iface->ifa_label, wlan_dev_name, 5) == 0)
> + if (memcmp(dev_iface->ifa_label, "wlan0", 5) == 0)
First of all. Why using a memcmp here? dev_iface->ifa_label could be
shorter. Also using the value '5' here is tricky. So it would be better
to say:
if (strlen(dev_iface->ifa_label) == strlen(dev_name) &&
memcmp(dev_iface->ifa_label,
dev_name, strlen(dev_name)) == 0)
> wilc_set_power_mgmt(vif, 0, 0);
However, it does not make sense at all to compare with wlan0 in the
first place. The net_device is registered in wilc_netdev_init() with
"wlan%d" as it should so there is no guarantee it is wlan0.
Regards,
Arend
^ permalink raw reply
* Re: [RFC,04/10] ath10k: new fw fetch functionality
From: Kalle Valo @ 2017-02-10 12:45 UTC (permalink / raw)
To: Erik Stromdahl; +Cc: linux-wireless, ath10k, Erik Stromdahl
In-Reply-To: <1484343309-6327-5-git-send-email-erik.stromdahl@gmail.com>
Erik Stromdahl <erik.stromdahl@gmail.com> wrote:
> A new function for creating the fw file name dynamically.
>
> Since both SDIO and USB based chipsets will use different
> firmware from the PCIe and AHB chipsets, the fw file name
> is created dynamically.
>
> The new firmware names are:
>
> For PCIe and AHB:
> firmware-<api_version>.bin (same as before)
>
> For SDIO:
> firmware-sdio-<api_version>.bin
>
> For USB:
> firmware-usb-<api_version>.bin
>
> Signed-off-by: Erik Stromdahl <erik.stromdahl@gmail.com>
Actually I needed this for something else so I took this into one of my
patchsets with small modifications:
ath10k: fetch firmware images in a loop
https://patchwork.kernel.org/patch/9566667/
--
https://patchwork.kernel.org/patch/9516551/
Documentation about submitting wireless patches and checking status
from patchwork:
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply
* Re: [PATCH net-next v2 00/12] net: dsa: remove unnecessary phy.h include
From: Florian Fainelli @ 2017-02-10 19:44 UTC (permalink / raw)
To: David Miller, kvalo
Cc: netdev, linux-mips, linux-nfs, linux-scsi, linux-usb,
linux-wireless, target-devel, andrew, anna.schumaker,
derek.chickles, felix.manlunas, bfields, jlayton, jirislaby,
mcgrof, madalin.bucur, UNGLinuxDriver, nab, mickflemm,
nicolas.ferre, raghu.vatsavayi, ralf, satananda.burla,
thomas.petazzoni, timur, trond.myklebust, vivien.didelot,
woojung.huh
In-Reply-To: <20170210.135138.2084086346069765205.davem@davemloft.net>
On 02/10/2017 10:51 AM, David Miller wrote:
> From: Kalle Valo <kvalo@codeaurora.org>
> Date: Thu, 09 Feb 2017 16:10:06 +0200
>
>> Florian Fainelli <f.fainelli@gmail.com> writes:
>>
>>>>> If not, for something like this it's a must:
>>>>>
>>>>> drivers/net/wireless/ath/wil6210/cfg80211.c:24:30: error: expected ‘)’ before ‘bool’
>>>>> module_param(disable_ap_sme, bool, 0444);
>>>>> ^
>>>>> drivers/net/wireless/ath/wil6210/cfg80211.c:25:34: error: expected ‘)’ before string constant
>>>>> MODULE_PARM_DESC(disable_ap_sme, " let user space handle AP mode SME");
>>>>> ^
>>>>> Like like that file needs linux/module.h included.
>>>>
>>>> Johannes already fixed a similar (or same) problem in my tree:
>>>>
>>>> wil6210: include moduleparam.h
>>>>
>>>> https://git.kernel.org/cgit/linux/kernel/git/kvalo/wireless-drivers-next.git/commit/?id=949c2d0096753d518ef6e0bd8418c8086747196b
>>>>
>>>> I'm planning to send you a pull request tomorrow which contains that
>>>> one.
>>>
>>> Thanks Kalle!
>>>
>>> David, can you hold on this series until Kalle's pull request gets
>>> submitted? Past this error, allmodconfig builds fine with this patch
>>> series (just tested). Thanks!
>>
>> Just submitted the pull request:
>>
>> https://patchwork.ozlabs.org/patch/726133/
>
> I've retried this patch series, and will push it out assuming the build
> completes properly.
I see it merged in net-next/master, thanks a lot this is going to save a
lot of cycles in the future, thanks David!
--
Florian
^ permalink raw reply
* Re: pull-request: mac80211-next 2017-02-09
From: David Miller @ 2017-02-10 19:32 UTC (permalink / raw)
To: johannes; +Cc: netdev, linux-wireless
In-Reply-To: <20170209142734.21891-1-johannes@sipsolutions.net>
From: Johannes Berg <johannes@sipsolutions.net>
Date: Thu, 9 Feb 2017 15:27:33 +0100
> Here are some more (final) updates for -next. Nothing here is
> really interesting, mostly cleanups and small fixes.
>
> Please pull and let me know if there's any problem.
Pulled, thank you.
^ permalink raw reply
* Re: [PATCH net-next v2 00/12] net: dsa: remove unnecessary phy.h include
From: David Miller @ 2017-02-10 18:51 UTC (permalink / raw)
To: kvalo
Cc: f.fainelli, netdev, linux-mips, linux-nfs, linux-scsi, linux-usb,
linux-wireless, target-devel, andrew, anna.schumaker,
derek.chickles, felix.manlunas, bfields, jlayton, jirislaby,
mcgrof, madalin.bucur, UNGLinuxDriver, nab, mickflemm,
nicolas.ferre, raghu.vatsavayi, ralf, satananda.burla,
thomas.petazzoni, timur, trond.myklebust, vivien.didelot,
woojung.huh
In-Reply-To: <877f4zjw01.fsf@kamboji.qca.qualcomm.com>
RnJvbTogS2FsbGUgVmFsbyA8a3ZhbG9AY29kZWF1cm9yYS5vcmc+DQpEYXRlOiBUaHUsIDA5IEZl
YiAyMDE3IDE2OjEwOjA2ICswMjAwDQoNCj4gRmxvcmlhbiBGYWluZWxsaSA8Zi5mYWluZWxsaUBn
bWFpbC5jb20+IHdyaXRlczoNCj4gDQo+Pj4+IElmIG5vdCwgZm9yIHNvbWV0aGluZyBsaWtlIHRo
aXMgaXQncyBhIG11c3Q6DQo+Pj4+DQo+Pj4+IGRyaXZlcnMvbmV0L3dpcmVsZXNzL2F0aC93aWw2
MjEwL2NmZzgwMjExLmM6MjQ6MzA6IGVycm9yOiBleHBlY3RlZCChKaIgYmVmb3JlIKFib29sog0K
Pj4+PiAgbW9kdWxlX3BhcmFtKGRpc2FibGVfYXBfc21lLCBib29sLCAwNDQ0KTsNCj4+Pj4gICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgXg0KPj4+PiBkcml2ZXJzL25ldC93aXJlbGVzcy9h
dGgvd2lsNjIxMC9jZmc4MDIxMS5jOjI1OjM0OiBlcnJvcjogZXhwZWN0ZWQgoSmiIGJlZm9yZSBz
dHJpbmcgY29uc3RhbnQNCj4+Pj4gIE1PRFVMRV9QQVJNX0RFU0MoZGlzYWJsZV9hcF9zbWUsICIg
bGV0IHVzZXIgc3BhY2UgaGFuZGxlIEFQIG1vZGUgU01FIik7DQo+Pj4+ICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICBeDQo+Pj4+IExpa2UgbGlrZSB0aGF0IGZpbGUgbmVlZHMgbGlu
dXgvbW9kdWxlLmggaW5jbHVkZWQuDQo+Pj4gDQo+Pj4gSm9oYW5uZXMgYWxyZWFkeSBmaXhlZCBh
IHNpbWlsYXIgKG9yIHNhbWUpIHByb2JsZW0gaW4gbXkgdHJlZToNCj4+PiANCj4+PiB3aWw2MjEw
OiBpbmNsdWRlIG1vZHVsZXBhcmFtLmgNCj4+PiANCj4+PiBodHRwczovL2dpdC5rZXJuZWwub3Jn
L2NnaXQvbGludXgva2VybmVsL2dpdC9rdmFsby93aXJlbGVzcy1kcml2ZXJzLW5leHQuZ2l0L2Nv
bW1pdC8/aWQ9OTQ5YzJkMDA5Njc1M2Q1MThlZjZlMGJkODQxOGM4MDg2NzQ3MTk2Yg0KPj4+IA0K
Pj4+IEknbSBwbGFubmluZyB0byBzZW5kIHlvdSBhIHB1bGwgcmVxdWVzdCB0b21vcnJvdyB3aGlj
aCBjb250YWlucyB0aGF0DQo+Pj4gb25lLg0KPj4NCj4+IFRoYW5rcyBLYWxsZSENCj4+DQo+PiBE
YXZpZCwgY2FuIHlvdSBob2xkIG9uIHRoaXMgc2VyaWVzIHVudGlsIEthbGxlJ3MgcHVsbCByZXF1
ZXN0IGdldHMNCj4+IHN1Ym1pdHRlZD8gUGFzdCB0aGlzIGVycm9yLCBhbGxtb2Rjb25maWcgYnVp
bGRzIGZpbmUgd2l0aCB0aGlzIHBhdGNoDQo+PiBzZXJpZXMgKGp1c3QgdGVzdGVkKS4gVGhhbmtz
IQ0KPiANCj4gSnVzdCBzdWJtaXR0ZWQgdGhlIHB1bGwgcmVxdWVzdDoNCj4gDQo+IGh0dHBzOi8v
cGF0Y2h3b3JrLm96bGFicy5vcmcvcGF0Y2gvNzI2MTMzLw0KDQpJJ3ZlIHJldHJpZWQgdGhpcyBw
YXRjaCBzZXJpZXMsIGFuZCB3aWxsIHB1c2ggaXQgb3V0IGFzc3VtaW5nIHRoZSBidWlsZA0KY29t
cGxldGVzIHByb3Blcmx5Lg0K
^ permalink raw reply
* Re: pull-request: wireless-drivers-next 2017-02-09
From: David Miller @ 2017-02-10 18:48 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless, netdev, linux-kernel
In-Reply-To: <87bmubjw2u.fsf@kamboji.qca.qualcomm.com>
From: Kalle Valo <kvalo@codeaurora.org>
Date: Thu, 09 Feb 2017 16:08:25 +0200
> another pull request for net-next. If the merge window starts on Sunday
> this would be the last pull request from me with new features. But if it
> doesn't open, I'm planning to send one more next week.
>
> Please let me know if there any problems.
Pulled, thank you.
^ permalink raw reply
* Re: [PATCH 1/3] ath10k: remove ath10k_vif_to_arvif()
From: Ben Greear @ 2017-02-10 16:43 UTC (permalink / raw)
To: Valo, Kalle
Cc: Adrian Chadd, netdev@vger.kernel.org,
linux-wireless@vger.kernel.org, Amadeusz Sławiński,
ath10k@lists.infradead.org, Linux Kernel Mailing List
In-Reply-To: <87tw82il32.fsf@kamboji.qca.qualcomm.com>
On 02/09/2017 11:03 PM, Valo, Kalle wrote:
> Ben Greear <greearb@candelatech.com> writes:
>
>> On 02/07/2017 01:14 AM, Valo, Kalle wrote:
>>> Adrian Chadd <adrian@freebsd.org> writes:
>>>
>>>> Removing this method makes the diff to FreeBSD larger, as "vif" in
>>>> FreeBSD is a different pointer.
>>>>
>>>> (Yes, I have ath10k on freebsd working and I'd like to find a way to
>>>> reduce the diff moving forward.)
>>>
>>> I don't like this "(void *) vif->drv_priv" style that much either but
>>> apparently it's commonly used in Linux wireless code and already parts
>>> of ath10k. So this patch just unifies the coding style.
>>
>> Surely the code compiles to the same thing, so why add a patch that
>> makes it more difficult for Adrian and makes the code no easier to read
>> for the rest of us?
>
> Because that's the coding style used already in Linux. It's great to see
> that parts of ath10k can be used also in other systems but in principle
> I'm not very fond of the idea starting to reject valid upstream patches
> because of driver forks.
There are lots of people trying to maintain out-of-tree or backported patches to ath10k,
and every time there is a meaningless style change, that just makes us
waste more time on useless work instead of having time to work on more important
matters.
Thanks,
Ben
> I think backports project is doing it right, it's not limiting upstream
> development in any way and handles all the API changes internally. Maybe
> FreeBSD could do something similar?
>
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
* Re: [PATCH] Make EN2 pin optional in the TRF7970A driver
From: Rob Herring @ 2017-02-10 15:51 UTC (permalink / raw)
To: Heiko Schocher
Cc: netdev, Guan Ben, Mark Jonas, devicetree, linux-wireless,
linux-kernel, Samuel Ortiz, Lauro Ramos Venancio,
Aloisio Almeida Jr, Mark Rutland
In-Reply-To: <1486444924-18444-1-git-send-email-hs@denx.de>
On Tue, Feb 07, 2017 at 06:22:04AM +0100, Heiko Schocher wrote:
> From: Guan Ben <ben.guan@cn.bosch.com>
>
> Make the EN2 pin optional. This is useful for boards,
> which have this pin fix wired, for example to ground.
>
> Signed-off-by: Guan Ben <ben.guan@cn.bosch.com>
> Signed-off-by: Mark Jonas <mark.jonas@de.bosch.com>
> Signed-off-by: Heiko Schocher <hs@denx.de>
>
> ---
>
> .../devicetree/bindings/net/nfc/trf7970a.txt | 4 ++--
> drivers/nfc/trf7970a.c | 26 ++++++++++++----------
> 2 files changed, 16 insertions(+), 14 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/net/nfc/trf7970a.txt b/Documentation/devicetree/bindings/net/nfc/trf7970a.txt
> index 32b35a0..5889a3d 100644
> --- a/Documentation/devicetree/bindings/net/nfc/trf7970a.txt
> +++ b/Documentation/devicetree/bindings/net/nfc/trf7970a.txt
> @@ -5,8 +5,8 @@ Required properties:
> - spi-max-frequency: Maximum SPI frequency (<= 2000000).
> - interrupt-parent: phandle of parent interrupt handler.
> - interrupts: A single interrupt specifier.
> -- ti,enable-gpios: Two GPIO entries used for 'EN' and 'EN2' pins on the
> - TRF7970A.
> +- ti,enable-gpios: One or two GPIO entries used for 'EN' and 'EN2' pins on the
> + TRF7970A. EN2 is optional.
Could EN ever be optional/fixed? If so, perhaps deprecate this property
and do 2 properties, one for each pin.
Rob
^ permalink raw reply
* Re: [PATCH 1/3] ath10k: remove ath10k_vif_to_arvif()
From: Adrian Chadd @ 2017-02-10 15:31 UTC (permalink / raw)
To: Joe Perches
Cc: Valo, Kalle, Ben Greear, netdev@vger.kernel.org,
linux-wireless@vger.kernel.org, Amadeusz Sławiński,
ath10k@lists.infradead.org, Linux Kernel Mailing List
In-Reply-To: <1486712222.2192.3.camel@perches.com>
On 9 February 2017 at 23:37, Joe Perches <joe@perches.com> wrote:
> On Thu, 2017-02-09 at 23:14 -0800, Adrian Chadd wrote:
>
>> If there
>> were accessors for the skb data / len fields (like we do for mbufs)
>> then porting the code would've involved about 5,000 less changed
>> lines.
>
> What generic mechanisms would you suggest to make
> porting easier between bsd and linux and what in
> your opinion are the best naming schemes to make
> these functions easiest to read and implement
> without resorting to excessive identifier lengths?
>
> If you have some, please provide examples.
(Why not, it's pre-coffee o'clock.)
The biggest barriers are direct struct accessors. Most of the time the
kernels have similar enough semantics that I can just implement a
linux shim layer (like we do for graphics layer porting from Linux.)
Eg, having skb_data(skb) (and skb_data_const(skb)) + skb_len(skb)
instead of skb->data and skb->len would remove a lot of churn. Having
say, a vif_to_drvpriv() method analogous to ath10k_vif_to_arvif()
would also simplify the changes. For the rest of it we can just use a
linux-like shim layer to get everything else working pretty darn well.
But the biggest thing that helps is a quasi HAL code structure. I know
HAL is a dirty word, so think of it more as "how would one separate
out the OS interface layer from the rest of the driver." A good
example in ath10k is the difference between say, wmi.c, the pci /
copyengine code and mac.c.
* the pci / copyengine code is almost 100% compilable on other
platforms, save the differences in little things (malloc, free, KVA
versus physical memory allocation, bounce buffering, sync'ing, etc.) A
sufficiently refactored driver like ath10k where almost all of that
stuff happens in the pci/copyengine code made porting that much less
painful.
* the wmi code is almost exclusively portable - besides the
malloc/free, etc mechanical changes which honestly can be stubbed, it
uses the lower layers (pci/ce, hif, htc, etc) for doing actual work,
and the upper layer uses a well-defined API + callback mechanism for
getting work done. Porting that was mechanical but reasonably easy.
* however, the mac.c code contains both code which sends commands to
the firmware (vif create/destroy, pdev commands, station
associate/update/destroy, crypto key handling, peer rate control, etc)
/and/ very linux mac80211/cfg80211 specific bits. If mac.c were split
into mac-mac80211.c (which was /just/ mac80211, cfg80211, etc bits)
and mac-utils.c (the bits that actually /sent/ the commands,
responses, all the support code, etc) then my port would just
implement mac-net80211.c as a completely new file, and the rest would
just be modified as required by porting.
A lot of the ath10k headers too mix linux specific things (eg struct
device, dependencies) with hardware specific definitions for say,
register accesses. I split out the register and firmware command /
structures into separate header files that didn't mingle OS and driver
specific structures to make it much easier to reuse that code. I find
that good driver writing hygiene in any case.
I'm not expecting an intel ethernet driver style HAL separation,
although that'd certainly make life easier in porting over drivers.
But just having inlined accessor functions for most things and some
stricter driver structure for OS touch points (dma setup/teardown,
bounce buffer stuff, mac80211/cfg80211, ethtool, etc APIs) would make
porting and testing things a lot easier. :-)
2c, and I'll do the porting/reimplementing work anyway regardless of
how much coffee it requires,
-adrian
^ permalink raw reply
* [PATCH v2 3/4] ath10k: silence firmware file probing warnings
From: Kalle Valo @ 2017-02-10 12:26 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless
In-Reply-To: <148672934198.8556.5588600166627442652.stgit@potku.adurom.net>
From: Michal Kazior <michal.kazior@tieto.com>
Firmware files are versioned to prevent older
driver instances to load unsupported firmware
blobs. This is reflected with a fallback logic
which attempts to load several firmware files.
This however produced a lot of unnecessary
warnings sometimes confusing users and leading
them to rename firmware files making things even
more confusing.
Hence use request_firmware_direct() which does not
produce extra warnings. This shouldn't really
break anything because most modern systems don't
rely on udev/hotplug helpers to load firmware
files anymore. For example it was confirmed that
LEDE does not user helper.
This also fixes a 60 second delay per _each_
unexistent firmware/calibration file with distros
which have CONFIG_FW_LOADER_USER_HELPER_FALLBACK
enabled, RHEL being a notable example. Using
ath10k with firmware-2.bin this might end up
into a five minute delay in boot.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Patchwork-Id: 9237095
[kvalo@qca.qualcomm.com: add more info to the commit log]
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/core.c | 11 +++++------
drivers/net/wireless/ath/ath10k/testmode.c | 5 ++++-
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index f395d3a98bc5..6433fdd2c0c7 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -456,7 +456,10 @@ static const struct firmware *ath10k_fetch_fw_file(struct ath10k *ar,
dir = ".";
snprintf(filename, sizeof(filename), "%s/%s", dir, file);
- ret = request_firmware(&fw, filename, ar->dev);
+ ret = request_firmware_direct(&fw, filename, ar->dev);
+ ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot fw request '%s': %d\n",
+ filename, ret);
+
if (ret)
return ERR_PTR(ret);
@@ -1190,12 +1193,8 @@ int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name,
/* first fetch the firmware file (firmware-*.bin) */
fw_file->firmware = ath10k_fetch_fw_file(ar, ar->hw_params.fw.dir,
name);
- if (IS_ERR(fw_file->firmware)) {
- ath10k_err(ar, "could not fetch firmware file '%s/%s': %ld\n",
- ar->hw_params.fw.dir, name,
- PTR_ERR(fw_file->firmware));
+ if (IS_ERR(fw_file->firmware))
return PTR_ERR(fw_file->firmware);
- }
data = fw_file->firmware->data;
len = fw_file->firmware->size;
diff --git a/drivers/net/wireless/ath/ath10k/testmode.c b/drivers/net/wireless/ath/ath10k/testmode.c
index ed85f938e3c0..8bb36c18a749 100644
--- a/drivers/net/wireless/ath/ath10k/testmode.c
+++ b/drivers/net/wireless/ath/ath10k/testmode.c
@@ -150,7 +150,10 @@ static int ath10k_tm_fetch_utf_firmware_api_1(struct ath10k *ar,
ar->hw_params.fw.dir, ATH10K_FW_UTF_FILE);
/* load utf firmware image */
- ret = request_firmware(&fw_file->firmware, filename, ar->dev);
+ ret = request_firmware_direct(&fw_file->firmware, filename, ar->dev);
+ ath10k_dbg(ar, ATH10K_DBG_TESTMODE, "testmode fw request '%s': %d\n",
+ filename, ret);
+
if (ret) {
ath10k_warn(ar, "failed to retrieve utf firmware '%s': %d\n",
filename, ret);
^ permalink raw reply related
* [PATCH] staging: wilc1000: remove unnecessary local array
From: Franck Demathieu @ 2017-02-10 15:06 UTC (permalink / raw)
To: linux-wireless, devel; +Cc: aditya.shankar, ganesh.krishna
It fixes the following warning reported by sparse:
drivers/staging/wilc1000/linux_wlan.c:67:33: warning: too long initializer-string for array of char(no space for nul char)
Signed-off-by: Franck Demathieu <fdemathieu@gmail.com>
---
drivers/staging/wilc1000/linux_wlan.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 2eebc62..fc61f4e 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -64,7 +64,6 @@ static int dev_state_ev_handler(struct notifier_block *this,
u8 *ip_addr_buf;
struct wilc_vif *vif;
u8 null_ip[4] = {0};
- char wlan_dev_name[5] = "wlan0";
if (!dev_iface || !dev_iface->ifa_dev || !dev_iface->ifa_dev->dev)
return NOTIFY_DONE;
@@ -113,7 +112,7 @@ static int dev_state_ev_handler(struct notifier_block *this,
wilc_optaining_ip = false;
}
- if (memcmp(dev_iface->ifa_label, wlan_dev_name, 5) == 0)
+ if (memcmp(dev_iface->ifa_label, "wlan0", 5) == 0)
wilc_set_power_mgmt(vif, 0, 0);
wilc_resolve_disconnect_aberration(vif);
--
2.10.1
^ permalink raw reply related
* Re: [PATCH v3] ath10k: Fix crash during rmmod when probe firmware fails
From: Shajakhan, Mohammed Shafi (Mohammed Shafi) @ 2017-02-10 12:16 UTC (permalink / raw)
To: Valo, Kalle, Mohammed Shafi Shajakhan
Cc: ath10k@lists.infradead.org, linux-wireless@vger.kernel.org
In-Reply-To: <87lgteidii.fsf@kamboji.qca.qualcomm.com>
Mohammed Shafi Shajakhan <mohammed@codeaurora.org> writes:=0A=
=0A=
> the change suggested by you helps, and the device probe, scan=0A=
> is successful as well. Still good to have this change part of your=0A=
> basic sanity and regression testing !=0A=
=0A=
Sure. I was sort of expecting that you would send v4 but I haven't seen=0A=
one so I guess you assumed I send that? :) I'll then submit v4.=0A=
=0A=
[shafi] thanks Kalle, just saw your patch.=0A=
=0A=
regards,=0A=
shafi=0A=
^ permalink raw reply
* Re: [PATCH] staging: wilc1000: remove unnecessary local array
From: Greg KH @ 2017-02-10 14:02 UTC (permalink / raw)
To: Franck Demathieu; +Cc: linux-wireless, devel
In-Reply-To: <20170209134839.12138-1-fdemathieu@gmail.com>
On Thu, Feb 09, 2017 at 02:48:39PM +0100, Franck Demathieu wrote:
> It fixes the following warning reported by sparse:
>
> drivers/staging/wilc1000/linux_wlan.c:67:33: warning: too long initializer-string for array of char(no space for nul char)
>
> Signed-off-by: Franck Demathieu <fdemathieu@gmail.com>
> ---
> drivers/staging/wilc1000/linux_wlan.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
Always use scripts/get_maintainer.pl to determine who to send patches
to.
Please fix up and try again.
thanks,
greg k-h
^ permalink raw reply
* Re: [v4] ath10k: fix napi crash during rmmod when probe firmware fails
From: Kalle Valo @ 2017-02-10 12:46 UTC (permalink / raw)
To: Kalle Valo; +Cc: ath10k, linux-wireless
In-Reply-To: <148672748569.28126.12259592472689214081.stgit@potku.adurom.net>
Kalle Valo <kvalo@qca.qualcomm.com> wrote:
> This fixes the below crash when ath10k probe firmware fails, NAPI polling tries
> to access a rx ring resource which was never allocated. An easy way to
> reproduce this is easy to remove all the firmware files, load ath10k modules
> and ath10k will crash when calling 'rmmod ath10k_pci'. The fix is to call
> napi_enable() from ath10k_pci_hif_start() so that it matches with
> napi_disable() being called from ath10k_pci_hif_stop().
>
> Big thanks to Mohammed Shafi Shajakhan who debugged this and provided first
> version of the fix. In this patch I just fix the actual problem in pci.c
> instead of having a workaround in core.c.
>
> BUG: unable to handle kernel NULL pointer dereference at (null)
> IP: __ath10k_htt_rx_ring_fill_n+0x19/0x230 [ath10k_core]
> __ath10k_htt_rx_ring_fill_n+0x19/0x230 [ath10k_core]
>
> Call Trace:
>
> [<ffffffffa113ec62>] ath10k_htt_rx_msdu_buff_replenish+0x42/0x90
> [ath10k_core]
> [<ffffffffa113f393>] ath10k_htt_txrx_compl_task+0x433/0x17d0
> [ath10k_core]
> [<ffffffff8114406d>] ? __wake_up_common+0x4d/0x80
> [<ffffffff811349ec>] ? cpu_load_update+0xdc/0x150
> [<ffffffffa119301d>] ? ath10k_pci_read32+0xd/0x10 [ath10k_pci]
> [<ffffffffa1195b17>] ath10k_pci_napi_poll+0x47/0x110 [ath10k_pci]
> [<ffffffff817863af>] net_rx_action+0x20f/0x370
>
> Reported-by: Ben Greear <greearb@candelatech.com>
> Fixes: 3c97f5de1f28 ("ath10k: implement NAPI support")
> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
I'm planning to push this to 4.11.
--
https://patchwork.kernel.org/patch/9566625/
Documentation about submitting wireless patches and checking status
from patchwork:
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply
* [PATCH v2 4/4] ath10k: convert warning about non-existent OTP board id to debug message
From: Kalle Valo @ 2017-02-10 12:27 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless
In-Reply-To: <148672934198.8556.5588600166627442652.stgit@potku.adurom.net>
Currently ath10k unncessarily warns about board id not available from OTP:
ath10k_pci 0000:02:00.0: pci irq msi oper_irq_mode 2 irq_mode 0 reset_mode 0
ath10k_pci 0000:02:00.0: qca988x hw2.0 target 0x4100016c chip_id 0x043202ff sub 0000:0000
ath10k_pci 0000:02:00.0: kconfig debug 1 debugfs 1 tracing 1 dfs 1 testmode 1
ath10k_pci 0000:02:00.0: firmware ver 10.2.4.70.9-2 api 5 features no-p2p,raw-mode crc32 b8d50af5
ath10k_pci 0000:02:00.0: board id is not exist in otp, ignore it
ath10k_pci 0000:02:00.0: board_file api 1 bmi_id N/A crc32 bebc7c08
ath10k_pci 0000:02:00.0: htt-ver 2.1 wmi-op 5 htt-op 2 cal otp max-sta 128 raw 0 hwcrypto 1
But not all boards have the board id in OTP so this is not a problem and no
need to confuse the user with that info. So this can be safely changed to a
debug message.
Also fix grammar in the debug message.
Fixes: d2e202c06ca4 ("ath10k: ignore configuring the incorrect board_id")
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 6433fdd2c0c7..5e8dd3806622 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -701,7 +701,8 @@ static int ath10k_core_get_board_id_from_otp(struct ath10k *ar)
if ((result & ATH10K_BMI_BOARD_ID_STATUS_MASK) != 0 ||
(board_id == 0)) {
- ath10k_warn(ar, "board id is not exist in otp, ignore it\n");
+ ath10k_dbg(ar, ATH10K_DBG_BOOT,
+ "board id does not exist in otp, ignore it\n");
return -EOPNOTSUPP;
}
^ permalink raw reply related
* [PATCH] orinoco: Use net_device_stats from struct net_device
From: Tobias Klauser @ 2017-02-10 13:03 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless, netdev
Instead of using a private copy of struct net_device_stats in
struct orinoco_private, use stats from struct net_device. Also remove
the now unnecessary .ndo_get_stats function.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
drivers/net/wireless/intersil/orinoco/main.c | 27 ++++++----------------
drivers/net/wireless/intersil/orinoco/orinoco.h | 2 --
.../net/wireless/intersil/orinoco/orinoco_usb.c | 6 ++---
3 files changed, 9 insertions(+), 26 deletions(-)
diff --git a/drivers/net/wireless/intersil/orinoco/main.c b/drivers/net/wireless/intersil/orinoco/main.c
index 9d96b7c928f7..28cf97489001 100644
--- a/drivers/net/wireless/intersil/orinoco/main.c
+++ b/drivers/net/wireless/intersil/orinoco/main.c
@@ -294,14 +294,6 @@ int orinoco_stop(struct net_device *dev)
}
EXPORT_SYMBOL(orinoco_stop);
-struct net_device_stats *orinoco_get_stats(struct net_device *dev)
-{
- struct orinoco_private *priv = ndev_priv(dev);
-
- return &priv->stats;
-}
-EXPORT_SYMBOL(orinoco_get_stats);
-
void orinoco_set_multicast_list(struct net_device *dev)
{
struct orinoco_private *priv = ndev_priv(dev);
@@ -433,7 +425,7 @@ EXPORT_SYMBOL(orinoco_process_xmit_skb);
static netdev_tx_t orinoco_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct orinoco_private *priv = ndev_priv(dev);
- struct net_device_stats *stats = &priv->stats;
+ struct net_device_stats *stats = &dev->stats;
struct hermes *hw = &priv->hw;
int err = 0;
u16 txfid = priv->txfid;
@@ -593,10 +585,7 @@ static void __orinoco_ev_alloc(struct net_device *dev, struct hermes *hw)
static void __orinoco_ev_tx(struct net_device *dev, struct hermes *hw)
{
- struct orinoco_private *priv = ndev_priv(dev);
- struct net_device_stats *stats = &priv->stats;
-
- stats->tx_packets++;
+ dev->stats.tx_packets++;
netif_wake_queue(dev);
@@ -605,8 +594,7 @@ static void __orinoco_ev_tx(struct net_device *dev, struct hermes *hw)
static void __orinoco_ev_txexc(struct net_device *dev, struct hermes *hw)
{
- struct orinoco_private *priv = ndev_priv(dev);
- struct net_device_stats *stats = &priv->stats;
+ struct net_device_stats *stats = &dev->stats;
u16 fid = hermes_read_regn(hw, TXCOMPLFID);
u16 status;
struct hermes_txexc_data hdr;
@@ -662,7 +650,7 @@ static void __orinoco_ev_txexc(struct net_device *dev, struct hermes *hw)
void orinoco_tx_timeout(struct net_device *dev)
{
struct orinoco_private *priv = ndev_priv(dev);
- struct net_device_stats *stats = &priv->stats;
+ struct net_device_stats *stats = &dev->stats;
struct hermes *hw = &priv->hw;
printk(KERN_WARNING "%s: Tx timeout! "
@@ -749,7 +737,7 @@ static void orinoco_rx_monitor(struct net_device *dev, u16 rxfid,
int len;
struct sk_buff *skb;
struct orinoco_private *priv = ndev_priv(dev);
- struct net_device_stats *stats = &priv->stats;
+ struct net_device_stats *stats = &dev->stats;
struct hermes *hw = &priv->hw;
len = le16_to_cpu(desc->data_len);
@@ -840,7 +828,7 @@ static void orinoco_rx_monitor(struct net_device *dev, u16 rxfid,
void __orinoco_ev_rx(struct net_device *dev, struct hermes *hw)
{
struct orinoco_private *priv = ndev_priv(dev);
- struct net_device_stats *stats = &priv->stats;
+ struct net_device_stats *stats = &dev->stats;
struct iw_statistics *wstats = &priv->wstats;
struct sk_buff *skb = NULL;
u16 rxfid, status;
@@ -959,7 +947,7 @@ static void orinoco_rx(struct net_device *dev,
struct sk_buff *skb)
{
struct orinoco_private *priv = ndev_priv(dev);
- struct net_device_stats *stats = &priv->stats;
+ struct net_device_stats *stats = &dev->stats;
u16 status, fc;
int length;
struct ethhdr *hdr;
@@ -2137,7 +2125,6 @@ static const struct net_device_ops orinoco_netdev_ops = {
.ndo_set_mac_address = eth_mac_addr,
.ndo_validate_addr = eth_validate_addr,
.ndo_tx_timeout = orinoco_tx_timeout,
- .ndo_get_stats = orinoco_get_stats,
};
/* Allocate private data.
diff --git a/drivers/net/wireless/intersil/orinoco/orinoco.h b/drivers/net/wireless/intersil/orinoco/orinoco.h
index 5fa1c3e3713f..430862a6a24b 100644
--- a/drivers/net/wireless/intersil/orinoco/orinoco.h
+++ b/drivers/net/wireless/intersil/orinoco/orinoco.h
@@ -84,7 +84,6 @@ struct orinoco_private {
/* Net device stuff */
struct net_device *ndev;
- struct net_device_stats stats;
struct iw_statistics wstats;
/* Hardware control variables */
@@ -206,7 +205,6 @@ int orinoco_process_xmit_skb(struct sk_buff *skb,
/* Common ndo functions exported for reuse by orinoco_usb */
int orinoco_open(struct net_device *dev);
int orinoco_stop(struct net_device *dev);
-struct net_device_stats *orinoco_get_stats(struct net_device *dev);
void orinoco_set_multicast_list(struct net_device *dev);
int orinoco_change_mtu(struct net_device *dev, int new_mtu);
void orinoco_tx_timeout(struct net_device *dev);
diff --git a/drivers/net/wireless/intersil/orinoco/orinoco_usb.c b/drivers/net/wireless/intersil/orinoco/orinoco_usb.c
index bca6935a94db..98e1380b9917 100644
--- a/drivers/net/wireless/intersil/orinoco/orinoco_usb.c
+++ b/drivers/net/wireless/intersil/orinoco/orinoco_usb.c
@@ -403,8 +403,7 @@ static void ezusb_ctx_complete(struct request_context *ctx)
if ((ctx->out_rid == EZUSB_RID_TX) && upriv->dev) {
struct net_device *dev = upriv->dev;
- struct orinoco_private *priv = ndev_priv(dev);
- struct net_device_stats *stats = &priv->stats;
+ struct net_device_stats *stats = &dev->stats;
if (ctx->state != EZUSB_CTX_COMPLETE)
stats->tx_errors++;
@@ -1183,7 +1182,7 @@ static int ezusb_program(struct hermes *hw, const char *buf,
static netdev_tx_t ezusb_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct orinoco_private *priv = ndev_priv(dev);
- struct net_device_stats *stats = &priv->stats;
+ struct net_device_stats *stats = &dev->stats;
struct ezusb_priv *upriv = priv->card;
u8 mic[MICHAEL_MIC_LEN + 1];
int err = 0;
@@ -1556,7 +1555,6 @@ static const struct net_device_ops ezusb_netdev_ops = {
.ndo_set_mac_address = eth_mac_addr,
.ndo_validate_addr = eth_validate_addr,
.ndo_tx_timeout = orinoco_tx_timeout,
- .ndo_get_stats = orinoco_get_stats,
};
static int ezusb_probe(struct usb_interface *interface,
--
2.11.0
^ permalink raw reply related
* [PATCH v2 2/4] ath10k: add directory to board data error message
From: Kalle Valo @ 2017-02-10 12:26 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless
In-Reply-To: <148672934198.8556.5588600166627442652.stgit@potku.adurom.net>
This way user has a better idea what file exactly is missing.
This is needed when we switch to using request_firmware_direct() which doesn't
print any errors anymore.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 9674c08464ab..f395d3a98bc5 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -1168,7 +1168,8 @@ static int ath10k_core_fetch_board_file(struct ath10k *ar)
ar->bd_api = 1;
ret = ath10k_core_fetch_board_data_api_1(ar);
if (ret) {
- ath10k_err(ar, "failed to fetch board data\n");
+ ath10k_err(ar, "failed to fetch board-2.bin or board.bin from %s\n",
+ ar->hw_params.fw.dir);
return ret;
}
^ permalink raw reply related
* [PATCH v2 0/4] ath10k: silence firmware file probing warnings
From: Kalle Valo @ 2017-02-10 12:26 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless
Hi,
here are patches to make ath10k less spammy during initialisation.
v2:
* RFC -> PATCH
* add new patches:
ath10k: fetch firmware images in a loop
ath10k: add directory to board data error message
ath10k: convert warning about non-existent OTP board id to debug message
---
Erik Stromdahl (1):
ath10k: fetch firmware images in a loop
Kalle Valo (2):
ath10k: add directory to board data error message
ath10k: convert warning about non-existent OTP board id to debug message
Michal Kazior (1):
ath10k: silence firmware file probing warnings
drivers/net/wireless/ath/ath10k/core.c | 68 +++++++++++++---------------
drivers/net/wireless/ath/ath10k/hw.h | 4 ++
drivers/net/wireless/ath/ath10k/testmode.c | 5 ++
3 files changed, 40 insertions(+), 37 deletions(-)
^ permalink raw reply
* [PATCH v2 1/4] ath10k: fetch firmware images in a loop
From: Kalle Valo @ 2017-02-10 12:26 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless
In-Reply-To: <148672934198.8556.5588600166627442652.stgit@potku.adurom.net>
From: Erik Stromdahl <erik.stromdahl@gmail.com>
To make it easier to handle minimum and maximum firmware API numbers convert
the firmware fetch functionality to a loop. If no firmware image is found print
an error with minimum and maximum API numbers and the name of firmware
directory. This is needed when we switch to using request_firmware_direct()
which doesn't print any errors anymore.
Also add a new function for creating the fw file name dynamically which makes it
easier to add new bus support, for example SDIO and USB, later.
Signed-off-by: Erik Stromdahl <erik.stromdahl@gmail.com>
[kvalo@qca.qualcomm.com: remove sdio/usb part, new error message, clarify commit log]
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/core.c | 51 ++++++++++++++------------------
drivers/net/wireless/ath/ath10k/hw.h | 4 +++
2 files changed, 27 insertions(+), 28 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index c27e7ea38a65..9674c08464ab 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -1358,44 +1358,39 @@ int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name,
return ret;
}
+static void ath10k_core_get_fw_name(struct ath10k *ar, char *fw_name,
+ size_t fw_name_len, int fw_api)
+{
+ scnprintf(fw_name, fw_name_len, "%s-%d.bin", ATH10K_FW_FILE_BASE, fw_api);
+}
+
static int ath10k_core_fetch_firmware_files(struct ath10k *ar)
{
- int ret;
+ int ret, i;
+ char fw_name[100];
/* calibration file is optional, don't check for any errors */
ath10k_fetch_cal_file(ar);
- ar->fw_api = 5;
- ath10k_dbg(ar, ATH10K_DBG_BOOT, "trying fw api %d\n", ar->fw_api);
-
- ret = ath10k_core_fetch_firmware_api_n(ar, ATH10K_FW_API5_FILE,
- &ar->normal_mode_fw.fw_file);
- if (ret == 0)
- goto success;
-
- ar->fw_api = 4;
- ath10k_dbg(ar, ATH10K_DBG_BOOT, "trying fw api %d\n", ar->fw_api);
-
- ret = ath10k_core_fetch_firmware_api_n(ar, ATH10K_FW_API4_FILE,
- &ar->normal_mode_fw.fw_file);
- if (ret == 0)
- goto success;
+ for (i = ATH10K_FW_API_MAX; i >= ATH10K_FW_API_MIN; i--) {
+ ar->fw_api = i;
+ ath10k_dbg(ar, ATH10K_DBG_BOOT, "trying fw api %d\n",
+ ar->fw_api);
- ar->fw_api = 3;
- ath10k_dbg(ar, ATH10K_DBG_BOOT, "trying fw api %d\n", ar->fw_api);
+ ath10k_core_get_fw_name(ar, fw_name, sizeof(fw_name), ar->fw_api);
+ ret = ath10k_core_fetch_firmware_api_n(ar, fw_name,
+ &ar->normal_mode_fw.fw_file);
+ if (!ret)
+ goto success;
+ }
- ret = ath10k_core_fetch_firmware_api_n(ar, ATH10K_FW_API3_FILE,
- &ar->normal_mode_fw.fw_file);
- if (ret == 0)
- goto success;
+ /* we end up here if we couldn't fetch any firmware */
- ar->fw_api = 2;
- ath10k_dbg(ar, ATH10K_DBG_BOOT, "trying fw api %d\n", ar->fw_api);
+ ath10k_err(ar, "Failed to find firmware-N.bin (N between %d and %d) from %s: %d",
+ ATH10K_FW_API_MIN, ATH10K_FW_API_MAX, ar->hw_params.fw.dir,
+ ret);
- ret = ath10k_core_fetch_firmware_api_n(ar, ATH10K_FW_API2_FILE,
- &ar->normal_mode_fw.fw_file);
- if (ret)
- return ret;
+ return ret;
success:
ath10k_dbg(ar, ATH10K_DBG_BOOT, "using fw api %d\n", ar->fw_api);
diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h
index 38aa7c95732e..f0fda0f2b3b4 100644
--- a/drivers/net/wireless/ath/ath10k/hw.h
+++ b/drivers/net/wireless/ath/ath10k/hw.h
@@ -128,6 +128,10 @@ enum qca9377_chip_id_rev {
#define QCA4019_HW_1_0_BOARD_DATA_FILE "board.bin"
#define QCA4019_HW_1_0_PATCH_LOAD_ADDR 0x1234
+#define ATH10K_FW_FILE_BASE "firmware"
+#define ATH10K_FW_API_MAX 5
+#define ATH10K_FW_API_MIN 2
+
#define ATH10K_FW_API2_FILE "firmware-2.bin"
#define ATH10K_FW_API3_FILE "firmware-3.bin"
^ permalink raw reply related
* [PATCH v4] ath10k: fix napi crash during rmmod when probe firmware fails
From: Kalle Valo @ 2017-02-10 11:51 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless
This fixes the below crash when ath10k probe firmware fails, NAPI polling tries
to access a rx ring resource which was never allocated. An easy way to
reproduce this is easy to remove all the firmware files, load ath10k modules
and ath10k will crash when calling 'rmmod ath10k_pci'. The fix is to call
napi_enable() from ath10k_pci_hif_start() so that it matches with
napi_disable() being called from ath10k_pci_hif_stop().
Big thanks to Mohammed Shafi Shajakhan who debugged this and provided first
version of the fix. In this patch I just fix the actual problem in pci.c
instead of having a workaround in core.c.
BUG: unable to handle kernel NULL pointer dereference at (null)
IP: __ath10k_htt_rx_ring_fill_n+0x19/0x230 [ath10k_core]
__ath10k_htt_rx_ring_fill_n+0x19/0x230 [ath10k_core]
Call Trace:
[<ffffffffa113ec62>] ath10k_htt_rx_msdu_buff_replenish+0x42/0x90
[ath10k_core]
[<ffffffffa113f393>] ath10k_htt_txrx_compl_task+0x433/0x17d0
[ath10k_core]
[<ffffffff8114406d>] ? __wake_up_common+0x4d/0x80
[<ffffffff811349ec>] ? cpu_load_update+0xdc/0x150
[<ffffffffa119301d>] ? ath10k_pci_read32+0xd/0x10 [ath10k_pci]
[<ffffffffa1195b17>] ath10k_pci_napi_poll+0x47/0x110 [ath10k_pci]
[<ffffffff817863af>] net_rx_action+0x20f/0x370
Reported-by: Ben Greear <greearb@candelatech.com>
Fixes: 3c97f5de1f28 ("ath10k: implement NAPI support")
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/pci.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index 5d2f9b9922d3..6094372307aa 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -1651,6 +1651,8 @@ static int ath10k_pci_hif_start(struct ath10k *ar)
ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot hif start\n");
+ napi_enable(&ar->napi);
+
ath10k_pci_irq_enable(ar);
ath10k_pci_rx_post(ar);
@@ -2535,7 +2537,6 @@ static int ath10k_pci_hif_power_up(struct ath10k *ar)
ath10k_err(ar, "could not wake up target CPU: %d\n", ret);
goto err_ce;
}
- napi_enable(&ar->napi);
return 0;
^ permalink raw reply related
* Re: [PATCH v3] ath10k: Fix crash during rmmod when probe firmware fails
From: Valo, Kalle @ 2017-02-10 11:36 UTC (permalink / raw)
To: Mohammed Shafi Shajakhan
Cc: Shajakhan, Mohammed Shafi (Mohammed Shafi),
ath10k@lists.infradead.org, linux-wireless@vger.kernel.org
In-Reply-To: <87lgteidii.fsf@kamboji.qca.qualcomm.com>
Kalle Valo <kvalo@qca.qualcomm.com> writes:
> BTW, just curious but why do you have "during rmmod" in the title? I
> think I was able to reproduce this crash by removing all firmware files
> and didn't use rmmod at all.
Nevermind, I was blind again. It was my script which calls rmmod and I
failed to realise that. Sorry for the noise.
--=20
Kalle Valo=
^ permalink raw reply
* instlation of driver?
From: Tommy @ 2017-02-10 11:08 UTC (permalink / raw)
To: linux-wireless
I've installed a Linux disto on my old Dell d630 to keep it alive sins XP's not supported.
I've trouble with my wifi.
It seems like I lost the wifi then I migtate from Windows so I downloaded the linux driver for Intel 3945 but I can't figure it out how to install.
will you please help me?
--
Tommy <tommy.jobbet@gmail.com>
^ permalink raw reply
* Re: [PATCH v4 3/5] cfg80211: Accept multiple RSSI thresholds for CQM
From: Andrew Zaborowski @ 2017-02-10 9:39 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless
In-Reply-To: <1486557177.24745.8.camel@sipsolutions.net>
On 8 February 2017 at 13:32, Johannes Berg <johannes@sipsolutions.net> wrote:
>> > I think it would make sense to unconditionally apply the hysteresis
>> > to low/high, i.e. always set
>> > low = low - hyst
>> > high = high + hyst
>> >
>> > so that you get "sticky" ranges once you're in them?
>>
>> Yes, maybe that's better, I guess I want to avoid just adding a lag /
>> delay in reporting changes that are not due to measurement error or
>> temporary. Could also do something in between, e.g. use "low - hyst"
>> if signal is close to low, otherwise just "low".
>
> That's sort of what you had, but except for the precise definition of
> "close", no?
>
> Actually, no, because you used "last - hyst" rather than "low - hyst"
> it's different. I think we can live with checking if it's close, say
> setting to "low - hyst" when it's within low + hyst - that avoids the
> problem I outlined above and gets a bit more responsiveness, I guess.
I sent a version with this logic but came up with values that would
still cause the continous events as in your example, specifically with
a hyst of 3 and the reported RSSI values jumping between -51 and -47.
This could be avoided by changing operators between "less than" and
"less or equal" but I eventually sent a version with the "sticky"
ranges you suggested, I think that is just as good.
Best regards
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox