* Re: [PATCH 1/2] ath10k: rename WMI_CMD_UNDEFINED
From: Kalle Valo @ 2013-10-16 8:52 UTC (permalink / raw)
To: Bartosz Markowski; +Cc: ath10k, linux-wireless
In-Reply-To: <1381823732-10128-1-git-send-email-bartosz.markowski@tieto.com>
Bartosz Markowski <bartosz.markowski@tieto.com> writes:
> Rename WMI_CMD_UNDEFINED to WMI_CMD_UNSUPPORTED. This is more
> accurate here. Also return -EOPNOTSUPP instead of -EINVAL in
> wmi_cmd_send().
>
> Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Thanks, both patches applied.
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH 2/7] ath10k: add sanity checks for monitor management
From: Kalle Valo @ 2013-10-16 9:19 UTC (permalink / raw)
To: Michal Kazior; +Cc: ath10k, linux-wireless
In-Reply-To: <1381858196-17000-3-git-send-email-michal.kazior@tieto.com>
Michal Kazior <michal.kazior@tieto.com> writes:
> Add a few checks and warnings to make it easier to
> track any kind of monitor vdev mismanagement.
>
> Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
[...]
> + if (!ar->monitor_present) {
> + ath10k_warn("mac montor stop -- monitor is not present\n");
> + return -EINVAL;
> + }
[...]
> + if (!ar->monitor_present) {
> + ath10k_warn("mac montor stop -- monitor is not present\n");
> + return -EINVAL;
> + }
> +
> + if (!ar->monitor_enabled) {
> + ath10k_warn("mac montor stop -- monitor is not enabled\n");
> + return -EINVAL;
> + }
s/montor/monitor/
--
Kalle Valo
^ permalink raw reply
* Re: iwlwifi Centrino Advanced-N 6235, setting regulatory domain with iw reg set XX doesn't work.
From: Emmanuel Grumbach @ 2013-10-16 9:51 UTC (permalink / raw)
To: Sander Eikelenboom
Cc: Grumbach, Emmanuel, John W. Linville, Berg, Johannes,
ilw@linux.intel.com, netdev@vger.kernel.org,
linux-wireless@vger.kernel.org, Luis R. Rodriguez
In-Reply-To: <577936357.20131016104505@eikelenboom.it>
> Hi
>
> I seem to have to take a second hurdle in using my Centrino Advanced-N 6235 with linux.
>
> I'm trying to set the regulatory domain (currenly world domain (00))
> But a "iw reg set US" or "iw reg set NL" does not succeed.
>
> # iw reg get
> country 00:
> (2402 - 2472 @ 40), (6, 20)
> (2457 - 2482 @ 40), (6, 20), PASSIVE-SCAN, NO-IBSS
> (2474 - 2494 @ 20), (6, 20), NO-OFDM, PASSIVE-SCAN, NO-IBSS
> (5170 - 5250 @ 80), (6, 20), PASSIVE-SCAN, NO-IBSS
> (5735 - 5835 @ 80), (6, 20), PASSIVE-SCAN, NO-IBSS
> (57240 - 63720 @ 2160), (N/A, 0)
>
> # iw reg set US
>
> # iw reg get
> country 00:
> (2402 - 2472 @ 40), (6, 20)
> (2457 - 2482 @ 40), (6, 20), PASSIVE-SCAN, NO-IBSS
> (2474 - 2494 @ 20), (6, 20), NO-OFDM, PASSIVE-SCAN, NO-IBSS
> (5170 - 5250 @ 80), (6, 20), PASSIVE-SCAN, NO-IBSS
> (5735 - 5835 @ 80), (6, 20), PASSIVE-SCAN, NO-IBSS
> (57240 - 63720 @ 2160), (N/A, 0)
>
>
> The only thing is this message in dmesg:
> "cfg80211: Pending regulatory request, waiting for it to be processed...".
>
> I did enable some of the kernel wifi debug options, but there is no error or more informatie.
> But it doesn't get set as you can see above.
>
This is most probably not related to the device itself.
Luis?
^ permalink raw reply
* [PATCH 0/5] rfkill-gpio: ACPI support
From: Heikki Krogerus @ 2013-10-16 10:53 UTC (permalink / raw)
To: John W. Linville
Cc: Johannes Berg, Rhyland Klein, Rafael J. Wysocki, linux-acpi,
linux-wireless, netdev
Hi,
The first patches prepare the driver for the support. The last patch
can then add the support quite easily. With these patches, adding DT
support later will be quite straight forward if someone needs it.
Heikki Krogerus (5):
net: rfkill: gpio: convert to resource managed allocation
net: rfkill: gpio: clean up clock handling
net: rfkill: gpio: spinlock-safe GPIO access
net: rfkill: gpio: prepare for DT and ACPI support
net: rfkill: gpio: add ACPI support
net/rfkill/Kconfig | 2 +-
net/rfkill/rfkill-gpio.c | 211 ++++++++++++++++++++++-------------------------
2 files changed, 99 insertions(+), 114 deletions(-)
--
1.8.4.rc3
^ permalink raw reply
* [PATCH 1/5] net: rfkill: gpio: convert to resource managed allocation
From: Heikki Krogerus @ 2013-10-16 10:53 UTC (permalink / raw)
To: John W. Linville
Cc: Johannes Berg, Rhyland Klein, Rafael J. Wysocki, linux-acpi,
linux-wireless, netdev
In-Reply-To: <1381920823-15403-1-git-send-email-heikki.krogerus@linux.intel.com>
And remove now unneeded resource freeing.
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
net/rfkill/rfkill-gpio.c | 75 +++++++++++++-----------------------------------
1 file changed, 20 insertions(+), 55 deletions(-)
diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c
index fb076cd..0705806 100644
--- a/net/rfkill/rfkill-gpio.c
+++ b/net/rfkill/rfkill-gpio.c
@@ -97,7 +97,7 @@ static int rfkill_gpio_probe(struct platform_device *pdev)
return -EINVAL;
}
- rfkill = kzalloc(sizeof(*rfkill), GFP_KERNEL);
+ rfkill = devm_kzalloc(&pdev->dev, sizeof(*rfkill), GFP_KERNEL);
if (!rfkill)
return -ENOMEM;
@@ -105,89 +105,65 @@ static int rfkill_gpio_probe(struct platform_device *pdev)
ret = pdata->gpio_runtime_setup(pdev);
if (ret) {
pr_warn("%s: can't set up gpio\n", __func__);
- goto fail_alloc;
+ return ret;
}
}
rfkill->pdata = pdata;
len = strlen(pdata->name);
- rfkill->reset_name = kzalloc(len + 7, GFP_KERNEL);
- if (!rfkill->reset_name) {
- ret = -ENOMEM;
- goto fail_alloc;
- }
+ rfkill->reset_name = devm_kzalloc(&pdev->dev, len + 7, GFP_KERNEL);
+ if (!rfkill->reset_name)
+ return -ENOMEM;
- rfkill->shutdown_name = kzalloc(len + 10, GFP_KERNEL);
- if (!rfkill->shutdown_name) {
- ret = -ENOMEM;
- goto fail_reset_name;
- }
+ rfkill->shutdown_name = devm_kzalloc(&pdev->dev, len + 10, GFP_KERNEL);
+ if (!rfkill->shutdown_name)
+ return -ENOMEM;
snprintf(rfkill->reset_name, len + 6 , "%s_reset", pdata->name);
snprintf(rfkill->shutdown_name, len + 9, "%s_shutdown", pdata->name);
if (pdata->power_clk_name) {
- rfkill->pwr_clk = clk_get(&pdev->dev, pdata->power_clk_name);
+ rfkill->pwr_clk = devm_clk_get(&pdev->dev,
+ pdata->power_clk_name);
if (IS_ERR(rfkill->pwr_clk)) {
pr_warn("%s: can't find pwr_clk.\n", __func__);
- ret = PTR_ERR(rfkill->pwr_clk);
- goto fail_shutdown_name;
+ return PTR_ERR(rfkill->pwr_clk);
}
}
if (gpio_is_valid(pdata->reset_gpio)) {
- ret = gpio_request(pdata->reset_gpio, rfkill->reset_name);
+ ret = devm_gpio_request(&pdev->dev, pdata->reset_gpio,
+ rfkill->reset_name);
if (ret) {
pr_warn("%s: failed to get reset gpio.\n", __func__);
- goto fail_clock;
+ return ret;
}
}
if (gpio_is_valid(pdata->shutdown_gpio)) {
- ret = gpio_request(pdata->shutdown_gpio, rfkill->shutdown_name);
+ ret = devm_gpio_request(&pdev->dev, pdata->shutdown_gpio,
+ rfkill->shutdown_name);
if (ret) {
pr_warn("%s: failed to get shutdown gpio.\n", __func__);
- goto fail_reset;
+ return ret;
}
}
rfkill->rfkill_dev = rfkill_alloc(pdata->name, &pdev->dev, pdata->type,
&rfkill_gpio_ops, rfkill);
- if (!rfkill->rfkill_dev) {
- ret = -ENOMEM;
- goto fail_shutdown;
- }
+ if (!rfkill->rfkill_dev)
+ return -ENOMEM;
ret = rfkill_register(rfkill->rfkill_dev);
if (ret < 0)
- goto fail_rfkill;
+ return ret;
platform_set_drvdata(pdev, rfkill);
dev_info(&pdev->dev, "%s device registered.\n", pdata->name);
return 0;
-
-fail_rfkill:
- rfkill_destroy(rfkill->rfkill_dev);
-fail_shutdown:
- if (gpio_is_valid(pdata->shutdown_gpio))
- gpio_free(pdata->shutdown_gpio);
-fail_reset:
- if (gpio_is_valid(pdata->reset_gpio))
- gpio_free(pdata->reset_gpio);
-fail_clock:
- if (rfkill->pwr_clk)
- clk_put(rfkill->pwr_clk);
-fail_shutdown_name:
- kfree(rfkill->shutdown_name);
-fail_reset_name:
- kfree(rfkill->reset_name);
-fail_alloc:
- kfree(rfkill);
-
- return ret;
}
static int rfkill_gpio_remove(struct platform_device *pdev)
@@ -199,17 +175,6 @@ static int rfkill_gpio_remove(struct platform_device *pdev)
pdata->gpio_runtime_close(pdev);
rfkill_unregister(rfkill->rfkill_dev);
rfkill_destroy(rfkill->rfkill_dev);
- if (gpio_is_valid(rfkill->pdata->shutdown_gpio))
- gpio_free(rfkill->pdata->shutdown_gpio);
- if (gpio_is_valid(rfkill->pdata->reset_gpio))
- gpio_free(rfkill->pdata->reset_gpio);
- if (rfkill->pwr_clk && PWR_CLK_ENABLED(rfkill))
- clk_disable(rfkill->pwr_clk);
- if (rfkill->pwr_clk)
- clk_put(rfkill->pwr_clk);
- kfree(rfkill->shutdown_name);
- kfree(rfkill->reset_name);
- kfree(rfkill);
return 0;
}
--
1.8.4.rc3
^ permalink raw reply related
* [PATCH 2/5] net: rfkill: gpio: clean up clock handling
From: Heikki Krogerus @ 2013-10-16 10:53 UTC (permalink / raw)
To: John W. Linville
Cc: Johannes Berg, Rhyland Klein, Rafael J. Wysocki, linux-acpi,
linux-wireless, netdev
In-Reply-To: <1381920823-15403-1-git-send-email-heikki.krogerus@linux.intel.com>
Use a simple flag to see the state of the clock, and make
the clock available even without a name. Also, get rid of
HAVE_CLK dependency.
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
net/rfkill/Kconfig | 2 +-
net/rfkill/rfkill-gpio.c | 35 ++++++++---------------------------
2 files changed, 9 insertions(+), 28 deletions(-)
diff --git a/net/rfkill/Kconfig b/net/rfkill/Kconfig
index 78efe89..4c10e7e 100644
--- a/net/rfkill/Kconfig
+++ b/net/rfkill/Kconfig
@@ -36,7 +36,7 @@ config RFKILL_REGULATOR
config RFKILL_GPIO
tristate "GPIO RFKILL driver"
- depends on RFKILL && GPIOLIB && HAVE_CLK
+ depends on RFKILL && GPIOLIB
default n
help
If you say yes here you get support of a generic gpio RFKILL
diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c
index 0705806..1d104e7 100644
--- a/net/rfkill/rfkill-gpio.c
+++ b/net/rfkill/rfkill-gpio.c
@@ -27,24 +27,13 @@
#include <linux/rfkill-gpio.h>
-enum rfkill_gpio_clk_state {
- UNSPECIFIED = 0,
- PWR_ENABLED,
- PWR_DISABLED
-};
-
-#define PWR_CLK_SET(_RF, _EN) \
- ((_RF)->pwr_clk_enabled = (!(_EN) ? PWR_ENABLED : PWR_DISABLED))
-#define PWR_CLK_ENABLED(_RF) ((_RF)->pwr_clk_enabled == PWR_ENABLED)
-#define PWR_CLK_DISABLED(_RF) ((_RF)->pwr_clk_enabled != PWR_ENABLED)
-
struct rfkill_gpio_data {
struct rfkill_gpio_platform_data *pdata;
struct rfkill *rfkill_dev;
char *reset_name;
char *shutdown_name;
- enum rfkill_gpio_clk_state pwr_clk_enabled;
- struct clk *pwr_clk;
+ struct clk *clk;
+ bool clk_enabled;
};
static int rfkill_gpio_set_power(void *data, bool blocked)
@@ -56,19 +45,18 @@ static int rfkill_gpio_set_power(void *data, bool blocked)
gpio_direction_output(rfkill->pdata->shutdown_gpio, 0);
if (gpio_is_valid(rfkill->pdata->reset_gpio))
gpio_direction_output(rfkill->pdata->reset_gpio, 0);
- if (rfkill->pwr_clk && PWR_CLK_ENABLED(rfkill))
- clk_disable(rfkill->pwr_clk);
+ if (!IS_ERR(rfkill->clk) && rfkill->clk_enabled)
+ clk_disable(rfkill->clk);
} else {
- if (rfkill->pwr_clk && PWR_CLK_DISABLED(rfkill))
- clk_enable(rfkill->pwr_clk);
+ if (!IS_ERR(rfkill->clk) && !rfkill->clk_enabled)
+ clk_enable(rfkill->clk);
if (gpio_is_valid(rfkill->pdata->reset_gpio))
gpio_direction_output(rfkill->pdata->reset_gpio, 1);
if (gpio_is_valid(rfkill->pdata->shutdown_gpio))
gpio_direction_output(rfkill->pdata->shutdown_gpio, 1);
}
- if (rfkill->pwr_clk)
- PWR_CLK_SET(rfkill, blocked);
+ rfkill->clk_enabled = blocked;
return 0;
}
@@ -123,14 +111,7 @@ static int rfkill_gpio_probe(struct platform_device *pdev)
snprintf(rfkill->reset_name, len + 6 , "%s_reset", pdata->name);
snprintf(rfkill->shutdown_name, len + 9, "%s_shutdown", pdata->name);
- if (pdata->power_clk_name) {
- rfkill->pwr_clk = devm_clk_get(&pdev->dev,
- pdata->power_clk_name);
- if (IS_ERR(rfkill->pwr_clk)) {
- pr_warn("%s: can't find pwr_clk.\n", __func__);
- return PTR_ERR(rfkill->pwr_clk);
- }
- }
+ rfkill->clk = devm_clk_get(&pdev->dev, pdata->power_clk_name);
if (gpio_is_valid(pdata->reset_gpio)) {
ret = devm_gpio_request(&pdev->dev, pdata->reset_gpio,
--
1.8.4.rc3
^ permalink raw reply related
* [PATCH 3/5] net: rfkill: gpio: spinlock-safe GPIO access
From: Heikki Krogerus @ 2013-10-16 10:53 UTC (permalink / raw)
To: John W. Linville
Cc: Johannes Berg, Rhyland Klein, Rafael J. Wysocki, linux-acpi,
linux-wireless, netdev
In-Reply-To: <1381920823-15403-1-git-send-email-heikki.krogerus@linux.intel.com>
This sets the direction of the gpio once when it's requested,
and uses the spinlock-safe gpio_set_state() to change the
state.
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
net/rfkill/rfkill-gpio.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c
index 1d104e7..aa4ac10 100644
--- a/net/rfkill/rfkill-gpio.c
+++ b/net/rfkill/rfkill-gpio.c
@@ -42,18 +42,18 @@ static int rfkill_gpio_set_power(void *data, bool blocked)
if (blocked) {
if (gpio_is_valid(rfkill->pdata->shutdown_gpio))
- gpio_direction_output(rfkill->pdata->shutdown_gpio, 0);
+ gpio_set_value(rfkill->pdata->shutdown_gpio, 0);
if (gpio_is_valid(rfkill->pdata->reset_gpio))
- gpio_direction_output(rfkill->pdata->reset_gpio, 0);
+ gpio_set_value(rfkill->pdata->reset_gpio, 0);
if (!IS_ERR(rfkill->clk) && rfkill->clk_enabled)
clk_disable(rfkill->clk);
} else {
if (!IS_ERR(rfkill->clk) && !rfkill->clk_enabled)
clk_enable(rfkill->clk);
if (gpio_is_valid(rfkill->pdata->reset_gpio))
- gpio_direction_output(rfkill->pdata->reset_gpio, 1);
+ gpio_set_value(rfkill->pdata->reset_gpio, 1);
if (gpio_is_valid(rfkill->pdata->shutdown_gpio))
- gpio_direction_output(rfkill->pdata->shutdown_gpio, 1);
+ gpio_set_value(rfkill->pdata->shutdown_gpio, 1);
}
rfkill->clk_enabled = blocked;
@@ -114,8 +114,8 @@ static int rfkill_gpio_probe(struct platform_device *pdev)
rfkill->clk = devm_clk_get(&pdev->dev, pdata->power_clk_name);
if (gpio_is_valid(pdata->reset_gpio)) {
- ret = devm_gpio_request(&pdev->dev, pdata->reset_gpio,
- rfkill->reset_name);
+ ret = devm_gpio_request_one(&pdev->dev, pdata->reset_gpio,
+ 0, rfkill->reset_name);
if (ret) {
pr_warn("%s: failed to get reset gpio.\n", __func__);
return ret;
@@ -123,8 +123,8 @@ static int rfkill_gpio_probe(struct platform_device *pdev)
}
if (gpio_is_valid(pdata->shutdown_gpio)) {
- ret = devm_gpio_request(&pdev->dev, pdata->shutdown_gpio,
- rfkill->shutdown_name);
+ ret = devm_gpio_request_one(&pdev->dev, pdata->shutdown_gpio,
+ 0, rfkill->shutdown_name);
if (ret) {
pr_warn("%s: failed to get shutdown gpio.\n", __func__);
return ret;
--
1.8.4.rc3
^ permalink raw reply related
* [PATCH 4/5] net: rfkill: gpio: prepare for DT and ACPI support
From: Heikki Krogerus @ 2013-10-16 10:53 UTC (permalink / raw)
To: John W. Linville
Cc: Johannes Berg, Rhyland Klein, Rafael J. Wysocki, linux-acpi,
linux-wireless, netdev
In-Reply-To: <1381920823-15403-1-git-send-email-heikki.krogerus@linux.intel.com>
This will add the relevant values like the gpios and the
type in rfkill_gpio_platform_data to the rfkill_gpio_data
structure. It will allow those values to be easily picked
from DT and ACPI tables later.
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
net/rfkill/rfkill-gpio.c | 92 +++++++++++++++++++++++++++---------------------
1 file changed, 51 insertions(+), 41 deletions(-)
diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c
index aa4ac10..2dd78c6 100644
--- a/net/rfkill/rfkill-gpio.c
+++ b/net/rfkill/rfkill-gpio.c
@@ -28,12 +28,17 @@
#include <linux/rfkill-gpio.h>
struct rfkill_gpio_data {
- struct rfkill_gpio_platform_data *pdata;
- struct rfkill *rfkill_dev;
- char *reset_name;
- char *shutdown_name;
- struct clk *clk;
- bool clk_enabled;
+ const char *name;
+ enum rfkill_type type;
+ int reset_gpio;
+ int shutdown_gpio;
+
+ struct rfkill *rfkill_dev;
+ char *reset_name;
+ char *shutdown_name;
+ struct clk *clk;
+
+ bool clk_enabled;
};
static int rfkill_gpio_set_power(void *data, bool blocked)
@@ -41,19 +46,19 @@ static int rfkill_gpio_set_power(void *data, bool blocked)
struct rfkill_gpio_data *rfkill = data;
if (blocked) {
- if (gpio_is_valid(rfkill->pdata->shutdown_gpio))
- gpio_set_value(rfkill->pdata->shutdown_gpio, 0);
- if (gpio_is_valid(rfkill->pdata->reset_gpio))
- gpio_set_value(rfkill->pdata->reset_gpio, 0);
+ if (gpio_is_valid(rfkill->shutdown_gpio))
+ gpio_set_value(rfkill->shutdown_gpio, 0);
+ if (gpio_is_valid(rfkill->reset_gpio))
+ gpio_set_value(rfkill->reset_gpio, 0);
if (!IS_ERR(rfkill->clk) && rfkill->clk_enabled)
clk_disable(rfkill->clk);
} else {
if (!IS_ERR(rfkill->clk) && !rfkill->clk_enabled)
clk_enable(rfkill->clk);
- if (gpio_is_valid(rfkill->pdata->reset_gpio))
- gpio_set_value(rfkill->pdata->reset_gpio, 1);
- if (gpio_is_valid(rfkill->pdata->shutdown_gpio))
- gpio_set_value(rfkill->pdata->shutdown_gpio, 1);
+ if (gpio_is_valid(rfkill->reset_gpio))
+ gpio_set_value(rfkill->reset_gpio, 1);
+ if (gpio_is_valid(rfkill->shutdown_gpio))
+ gpio_set_value(rfkill->shutdown_gpio, 1);
}
rfkill->clk_enabled = blocked;
@@ -67,29 +72,35 @@ static const struct rfkill_ops rfkill_gpio_ops = {
static int rfkill_gpio_probe(struct platform_device *pdev)
{
- struct rfkill_gpio_data *rfkill;
struct rfkill_gpio_platform_data *pdata = pdev->dev.platform_data;
+ struct rfkill_gpio_data *rfkill;
+ const char *clk_name = NULL;
int ret = 0;
int len = 0;
- if (!pdata) {
- pr_warn("%s: No platform data specified\n", __func__);
- return -EINVAL;
+ rfkill = devm_kzalloc(&pdev->dev, sizeof(*rfkill), GFP_KERNEL);
+ if (!rfkill)
+ return -ENOMEM;
+
+ if (pdata) {
+ clk_name = pdata->power_clk_name;
+ rfkill->name = pdata->name;
+ rfkill->type = pdata->type;
+ rfkill->reset_gpio = pdata->reset_gpio;
+ rfkill->shutdown_gpio = pdata->shutdown_gpio;
+ } else {
+ return -ENODEV;
}
/* make sure at-least one of the GPIO is defined and that
* a name is specified for this instance */
- if (!pdata->name || (!gpio_is_valid(pdata->reset_gpio) &&
- !gpio_is_valid(pdata->shutdown_gpio))) {
+ if ((!gpio_is_valid(rfkill->reset_gpio) &&
+ !gpio_is_valid(rfkill->shutdown_gpio)) || !rfkill->name) {
pr_warn("%s: invalid platform data\n", __func__);
return -EINVAL;
}
- rfkill = devm_kzalloc(&pdev->dev, sizeof(*rfkill), GFP_KERNEL);
- if (!rfkill)
- return -ENOMEM;
-
- if (pdata->gpio_runtime_setup) {
+ if (pdata && pdata->gpio_runtime_setup) {
ret = pdata->gpio_runtime_setup(pdev);
if (ret) {
pr_warn("%s: can't set up gpio\n", __func__);
@@ -97,9 +108,7 @@ static int rfkill_gpio_probe(struct platform_device *pdev)
}
}
- rfkill->pdata = pdata;
-
- len = strlen(pdata->name);
+ len = strlen(rfkill->name);
rfkill->reset_name = devm_kzalloc(&pdev->dev, len + 7, GFP_KERNEL);
if (!rfkill->reset_name)
return -ENOMEM;
@@ -108,13 +117,13 @@ static int rfkill_gpio_probe(struct platform_device *pdev)
if (!rfkill->shutdown_name)
return -ENOMEM;
- snprintf(rfkill->reset_name, len + 6 , "%s_reset", pdata->name);
- snprintf(rfkill->shutdown_name, len + 9, "%s_shutdown", pdata->name);
+ snprintf(rfkill->reset_name, len + 6 , "%s_reset", rfkill->name);
+ snprintf(rfkill->shutdown_name, len + 9, "%s_shutdown", rfkill->name);
- rfkill->clk = devm_clk_get(&pdev->dev, pdata->power_clk_name);
+ rfkill->clk = devm_clk_get(&pdev->dev, clk_name);
- if (gpio_is_valid(pdata->reset_gpio)) {
- ret = devm_gpio_request_one(&pdev->dev, pdata->reset_gpio,
+ if (gpio_is_valid(rfkill->reset_gpio)) {
+ ret = devm_gpio_request_one(&pdev->dev, rfkill->reset_gpio,
0, rfkill->reset_name);
if (ret) {
pr_warn("%s: failed to get reset gpio.\n", __func__);
@@ -122,8 +131,8 @@ static int rfkill_gpio_probe(struct platform_device *pdev)
}
}
- if (gpio_is_valid(pdata->shutdown_gpio)) {
- ret = devm_gpio_request_one(&pdev->dev, pdata->shutdown_gpio,
+ if (gpio_is_valid(rfkill->shutdown_gpio)) {
+ ret = devm_gpio_request_one(&pdev->dev, rfkill->shutdown_gpio,
0, rfkill->shutdown_name);
if (ret) {
pr_warn("%s: failed to get shutdown gpio.\n", __func__);
@@ -131,8 +140,9 @@ static int rfkill_gpio_probe(struct platform_device *pdev)
}
}
- rfkill->rfkill_dev = rfkill_alloc(pdata->name, &pdev->dev, pdata->type,
- &rfkill_gpio_ops, rfkill);
+ rfkill->rfkill_dev = rfkill_alloc(rfkill->name, &pdev->dev,
+ rfkill->type, &rfkill_gpio_ops,
+ rfkill);
if (!rfkill->rfkill_dev)
return -ENOMEM;
@@ -142,7 +152,7 @@ static int rfkill_gpio_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, rfkill);
- dev_info(&pdev->dev, "%s device registered.\n", pdata->name);
+ dev_info(&pdev->dev, "%s device registered.\n", rfkill->name);
return 0;
}
@@ -152,7 +162,7 @@ static int rfkill_gpio_remove(struct platform_device *pdev)
struct rfkill_gpio_data *rfkill = platform_get_drvdata(pdev);
struct rfkill_gpio_platform_data *pdata = pdev->dev.platform_data;
- if (pdata->gpio_runtime_close)
+ if (pdata && pdata->gpio_runtime_close)
pdata->gpio_runtime_close(pdev);
rfkill_unregister(rfkill->rfkill_dev);
rfkill_destroy(rfkill->rfkill_dev);
@@ -164,8 +174,8 @@ static struct platform_driver rfkill_gpio_driver = {
.probe = rfkill_gpio_probe,
.remove = rfkill_gpio_remove,
.driver = {
- .name = "rfkill_gpio",
- .owner = THIS_MODULE,
+ .name = "rfkill_gpio",
+ .owner = THIS_MODULE,
},
};
--
1.8.4.rc3
^ permalink raw reply related
* [PATCH 5/5] net: rfkill: gpio: add ACPI support
From: Heikki Krogerus @ 2013-10-16 10:53 UTC (permalink / raw)
To: John W. Linville
Cc: Johannes Berg, Rhyland Klein, Rafael J. Wysocki, linux-acpi,
linux-wireless, netdev
In-Reply-To: <1381920823-15403-1-git-send-email-heikki.krogerus@linux.intel.com>
Including ACPI ID for Broadcom GPS receiver BCM4752.
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
net/rfkill/rfkill-gpio.c | 31 ++++++++++++++++++++++++++++++-
1 file changed, 30 insertions(+), 1 deletion(-)
diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c
index 2dd78c6..5620d3c 100644
--- a/net/rfkill/rfkill-gpio.c
+++ b/net/rfkill/rfkill-gpio.c
@@ -24,6 +24,8 @@
#include <linux/platform_device.h>
#include <linux/clk.h>
#include <linux/slab.h>
+#include <linux/acpi.h>
+#include <linux/acpi_gpio.h>
#include <linux/rfkill-gpio.h>
@@ -70,6 +72,23 @@ static const struct rfkill_ops rfkill_gpio_ops = {
.set_block = rfkill_gpio_set_power,
};
+static int rfkill_gpio_acpi_probe(struct device *dev,
+ struct rfkill_gpio_data *rfkill)
+{
+ const struct acpi_device_id *id;
+
+ id = acpi_match_device(dev->driver->acpi_match_table, dev);
+ if (!id)
+ return -ENODEV;
+
+ rfkill->name = dev_name(dev);
+ rfkill->type = (unsigned)id->driver_data;
+ rfkill->reset_gpio = acpi_get_gpio_by_index(dev, 0, NULL);
+ rfkill->shutdown_gpio = acpi_get_gpio_by_index(dev, 1, NULL);
+
+ return 0;
+}
+
static int rfkill_gpio_probe(struct platform_device *pdev)
{
struct rfkill_gpio_platform_data *pdata = pdev->dev.platform_data;
@@ -82,7 +101,11 @@ static int rfkill_gpio_probe(struct platform_device *pdev)
if (!rfkill)
return -ENOMEM;
- if (pdata) {
+ if (ACPI_HANDLE(&pdev->dev)) {
+ ret = rfkill_gpio_acpi_probe(&pdev->dev, rfkill);
+ if (ret)
+ return ret;
+ } else if (pdata) {
clk_name = pdata->power_clk_name;
rfkill->name = pdata->name;
rfkill->type = pdata->type;
@@ -170,12 +193,18 @@ static int rfkill_gpio_remove(struct platform_device *pdev)
return 0;
}
+static const struct acpi_device_id rfkill_acpi_match[] = {
+ { "BCM4752", RFKILL_TYPE_GPS },
+ { },
+};
+
static struct platform_driver rfkill_gpio_driver = {
.probe = rfkill_gpio_probe,
.remove = rfkill_gpio_remove,
.driver = {
.name = "rfkill_gpio",
.owner = THIS_MODULE,
+ .acpi_match_table = ACPI_PTR(rfkill_acpi_match),
},
};
--
1.8.4.rc3
^ permalink raw reply related
* Re: [PATCH 3/7] ath10k: track vif list internally
From: Kalle Valo @ 2013-10-16 12:47 UTC (permalink / raw)
To: Michal Kazior; +Cc: linux-wireless, ath10k
In-Reply-To: <CA+BoTQ=CqXN24Y-tb=r_ruUUNR_imcztULnoTScAvScvbPDbdA@mail.gmail.com>
Michal Kazior <michal.kazior@tieto.com> writes:
> On 15 October 2013 11:49, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
>> Kalle Valo <kvalo@qca.qualcomm.com> writes:
>>
>>> From: Michal Kazior <michal.kazior@tieto.com>
>>>
>>> mac80211 interface interations functions have
>>> peculiar locking issues. This patch introduces
>>> internal (to ath10k) vif list that will be used
>>> for vif iteration purposes.
>>>
>>> Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
>>> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
>>
>> [...]
>>
>> Michal, why do the INIT_LIST_HEAD() twice? Isn't it enough to do it
>> core_start()?
>
> Ah, good point. It's most likely okay to just do it in
> ath10k_core_start(). The one in ath10k_core_create() isn't required.
Ok, I removed the one from ath10k_core_create() before I commited this.
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH 0/7] ath10k: fix WMI atomic usage
From: Kalle Valo @ 2013-10-16 12:48 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless
In-Reply-To: <20131015184548.14123.56949.stgit@localhost6.localdomain6>
Kalle Valo <kvalo@qca.qualcomm.com> writes:
> Some WMI calls were made in atomic contex, these patches fix
> those. Please review.
>
> ---
>
> Kalle Valo (2):
> ath10k: fix ath10k_bss_assoc() to not sleep in atomic context
> ath10k: add might_sleep() to ath10k_wmi_cmd_send()
>
> Michal Kazior (5):
> ath10k: use workqueue to set WEP TX key
> ath10k: fix add_interface failure handling
> ath10k: track vif list internally
> ath10k: fix scheduling while atomic config bug
> ath10k: remove unnecessary checks
All patches applied.
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH 0/7] ath10k: fixes 2013-10-15
From: Kalle Valo @ 2013-10-16 12:56 UTC (permalink / raw)
To: Michal Kazior; +Cc: linux-wireless, ath10k
In-Reply-To: <8761sybbye.fsf@kamboji.qca.qualcomm.com>
Kalle Valo <kvalo@qca.qualcomm.com> writes:
> Michal Kazior <michal.kazior@tieto.com> writes:
>
>> This is a bunch of fixes I've had queued up for
>> some time now. I was reluctant to send them
>> without some additional checks and because some of
>> the fixes are not ideal. At least we can get a
>> discussion going if anything raises any serious
>> concern.
>>
>>
>> Michal Kazior (7):
>> ath10k: prevent starting monitor without a vdev
>> ath10k: add sanity checks for monitor management
>> ath10k: fix endianess in prints
>> ath10k: fix NSS reporting in RX
>> ath10k: fix NULL deref upon early FW crash
>> ath10k: fix device initialization routine
>> ath10k: fix FW crashes on heavy TX on 10.1.389 AP FW
>
> I get few long line warnings:
>
> drivers/net/wireless/ath/ath10k/pci.c:1842: WARNING: line over 80 characters
> drivers/net/wireless/ath/ath10k/pci.c:1844: WARNING: line over 80 characters
> drivers/net/wireless/ath/ath10k/pci.c:1847: WARNING: line over 80 characters
> drivers/net/wireless/ath/ath10k/pci.c:1848: WARNING: line over 80 characters
> drivers/net/wireless/ath/ath10k/pci.c:1856: WARNING: line over 80 characters
> drivers/net/wireless/ath/ath10k/pci.c:1875: WARNING: line over 80 characters
> drivers/net/wireless/ath/ath10k/pci.c:1877: WARNING: line over 80 characters
> drivers/net/wireless/ath/ath10k/pci.c:1883: WARNING: line over 80 characters
> drivers/net/wireless/ath/ath10k/mac.c:2284: WARNING: line over 80 characters
Michal, if it's ok for you I'll submit v2 of this patchset. I'll fix the
long line warnings and also I do small cleanup to the warm reset code.
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH 6/7] ath10k: fix device initialization routine
From: Kalle Valo @ 2013-10-16 13:31 UTC (permalink / raw)
To: Michal Kazior; +Cc: ath10k, linux-wireless
In-Reply-To: <1381858196-17000-7-git-send-email-michal.kazior@tieto.com>
Michal Kazior <michal.kazior@tieto.com> writes:
> Hardware revision 2 does not support cold reset
> correctly. As such it would sometimes lead to host
> machine freeze or data bus errors.
>
> The patch introduces warm reset function which is
> used instead of the cold reset one. It also moves
> the reset before interrupts are being set up to
> prevent any kind of spurious interrupts from being
> handled.
>
> Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
[...]
> + /* reset CE */
> + addr = ar_pci->mem + RTC_SOC_BASE_ADDRESS + SOC_RESET_CONTROL_ADDRESS;
> + val = ioread32(addr);
> + val |= SOC_RESET_CONTROL_CE_RST_MASK;
> + iowrite32(val, addr);
> + val = ioread32(addr);
> + msleep(10);
> +
> + /* unreset CE */
> + val &= ~SOC_RESET_CONTROL_CE_RST_MASK, addr;
> + iowrite32(val, addr);
This looks wrong, I assume it was supposed to be this:
val &= ~SOC_RESET_CONTROL_CE_RST_MASK;
--
Kalle Valo
^ permalink raw reply
* [PATCH v2 0/8] ath10k: fixes 2013-10-15
From: Kalle Valo @ 2013-10-16 13:45 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless
This is Michal's patchset which he said:
This is a bunch of fixes I've had queued up for
some time now. I was reluctant to send them without some additional checks
and because some of the fixes are not ideal. At least we can get a discussion
going if anything raises any serious concern.
For v2 I added one patch myself, modified "ath10k: fix device initialization
routine" to use ath10k_pci_write32() style of wrappers and fixed long line warnings
from checkpatch.
---
Kalle Valo (1):
ath10k: implement ath10k_pci_soc_read/write32()
Michal Kazior (7):
ath10k: prevent starting monitor without a vdev
ath10k: add sanity checks for monitor management
ath10k: fix endianess in prints
ath10k: fix NSS reporting in RX
ath10k: fix NULL deref upon early FW crash
ath10k: fix device initialization routine
ath10k: fix FW crashes on heavy TX on 10.1.389 AP FW
drivers/net/wireless/ath/ath10k/ce.c | 11 ++
drivers/net/wireless/ath/ath10k/core.c | 3 -
drivers/net/wireless/ath/ath10k/htt_tx.c | 11 +-
drivers/net/wireless/ath/ath10k/hw.h | 7 ++
drivers/net/wireless/ath/ath10k/mac.c | 25 +++++-
drivers/net/wireless/ath/ath10k/pci.c | 135 ++++++++++++++++++------------
drivers/net/wireless/ath/ath10k/pci.h | 20 ++++
drivers/net/wireless/ath/ath10k/txrx.c | 2
drivers/net/wireless/ath/ath10k/wmi.c | 16 ++--
9 files changed, 158 insertions(+), 72 deletions(-)
^ permalink raw reply
* [PATCH v2 1/8] ath10k: prevent starting monitor without a vdev
From: Kalle Valo @ 2013-10-16 13:45 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless
In-Reply-To: <20131016134503.25095.8044.stgit@localhost6.localdomain6>
From: Michal Kazior <michal.kazior@tieto.com>
This fixes issue with interface bridging.
Linux bridging sets promiscuous mode for all
interfaces that are in a bridge. This translates
to configure_filter() being called in a mac80211
driver.
Before the patch operational interface would be
started and upped again when promiscuous mode was
enabled causing all sorts of strange issues:
* no HTT RX happening (i.e. no traffic)
* FW crash upon driver reload/unload
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/mac.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 0b1cc51..527343d 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -2265,8 +2265,14 @@ static void ath10k_configure_filter(struct ieee80211_hw *hw,
*total_flags &= SUPPORTED_FILTERS;
ar->filter_flags = *total_flags;
+ /* Monitor must not be started if it wasn't created first.
+ * Promiscuous mode may be started on a non-monitor interface - in
+ * such case the monitor vdev is not created so starting the
+ * monitor makes no sense. Since ath10k uses no special RX filters
+ * (only BSS filter in STA mode) there's no need for any special
+ * action here. */
if ((ar->filter_flags & FIF_PROMISC_IN_BSS) &&
- !ar->monitor_enabled) {
+ !ar->monitor_enabled && ar->monitor_present) {
ath10k_dbg(ATH10K_DBG_MAC, "mac monitor %d start\n",
ar->monitor_vdev_id);
@@ -2274,7 +2280,7 @@ static void ath10k_configure_filter(struct ieee80211_hw *hw,
if (ret)
ath10k_warn("Unable to start monitor mode\n");
} else if (!(ar->filter_flags & FIF_PROMISC_IN_BSS) &&
- ar->monitor_enabled) {
+ ar->monitor_enabled && ar->monitor_present) {
ath10k_dbg(ATH10K_DBG_MAC, "mac monitor %d stop\n",
ar->monitor_vdev_id);
^ permalink raw reply related
* [PATCH v2 2/8] ath10k: add sanity checks for monitor management
From: Kalle Valo @ 2013-10-16 13:45 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless
In-Reply-To: <20131016134503.25095.8044.stgit@localhost6.localdomain6>
From: Michal Kazior <michal.kazior@tieto.com>
Add a few checks and warnings to make it easier to
track any kind of monitor vdev mismanagement.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/mac.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 527343d..da23c3f 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -516,6 +516,11 @@ static int ath10k_monitor_start(struct ath10k *ar, int vdev_id)
lockdep_assert_held(&ar->conf_mutex);
+ if (!ar->monitor_present) {
+ ath10k_warn("mac montor stop -- monitor is not present\n");
+ return -EINVAL;
+ }
+
arg.vdev_id = vdev_id;
arg.channel.freq = channel->center_freq;
arg.channel.band_center_freq1 = ar->hw->conf.chandef.center_freq1;
@@ -566,6 +571,16 @@ static int ath10k_monitor_stop(struct ath10k *ar)
lockdep_assert_held(&ar->conf_mutex);
+ if (!ar->monitor_present) {
+ ath10k_warn("mac montor stop -- monitor is not present\n");
+ return -EINVAL;
+ }
+
+ if (!ar->monitor_enabled) {
+ ath10k_warn("mac montor stop -- monitor is not enabled\n");
+ return -EINVAL;
+ }
+
ret = ath10k_wmi_vdev_down(ar, ar->monitor_vdev_id);
if (ret)
ath10k_warn("Monitor vdev down failed: %d\n", ret);
^ permalink raw reply related
* [PATCH v2 3/8] ath10k: fix endianess in prints
From: Kalle Valo @ 2013-10-16 13:45 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless
In-Reply-To: <20131016134503.25095.8044.stgit@localhost6.localdomain6>
From: Michal Kazior <michal.kazior@tieto.com>
This fixes incorrect values being printed on
big-endian hosts.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/wmi.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 77238af..a796d0b 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -2211,7 +2211,7 @@ static int ath10k_wmi_main_cmd_init(struct ath10k *ar)
}
ath10k_dbg(ATH10K_DBG_WMI, "wmi sending %d memory chunks info.\n",
- __cpu_to_le32(ar->wmi.num_mem_chunks));
+ ar->wmi.num_mem_chunks);
cmd->num_host_mem_chunks = __cpu_to_le32(ar->wmi.num_mem_chunks);
@@ -2224,10 +2224,10 @@ static int ath10k_wmi_main_cmd_init(struct ath10k *ar)
__cpu_to_le32(ar->wmi.mem_chunks[i].req_id);
ath10k_dbg(ATH10K_DBG_WMI,
- "wmi chunk %d len %d requested, addr 0x%x\n",
+ "wmi chunk %d len %d requested, addr 0x%llx\n",
i,
- cmd->host_mem_chunks[i].size,
- cmd->host_mem_chunks[i].ptr);
+ ar->wmi.mem_chunks[i].len,
+ (unsigned long long)ar->wmi.mem_chunks[i].paddr);
}
out:
memcpy(&cmd->resource_config, &config, sizeof(config));
@@ -2302,7 +2302,7 @@ static int ath10k_wmi_10x_cmd_init(struct ath10k *ar)
}
ath10k_dbg(ATH10K_DBG_WMI, "wmi sending %d memory chunks info.\n",
- __cpu_to_le32(ar->wmi.num_mem_chunks));
+ ar->wmi.num_mem_chunks);
cmd->num_host_mem_chunks = __cpu_to_le32(ar->wmi.num_mem_chunks);
@@ -2315,10 +2315,10 @@ static int ath10k_wmi_10x_cmd_init(struct ath10k *ar)
__cpu_to_le32(ar->wmi.mem_chunks[i].req_id);
ath10k_dbg(ATH10K_DBG_WMI,
- "wmi chunk %d len %d requested, addr 0x%x\n",
+ "wmi chunk %d len %d requested, addr 0x%llx\n",
i,
- cmd->host_mem_chunks[i].size,
- cmd->host_mem_chunks[i].ptr);
+ ar->wmi.mem_chunks[i].len,
+ (unsigned long long)ar->wmi.mem_chunks[i].paddr);
}
out:
memcpy(&cmd->resource_config, &config, sizeof(config));
^ permalink raw reply related
* [PATCH v2 4/8] ath10k: fix NSS reporting in RX
From: Kalle Valo @ 2013-10-16 13:45 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless
In-Reply-To: <20131016134503.25095.8044.stgit@localhost6.localdomain6>
From: Michal Kazior <michal.kazior@tieto.com>
NSTS values reported in the VHT-SIG-A1 are 0
through 7 but they actually describe number of
streams 1 through 8.
1SS frames were dropped. This patch fixes this.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/txrx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath10k/txrx.c b/drivers/net/wireless/ath/ath10k/txrx.c
index 5ae373a..c511f91 100644
--- a/drivers/net/wireless/ath/ath10k/txrx.c
+++ b/drivers/net/wireless/ath/ath10k/txrx.c
@@ -183,7 +183,7 @@ static void process_rx_rates(struct ath10k *ar, struct htt_rx_info *info,
/* VHT-SIG-A1 in info 1, VHT-SIG-A2 in info2
TODO check this */
mcs = (info2 >> 4) & 0x0F;
- nss = (info1 >> 10) & 0x07;
+ nss = ((info1 >> 10) & 0x07) + 1;
bw = info1 & 3;
sgi = info2 & 1;
^ permalink raw reply related
* [PATCH v2 5/8] ath10k: fix NULL deref upon early FW crash
From: Kalle Valo @ 2013-10-16 13:46 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless
In-Reply-To: <20131016134503.25095.8044.stgit@localhost6.localdomain6>
From: Michal Kazior <michal.kazior@tieto.com>
If firmware crashes during FW probing it would try
to perform FW recovery which uses mac80211
workqueue before registering to mac80211.
Using internal workqueue solves the problem.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/core.c | 3 ++-
drivers/net/wireless/ath/ath10k/pci.c | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 1129994..2a360ca 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -664,7 +664,8 @@ static void ath10k_core_restart(struct work_struct *work)
ieee80211_restart_hw(ar->hw);
break;
case ATH10K_STATE_OFF:
- /* this can happen if driver is being unloaded */
+ /* this can happen if driver is being unloaded
+ * or if the crash happens during FW probing */
ath10k_warn("cannot restart a device that hasn't been started\n");
break;
case ATH10K_STATE_RESTARTING:
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index f8d59c7..d09f8a2 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -777,7 +777,7 @@ static void ath10k_pci_hif_dump_area(struct ath10k *ar)
reg_dump_values[i + 2],
reg_dump_values[i + 3]);
- ieee80211_queue_work(ar->hw, &ar->restart_work);
+ queue_work(ar->workqueue, &ar->restart_work);
}
static void ath10k_pci_hif_send_complete_check(struct ath10k *ar, u8 pipe,
^ permalink raw reply related
* [PATCH v2 6/8] ath10k: implement ath10k_pci_soc_read/write32()
From: Kalle Valo @ 2013-10-16 13:46 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless
In-Reply-To: <20131016134503.25095.8044.stgit@localhost6.localdomain6>
To make it easier to access SOC registers. No functional
changes.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/pci.c | 3 +--
drivers/net/wireless/ath/ath10k/pci.h | 10 ++++++++++
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index d09f8a2..5c78383 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -2454,8 +2454,7 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
return ret;
}
- chip_id = ath10k_pci_read32(ar,
- RTC_SOC_BASE_ADDRESS + SOC_CHIP_ID_ADDRESS);
+ chip_id = ath10k_pci_soc_read32(ar, SOC_CHIP_ID_ADDRESS);
ath10k_do_pci_sleep(ar);
diff --git a/drivers/net/wireless/ath/ath10k/pci.h b/drivers/net/wireless/ath/ath10k/pci.h
index 52fb7b9..a304c33 100644
--- a/drivers/net/wireless/ath/ath10k/pci.h
+++ b/drivers/net/wireless/ath/ath10k/pci.h
@@ -318,6 +318,16 @@ static inline u32 ath10k_pci_read32(struct ath10k *ar, u32 offset)
return ioread32(ar_pci->mem + offset);
}
+static inline u32 ath10k_pci_soc_read32(struct ath10k *ar, u32 addr)
+{
+ return ath10k_pci_read32(ar, RTC_SOC_BASE_ADDRESS + addr);
+}
+
+static inline void ath10k_pci_soc_write32(struct ath10k *ar, u32 addr, u32 val)
+{
+ ath10k_pci_write32(ar, RTC_SOC_BASE_ADDRESS + addr, val);
+}
+
int ath10k_do_pci_wake(struct ath10k *ar);
void ath10k_do_pci_sleep(struct ath10k *ar);
^ permalink raw reply related
* [PATCH v2 7/8] ath10k: fix device initialization routine
From: Kalle Valo @ 2013-10-16 13:46 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless
In-Reply-To: <20131016134503.25095.8044.stgit@localhost6.localdomain6>
From: Michal Kazior <michal.kazior@tieto.com>
Hardware revision 2 does not support cold reset
correctly. As such it would sometimes lead to host
machine freeze or data bus errors.
The patch introduces warm reset function which is
used instead of the cold reset one. It also moves
the reset before interrupts are being set up to
prevent any kind of spurious interrupts from being
handled.
kvalo: use ath10k_pci_write32() style wrappers, fix long
lines
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/hw.h | 7 ++
drivers/net/wireless/ath/ath10k/pci.c | 130 ++++++++++++++++++++-------------
drivers/net/wireless/ath/ath10k/pci.h | 10 +++
3 files changed, 97 insertions(+), 50 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h
index 8aeb46d..2032737 100644
--- a/drivers/net/wireless/ath/ath10k/hw.h
+++ b/drivers/net/wireless/ath/ath10k/hw.h
@@ -204,8 +204,11 @@ enum ath10k_mcast2ucast_mode {
#define WLAN_ANALOG_INTF_PCIE_BASE_ADDRESS 0x0006c000
#define PCIE_LOCAL_BASE_ADDRESS 0x00080000
+#define SOC_RESET_CONTROL_ADDRESS 0x00000000
#define SOC_RESET_CONTROL_OFFSET 0x00000000
#define SOC_RESET_CONTROL_SI0_RST_MASK 0x00000001
+#define SOC_RESET_CONTROL_CE_RST_MASK 0x00040000
+#define SOC_RESET_CONTROL_CPU_WARM_RST_MASK 0x00000040
#define SOC_CPU_CLOCK_OFFSET 0x00000020
#define SOC_CPU_CLOCK_STANDARD_LSB 0
#define SOC_CPU_CLOCK_STANDARD_MASK 0x00000003
@@ -215,6 +218,8 @@ enum ath10k_mcast2ucast_mode {
#define SOC_LPO_CAL_OFFSET 0x000000e0
#define SOC_LPO_CAL_ENABLE_LSB 20
#define SOC_LPO_CAL_ENABLE_MASK 0x00100000
+#define SOC_LF_TIMER_CONTROL0_ADDRESS 0x00000050
+#define SOC_LF_TIMER_CONTROL0_ENABLE_MASK 0x00000004
#define SOC_CHIP_ID_ADDRESS 0x000000ec
#define SOC_CHIP_ID_REV_LSB 8
@@ -269,8 +274,10 @@ enum ath10k_mcast2ucast_mode {
#define CORE_CTRL_CPU_INTR_MASK 0x00002000
#define CORE_CTRL_ADDRESS 0x0000
#define PCIE_INTR_ENABLE_ADDRESS 0x0008
+#define PCIE_INTR_CAUSE_ADDRESS 0x000c
#define PCIE_INTR_CLR_ADDRESS 0x0014
#define SCRATCH_3_ADDRESS 0x0030
+#define CPU_INTR_ADDRESS 0x0010
/* Firmware indications to the Host via SCRATCH_3 register. */
#define FW_INDICATOR_ADDRESS (SOC_CORE_BASE_ADDRESS + SCRATCH_3_ADDRESS)
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index 5c78383..1e9cfcc9 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -52,7 +52,6 @@ static int ath10k_pci_post_rx_pipe(struct ath10k_pci_pipe *pipe_info,
int num);
static void ath10k_pci_rx_pipe_cleanup(struct ath10k_pci_pipe *pipe_info);
static void ath10k_pci_stop_ce(struct ath10k *ar);
-static void ath10k_pci_device_reset(struct ath10k *ar);
static int ath10k_pci_reset_target(struct ath10k *ar);
static int ath10k_pci_start_intr(struct ath10k *ar);
static void ath10k_pci_stop_intr(struct ath10k *ar);
@@ -1825,16 +1824,78 @@ static void ath10k_pci_fw_interrupt_handler(struct ath10k *ar)
ath10k_pci_sleep(ar);
}
-static int ath10k_pci_hif_power_up(struct ath10k *ar)
+static int ath10k_pci_warm_reset(struct ath10k *ar)
{
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
int ret;
+ u32 val;
- ret = ath10k_pci_start_intr(ar);
- if (ret) {
- ath10k_err("could not start interrupt handling (%d)\n", ret);
- goto err;
- }
+ ath10k_dbg(ATH10K_DBG_BOOT, "performing warm chip reset\n");
+
+ ret = ath10k_do_pci_wake(ar);
+ if (ret)
+ return ret;
+
+ ath10k_dbg(ATH10K_DBG_BOOT,
+ "pci intr cause 0x%08x cpu intr 0x%08x (before)\n",
+ ath10k_pci_core_read32(ar, PCIE_INTR_CAUSE_ADDRESS),
+ ath10k_pci_core_read32(ar, CPU_INTR_ADDRESS));
+
+ /* disable pending irqs */
+ ath10k_pci_core_write32(ar, PCIE_INTR_ENABLE_ADDRESS, 0);
+ ath10k_pci_core_write32(ar, PCIE_INTR_CLR_ADDRESS, ~0);
+
+ msleep(100);
+
+ /* clear fw indicator */
+ ath10k_pci_write32(ar, ar_pci->fw_indicator_address, 0);
+
+ /* clear target LF timer interrupts */
+ val = ath10k_pci_soc_read32(ar, SOC_LF_TIMER_CONTROL0_ADDRESS);
+ ath10k_pci_soc_write32(ar, SOC_LF_TIMER_CONTROL0_ADDRESS,
+ val & ~SOC_LF_TIMER_CONTROL0_ENABLE_MASK);
+
+ /* reset CE */
+ val = ath10k_pci_soc_read32(ar, SOC_RESET_CONTROL_ADDRESS);
+ val |= SOC_RESET_CONTROL_CE_RST_MASK;
+ ath10k_pci_soc_write32(ar, SOC_RESET_CONTROL_ADDRESS, val);
+ val = ath10k_pci_soc_read32(ar, SOC_RESET_CONTROL_ADDRESS);
+
+ msleep(10);
+
+ /* unreset CE */
+ val &= ~SOC_RESET_CONTROL_CE_RST_MASK;
+ ath10k_pci_soc_write32(ar, SOC_RESET_CONTROL_ADDRESS, val);
+ val = ath10k_pci_soc_read32(ar, SOC_RESET_CONTROL_ADDRESS);
+
+ msleep(10);
+
+ ath10k_dbg(ATH10K_DBG_BOOT,
+ "pci intr cause 0x%08x cpu intr 0x%08x (after)\n",
+ ath10k_pci_core_read32(ar, PCIE_INTR_CAUSE_ADDRESS),
+ ath10k_pci_core_read32(ar, CPU_INTR_ADDRESS));
+
+ /* CPU warm reset */
+ val = ath10k_pci_soc_read32(ar, SOC_RESET_CONTROL_ADDRESS);
+ ath10k_pci_soc_write32(ar, SOC_RESET_CONTROL_ADDRESS,
+ val | SOC_RESET_CONTROL_CPU_WARM_RST_MASK);
+
+ ath10k_dbg(ATH10K_DBG_BOOT, "soc reset control 0x%08x\n",
+ ath10k_pci_soc_read32(ar, SOC_RESET_CONTROL_ADDRESS));
+
+ msleep(100);
+
+ ath10k_dbg(ATH10K_DBG_BOOT, "warm reset complete\n");
+
+ ath10k_do_pci_sleep(ar);
+
+ return ret;
+}
+
+static int ath10k_pci_hif_power_up(struct ath10k *ar)
+{
+ struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
+ int ret;
/*
* Bring the target up cleanly.
@@ -1845,8 +1906,19 @@ static int ath10k_pci_hif_power_up(struct ath10k *ar)
* (aux) powered and running. On a subsequent driver load, the Target
* is in an unexpected state. We try to catch that here in order to
* reset the Target and retry the probe.
+ *
+ * Only HW v2 supports warm reset. Since ath10k does not support v1
+ * anymore just forget about cold reset which is broken on v2 for now.
*/
- ath10k_pci_device_reset(ar);
+ ret = ath10k_pci_warm_reset(ar);
+ if (ret)
+ goto err;
+
+ ret = ath10k_pci_start_intr(ar);
+ if (ret) {
+ ath10k_err("could not start interrupt handling (%d)\n", ret);
+ goto err;
+ }
ret = ath10k_pci_reset_target(ar);
if (ret)
@@ -2278,48 +2350,6 @@ static int ath10k_pci_reset_target(struct ath10k *ar)
return 0;
}
-static void ath10k_pci_device_reset(struct ath10k *ar)
-{
- int i;
- u32 val;
-
- if (!SOC_GLOBAL_RESET_ADDRESS)
- return;
-
- ath10k_pci_reg_write32(ar, PCIE_SOC_WAKE_ADDRESS,
- PCIE_SOC_WAKE_V_MASK);
- for (i = 0; i < ATH_PCI_RESET_WAIT_MAX; i++) {
- if (ath10k_pci_target_is_awake(ar))
- break;
- msleep(1);
- }
-
- /* Put Target, including PCIe, into RESET. */
- val = ath10k_pci_reg_read32(ar, SOC_GLOBAL_RESET_ADDRESS);
- val |= 1;
- ath10k_pci_reg_write32(ar, SOC_GLOBAL_RESET_ADDRESS, val);
-
- for (i = 0; i < ATH_PCI_RESET_WAIT_MAX; i++) {
- if (ath10k_pci_reg_read32(ar, RTC_STATE_ADDRESS) &
- RTC_STATE_COLD_RESET_MASK)
- break;
- msleep(1);
- }
-
- /* Pull Target, including PCIe, out of RESET. */
- val &= ~1;
- ath10k_pci_reg_write32(ar, SOC_GLOBAL_RESET_ADDRESS, val);
-
- for (i = 0; i < ATH_PCI_RESET_WAIT_MAX; i++) {
- if (!(ath10k_pci_reg_read32(ar, RTC_STATE_ADDRESS) &
- RTC_STATE_COLD_RESET_MASK))
- break;
- msleep(1);
- }
-
- ath10k_pci_reg_write32(ar, PCIE_SOC_WAKE_ADDRESS, PCIE_SOC_WAKE_RESET);
-}
-
static void ath10k_pci_dump_features(struct ath10k_pci *ar_pci)
{
int i;
diff --git a/drivers/net/wireless/ath/ath10k/pci.h b/drivers/net/wireless/ath/ath10k/pci.h
index a304c33..28e8ca2 100644
--- a/drivers/net/wireless/ath/ath10k/pci.h
+++ b/drivers/net/wireless/ath/ath10k/pci.h
@@ -328,6 +328,16 @@ static inline void ath10k_pci_soc_write32(struct ath10k *ar, u32 addr, u32 val)
ath10k_pci_write32(ar, RTC_SOC_BASE_ADDRESS + addr, val);
}
+static inline u32 ath10k_pci_core_read32(struct ath10k *ar, u32 addr)
+{
+ return ath10k_pci_read32(ar, SOC_CORE_BASE_ADDRESS + addr);
+}
+
+static inline void ath10k_pci_core_write32(struct ath10k *ar, u32 addr, u32 val)
+{
+ ath10k_pci_write32(ar, SOC_CORE_BASE_ADDRESS + addr, val);
+}
+
int ath10k_do_pci_wake(struct ath10k *ar);
void ath10k_do_pci_sleep(struct ath10k *ar);
^ permalink raw reply related
* [PATCH v2 8/8] ath10k: fix FW crashes on heavy TX on 10.1.389 AP FW
From: Kalle Valo @ 2013-10-16 13:46 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless
In-Reply-To: <20131016134503.25095.8044.stgit@localhost6.localdomain6>
From: Michal Kazior <michal.kazior@tieto.com>
10.1.389 firmware has some differences in
calculation of number of outstanding HTT TX
completions. This led to FW crashes of 10.1.389
while main firmware branch was unnaffected.
The patch makes sure ath10k doesn't queue up more
MSDUs than it should.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/ce.c | 11 +++++++++++
drivers/net/wireless/ath/ath10k/htt_tx.c | 11 ++++-------
2 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/ce.c b/drivers/net/wireless/ath/ath10k/ce.c
index e46951b..d243f28 100644
--- a/drivers/net/wireless/ath/ath10k/ce.c
+++ b/drivers/net/wireless/ath/ath10k/ce.c
@@ -1050,6 +1050,17 @@ struct ath10k_ce_pipe *ath10k_ce_init(struct ath10k *ar,
u32 ctrl_addr = ath10k_ce_base_address(ce_id);
int ret;
+ /*
+ * Make sure there's enough CE ringbuffer entries for HTT TX to avoid
+ * additional TX locking checks.
+ *
+ * For the lack of a better place do the check here.
+ */
+ BUILD_BUG_ON(TARGET_NUM_MSDU_DESC >
+ (CE_HTT_H2T_MSG_SRC_NENTRIES - 1));
+ BUILD_BUG_ON(TARGET_10X_NUM_MSDU_DESC >
+ (CE_HTT_H2T_MSG_SRC_NENTRIES - 1));
+
ret = ath10k_pci_wake(ar);
if (ret)
return NULL;
diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c
index d9335e9..f1d36d2 100644
--- a/drivers/net/wireless/ath/ath10k/htt_tx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
@@ -85,16 +85,13 @@ void ath10k_htt_tx_free_msdu_id(struct ath10k_htt *htt, u16 msdu_id)
int ath10k_htt_tx_attach(struct ath10k_htt *htt)
{
- u8 pipe;
-
spin_lock_init(&htt->tx_lock);
init_waitqueue_head(&htt->empty_tx_wq);
- /* At the beginning free queue number should hint us the maximum
- * queue length */
- pipe = htt->ar->htc.endpoint[htt->eid].ul_pipe_id;
- htt->max_num_pending_tx = ath10k_hif_get_free_queue_number(htt->ar,
- pipe);
+ if (test_bit(ATH10K_FW_FEATURE_WMI_10X, htt->ar->fw_features))
+ htt->max_num_pending_tx = TARGET_10X_NUM_MSDU_DESC;
+ else
+ htt->max_num_pending_tx = TARGET_NUM_MSDU_DESC;
ath10k_dbg(ATH10K_DBG_BOOT, "htt tx max num pending tx %d\n",
htt->max_num_pending_tx);
^ permalink raw reply related
* Re: [PATCH 0/7] ath10k: fixes 2013-10-15
From: Michal Kazior @ 2013-10-16 14:05 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless, ath10k
In-Reply-To: <87bo2p74sp.fsf@kamboji.qca.qualcomm.com>
On 16 October 2013 05:56, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
> Kalle Valo <kvalo@qca.qualcomm.com> writes:
>
>> Michal Kazior <michal.kazior@tieto.com> writes:
>>
>>> This is a bunch of fixes I've had queued up for
>>> some time now. I was reluctant to send them
>>> without some additional checks and because some of
>>> the fixes are not ideal. At least we can get a
>>> discussion going if anything raises any serious
>>> concern.
>>>
>>>
>>> Michal Kazior (7):
>>> ath10k: prevent starting monitor without a vdev
>>> ath10k: add sanity checks for monitor management
>>> ath10k: fix endianess in prints
>>> ath10k: fix NSS reporting in RX
>>> ath10k: fix NULL deref upon early FW crash
>>> ath10k: fix device initialization routine
>>> ath10k: fix FW crashes on heavy TX on 10.1.389 AP FW
>>
>> I get few long line warnings:
>>
>> drivers/net/wireless/ath/ath10k/pci.c:1842: WARNING: line over 80 characters
>> drivers/net/wireless/ath/ath10k/pci.c:1844: WARNING: line over 80 characters
>> drivers/net/wireless/ath/ath10k/pci.c:1847: WARNING: line over 80 characters
>> drivers/net/wireless/ath/ath10k/pci.c:1848: WARNING: line over 80 characters
>> drivers/net/wireless/ath/ath10k/pci.c:1856: WARNING: line over 80 characters
>> drivers/net/wireless/ath/ath10k/pci.c:1875: WARNING: line over 80 characters
>> drivers/net/wireless/ath/ath10k/pci.c:1877: WARNING: line over 80 characters
>> drivers/net/wireless/ath/ath10k/pci.c:1883: WARNING: line over 80 characters
>> drivers/net/wireless/ath/ath10k/mac.c:2284: WARNING: line over 80 characters
>
> Michal, if it's ok for you I'll submit v2 of this patchset. I'll fix the
> long line warnings and also I do small cleanup to the warm reset code.
I am totally okay with this. Thank you for your trouble.
Micał
^ permalink raw reply
* Re: [PATCH 0/7] ath10k: fixes 2013-10-15
From: Kalle Valo @ 2013-10-16 14:18 UTC (permalink / raw)
To: Michal Kazior; +Cc: linux-wireless, ath10k
In-Reply-To: <CA+BoTQ=wpEWF3sWavKSfKy4s6qW097amCt_VqbapZg-ECWOE=g@mail.gmail.com>
Michal Kazior <michal.kazior@tieto.com> writes:
> On 16 October 2013 05:56, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
>> Kalle Valo <kvalo@qca.qualcomm.com> writes:
>>
>> Michal, if it's ok for you I'll submit v2 of this patchset. I'll fix the
>> long line warnings and also I do small cleanup to the warm reset code.
>
> I am totally okay with this. Thank you for your trouble.
As you can see, I changed the warm reset code quite a lot. If you have
time, please review that carefully.
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH v2 6/8] ath10k: implement ath10k_pci_soc_read/write32()
From: Michal Kazior @ 2013-10-16 15:38 UTC (permalink / raw)
To: Kalle Valo; +Cc: ath10k, linux-wireless
In-Reply-To: <20131016134611.25095.80204.stgit@localhost6.localdomain6>
On 16 October 2013 06:46, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
> To make it easier to access SOC registers. No functional
> changes.
>
> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
> ---
> drivers/net/wireless/ath/ath10k/pci.c | 3 +--
> drivers/net/wireless/ath/ath10k/pci.h | 10 ++++++++++
> 2 files changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
> index d09f8a2..5c78383 100644
> --- a/drivers/net/wireless/ath/ath10k/pci.c
> +++ b/drivers/net/wireless/ath/ath10k/pci.c
> @@ -2454,8 +2454,7 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
> return ret;
> }
>
> - chip_id = ath10k_pci_read32(ar,
> - RTC_SOC_BASE_ADDRESS + SOC_CHIP_ID_ADDRESS);
> + chip_id = ath10k_pci_soc_read32(ar, SOC_CHIP_ID_ADDRESS);
>
> ath10k_do_pci_sleep(ar);
>
> diff --git a/drivers/net/wireless/ath/ath10k/pci.h b/drivers/net/wireless/ath/ath10k/pci.h
> index 52fb7b9..a304c33 100644
> --- a/drivers/net/wireless/ath/ath10k/pci.h
> +++ b/drivers/net/wireless/ath/ath10k/pci.h
> @@ -318,6 +318,16 @@ static inline u32 ath10k_pci_read32(struct ath10k *ar, u32 offset)
> return ioread32(ar_pci->mem + offset);
> }
>
> +static inline u32 ath10k_pci_soc_read32(struct ath10k *ar, u32 addr)
> +{
> + return ath10k_pci_read32(ar, RTC_SOC_BASE_ADDRESS + addr);
> +}
> +
> +static inline void ath10k_pci_soc_write32(struct ath10k *ar, u32 addr, u32 val)
> +{
> + ath10k_pci_write32(ar, RTC_SOC_BASE_ADDRESS + addr, val);
> +}
> +
I'm not entirely sure about this. There are a couple of soc address
groups (RTC_SOC, RTC_WMAC, SOC_PCIE, SOC_CORE, ..).
I'd rather use just raw ioread/iowrite than have all those wrappers. I
think the reason for having ath10k_pci_{read,write}32 was the HW v1
workaround. Do we really need to keep it?
Michał
^ 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