Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F111044874
D6363.id16321.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D6363.id16321.diff
View Options
Index: sys/dev/pci/pci_pci.c
===================================================================
--- sys/dev/pci/pci_pci.c
+++ sys/dev/pci/pci_pci.c
@@ -891,20 +891,23 @@
return;
}
- if (sc->flags & PCIB_HOTPLUG_CMD_PENDING) {
- sc->pcie_pending_link_ctl_val &= ~mask;
- sc->pcie_pending_link_ctl_val |= val;
- sc->pcie_pending_link_ctl_mask |= mask;
- } else {
- ctl = pcie_read_config(dev, PCIER_SLOT_CTL, 2);
- new = (ctl & ~mask) | val;
- if (new != ctl) {
- pcie_write_config(dev, PCIER_SLOT_CTL, ctl, 2);
- sc->flags |= PCIB_HOTPLUG_CMD_PENDING;
- if (!cold)
- callout_reset(&sc->pcie_cc_timer, hz,
- pcib_pcie_cc_timeout, sc);
- }
+ sc->pcie_pending_link_ctl_val &= ~mask;
+ sc->pcie_pending_link_ctl_val |= val;
+ sc->pcie_pending_link_ctl_mask |= mask;
+ if (sc->flags & PCIB_HOTPLUG_CMD_PENDING)
+ return;
+
+ ctl = pcie_read_config(dev, PCIER_SLOT_CTL, 2);
+ new = (ctl & ~sc->pcie_pending_link_ctl_mask) |
+ sc->pcie_pending_link_ctl_val;
+ sc->pcie_pending_link_ctl_mask = 0;
+ sc->pcie_pending_link_ctl_val = 0;
+ if (new != ctl) {
+ pcie_write_config(dev, PCIER_SLOT_CTL, ctl, 2);
+ sc->flags |= PCIB_HOTPLUG_CMD_PENDING;
+ if (!cold)
+ callout_reset(&sc->pcie_cc_timer, hz,
+ pcib_pcie_cc_timeout, sc);
}
}
@@ -912,7 +915,6 @@
pcib_pcie_hotplug_command_completed(struct pcib_softc *sc)
{
device_t dev;
- uint16_t ctl, new;
dev = sc->dev;
@@ -920,23 +922,8 @@
device_printf(dev, "Command Completed\n");
if (!(sc->flags & PCIB_HOTPLUG_CMD_PENDING))
return;
- if (sc->pcie_pending_link_ctl_mask != 0) {
- ctl = pcie_read_config(dev, PCIER_SLOT_CTL, 2);
- new = ctl & ~sc->pcie_pending_link_ctl_mask;
- new |= sc->pcie_pending_link_ctl_val;
- if (new != ctl) {
- pcie_write_config(dev, PCIER_SLOT_CTL, ctl, 2);
- if (!cold)
- callout_reset(&sc->pcie_cc_timer, hz,
- pcib_pcie_cc_timeout, sc);
- } else
- sc->flags &= ~PCIB_HOTPLUG_CMD_PENDING;
- sc->pcie_pending_link_ctl_mask = 0;
- sc->pcie_pending_link_ctl_val = 0;
- } else {
- callout_stop(&sc->pcie_cc_timer);
- sc->flags &= ~PCIB_HOTPLUG_CMD_PENDING;
- }
+ callout_stop(&sc->pcie_cc_timer);
+ sc->flags &= ~PCIB_HOTPLUG_CMD_PENDING;
}
/*
@@ -1040,11 +1027,10 @@
* Interlock.
*/
if (sc->pcie_slot_cap & PCIEM_SLOT_CAP_EIP) {
+ mask |= PCIEM_SLOT_CTL_EIC;
if (card_inserted !=
- !(sc->pcie_slot_sta & PCIEM_SLOT_STA_EIS)) {
- mask |= PCIEM_SLOT_CTL_EIC;
+ !(sc->pcie_slot_sta & PCIEM_SLOT_STA_EIS))
val |= PCIEM_SLOT_CTL_EIC;
- }
}
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Feb 27, 3:47 PM (18 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16870839
Default Alt Text
D6363.id16321.diff (2 KB)
Attached To
Mode
D6363: Rework managing hotplug commands with command completions.
Attached
Detach File
Event Timeline
Log In to Comment