From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: linux-usb@vger.kernel.org
Cc: Michael Jamet <michael.jamet@intel.com>,
Yehezkel Bernat <YehezkelShB@gmail.com>,
Andreas Noever <andreas.noever@gmail.com>,
Chiranjeevi Rapolu <chiranjeevi.rapolu@intel.com>,
Lukas Wunner <lukas@wunner.de>
Subject: Re: [PATCH 1/2] thunderbolt: Initialize HopID IDAs in tb_switch_alloc()
Date: Mon, 8 Mar 2021 13:30:50 +0200 [thread overview]
Message-ID: <20210308113050.GF2542@lahna.fi.intel.com> (raw)
In-Reply-To: <20210303121310.80937-1-mika.westerberg@linux.intel.com>
On Wed, Mar 03, 2021 at 03:13:09PM +0300, Mika Westerberg wrote:
> If there is a failure before the tb_switch_add() is called the switch
> object is released by tb_switch_release() but at that point HopID IDAs
> have not yet been initialized. So we see splat like this:
>
> BUG: spinlock bad magic on CPU#2, kworker/u8:5/115
> ...
> Workqueue: thunderbolt0 tb_handle_hotplug
> Call Trace:
> dump_stack+0x97/0xdc
> ? spin_bug+0x9a/0xa7
> do_raw_spin_lock+0x68/0x98
> _raw_spin_lock_irqsave+0x3f/0x5d
> ida_destroy+0x4f/0x127
> tb_switch_release+0x6d/0xfd
> device_release+0x2c/0x7d
> kobject_put+0x9b/0xbc
> tb_handle_hotplug+0x278/0x452
> process_one_work+0x1db/0x396
> worker_thread+0x216/0x375
> kthread+0x14d/0x155
> ? pr_cont_work+0x58/0x58
> ? kthread_blkcg+0x2e/0x2e
> ret_from_fork+0x1f/0x40
>
> Fix this by always initializing HopID IDAs in tb_switch_alloc().
>
> Fixes: 0b2863ac3cfd ("thunderbolt: Add functions for allocating and releasing HopIDs")
> Cc: stable@vger.kernel.org
> Reported-by: Chiranjeevi Rapolu <chiranjeevi.rapolu@intel.com>
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Applied this and the 2/2 to thunderbolt.git/fixes.
prev parent reply other threads:[~2021-03-08 11:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-03 12:13 [PATCH 1/2] thunderbolt: Initialize HopID IDAs in tb_switch_alloc() Mika Westerberg
2021-03-03 12:13 ` [PATCH 2/2] thunderbolt: Increase runtime PM reference count on DP tunnel discovery Mika Westerberg
2021-03-08 11:30 ` Mika Westerberg [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=20210308113050.GF2542@lahna.fi.intel.com \
--to=mika.westerberg@linux.intel.com \
--cc=YehezkelShB@gmail.com \
--cc=andreas.noever@gmail.com \
--cc=chiranjeevi.rapolu@intel.com \
--cc=linux-usb@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=michael.jamet@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).