Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F173726771
D60078.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D60078.diff
View Options
diff --git a/sys/dev/iwm/if_iwm_pcie_trans.h b/sys/dev/iwm/if_iwm_pcie_trans.h
--- a/sys/dev/iwm/if_iwm_pcie_trans.h
+++ b/sys/dev/iwm/if_iwm_pcie_trans.h
@@ -128,6 +128,7 @@
extern void iwm_apm_config(struct iwm_softc *sc);
extern int iwm_apm_init(struct iwm_softc *sc);
extern void iwm_apm_stop(struct iwm_softc *sc);
+extern int iwm_clear_persistence_bit(struct iwm_softc *sc);
extern int iwm_start_hw(struct iwm_softc *sc);
extern void iwm_set_pwr(struct iwm_softc *sc);
extern int iwm_pcie_rx_stop(struct iwm_softc *sc);
diff --git a/sys/dev/iwm/if_iwm_pcie_trans.c b/sys/dev/iwm/if_iwm_pcie_trans.c
--- a/sys/dev/iwm/if_iwm_pcie_trans.c
+++ b/sys/dev/iwm/if_iwm_pcie_trans.c
@@ -620,6 +620,26 @@
IWM_DPRINTF(sc, IWM_DEBUG_TRANS, "%s: iwm apm stop\n", __func__);
}
+int
+iwm_clear_persistence_bit(struct iwm_softc *sc)
+{
+ uint32_t hpm, wprot;
+
+ hpm = iwm_read_prph(sc, IWM_HPM_DEBUG);
+ if (hpm != 0xa5a5a5a0 && (hpm & IWM_HPM_PERSISTENCE_BIT)) {
+ wprot = iwm_read_prph(sc, IWM_PREG_PRPH_WPROT_9000);
+ if (wprot & IWM_PREG_WFPM_ACCESS) {
+ device_printf(sc->sc_dev,
+ "cannot clear persistence bit\n");
+ return EPERM;
+ }
+ iwm_write_prph(sc, IWM_HPM_DEBUG,
+ hpm & ~IWM_HPM_PERSISTENCE_BIT);
+ }
+
+ return 0;
+}
+
/* iwlwifi pcie/trans.c */
int
iwm_start_hw(struct iwm_softc *sc)
@@ -629,6 +649,11 @@
if ((error = iwm_prepare_card_hw(sc)) != 0)
return error;
+ if (sc->cfg->device_family == IWM_DEVICE_FAMILY_9000) {
+ if ((error = iwm_clear_persistence_bit(sc)) != 0)
+ return error;
+ }
+
/* Reset the entire device */
IWM_WRITE(sc, IWM_CSR_RESET, IWM_CSR_RESET_REG_FLAG_SW_RESET);
DELAY(5000);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Sep 28, 11:46 PM (1 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
39830543
Default Alt Text
D60078.diff (1 KB)
Attached To
Mode
D60078: iwm: clear persistence bit on 9000 series NICs
Attached
Detach File
Event Timeline
Log In to Comment