Bug 242087

Summary: aacraid: with system aacraid instead of vendor aacraid, all disks from the controller disappeared
Product: Base System Reporter: Igor Timkin <ivt>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: New ---    
Severity: Affects Some People CC: achim, ivt
Priority: --- Keywords: patch
Version: 12.0-STABLE   
Hardware: amd64   
OS: Any   
Description Flags
Patch solves problems none

Description Igor Timkin 2019-11-19 21:27:15 UTC
Created attachment 209257 [details]
Patch solves problems

I am using Adaptec 6805e with 8 disks without arrays. In FreeBSD9, I used the driver from the Adaptec site. When migrating to FreeBSD10 or later, I switched to the system aacraid. All disks from the controller disappeared in the system and passX devices remained. Patch solves these problems, I use it on 12.1-STABLE for three months (I also tested it on 11-STABLE).
Comment 1 Andriy Gapon freebsd_committer 2019-11-20 07:46:24 UTC
I believe that the code is self-consistent as it was designed.
You can question whether the design is sane, but that's a different story.
By default the driver exposes only logical disks.
If you want it to expose physical devices you need to set '8' (3rd bit) in its flags.
And, of course, a part of the problem is that this is not documented.
Comment 2 Igor Timkin 2019-11-20 20:09:22 UTC
Sorry, I did not put it very clearly. The problem occurred when I switching vendor aacu64.ko (for FreeBSD9) to vendor aacraidu.ko (for FreeBSD10). The behavior of the vendor driver and the system driver are the same in FreeBSD10 and higher.

How can I add the 3rd bit to the disk flag?
Comment 3 Andriy Gapon freebsd_committer 2019-11-20 22:18:18 UTC
Maybe something like
in /boot/device.hints ?
Comment 4 Igor Timkin 2019-11-21 09:55:29 UTC
I looked again at the aacraid source.
In struct aac_softc:
#define AAC_FLAGS_PERC2QC (1 << 0)
#define AAC_FLAGS_ENABLE_CAM (1 << 1) / * No SCSI passthrough * /
#define AAC_FLAGS_CAM_NORESET (1 << 2) / * Fake SCSI resets * /
#define AAC_FLAGS_CAM_PASSONLY (1 << 3) / * Only create pass devices * /
#define AAC_FLAGS_SYNC_MODE (1 << 18) / * Sync. transfer mode * /
u_int32_t hint_flags; / * driver parameters * /

If the 3rd bit is set (AAC_FLAGS_CAM_PASSONLY), then there should only be a passX device.