Skip to contentSkip to conversation

usb: host: xhci-hub: drop redundant PORTSC register read

PATCH New Sergey Shtylyov 1 participant 1 message Feb 14, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 usb: host: xhci-hub: drop redundant PORTSC register read

In xhci_hub_control(), there are many PORTSC register readbacks in several branches of the *switch* statement which get duplicated right after that *switch* by reading back that register once more -- which is done to flush the posted writes. Drop that redundant PORTSC readback...

Found by Linux Verification Center (linuxtesting.org) with the SVACE static analysis tool.

---
This patch is against the 'usb-next' branch of Greg KH's 'usb.git' repo.

Changes in version 2:
- dropped the register readback after the *switch* not inside it, updated the patch description/subject accordingly;
- added the reigster name in the patch description/subject.

 drivers/usb/host/xhci-hub.c |    2 --
 1 file changed, 2 deletions(-)
drivers/usb/host/xhci-hub.c +0 -2
Index: usb/drivers/usb/host/xhci-hub.c
===================================================================
@@ -1522,8 +1522,6 @@ int xhci_hub_control(struct usb_hcd *hcd
 		default:
 			goto error;
 		}
-		/* unblock any posted writes */
-		temp = readl(ports[wIndex]->addr);
 		break;
 	case ClearPortFeature:
 		if (!wIndex || wIndex > max_ports)