To work around a boot issue with the AR6234, I discovered a few
instances where error cleanup code is not working as expected.
A full solution for the boot issue is being worked up, but in the
mean time these fixes make error cleanup work properly.
James Minor (3):
ath6kl: fix busreqs so they can be reused when sg is cleaned up
ath6kl: after cleanup properly reflect that sg is disabled
ath6kl: configure SDIO when power is reapplied
drivers/net/wireless/ath/ath6kl/sdio.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
--
1.9.1
James Minor <[email protected]> wrote:
> To reuse the busreqs in case of hardware restart, they must be
> properly reinitialized. If the scat_req pointer isn't reset to
> 0, __ath6kl_sdio_write_async() will assume there is sg work to be
> done (causing a kernel OOPS).
>
> Signed-off-by: James Minor <[email protected]>
> Reviewed-by: Steve deRosier <[email protected]>
3 patches applied to ath-next branch of ath.git, thanks.
3605d751d5dd ath6kl: fix busreqs so they can be reused when sg is cleaned up
db14b18a73a1 ath6kl: after cleanup properly reflect that sg is disabled
fdb6e4839e3a ath6kl: configure SDIO when power is reapplied
--
https://patchwork.kernel.org/patch/9360777/
Documentation about submitting wireless patches and checking status
from patchwork:
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
To reuse the busreqs in case of hardware restart, they must be
properly reinitialized. If the scat_req pointer isn't reset to
0, __ath6kl_sdio_write_async() will assume there is sg work to be
done (causing a kernel OOPS).
Signed-off-by: James Minor <[email protected]>
Reviewed-by: Steve deRosier <[email protected]>
---
drivers/net/wireless/ath/ath6kl/sdio.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath6kl/sdio.c b/drivers/net/wireless/ath/ath6kl/sdio.c
index eab0ab9..96ed060 100644
--- a/drivers/net/wireless/ath/ath6kl/sdio.c
+++ b/drivers/net/wireless/ath/ath6kl/sdio.c
@@ -703,8 +703,10 @@ static void ath6kl_sdio_cleanup_scatter(struct ath6kl *ar)
* ath6kl_hif_rw_comp_handler() with status -ECANCELED so
* that the packet is properly freed?
*/
- if (s_req->busrequest)
+ if (s_req->busrequest) {
+ s_req->busrequest->scat_req = 0;
ath6kl_sdio_free_bus_req(ar_sdio, s_req->busrequest);
+ }
kfree(s_req->virt_dma_buf);
kfree(s_req->sgentries);
kfree(s_req);
--
1.9.1
This allows the hardware to be restarted, as it will cause the
sg to be reinitialized.
Signed-off-by: James Minor <[email protected]>
Reviewed-by: Steve deRosier <[email protected]>
---
drivers/net/wireless/ath/ath6kl/sdio.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/wireless/ath/ath6kl/sdio.c b/drivers/net/wireless/ath/ath6kl/sdio.c
index 96ed060..8261e24 100644
--- a/drivers/net/wireless/ath/ath6kl/sdio.c
+++ b/drivers/net/wireless/ath/ath6kl/sdio.c
@@ -714,6 +714,8 @@ static void ath6kl_sdio_cleanup_scatter(struct ath6kl *ar)
spin_lock_bh(&ar_sdio->scat_lock);
}
spin_unlock_bh(&ar_sdio->scat_lock);
+
+ ar_sdio->scatter_enabled = false;
}
/* setup of HIF scatter resources */
--
1.9.1
When power is removed from the device, all of the SDIO settings
return to default. Fix that by reconfiguring after power is
applied.
Signed-off-by: James Minor <[email protected]>
Reviewed-by: Steve deRosier <[email protected]>
---
drivers/net/wireless/ath/ath6kl/sdio.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/net/wireless/ath/ath6kl/sdio.c b/drivers/net/wireless/ath/ath6kl/sdio.c
index 8261e24..c2df075 100644
--- a/drivers/net/wireless/ath/ath6kl/sdio.c
+++ b/drivers/net/wireless/ath/ath6kl/sdio.c
@@ -75,6 +75,8 @@ struct ath6kl_sdio {
#define CMD53_ARG_FIXED_ADDRESS 0
#define CMD53_ARG_INCR_ADDRESS 1
+static int ath6kl_sdio_config(struct ath6kl *ar);
+
static inline struct ath6kl_sdio *ath6kl_sdio_priv(struct ath6kl *ar)
{
return ar->hif_priv;
@@ -526,8 +528,15 @@ static int ath6kl_sdio_power_on(struct ath6kl *ar)
*/
msleep(10);
+ ret = ath6kl_sdio_config(ar);
+ if (ret) {
+ ath6kl_err("Failed to config sdio: %d\n", ret);
+ goto out;
+ }
+
ar_sdio->is_disabled = false;
+out:
return ret;
}
--
1.9.1