Commit 19cde9c
i2c: rk3x: fix potential spinlock recursion on poll
Possible deadlock scenario (on reboot):
rk3x_i2c_xfer_common(polling)
-> rk3x_i2c_wait_xfer_poll()
-> rk3x_i2c_irq(0, i2c);
--> spin_lock(&i2c->lock);
...
<rk3x i2c interrupt>
-> rk3x_i2c_irq(0, i2c);
--> spin_lock(&i2c->lock); (deadlock here)
Store the IRQ number and disable/enable it around the polling transfer.
This patch has been tested on NanoPC-T4.
Signed-off-by: Jensen Huang <jensenhuang@friendlyarm.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Signed-off-by: Wolfram Sang <wsa@kernel.org>1 parent 043465b commit 19cde9c
1 file changed
Lines changed: 11 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| 181 | + | |
181 | 182 | | |
182 | 183 | | |
183 | 184 | | |
| |||
200 | 201 | | |
201 | 202 | | |
202 | 203 | | |
| 204 | + | |
203 | 205 | | |
204 | 206 | | |
205 | 207 | | |
| |||
1087 | 1089 | | |
1088 | 1090 | | |
1089 | 1091 | | |
1090 | | - | |
1091 | | - | |
1092 | 1092 | | |
| 1093 | + | |
| 1094 | + | |
1093 | 1095 | | |
1094 | 1096 | | |
1095 | 1097 | | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
1096 | 1101 | | |
| 1102 | + | |
| 1103 | + | |
1097 | 1104 | | |
1098 | 1105 | | |
1099 | 1106 | | |
| |||
1310 | 1317 | | |
1311 | 1318 | | |
1312 | 1319 | | |
| 1320 | + | |
| 1321 | + | |
1313 | 1322 | | |
1314 | 1323 | | |
1315 | 1324 | | |
| |||
0 commit comments