[xhci] null pointer dereference on ring_doorbell_for_active_rings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello all,

i'm working on usb_autosuspend for ath9k_htc and triggered this oops. Currently i do not know if real bug is in ath9k_htc or in xhci. Same adapter with same kernel and my patches work fine on ehci host... so may be it is xhci.

i get oops on this line:
426	static void ring_doorbell_for_active_rings(struct xhci_hcd *xhci,
427			unsigned int slot_id,
428			unsigned int ep_index)
429	{
430		unsigned int stream_id;
431		struct xhci_virt_ep *ep;
432	
433		ep = &xhci->devs[slot_id]->eps[ep_index];
^^^             ^^^^^^^^^^^^^^^^^^^^^^^

changes for ath9k_htc are in attachment and photo of oops here:
https://plus.google.com/u/0/102032716864870215256/posts/a9d8nFsLhYK
--
Regards,
Oleksij
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c
index f5dda84..3d74575 100644
--- a/drivers/net/wireless/ath/ath9k/hif_usb.c
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
@@ -1368,6 +1368,7 @@ static struct usb_driver ath9k_hif_usb_driver = {
 	.suspend = ath9k_hif_usb_suspend,
 	.resume = ath9k_hif_usb_resume,
 	.reset_resume = ath9k_hif_usb_resume,
+	.supports_autosuspend = 1,
 #endif
 	.id_table = ath9k_hif_usb_ids,
 	.soft_unbind = 1,
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index 0743a47..20be8a1 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -905,6 +905,7 @@ static int ath9k_htc_start(struct ieee80211_hw *hw)
 	struct ath_hw *ah = priv->ah;
 	struct ath_common *common = ath9k_hw_common(ah);
 	struct ieee80211_channel *curchan = hw->conf.chandef.chan;
+	struct hif_device_usb *hif_dev = priv->htc->hif_dev;
 	struct ath9k_channel *init_channel;
 	int ret = 0;
 	enum htc_phymode mode;
@@ -917,6 +918,14 @@ static int ath9k_htc_start(struct ieee80211_hw *hw)
 		"Starting driver with initial channel: %d MHz\n",
 		curchan->center_freq);
 
+	ret = usb_autopm_get_interface(hif_dev->interface);
+	if (ret < 0) {
+		ath_err(common,
+			"Unable wake up hardware\n");
+		mutex_unlock(&priv->mutex);
+		return ret;
+	}
+
 	/* Ensure that HW is awake before flushing RX */
 	ath9k_htc_setpower(priv, ATH9K_PM_AWAKE);
 	WMI_CMD(WMI_FLUSH_RECV_CMDID);
@@ -972,6 +981,7 @@ static void ath9k_htc_stop(struct ieee80211_hw *hw)
 {
 	struct ath9k_htc_priv *priv = hw->priv;
 	struct ath_hw *ah = priv->ah;
+	struct hif_device_usb *hif_dev = priv->htc->hif_dev;
 	struct ath_common *common = ath9k_hw_common(ah);
 	int ret __attribute__ ((unused));
 	u8 cmd_rsp;
@@ -1022,6 +1032,8 @@ static void ath9k_htc_stop(struct ieee80211_hw *hw)
 
 	set_bit(OP_INVALID, &priv->op_flags);
 
+	usb_autopm_put_interface(hif_dev->interface);
+
 	ath_dbg(common, CONFIG, "Driver halt\n");
 	mutex_unlock(&priv->mutex);
 }


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux