mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 20:33:58 -04:00
Merge "mhi: core: Make sure reg_write_q stores visible to other cores"
This commit is contained in:
commit
bcf1293b7c
1 changed files with 14 additions and 0 deletions
|
|
@ -118,7 +118,21 @@ static void mhi_reg_write_enqueue(struct mhi_controller *mhi_cntrl,
|
|||
|
||||
mhi_cntrl->reg_write_q[q_index].reg_addr = reg_addr;
|
||||
mhi_cntrl->reg_write_q[q_index].val = val;
|
||||
|
||||
/*
|
||||
* prevent reordering to make sure val is set before valid is set to
|
||||
* true. This prevents offload worker running on another core to write
|
||||
* stale value to register with valid set to true.
|
||||
*/
|
||||
smp_wmb();
|
||||
|
||||
mhi_cntrl->reg_write_q[q_index].valid = true;
|
||||
|
||||
/*
|
||||
* make sure valid value is visible to other cores to prevent offload
|
||||
* worker from skipping the reg write.
|
||||
*/
|
||||
smp_wmb();
|
||||
}
|
||||
|
||||
void mhi_write_reg_offload(struct mhi_controller *mhi_cntrl,
|
||||
|
|
|
|||
Loading…
Reference in a new issue