Bug 13141

Summary: [scsi] Multiple LUN support in NCR driver is broken.
Product: Base System Reporter: tobi <tobi>
Component: kernAssignee: Stefan Eßer <se>
Status: Closed Unable to Reproduce    
Severity: Affects Only Me    
Priority: Normal    
Version: 3.2-STABLE   
Hardware: Any   
OS: Any   

Description tobi 1999-08-14 18:30:00 UTC
I am using an Asus SC-200 scsi card with NCR 810 chip, which
is probed as follows:

/kernel: ncr0: <ncr 53c810a fast10 scsi> rev 0x12 int a irq 12 on pci0.14.0

I have a Pioneer DRM 624X CD changer connected to this
controller.  The changer presents 6 multiple LUNS, which are
recognise as cd0 until cd5 and can be independently used, in
theory. Here is how the Pioneer is probed (note that for this 
example, it was connected to an Adaptec controller instead):

/kernel: cd0 at aha0 bus 0 target 6 lun 0
/kernel: cd0: <PIONEER CD-ROM DRM-624X 1.08> Removable CD-ROM SCSI-2 device
/kernel: cd1 at aha0 bus 0 target 6 lun 1
/kernel: cd1: <PIONEER CD-ROM DRM-624X 1.08> Removable CD-ROM SCSI-2 device
[...]

The problem is that the NCR support for multiple LUNs is 
severly broken. As soon as I try to access any of the cd 
devices, I get messages about "CCB already dequeued", and 
am even able to bring the system to a complete halt, e.g. 
if trying to access two devices simultaneously.

On the one hand, if I connect the CD changer to an Adaptec
1542, everything works expected:  No messages about CCBs, no
kernel panics, no system halts, even if two CDs are accessed
simultaneously.  Also, if I connect the CD changer to the
Asus SC200, but use a different operating system (e.g.:
OS/2), everything works as suspected.  So I conclude it must
be a problem in the FreeBSD NCR driver.

Fix: 

Nearly same problem existed in FreeBSD 2.2.5.  At that time,
I reported it informally to the owner of the ncr driver code
at that time.  I never got a response, but after I did an
upgrade to 2.2.7, the problem was solved.  It worked until
I upgraded to 3.x (in my case, 3.1-RELEASE).  Probably, the
fixes that had been applied to the NCR driver between 2.2.5
and 2.2.7 have not been migrated up to the 3.x branch.
Maybe this helps in finding the problem.
How-To-Repeat: Connect a multiple LUN device (a CD changer if possible) to
an NCR 810 - based controller and try to access the first
LUN (by mounting a CD from it), and then the second (by
mounting another CD without unmounting the first).  This
should already trigger the bug, but if not, just try to
access the second CD while copying files from the first CD
to hard disk.  (The expected result is that at least one of
the two processes terminates with an error code).
Comment 1 se 1999-08-16 10:26:37 UTC
On 1999-08-14 10:27 -0700, tobi@bland.fido.de wrote:
> /kernel: ncr0: <ncr 53c810a fast10 scsi> rev 0x12 int a irq 12 on pci0.14.0
> 
> I have a Pioneer DRM 624X CD changer connected to this
> controller.  The changer presents 6 multiple LUNS, which are
> recognise as cd0 until cd5 and can be independently used, in
> theory. Here is how the Pioneer is probed (note that for this 
> example, it was connected to an Adaptec controller instead):
> 
> /kernel: cd0 at aha0 bus 0 target 6 lun 0
> /kernel: cd0: <PIONEER CD-ROM DRM-624X 1.08> Removable CD-ROM SCSI-2 device
> /kernel: cd1 at aha0 bus 0 target 6 lun 1
> /kernel: cd1: <PIONEER CD-ROM DRM-624X 1.08> Removable CD-ROM SCSI-2 device
> [...]
> 
> The problem is that the NCR support for multiple LUNs is 
> severly broken. As soon as I try to access any of the cd 
> devices, I get messages about "CCB already dequeued", and 
> am even able to bring the system to a complete halt, e.g. 
> if trying to access two devices simultaneously.

I have access to a CD-ROM changer (Nakamichi, though) which 
is not currently connected to a NCR controller, but I may be
able to use it for some tests. That machine only a Sym8951
(U2W, no 8-bit connector, and I do not have a Wide to Narrow
converter), but I can install another NCR card in that box
for testing purposes. This will take some time, though, since
this hardware is part of a large system currently being prepared
to become operational ...

Regards, STefan
Comment 2 Kenneth D. Merry freebsd_committer freebsd_triage 1999-08-16 21:13:15 UTC
Responsible Changed
From-To: freebsd-bugs->se

Stefan owns the NCR driver... 

Comment 3 Stefan Eßer freebsd_committer freebsd_triage 2014-11-24 08:57:53 UTC
I'm going to close this PR after not being able to work on it for 15 years:

I have not been able to perform the tests with an alternate controller in that system, before I lost access to it.  Since that was the only multiple-LUN SCSI device I had access to, and since CD changers (drive mechanism with one head assembly that is used to sequentially access contents on several CD media, where each media is associated with one LUN) are a thing of the past, I do not expect to be able to reproduce this, even though I still have the other required parts.

This Bug may be re-opened, if somebody knows about easily available hardware that could be used to reproduce the problem, today. But since there was only this single PR for a problem with a multi-LUN SCSI device, ever, this does not appear to be a problem that hit many users.