From patchwork Tue Jun 23 19:28:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timothy Pearson X-Patchwork-Id: 6662961 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5EBB19F380 for ; Tue, 23 Jun 2015 19:28:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7A39B2058C for ; Tue, 23 Jun 2015 19:28:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4834220591 for ; Tue, 23 Jun 2015 19:28:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754900AbbFWT2t (ORCPT ); Tue, 23 Jun 2015 15:28:49 -0400 Received: from pearsoncomputing.net ([192.119.205.242]:47343 "EHLO mail.pearsoncomputing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754877AbbFWT2s (ORCPT ); Tue, 23 Jun 2015 15:28:48 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.pearsoncomputing.net (Postfix) with ESMTP id 3EB03640EB5; Tue, 23 Jun 2015 14:28:47 -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 5Gjve4mo4tSt; Tue, 23 Jun 2015 14:28:46 -0500 (CDT) Received: from localhost (localhost [127.0.0.1]) by mail.pearsoncomputing.net (Postfix) with ESMTP id AB97C640EB9; Tue, 23 Jun 2015 14:28:46 -0500 (CDT) DKIM-Filter: OpenDKIM Filter v2.9.2 mail.pearsoncomputing.net AB97C640EB9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raptorengineeringinc.com; s=5DF8A618-71A7-11E4-BA59-1A98DAB8A1D6; t=1435087726; bh=qGudAXZQKD6l7PTxG8l7J0UNLz/AuJYhn0G0GxuRACM=; h=Date:From:To:Message-ID:Subject:MIME-Version:Content-Type: Content-Transfer-Encoding; b=k2aS2KtiGXSQ3UKjm0aPvE9rNI8bwA1vup0os2LOOdrURyE9B4o8Mz3g/3ypbRBWE Y5IcefBEjNxn/ViofjImtC/UljiXfIl5+1zEBsjK55LOHpNYhMC5IbjSxQrXlm/zX2 x6jf8i01iJawd1H/swfqMZ4vi9EwRAp4v+D0/iqc= 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 iSp3jfUN_9DZ; Tue, 23 Jun 2015 14:28:46 -0500 (CDT) Received: from vali.starlink.edu (vali.starlink.edu [192.168.3.21]) by mail.pearsoncomputing.net (Postfix) with ESMTP id 6DD28640EB5; Tue, 23 Jun 2015 14:28:46 -0500 (CDT) Date: Tue, 23 Jun 2015 14:28:44 -0500 (CDT) From: Timothy Pearson To: James Bottomley Cc: Sreekanth Reddy , Joe Lawrence , Nagalakshmi Nandigama , Sreekanth Reddy , "Support (LSI)" , DL-MPTFusionLinux@lsi.com, linux-scsi@vger.kernel.org Message-ID: <1752241556.3143.1435087724484.JavaMail.zimbra@raptorengineeringinc.com> In-Reply-To: <421649124.3142.1435087707382.JavaMail.zimbra@raptorengineeringinc.com> References: <557B578D.50706@raptorengineeringinc.com> <1435066507.2251.10.camel@HansenPartnership.com> <55899867.3010400@raptorengineeringinc.com> <1435081516.2251.118.camel@HansenPartnership.com> <55899BBA.5030509@raptorengineeringinc.com> <1435082169.2251.120.camel@HansenPartnership.com> <55899E79.1010208@raptorengineeringinc.com> <1435083585.2251.125.camel@HansenPartnership.com> Subject: [PATCH v2] mpt2sas: Abort initialization if no memory I/O resources detected MIME-Version: 1.0 X-Originating-IP: [192.168.3.54] X-Mailer: Zimbra 8.5.0_GA_3042 (ZimbraWebClient - FF3.6 (Linux)/8.5.0_GA_3042) Thread-Topic: mpt2sas: Abort initialization if no memory I/O resources detected Thread-Index: KgPmvfvZ9HhK4XL34uQ6nSYbOVVjSA== Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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. Signed-off-by: Timothy Pearson Tested-by: Timothy Pearson --- drivers/scsi/mpt2sas/mpt2sas_base.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c index 11248de..b70fa5a 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_base.c +++ b/drivers/scsi/mpt2sas/mpt2sas_base.c @@ -1582,6 +1582,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); r = _base_get_ioc_facts(ioc, CAN_SLEEP);