All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ath9k_htc: do some initial hardware configuration
@ 2013-07-10  6:40 ` Oleksij Rempel
  0 siblings, 0 replies; 7+ messages in thread
From: Oleksij Rempel @ 2013-07-10  6:40 UTC (permalink / raw)
  To: ath9k-devel, linux-wireless; +Cc: Oleksij Rempel

Currently we configure harwdare and clock, only after
interface start. In this case, if we reload module or
reboot PC without configuring adapter, firmware will freeze.
There is no software way to reset adpter.

This patch add initial configuration and set it in
disabled state, to avoid this freeze. Behaviour of this patch
should be similar to: ifconfig wlan0 up; ifconfig wlan0 down.

Bug: https://github.com/qca/open-ath9k-htc-firmware/issues/1
Tested-by: Bo Shi <cnshibo@gmail.com>
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
---
 drivers/net/wireless/ath/ath9k/htc_drv_init.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
index 71a183f..c3676bf 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
@@ -861,6 +861,7 @@ static int ath9k_init_device(struct ath9k_htc_priv *priv,
 	if (error != 0)
 		goto err_rx;
 
+	ath9k_hw_disable(priv->ah);
 #ifdef CONFIG_MAC80211_LEDS
 	/* must be initialized before ieee80211_register_hw */
 	priv->led_cdev.default_trigger = ieee80211_create_tpt_led_trigger(priv->hw,
-- 
1.8.1.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [ath9k-devel] [PATCH 1/2] ath9k_htc: do some initial hardware configuration
@ 2013-07-10  6:40 ` Oleksij Rempel
  0 siblings, 0 replies; 7+ messages in thread
From: Oleksij Rempel @ 2013-07-10  6:40 UTC (permalink / raw)
  To: ath9k-devel

Currently we configure harwdare and clock, only after
interface start. In this case, if we reload module or
reboot PC without configuring adapter, firmware will freeze.
There is no software way to reset adpter.

This patch add initial configuration and set it in
disabled state, to avoid this freeze. Behaviour of this patch
should be similar to: ifconfig wlan0 up; ifconfig wlan0 down.

Bug: https://github.com/qca/open-ath9k-htc-firmware/issues/1
Tested-by: Bo Shi <cnshibo@gmail.com>
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
---
 drivers/net/wireless/ath/ath9k/htc_drv_init.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
index 71a183f..c3676bf 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
@@ -861,6 +861,7 @@ static int ath9k_init_device(struct ath9k_htc_priv *priv,
 	if (error != 0)
 		goto err_rx;
 
+	ath9k_hw_disable(priv->ah);
 #ifdef CONFIG_MAC80211_LEDS
 	/* must be initialized before ieee80211_register_hw */
 	priv->led_cdev.default_trigger = ieee80211_create_tpt_led_trigger(priv->hw,
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] ath9k_htc: reboot firmware if it was loaded
  2013-07-10  6:40 ` [ath9k-devel] " Oleksij Rempel
@ 2013-07-10  6:40   ` Oleksij Rempel
  -1 siblings, 0 replies; 7+ messages in thread
From: Oleksij Rempel @ 2013-07-10  6:40 UTC (permalink / raw)
  To: ath9k-devel, linux-wireless; +Cc: Oleksij Rempel

Currently ath9k_htc will reboot firmware only if interface was
ever started. Which lead to the problem in case where interface
was never started but module need to be reloaded.

This patch will partially fix bug "ath9k_htc: Target is unresponsive"
https://github.com/qca/open-ath9k-htc-firmware/issues/1

Reproduction case:
- plug adapter
- make sure nothing will touch it. Stop Networkmanager or blacklist mac address of this adapter.
- rmmod ath9k_htc; sleep 1; modprobe ath9k_htc

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
---
 drivers/net/wireless/ath/ath9k/hif_usb.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c
index 2469db5..5205a36 100644
--- a/drivers/net/wireless/ath/ath9k/hif_usb.c
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
@@ -1295,7 +1295,9 @@ static void ath9k_hif_usb_disconnect(struct usb_interface *interface)
 
 	usb_set_intfdata(interface, NULL);
 
-	if (!unplugged && (hif_dev->flags & HIF_USB_START))
+	/* If firmware was loaded we should drop it
+	 * go back to first stage bootloader. */
+	if (!unplugged && (hif_dev->flags & HIF_USB_READY))
 		ath9k_hif_usb_reboot(udev);
 
 	kfree(hif_dev);
-- 
1.8.1.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [ath9k-devel] [PATCH 2/2] ath9k_htc: reboot firmware if it was loaded
@ 2013-07-10  6:40   ` Oleksij Rempel
  0 siblings, 0 replies; 7+ messages in thread
From: Oleksij Rempel @ 2013-07-10  6:40 UTC (permalink / raw)
  To: ath9k-devel

Currently ath9k_htc will reboot firmware only if interface was
ever started. Which lead to the problem in case where interface
was never started but module need to be reloaded.

This patch will partially fix bug "ath9k_htc: Target is unresponsive"
https://github.com/qca/open-ath9k-htc-firmware/issues/1

Reproduction case:
- plug adapter
- make sure nothing will touch it. Stop Networkmanager or blacklist mac address of this adapter.
- rmmod ath9k_htc; sleep 1; modprobe ath9k_htc

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
---
 drivers/net/wireless/ath/ath9k/hif_usb.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c
index 2469db5..5205a36 100644
--- a/drivers/net/wireless/ath/ath9k/hif_usb.c
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
@@ -1295,7 +1295,9 @@ static void ath9k_hif_usb_disconnect(struct usb_interface *interface)
 
 	usb_set_intfdata(interface, NULL);
 
-	if (!unplugged && (hif_dev->flags & HIF_USB_START))
+	/* If firmware was loaded we should drop it
+	 * go back to first stage bootloader. */
+	if (!unplugged && (hif_dev->flags & HIF_USB_READY))
 		ath9k_hif_usb_reboot(udev);
 
 	kfree(hif_dev);
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] ath9k_htc: reboot firmware if it was loaded
  2013-07-10  6:40   ` [ath9k-devel] " Oleksij Rempel
@ 2013-07-10 19:27     ` Adrian Chadd
  -1 siblings, 0 replies; 7+ messages in thread
From: Adrian Chadd @ 2013-07-10 19:27 UTC (permalink / raw)
  To: Oleksij Rempel; +Cc: ath9k-devel, linux-wireless

Great catch!


-adrian

On 9 July 2013 23:40, Oleksij Rempel <linux@rempel-privat.de> wrote:
> Currently ath9k_htc will reboot firmware only if interface was
> ever started. Which lead to the problem in case where interface
> was never started but module need to be reloaded.
>
> This patch will partially fix bug "ath9k_htc: Target is unresponsive"
> https://github.com/qca/open-ath9k-htc-firmware/issues/1
>
> Reproduction case:
> - plug adapter
> - make sure nothing will touch it. Stop Networkmanager or blacklist mac address of this adapter.
> - rmmod ath9k_htc; sleep 1; modprobe ath9k_htc
>
> Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
> ---
>  drivers/net/wireless/ath/ath9k/hif_usb.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c
> index 2469db5..5205a36 100644
> --- a/drivers/net/wireless/ath/ath9k/hif_usb.c
> +++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
> @@ -1295,7 +1295,9 @@ static void ath9k_hif_usb_disconnect(struct usb_interface *interface)
>
>         usb_set_intfdata(interface, NULL);
>
> -       if (!unplugged && (hif_dev->flags & HIF_USB_START))
> +       /* If firmware was loaded we should drop it
> +        * go back to first stage bootloader. */
> +       if (!unplugged && (hif_dev->flags & HIF_USB_READY))
>                 ath9k_hif_usb_reboot(udev);
>
>         kfree(hif_dev);
> --
> 1.8.1.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ath9k-devel] [PATCH 2/2] ath9k_htc: reboot firmware if it was loaded
@ 2013-07-10 19:27     ` Adrian Chadd
  0 siblings, 0 replies; 7+ messages in thread
From: Adrian Chadd @ 2013-07-10 19:27 UTC (permalink / raw)
  To: ath9k-devel

Great catch!


-adrian

On 9 July 2013 23:40, Oleksij Rempel <linux@rempel-privat.de> wrote:
> Currently ath9k_htc will reboot firmware only if interface was
> ever started. Which lead to the problem in case where interface
> was never started but module need to be reloaded.
>
> This patch will partially fix bug "ath9k_htc: Target is unresponsive"
> https://github.com/qca/open-ath9k-htc-firmware/issues/1
>
> Reproduction case:
> - plug adapter
> - make sure nothing will touch it. Stop Networkmanager or blacklist mac address of this adapter.
> - rmmod ath9k_htc; sleep 1; modprobe ath9k_htc
>
> Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
> ---
>  drivers/net/wireless/ath/ath9k/hif_usb.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c
> index 2469db5..5205a36 100644
> --- a/drivers/net/wireless/ath/ath9k/hif_usb.c
> +++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
> @@ -1295,7 +1295,9 @@ static void ath9k_hif_usb_disconnect(struct usb_interface *interface)
>
>         usb_set_intfdata(interface, NULL);
>
> -       if (!unplugged && (hif_dev->flags & HIF_USB_START))
> +       /* If firmware was loaded we should drop it
> +        * go back to first stage bootloader. */
> +       if (!unplugged && (hif_dev->flags & HIF_USB_READY))
>                 ath9k_hif_usb_reboot(udev);
>
>         kfree(hif_dev);
> --
> 1.8.1.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] ath9k_htc: do some initial hardware configuration
  2013-07-19 18:16 [PATCH 0/2] ath9k_htc fixes, resend Oleksij Rempel
@ 2013-07-19 18:16 ` Oleksij Rempel
  0 siblings, 0 replies; 7+ messages in thread
From: Oleksij Rempel @ 2013-07-19 18:16 UTC (permalink / raw)
  To: linux-wireless, ath9k-devel, linville; +Cc: Oleksij Rempel

Currently we configure harwdare and clock, only after
interface start. In this case, if we reload module or
reboot PC without configuring adapter, firmware will freeze.
There is no software way to reset adpter.

This patch add initial configuration and set it in
disabled state, to avoid this freeze. Behaviour of this patch
should be similar to: ifconfig wlan0 up; ifconfig wlan0 down.

Bug: https://github.com/qca/open-ath9k-htc-firmware/issues/1
Tested-by: Bo Shi <cnshibo@gmail.com>
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
---
 drivers/net/wireless/ath/ath9k/htc_drv_init.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
index 71a183f..c3676bf 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
@@ -861,6 +861,7 @@ static int ath9k_init_device(struct ath9k_htc_priv *priv,
 	if (error != 0)
 		goto err_rx;
 
+	ath9k_hw_disable(priv->ah);
 #ifdef CONFIG_MAC80211_LEDS
 	/* must be initialized before ieee80211_register_hw */
 	priv->led_cdev.default_trigger = ieee80211_create_tpt_led_trigger(priv->hw,
-- 
1.8.1.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-07-19 18:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-10  6:40 [PATCH 1/2] ath9k_htc: do some initial hardware configuration Oleksij Rempel
2013-07-10  6:40 ` [ath9k-devel] " Oleksij Rempel
2013-07-10  6:40 ` [PATCH 2/2] ath9k_htc: reboot firmware if it was loaded Oleksij Rempel
2013-07-10  6:40   ` [ath9k-devel] " Oleksij Rempel
2013-07-10 19:27   ` Adrian Chadd
2013-07-10 19:27     ` [ath9k-devel] " Adrian Chadd
2013-07-19 18:16 [PATCH 0/2] ath9k_htc fixes, resend Oleksij Rempel
2013-07-19 18:16 ` [PATCH 1/2] ath9k_htc: do some initial hardware configuration Oleksij Rempel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.