Commit dfae9a2
HID: mcp2221: Don't set bus speed on every transfer
commit 02a4675 upstream.
Since the initial commit of this driver the I2C bus speed has been
reconfigured for every single transfer. This is despite the fact that we
never change the speed and it is never "lost" by the chip.
Upon investigation we find that what was really happening was that the
setting of the bus speed had the side effect of cancelling a previous
failed command if there was one, thereby freeing the bus. This is the
part that was actually required to keep the bus operational in the face
of failed commands.
Instead of always setting the speed, we now correctly cancel any failed
commands as they are detected. This means we can just set the bus speed
at probe time and remove the previous speed sets on each transfer.
This has the effect of improving performance and reducing the number of
commands required to complete transfers.
Signed-off-by: Hamish Martin <hamish.martin@alliedtelesis.co.nz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Fixes: 67a95c2 ("HID: mcp2221: add usb to i2c-smbus host bridge")
[romain.sioen@microchip.com: backport to stable, up to 6.8. Add "Fixes" tag]
Signed-off-by: Romain Sioen <romain.sioen@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 407ae39 commit dfae9a2
1 file changed
Lines changed: 27 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
172 | 191 | | |
173 | 192 | | |
174 | 193 | | |
| |||
223 | 242 | | |
224 | 243 | | |
225 | 244 | | |
226 | | - | |
| 245 | + | |
227 | 246 | | |
228 | 247 | | |
229 | 248 | | |
| |||
290 | 309 | | |
291 | 310 | | |
292 | 311 | | |
293 | | - | |
| 312 | + | |
294 | 313 | | |
295 | 314 | | |
296 | 315 | | |
| |||
310 | 329 | | |
311 | 330 | | |
312 | 331 | | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | 332 | | |
319 | 333 | | |
320 | 334 | | |
| |||
399 | 413 | | |
400 | 414 | | |
401 | 415 | | |
402 | | - | |
403 | | - | |
404 | | - | |
| 416 | + | |
405 | 417 | | |
406 | 418 | | |
407 | 419 | | |
| |||
419 | 431 | | |
420 | 432 | | |
421 | 433 | | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | 434 | | |
427 | 435 | | |
428 | 436 | | |
| |||
870 | 878 | | |
871 | 879 | | |
872 | 880 | | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
873 | 886 | | |
874 | 887 | | |
875 | 888 | | |
| |||
0 commit comments