mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 14:13:01 -04:00
msm: pcie: use a local copy for PCIe event callback
Instead of directly modifying client's callback event, make a local copy and give that to the client. This will prevent race condition where the latest event is updated before the client has had the chance to see the previous event. Change-Id: Icb77471e71d48095eaa2610da26c22a161ff02e2 Signed-off-by: Tony Truong <truong@codeaurora.org>
This commit is contained in:
parent
3a82802e7b
commit
e203df245d
1 changed files with 6 additions and 3 deletions
|
|
@ -4690,12 +4690,15 @@ static void msm_pcie_notify_client(struct msm_pcie_dev_t *dev,
|
|||
if (dev->event_reg && dev->event_reg->callback &&
|
||||
(dev->event_reg->events & event)) {
|
||||
struct msm_pcie_notify *notify = &dev->event_reg->notify;
|
||||
struct msm_pcie_notify client_notify;
|
||||
|
||||
notify->event = event;
|
||||
notify->user = dev->event_reg->user;
|
||||
client_notify.event = event;
|
||||
client_notify.user = notify->user;
|
||||
client_notify.data = notify->data;
|
||||
client_notify.options = notify->options;
|
||||
PCIE_DUMP(dev, "PCIe: callback RC%d for event %d\n",
|
||||
dev->rc_idx, event);
|
||||
dev->event_reg->callback(notify);
|
||||
dev->event_reg->callback(&client_notify);
|
||||
|
||||
if ((dev->event_reg->options & MSM_PCIE_CONFIG_NO_RECOVERY) &&
|
||||
(event == MSM_PCIE_EVENT_LINKDOWN)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue