drivers/usbhost: Do not disable an xHCI port while probing it.

xhci_probe_ports() wrote PORTSC back to clear the change bits, including
PED, which is write-one-to-clear.  A port that came up enabled, which is
what a device attached at power up produces, was switched off by the act
of reading it.

Mask PED out of the value written back.  The port status worker already
does this.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Justin Hammond <justin@dynam.ac>
This commit is contained in:
Justin Hammond 2026-08-16 17:09:58 +08:00 • committed by Xiang Xiao
parent 648aa30e37
commit e03c23c4ae

View file

@ -1291,8 +1291,13 @@ static void xhci_probe_ports(FAR struct usbhost_xhci_s *priv)
portsc = xhci_oper_getreg(priv, XHCI_PORTSC(i));
priv->rhport[i].connected = ((portsc & XHCI_PORTSC_CCS) != 0);
/* Clear status change */
/* Clear status change, but not PED. Port Enabled/Disabled is
* write-one-to-clear, so writing back what was read disables any
* port that came up enabled, which is what a device attached at
* power up does.
*/
portsc &= ~XHCI_PORTSC_PED;
xhci_oper_putreg(priv, XHCI_PORTSC(i), portsc);
}
}