From patchwork Thu Feb 26 10:04:54 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sosnowski, Maciej" X-Patchwork-Id: 23761 X-Patchwork-Delegate: davem@davemloft.net 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 21B48DDDFA for ; Thu, 26 Feb 2009 21:13:43 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755762AbZBZKNj (ORCPT ); Thu, 26 Feb 2009 05:13:39 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756058AbZBZKNj (ORCPT ); Thu, 26 Feb 2009 05:13:39 -0500 Received: from mga11.intel.com ([192.55.52.93]:42350 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756045AbZBZKNh (ORCPT ); Thu, 26 Feb 2009 05:13:37 -0500 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 26 Feb 2009 02:11:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.38,270,1233561600"; d="scan'208";a="434322852" Received: from gklab-190-232.igk.intel.com (HELO linux.site) ([172.28.190.232]) by fmsmga002.fm.intel.com with ESMTP; 26 Feb 2009 02:09:25 -0800 From: Maciej Sosnowski Subject: [PATCH 3/7] I/OAT: fail initialization on zero channels detection To: dan.j.williams@intel.com Cc: snakebyte@gmx.de, shannon.nelson@intel.com, jeffrey.t.krisher@intel.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Date: Thu, 26 Feb 2009 11:04:54 +0100 Message-ID: <20090226100446.3615.46026.stgit@linux.site> In-Reply-To: <20090226100327.3615.21419.stgit@linux.site> References: <20090226100327.3615.21419.stgit@linux.site> User-Agent: StGIT/0.13 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On some systems with I/OAT ver.2 when DCA is disabled in BIOS situations have been observed that zero DMA channels are detected instead of four. To avoid kernel panic driver should fail gracefully with appropriate message. Signed-off-by: Maciej Sosnowski Signed-off-by: Shannon Nelson Acked-by: Jeff Kirsher --- drivers/dma/ioat_dma.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 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/dma/ioat_dma.c b/drivers/dma/ioat_dma.c index 879f4a0..9012da7 100644 --- a/drivers/dma/ioat_dma.c +++ b/drivers/dma/ioat_dma.c @@ -1659,6 +1659,13 @@ struct ioatdma_device *ioat_dma_probe(st " %d channels, device version 0x%02x, driver version %s\n", device->common.chancnt, device->version, IOAT_DMA_VERSION); + if (!device->common.chancnt) { + dev_err(&device->pdev->dev, + "Intel(R) I/OAT DMA Engine problem found: " + "zero channels detected\n"); + goto err_setup_interrupts; + } + err = ioat_dma_setup_interrupts(device); if (err) goto err_setup_interrupts;