All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Lawrence <joe.lawrence@stratus.com>
To: Timothy Pearson <tpearson@raptorengineeringinc.com>
Cc: Nagalakshmi Nandigama <Nagalakshmi.Nandigama@lsi.com>,
	Sreekanth Reddy <Sreekanth.Reddy@lsi.com>,
	support@lsi.com, DL-MPTFusionLinux@lsi.com,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH] mpt2sas: Abort initialization if no memory I/O resources, detected
Date: Mon, 22 Jun 2015 23:54:44 -0400	[thread overview]
Message-ID: <5588D884.7030804@stratus.com> (raw)
In-Reply-To: <55870668.4070405@raptorengineeringinc.com>



On 06/21/2015 02:46 PM, Timothy Pearson wrote:
> On 06/16/2015 01:49 PM, Timothy Pearson wrote:
>> On 06/16/2015 12:42 PM, Joe Lawrence wrote:
>>> On 06/16/2015 12:28 PM, Timothy Pearson wrote:
>>>> On 06/12/2015 05:05 PM, Timothy Pearson wrote:
>>>>> 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<tpearson@raptorengineeringinc.com>
>>>>> Tested-by: Timothy Pearson<tpearson@raptorengineeringinc.com>
>>>>> ---
>>>>> drivers/scsi/mpt2sas/mpt2sas_base.c | 9 +++++++++
>>>>> 1 file changed, 9 insertions(+)
>>>>>
>>>>> 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);
>>>>>
>>>>> r = _base_get_ioc_facts(ioc, CAN_SLEEP);
>>>>
>>>> Just following up on this patch as I have not yet received any
>>>> response.
>>>>
>>>> Thanks!
>>>
>>> Hi Tim -- just curious, why was the similar check on ioc->chip just a
>>> few lines above the one added by the patch insufficient?
>>>
>>> That loop block sets memap_sz when it finds an IORESOURCE_MEM so that it
>>> only sets ioc->chip once. I wonder if the fix might be simpler if the
>>> existing ioc->chip check relocated entirely to where you put it (maybe
>>> also pulling the entire error text onto one line for easier grepping).
>>>
>>> Regards,
>>>
>>> -- Joe
>>
>> If there are no IORESOURCE_MEM resources allocated by the BIOS (i.e. if
>> the BIOS does not run resource allocation on the mpt2sas device) then
>> the check you are referring to is not executed, and the driver attempts
>> to perform operations on a null ioc->chip pointer.
>>
>> I can relocate the check if desired.
>>
> 
> On looking more closely at the code I think having the two separate
> checks is useful for debugging.  The first error message is triggered if
> the resource exists but Linux cannot map it for some reason, and the
> second error message is triggered if the resource does not exist at all
> (buggy BIOS).

Fair enough.  The two error messages are unique, so grepping will lead
to the correct check.

Only other nits would be the addition of a copyright (up to Avago I
guess) and an mpt3sas version (these drivers are 99% the same code).

Acked-by: Joe Lawrence <joe.lawrence@stratus.com>

-- Joe

  reply	other threads:[~2015-06-23 12:30 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-12 22:05 [PATCH] mpt2sas: Abort initialization if no memory I/O resources, detected Timothy Pearson
2015-06-16 16:28 ` Timothy Pearson
2015-06-16 17:42   ` Joe Lawrence
2015-06-16 18:49     ` Timothy Pearson
2015-06-21 18:46       ` Timothy Pearson
2015-06-23  3:54         ` Joe Lawrence [this message]
2015-06-23 12:36           ` Sreekanth Reddy
2015-06-23 13:35             ` James Bottomley
2015-06-23 13:49               ` Sreekanth Reddy
2015-06-23 17:33               ` Timothy Pearson
2015-06-23 17:45                 ` James Bottomley
2015-06-23 17:47                   ` Timothy Pearson
2015-06-23 17:56                     ` James Bottomley
2015-06-23 17:59                       ` Timothy Pearson
2015-06-23 18:19                         ` James Bottomley
     [not found]                           ` <421649124.3142.1435087707382.JavaMail.zimbra@raptorengineeringinc.com>
2015-06-23 19:28                             ` [PATCH v2] mpt2sas: Abort initialization if no memory I/O resources detected Timothy Pearson
2015-06-28  1:30                               ` Timothy Pearson
2015-06-28  9:41                                 ` Sreekanth Reddy
     [not found]                           ` <216113403.3157.1435087917094.JavaMail.zimbra@raptorengineeringinc.com>
2015-06-23 19:32                             ` [PATCH] mpt3sas: " Timothy Pearson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5588D884.7030804@stratus.com \
    --to=joe.lawrence@stratus.com \
    --cc=DL-MPTFusionLinux@lsi.com \
    --cc=Nagalakshmi.Nandigama@lsi.com \
    --cc=Sreekanth.Reddy@lsi.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=support@lsi.com \
    --cc=tpearson@raptorengineeringinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.