Message ID | 5497516A.2020400@lwfinger.net (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
Hi, To get your patched version to work at all I had to update _rtl_pci_init_rx_ring() to account for new return value of _rtl_pci_init_one_rxdesc(). I will let you know if anything shows up in the kernel log, but I expect this is a highly sporadic problem. The system has 4 GB of memory, and I used the 3.18 kernel for 10 days prior to the panic with no issues. The panic occurred while upgrading system packages, so it's possible jhat the system was experiencing memory pressure. I upgraded from 3.17 to 3.18 on Dec 8, so I've actually only had since then to notice any bugs that may have been introduced since 3.17. It does appear there were changes made to pci.c between 3.17 and 3.18. It appears the 3.17 code will drop the incoming packet if a new skb can't be allocated, whereas the 3.18 code assumes a new skb can always be allocated. The 3.17 behavior seems more logical to me. I don't know how either of these behaviors compare to other networking drivers, however. Eric -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 12/21/2014 05:47 PM, Eric Biggers wrote: > Hi, > > To get your patched version to work at all I had to update > _rtl_pci_init_rx_ring() to account for new return value of > _rtl_pci_init_one_rxdesc(). I will let you know if anything shows up in the > kernel log, but I expect this is a highly sporadic problem. The system has 4 GB > of memory, and I used the 3.18 kernel for 10 days prior to the panic with no > issues. The panic occurred while upgrading system packages, so it's possible > jhat the system was experiencing memory pressure. > > I upgraded from 3.17 to 3.18 on Dec 8, so I've actually only had since then to > notice any bugs that may have been introduced since 3.17. > > It does appear there were changes made to pci.c between 3.17 and 3.18. It > appears the 3.17 code will drop the incoming packet if a new skb can't be > allocated, whereas the 3.18 code assumes a new skb can always be allocated. The > 3.17 behavior seems more logical to me. I don't know how either of these > behaviors compare to other networking drivers, however. Sorry about missing the necessary changes in the rest of the driver. That is what I get for only compile testing. I reviewed the 3.17 => 3.18 changes and found the difference in the logic that you noticed, and I missed earlier. As a result, I need to push this change for 3.19 with the notation for updating of 3.18. You have probably received this patch already. As it needs to be backported, I decided to forgo changing the return value of _rtl_pci_init_one_rxdesc(). That change should be made, but there is no emergency there. Thanks, Larry -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c index 846a2e6..c576c71 100644 --- a/drivers/net/wireless/rtlwifi/pci.c +++ b/drivers/net/wireless/rtlwifi/pci.c @@ -676,7 +676,7 @@ static int _rtl_pci_init_one_rxdesc(struct ieee80211_hw *hw, skb = dev_alloc_skb(rtlpci->rxbuffersize); if (!skb) - return 0; + return -ENOMEM;; rtlpci->rx_ring[rxring_idx].rx_buf[desc_idx] = skb; /* just set skb->cb to mapping addr for pci_unmap_single use */ @@ -685,7 +685,7 @@ static int _rtl_pci_init_one_rxdesc(struct ieee80211_hw *hw, rtlpci->rxbuffersize, PCI_DMA_FROMDEVICE); bufferaddress = *((dma_addr_t *)skb->cb); if (pci_dma_mapping_error(rtlpci->pdev, bufferaddress)) - return 0; + return -EFAULT; if (rtlpriv->use_new_trx_flow) { rtlpriv->cfg->ops->set_desc(hw, (u8 *)entry, false, HW_DESC_RX_PREPARE, @@ -701,7 +701,7 @@ static int _rtl_pci_init_one_rxdesc(struct ieee80211_hw *hw, HW_DESC_RXOWN, (u8 *)&tmp_one); } - return 1; + return 0; } /* inorder to receive 8K AMSDU we have set skb to @@ -768,6 +768,7 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) .signal = 0, .rate = 0, }; + int err; /*RX NORMAL PKT */ while (count--) { @@ -912,13 +913,21 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) } end: if (rtlpriv->use_new_trx_flow) { - _rtl_pci_init_one_rxdesc(hw, (u8 *)buffer_desc, - rxring_idx, - rtlpci->rx_ring[rxring_idx].idx); + err = _rtl_pci_init_one_rxdesc(hw, (u8 *)buffer_desc, + rxring_idx, + rtlpci->rx_ring[rxring_idx].idx); + if (err) { + pr_err("%s Failed to init RX descriptor\n"); + return; + } } else { - _rtl_pci_init_one_rxdesc(hw, (u8 *)pdesc, rxring_idx, - rtlpci->rx_ring[rxring_idx].idx); - + err = _rtl_pci_init_one_rxdesc(hw, (u8 *)pdesc, + rxring_idx, + rtlpci->rx_ring[rxring_idx].idx); + if (err) { + pr_err("%s Failed to init RX descriptor\n"); + return; + } if (rtlpci->rx_ring[rxring_idx].idx == rtlpci->rxringcount - 1) rtlpriv->cfg->ops->set_desc(hw, (u8 *)pdesc,