Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 476a357f authored by Rajat Jain's avatar Rajat Jain Committed by Bjorn Helgaas
Browse files

PCI: pciehp: Acknowledge spurious "cmd completed" event



In case of a spurious "cmd completed", pcie_write_cmd() does not clear it,
but yet expects more "cmd completed" events to be generated.  This does not
happen because the previous (spurious) event has not been acknowledged.
Fix that.

Signed-off-by: default avatarRajat Jain <rajatxjain@gmail.com>
Signed-off-by: default avatarRajat Jain <rajatjain@juniper.net>
Signed-off-by: default avatarGuenter Roeck <groeck@juniper.net>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent 17f830bb
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -159,6 +159,8 @@ static void pcie_write_cmd(struct controller *ctrl, u16 cmd, u16 mask)


	pcie_capability_read_word(pdev, PCI_EXP_SLTSTA, &slot_status);
	pcie_capability_read_word(pdev, PCI_EXP_SLTSTA, &slot_status);
	if (slot_status & PCI_EXP_SLTSTA_CC) {
	if (slot_status & PCI_EXP_SLTSTA_CC) {
		pcie_capability_write_word(pdev, PCI_EXP_SLTSTA,
					   PCI_EXP_SLTSTA_CC);
		if (!ctrl->no_cmd_complete) {
		if (!ctrl->no_cmd_complete) {
			/*
			/*
			 * After 1 sec and CMD_COMPLETED still not set, just
			 * After 1 sec and CMD_COMPLETED still not set, just