From nobody@FreeBSD.org  Tue May 12 14:45:39 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2DEB8106566C
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 12 May 2009 14:45:39 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 1DD398FC08
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 12 May 2009 14:45:39 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n4CEjcWL035089
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 12 May 2009 14:45:38 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n4CEjcFi035088;
	Tue, 12 May 2009 14:45:38 GMT
	(envelope-from nobody)
Message-Id: <200905121445.n4CEjcFi035088@www.freebsd.org>
Date: Tue, 12 May 2009 14:45:38 GMT
From: Michel Bouissou <michel.bouissou@bioclinica.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [SCSI] MPT SCSI driver probes max. 8 LUNs per device
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         134488
>Category:       kern
>Synopsis:       [mpt] MPT SCSI driver probes max. 8 LUNs per device
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-scsi
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue May 12 14:50:00 UTC 2009
>Closed-Date:    
>Last-Modified:  Wed May 13 15:00:13 UTC 2009
>Originator:     Michel Bouissou
>Release:        7.2
>Organization:
Bioclinica
>Environment:
>Description:
The MPT SCSI driver is only able to scan up to 8 LUNs (0-7) per SCSI device, which is far too few for some SCSI disks enclosures.

This issue had already been discussed in http://osdir.com/ml/os.freebsd.devel.scsi/2008-03/msg00015.html about a year ago, but it seems not to have been fixed even though the fix is easy.


>How-To-Repeat:

>Fix:
The highest LUN number that MPT will scan is hardcoded in dev/mpt/mpt_cam.c around line 3605 :

cpi->max_lun = 7;

Replacing this "7" with the number you want solves the issue (I used 32 for my needs).

But this necessitates the sysadmin to patch and recompile the kernel... Would be nice if this could default to a more sensible value than "8"...

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-scsi 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Tue May 12 19:51:36 UTC 2009 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=134488 

From: Scott Long <scottl@samsco.org>
To: bug-followup@FreeBSD.org, michel.bouissou@bioclinica.com
Cc:  
Subject: Re: kern/134488: [mpt] MPT SCSI driver probes max. 8 LUNs per device
Date: Tue, 12 May 2009 22:59:42 -0600

 Increasing the max_lun number in the code is not the solution.  Which 
 arbitrary number should be chosen?  If it's increased to 32, what about 
 those who want 64?  What about the problems created for those with older
 hardware that can't handle high lun scanning?  The correct action 
 requires a significant amount of code to be written and tested; if it
 were trivial it would have been done already.  I know this response is
 unsatisfying and slightly aloof, and I apologize for that, but right now
 it's easier to ask that admins recompile for this situation than it is
 to tear up the core SCSI scanning code.
 
 Scott

From: Michel Bouissou <mbouissou@bioimaging.com>
To: Scott Long <scottl@samsco.org>
Cc: bug-followup@FreeBSD.org
Subject: Re: kern/134488: [mpt] MPT SCSI driver probes max. 8 LUNs per
	device
Date: Wed, 13 May 2009 16:24:31 +0200

 On mar, 2009-05-12 at 22:59 -0600, Scott Long wrote:
 > Increasing the max_lun number in the code is not the solution.  Which 
 > arbitrary number should be chosen?  If it's increased to 32, what about 
 > those who want 64?
 
 Well, 8 is as much arbitrary than 32 would be, but 32 would cover a
 wider use spectrum.
 
 SCSI disks enclosures holding 16 to 20 disks are quite commonplace, and
 some show each disk as a LUN on the same SCSI device (i.e. some SCSI to
 SATA enclosures, or some RAID bays with RAID turned off to use ZFS RAID
 instead).
 
 > What about the problems created for those with older
 > hardware that can't handle high lun scanning?
 
 I'm not sure whether this exists. Possibly. My own SCSI card BIOS
 (LSILogic 1030 Ultra4 Adapter) only scans LUNs 0-7 when the system
 boots, *but* that doesn't prevent FreeBSD to use much higher LUN numbers
 when dev/mpt/mpt_cam.c is patched and recompiled for allowing so.
 
 > The correct action requires a significant amount of code to be written
 > and tested; if it were trivial it would have been done already.
 
 Maybe guessing the highest LUN number to scan according to HW type would
 be difficult, but would it be also very difficult to make this a
 parameter that could default to 8 and be set to higher values with an
 entry i.e. in /boot/loader.conf ?
 
 Would be easier than having to recompile the kernel...
 
>Unformatted:
