-
Notifications
You must be signed in to change notification settings - Fork 108
[Deepin-Kernel-SIG] [linux 6.6.y] [Upstream] Sync bugfix for intel mei from upstream #1492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: linux-6.6.y
Are you sure you want to change the base?
Changes from all commits
f424a8f
176e572
9294100
0503237
1aa7468
e1fb824
997e81e
cdfb939
3e3da29
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -18,6 +18,7 @@ | |||||||
| #include <linux/platform_device.h> | ||||||||
| #include <linux/spi/spi.h> | ||||||||
| #include <linux/types.h> | ||||||||
| #include <linux/workqueue.h> | ||||||||
|
|
||||||||
| #include "vsc-tp.h" | ||||||||
|
|
||||||||
|
|
@@ -72,12 +73,12 @@ struct vsc_tp { | |||||||
|
|
||||||||
| atomic_t assert_cnt; | ||||||||
| wait_queue_head_t xfer_wait; | ||||||||
| struct work_struct event_work; | ||||||||
|
|
||||||||
| vsc_tp_event_cb_t event_notify; | ||||||||
| void *event_notify_context; | ||||||||
|
|
||||||||
| /* used to protect command download */ | ||||||||
| struct mutex mutex; | ||||||||
| struct mutex event_notify_mutex; /* protects event_notify + context */ | ||||||||
| struct mutex mutex; /* protects command download */ | ||||||||
| }; | ||||||||
|
|
||||||||
| /* GPIO resources */ | ||||||||
|
|
@@ -102,17 +103,19 @@ static irqreturn_t vsc_tp_isr(int irq, void *data) | |||||||
|
|
||||||||
| wake_up(&tp->xfer_wait); | ||||||||
|
|
||||||||
| return IRQ_WAKE_THREAD; | ||||||||
| schedule_work(&tp->event_work); | ||||||||
|
|
||||||||
| return IRQ_HANDLED; | ||||||||
| } | ||||||||
|
|
||||||||
| static irqreturn_t vsc_tp_thread_isr(int irq, void *data) | ||||||||
| static void vsc_tp_event_work(struct work_struct *work) | ||||||||
| { | ||||||||
| struct vsc_tp *tp = data; | ||||||||
| struct vsc_tp *tp = container_of(work, struct vsc_tp, event_work); | ||||||||
|
|
||||||||
| guard(mutex)(&tp->event_notify_mutex); | ||||||||
|
|
||||||||
| if (tp->event_notify) | ||||||||
| tp->event_notify(tp->event_notify_context); | ||||||||
|
|
||||||||
| return IRQ_HANDLED; | ||||||||
| } | ||||||||
|
|
||||||||
| /* wakeup firmware and wait for response */ | ||||||||
|
|
@@ -364,8 +367,6 @@ void vsc_tp_reset(struct vsc_tp *tp) | |||||||
| gpiod_set_value_cansleep(tp->wakeupfw, 1); | ||||||||
|
|
||||||||
| atomic_set(&tp->assert_cnt, 0); | ||||||||
|
||||||||
| atomic_set(&tp->assert_cnt, 0); | |
| atomic_set(&tp->assert_cnt, 0); | |
| enable_irq(tp->spi->irq); |
Copilot
AI
Feb 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
request_threaded_irq() is switched to run vsc_tp_isr() as the threaded handler, but vsc_tp_request_irq() (used by suspend/resume) still references the removed vsc_tp_thread_isr, which will cause a build failure. Please update vsc_tp_request_irq() to match the new IRQ registration pattern (primary handler NULL, threaded handler vsc_tp_isr()) or reintroduce the missing handler as appropriate.
Copilot
AI
Feb 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In vsc_tp_probe(), the IRQ is requested before event_notify_mutex is initialized and before INIT_WORK(&tp->event_work, ...). Since the IRQ handler schedules tp->event_work, an interrupt firing immediately after request_threaded_irq() can queue/execute an uninitialized work item and use an uninitialized mutex. Initialize the mutex and work_struct before requesting the IRQ, or request the IRQ with IRQF_NO_AUTOEN and explicitly enable it after initialization.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since VSC events are now delivered via
vsc_tp's workqueue,mei_stop()/mei_reset()no longer implicitly synchronize with the event callback (it used to run in the IRQ thread). Inmei_vsc_remove(), the callback is unset only aftermei_stop(), leaving a window where a previously queued VSC event-work item can still runmei_vsc_event_cb()while teardown is in progress. Consider unsetting the callback before callingmei_stop()(and similarly in other teardown paths) so that any queued work will observe a NULL callback and exit quickly.