From: Kalle Valo <kvalo@qca.qualcomm.com>
To: Michal Kazior <michal.kazior@tieto.com>
Cc: Ben Greear <greearb@candelatech.com>, ath10k@lists.infradead.org
Subject: Re: [PATCH] ath10k: Fix crash due to tasklet race.
Date: Wed, 6 Nov 2013 13:50:51 +0200 [thread overview]
Message-ID: <87r4atsq90.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <CA+BoTQ=qUgR4TEcUMjV88RD+fFreCkkEtHfu5hB2_BguirfNHg@mail.gmail.com> (Michal Kazior's message of "Wed, 30 Oct 2013 10:03:48 +0100")
Michal Kazior <michal.kazior@tieto.com> writes:
> On 29 October 2013 22:38, <greearb@candelatech.com> wrote:
>> From: Ben Greear <greearb@candelatech.com>
>>
>> The tasklet can run after the rings have been cleaned up,
>> so check for NULL before de-referencing the ring.
>>
>> Signed-off-by: Ben Greear <greearb@candelatech.com>
>> ---
>> drivers/net/wireless/ath/ath10k/ce.c | 10 ++++++++--
>> 1 file changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/wireless/ath/ath10k/ce.c b/drivers/net/wireless/ath/ath10k/ce.c
>> index d243f28..dfcfda9 100644
>> --- a/drivers/net/wireless/ath/ath10k/ce.c
>> +++ b/drivers/net/wireless/ath/ath10k/ce.c
>> @@ -547,12 +547,18 @@ static int ath10k_ce_completed_send_next_nolock(struct ath10k_ce_pipe *ce_state,
>> struct ath10k_ce_ring *src_ring = ce_state->src_ring;
>> u32 ctrl_addr = ce_state->ctrl_addr;
>> struct ath10k *ar = ce_state->ar;
>> - unsigned int nentries_mask = src_ring->nentries_mask;
>> - unsigned int sw_index = src_ring->sw_index;
>> + unsigned int nentries_mask;
>> + unsigned int sw_index;
>> struct ce_desc *sdesc, *sbase;
>> unsigned int read_index;
>> int ret;
>>
>> + if (!src_ring)
>> + return -EIO;
>
> I don't think this is a proper way to fix the problem. What should be
> done is initialization clean up and some reordering to prevent this
> from happening in the first place.
I agree with Michal, but as we don't have any better fix for this issue
I'm inclined to take the patch anyway. Maybe there just should be a
comment stating that it's an ugly workaround and a WARN_ON() to make
sure that we properly fix the interrupt initialisation.
--
Kalle Valo
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
next prev parent reply other threads:[~2013-11-06 11:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-29 21:38 [PATCH] ath10k: Fix crash due to tasklet race greearb
2013-10-30 9:03 ` Michal Kazior
2013-11-06 11:50 ` Kalle Valo [this message]
2013-11-06 11:54 ` Michal Kazior
2013-11-06 13:06 ` Kalle Valo
2013-11-06 17:00 ` Ben Greear
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r4atsq90.fsf@kamboji.qca.qualcomm.com \
--to=kvalo@qca.qualcomm.com \
--cc=ath10k@lists.infradead.org \
--cc=greearb@candelatech.com \
--cc=michal.kazior@tieto.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.