From patchwork Fri Jun 12 22:05:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timothy Pearson X-Patchwork-Id: 6601141 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 70891C0020 for ; Fri, 12 Jun 2015 22:13:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 62A462034A for ; Fri, 12 Jun 2015 22:13:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BBDAC20303 for ; Fri, 12 Jun 2015 22:13:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751198AbbFLWNG (ORCPT ); Fri, 12 Jun 2015 18:13:06 -0400 Received: from pearsoncomputing.net ([192.119.205.242]:64137 "EHLO mail.pearsoncomputing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752818AbbFLWNF (ORCPT ); Fri, 12 Jun 2015 18:13:05 -0400 X-Greylist: delayed 480 seconds by postgrey-1.27 at vger.kernel.org; Fri, 12 Jun 2015 18:13:04 EDT Received: from localhost (localhost [127.0.0.1]) by mail.pearsoncomputing.net (Postfix) with ESMTP id 245B5640FC5; Fri, 12 Jun 2015 17:05:03 -0500 (CDT) Received: from mail.pearsoncomputing.net ([127.0.0.1]) by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id fmv6Iht4GEE9; Fri, 12 Jun 2015 17:05:02 -0500 (CDT) Received: from localhost (localhost [127.0.0.1]) by mail.pearsoncomputing.net (Postfix) with ESMTP id 7327B640FC6; Fri, 12 Jun 2015 17:05:02 -0500 (CDT) DKIM-Filter: OpenDKIM Filter v2.9.2 mail.pearsoncomputing.net 7327B640FC6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raptorengineeringinc.com; s=5DF8A618-71A7-11E4-BA59-1A98DAB8A1D6; t=1434146702; bh=rdfa50Ur6ZWUOrcKvphHSU9Ir3eH/ezgyWTq7tti4ZU=; h=Message-ID:Date:From:MIME-Version:To:Subject:Content-Type: Content-Transfer-Encoding; b=ViVvG4OuodcWt4JVkgzcJCgUkUMgc4tmUwcfh7APkwmcfmmc1xH9lFO1V2tTmYL6V XkcV5gHMN/wKvx7q0qeDCdJBvSLt7J/fxmNpv3qcFviH7WRx195VpTRhI6PaUwMXva 89aMpPSC6b9soYd9ZIRPpCUT+peiurjYDeEzIDoo= X-Virus-Scanned: amavisd-new at pearsoncomputing.net Received: from mail.pearsoncomputing.net ([127.0.0.1]) by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 8ZjSiZ61D2cr; Fri, 12 Jun 2015 17:05:02 -0500 (CDT) Received: from [192.168.3.54] (apollo.starlink.edu [192.168.3.54]) by mail.pearsoncomputing.net (Postfix) with ESMTP id 1CB56640FC5; Fri, 12 Jun 2015 17:05:02 -0500 (CDT) Message-ID: <557B578D.50706@raptorengineeringinc.com> Date: Fri, 12 Jun 2015 17:05:01 -0500 From: Timothy Pearson User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100922 Thunderbird/3.1.4 MIME-Version: 1.0 To: Nagalakshmi Nandigama , Sreekanth Reddy , support@lsi.com, DL-MPTFusionLinux@lsi.com, linux-scsi@vger.kernel.org Subject: [PATCH] mpt2sas: Abort initialization if no memory I/O resources, detected Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The mpt2sas driver crashes if the BIOS does not set up at least one memory I/O resource. This failure can happen if the device is too slow to respond during POST and is missed by the BIOS, but Linux then detects the device later in the boot process. This patch aborts initialization and prints a warning if no memory I/O resources are found. Signed-off-by: Timothy Pearson Tested-by: Timothy Pearson Acked-by: Joe Lawrence --- drivers/scsi/mpt2sas/mpt2sas_base.c | 9 +++++++++ 1 file changed, 9 insertions(+) r = _base_get_ioc_facts(ioc, CAN_SLEEP); diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c index 11248de..15c9504 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_base.c +++ b/drivers/scsi/mpt2sas/mpt2sas_base.c @@ -6,6 +6,8 @@ * Copyright (C) 2007-2014 LSI Corporation * Copyright (C) 20013-2014 Avago Technologies * (mailto: MPT-FusionLinux.pdl@avagotech.com) + * Copyright (C) 2015 Raptor Engineering + * (mailto: support@araptorengineeringinc.com) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -1582,6 +1584,13 @@ mpt2sas_base_map_resources(struct MPT2SAS_ADAPTER *ioc) } } + if (ioc->chip == NULL) { + printk(MPT2SAS_ERR_FMT "unable to map " + "adapter memory (resource not found)!\n", ioc->name); + r = -EINVAL; + goto out_fail; + } + _base_mask_interrupts(ioc);