From patchwork Wed Oct 1 21:59:27 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kirsher, Jeffrey T" X-Patchwork-Id: 2309 X-Patchwork-Delegate: jgarzik@pobox.com Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 73ADBDDF40 for ; Thu, 2 Oct 2008 07:59:54 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752649AbYJAV7u (ORCPT ); Wed, 1 Oct 2008 17:59:50 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753330AbYJAV7u (ORCPT ); Wed, 1 Oct 2008 17:59:50 -0400 Received: from qmta06.emeryville.ca.mail.comcast.net ([76.96.30.56]:46136 "EHLO QMTA06.emeryville.ca.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752297AbYJAV7t (ORCPT ); Wed, 1 Oct 2008 17:59:49 -0400 Received: from OMTA02.emeryville.ca.mail.comcast.net ([76.96.30.19]) by QMTA06.emeryville.ca.mail.comcast.net with comcast id MPhz1a0020QkzPwA6ZzoAP; Wed, 01 Oct 2008 21:59:48 +0000 Received: from gitlost.lost ([63.64.152.142]) by OMTA02.emeryville.ca.mail.comcast.net with comcast id MZzU1a00634bfcX8NZzWbT; Wed, 01 Oct 2008 21:59:45 +0000 X-Authority-Analysis: v=1.0 c=1 a=2B_ph8y7SmQA:10 a=JtYzIfCwiGoA:10 a=g88OuNbixt_eM4yeKigA:9 a=lhUA_mnYWP3S6-CjUoFe54U8CAIA:4 a=dGJ0OcVc7YAA:10 a=iYlkOlhu7C0A:10 From: Jeff Kirsher Subject: [NET-NEXT PATCH] ixgb: fix bug when freeing resources To: jeff@garzik.org Cc: davem@davemloft.net, netdev@vger.kernel.org, Jesse Brandeburg , Jeff Kirsher , Breno Leitao Date: Wed, 01 Oct 2008 14:59:27 -0700 Message-ID: <20081001215927.21799.53359.stgit@gitlost.lost> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jesse Brandeburg It was pointed out by Breno Leitao that ixgb would crash on PPC when an IOMMU was in use, if change_mtu was called. It appears to be a pretty simple issue in the driver that wasn't discovered because most systems don't run with an IOMMU. The driver needs to only unmap buffers that are mapped (duh). Signed-off-by: Jesse Brandeburg Signed-off-by: Jeff Kirsher CC: Breno Leitao --- drivers/net/ixgb/ixgb_main.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" 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/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c index aa75385..be3c7dc 100644 --- a/drivers/net/ixgb/ixgb_main.c +++ b/drivers/net/ixgb/ixgb_main.c @@ -977,15 +977,17 @@ ixgb_clean_rx_ring(struct ixgb_adapter *adapter) for (i = 0; i < rx_ring->count; i++) { buffer_info = &rx_ring->buffer_info[i]; - if (buffer_info->skb) { - + if (buffer_info->dma) { pci_unmap_single(pdev, buffer_info->dma, buffer_info->length, PCI_DMA_FROMDEVICE); + buffer_info->dma = 0; + buffer_info->length = 0; + } + if (buffer_info->skb) { dev_kfree_skb(buffer_info->skb); - buffer_info->skb = NULL; } }