From: Kalle Valo <kvalo@kernel.org>
To: <Ajay.Kathat@microchip.com>
Cc: <linux-wireless@vger.kernel.org>, <Claudiu.Beznea@microchip.com>,
<Sripad.Balwadgi@microchip.com>, <stable@vger.kernel.org>,
<mwalle@kernel.org>
Subject: Re: [PATCH v2] wifi: wilc1000: fix kernel oops during interface down during background scan
Date: Sat, 06 May 2023 08:57:40 +0300 [thread overview]
Message-ID: <87jzxmngrv.fsf@kernel.org> (raw)
In-Reply-To: <20230505232902.22651-1-ajay.kathat@microchip.com> (Ajay Kathat's message of "Fri, 5 May 2023 23:42:51 +0000")
<Ajay.Kathat@microchip.com> writes:
> Fix for kernel crash observed with following test procedure:
> while true;
> do ifconfig wlan0 up;
> iw dev wlan0 scan &
> ifconfig wlan0 down;
> done
>
> During the above test procedure, the scan results are received from firmware
> for 'iw scan' command gets queued even when the interface is going down. It
> was causing the kernel oops when dereferencing the freed pointers.
>
> For synchronization, 'mac_close()' calls flush_workqueue() to block its
> execution till all pending work is completed. Afterwards 'wilc->close' flag
> which is set before the flush_workqueue() should avoid adding new work.
> Added 'wilc->close' check in wilc_handle_isr() which is common for
> SPI/SDIO bus to ignore the interrupts from firmware that inturns adds the
> work since the interface is getting closed.
>
> Also, removed isr_uh_routine() as it's not necessary after 'wl->close' check
> is added in wilc_handle_isr(). So now the default primary handler would be
> used for threaded IRQ.
>
> Cc: stable@vger.kernel.org
> Reported-by: Michael Walle <mwalle@kernel.org>
> Link: https://lore.kernel.org/linux-wireless/20221024135407.7udo3dwl3mqyv2yj@0002.3ffe.de/
> Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
> ---
> changes since v1:
> - updated commit description and included 'Link:' tag
> - use atomic_t type for 'close' variable
> - set close state after clearing ongoing scan operation
> - make use of default primary handler for threaded_irq
> - avoid false failure debug message during mac_close
Like I said in v1, atomic_t with only values 0 and 1 does not really
make sense.
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
prev parent reply other threads:[~2023-05-06 5:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-05 23:42 [PATCH v2] wifi: wilc1000: fix kernel oops during interface down during background scan Ajay.Kathat
2023-05-06 5:52 ` Greg KH
2023-05-09 23:56 ` Ajay.Kathat
2023-05-06 5:57 ` Kalle Valo [this message]
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=87jzxmngrv.fsf@kernel.org \
--to=kvalo@kernel.org \
--cc=Ajay.Kathat@microchip.com \
--cc=Claudiu.Beznea@microchip.com \
--cc=Sripad.Balwadgi@microchip.com \
--cc=linux-wireless@vger.kernel.org \
--cc=mwalle@kernel.org \
--cc=stable@vger.kernel.org \
/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.