Commit e3ed55c
usb: typec: tipd: Clear interrupts first
Right now the interrupt handler first reads all updated status registers
and only then clears the interrupts. It's possible that a duplicate
interrupt for a changed register or plug state comes in after the
interrupts have been processed but before they have been cleared:
* plug is inserted, TPS_REG_INT_PLUG_EVENT is set
* TPS_REG_INT_EVENT1 is read
* tps6598x_handle_plug_event() has run and registered the plug
* plug is removed again, TPS_REG_INT_PLUG_EVENT is set (again)
* TPS_REG_INT_CLEAR1 is written, TPS_REG_INT_PLUG_EVENT is cleared
We then have no plug connected and no pending interrupt but the tipd
core still thinks there is a plug. It's possible to trigger this with
e.g. a slightly broken Type-C to USB A converter.
Fix this by first clearing the interrupts and only then reading the
updated registers.
Fixes: 45188f2 ("usb: typec: tipd: Add support for Apple CD321X")
Fixes: 0a4c005 ("usb: typec: driver for TI TPS6598x USB Power Delivery controllers")
Cc: stable <[email protected]>
Signed-off-by: Sven Peter <[email protected]>1 parent 42ffc89 commit e3ed55c
1 file changed
Lines changed: 11 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
494 | 494 | | |
495 | 495 | | |
496 | 496 | | |
| 497 | + | |
| 498 | + | |
497 | 499 | | |
498 | | - | |
| 500 | + | |
499 | 501 | | |
500 | 502 | | |
501 | 503 | | |
502 | | - | |
| 504 | + | |
503 | 505 | | |
504 | 506 | | |
505 | 507 | | |
506 | | - | |
| 508 | + | |
507 | 509 | | |
508 | 510 | | |
509 | 511 | | |
510 | 512 | | |
511 | 513 | | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | 514 | | |
516 | 515 | | |
517 | 516 | | |
| |||
541 | 540 | | |
542 | 541 | | |
543 | 542 | | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
544 | 546 | | |
545 | | - | |
| 547 | + | |
546 | 548 | | |
547 | 549 | | |
548 | 550 | | |
549 | | - | |
| 551 | + | |
550 | 552 | | |
551 | 553 | | |
552 | 554 | | |
553 | | - | |
| 555 | + | |
554 | 556 | | |
555 | 557 | | |
556 | 558 | | |
557 | 559 | | |
558 | 560 | | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | 561 | | |
564 | 562 | | |
565 | 563 | | |
| |||
0 commit comments