xcp-ng / xcp

Entry point for issues and wiki. Also contains some scripts and sources.
https://xcp-ng.org
1.32k stars 74 forks source link

Adaptec Series 6 Raid Cards not working because of kernel bug #472

Open stormi opened 3 years ago

stormi commented 3 years ago

See discussion at https://xcp-ng.org/forum/topic/3979/kernel-bug-causes-adaptec-series-6-raid-cards-to-not-work

There's a provided patch, though linked mailing list message also mentions a follow-up patch.

XCP-ng releases : probably 8.0 to 8.2+

stormi commented 3 years ago

Current status: the provided patches never got merged upstream and have a larger scope than just the bug above. kernel-alt also has the bug so it still exists in upstream kernel. One would need to find/contribute a better patch.

0nelight commented 2 years ago

Kernel-Mailing List and Thread responsible for repairing the faulity 2017 Commit 395e5df79: https://lore.kernel.org/linux-scsi/20190819163546.915-2-khorenko@virtuozzo.com/

0nelight commented 3 days ago

Current Status in 8.2.1:

Package XCP-ng 8.2 XCP-ng 8.2 alternate driver XS 8.2 XS 8.2 CU1 XS driver disk
microsemi-aacraid (built-in) 1.2.1[50877]-custom   (built-in) 1.2.1[50877]-custom idem 1.2.1.60001
xcp-ng-8.2.1-20231130.iso
SHA256: 108aa7144d1f5dd169a1b99ca70b510527136c549f2e3c3c1707b619e17ee1b6
RAID bus controller [0104]: Adaptec Series 6 - 6G SAS/PCIe 2 [9005:028b] (rev 01)
-----
dmesg:
[ xx:xxxxx] aacraid: Host adapter abort request.
[ xx:xxxxx] aacraid: Outstanding commands on (X,X,XXX,X):
...

Current Status in 8.3.0

Package XCP-ng 8.3 XCP-ng 8.3 alternate driver XS 8 base XS 8 earlyaccess XS driver disk
microsemi-aacraid 1.2.1.60001-1   1.2.1.60001-1   1.2.1.60001
xcp-ng-8.3.0.iso
SHA256: 49b6143d1bbb1fd0bb1f7ce873817190c1f2ca394c258ce7b1f8e13a75c72674
RAID bus controller [0104]: Adaptec Series 6 - 6G SAS/PCIe 2 [9005:028b] (rev 01)
-----
dmesg:
[xx:xxxxx] aacraid 0000:03:00.0: AAC: aac_eh_abort: Host adapter abort request (X,X,X)
[xx:xxxxx] aacraid 0000:03:00.0: AAC: aac_eh_abort: Timed out Command: 12 00 00 24 00 00 00 00 00 00 00 00 00 00 00
[xx:xxxxx] aacraid 0000:03:00.0: AAC: aac_fib_debug_print: FIB(0) = 000000005c443e4 : be400020 Command = 601 XferState = 000832ad Wait Time = 20 Sec

Notes

Usage as a non-boot Storage-Device: Install XCP-NG without the Raid-Card being inserted into the mainboard and then replace the *.ko file (compile it yourself). After that you can Insert the Raid-Card.

Usage as a XCP-Boot Device: Modify the ISO-Image because the Raid-Card leads to very long hangs during the Installer-Boot process so you can't even do anything in the command line.

I successfully created an custom-driver-iso which I can load via the installer. My Problem is that I don't know how I can de-blacklist the kernelmodule aacraid after loading the correct aacraid via the installer so I can continue with the Install. Should I patch the Device-ID out of https://github.com/xcp-ng-rpms/microsemi-aacraid linit.c:262 so it doesn't load the faulty driver for this card in 8.3? At least then, the command line will still be usable and the installer would not hang.

0nelight commented 3 days ago

I am very sure that the following would fix Series-6 Cards in XCP 8.3. This would restore the logic for Series-6 as in the Latest Supported Driver from the Adaptec Support Page (Driver 52011), without changing anything for the other Cards. Will update here as soon I have tested this :-)

diff --git a/comminit.c b/comminit.c
index 0c44ba8..d035e18 100644
--- a/comminit.c
+++ b/comminit.c
@@ -727,7 +727,7 @@ int aac_init_adapter(struct aac_dev *dev)
                }
        }

-       if (aac_is_srcv(dev))
+       if (aac_is_src(dev))
                aac_define_int_mode(dev);

 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
cat aacraid.h

static inline int aac_is_src(struct aac_dev *dev)
{
    u16 device = dev->pdev->device;
    if (device == PMC_DEVICE_S6 ||
        device == PMC_DEVICE_S7 ||
        device == PMC_DEVICE_S8)
        return 1;
    return 0;
}

static inline int aac_is_srcv(struct aac_dev *dev)
{
    u16 device = dev->pdev->device;
    if (device == PMC_DEVICE_S7 ||
        device == PMC_DEVICE_S8)
        return 1;
    return 0;
}
comminit.c from Driver 52011

        }
    }

    if (dev->pdev->device == PMC_DEVICE_S6 ||
        dev->pdev->device == PMC_DEVICE_S7 ||
        dev->pdev->device == PMC_DEVICE_S8 ||
        dev->pdev->device == PMC_DEVICE_S9)
        aac_define_int_mode(dev);
stormi commented 3 days ago

Thanks, keep us informed of the results!

0nelight commented 3 days ago

It works 😃 Installer doesn't hang anymore, no Error-Messages and Raid-Volume is visible in the Installer 😍

I managed to create a patch RPM and modify the ISO - thanks to the well written guides :-) I created a Pull-Request. I am very beginner in this! I am not sure if I should edit the Specfile further. For example, I think it would be better if the Version number one sees when doing modinfo aacraid should indicate that this is the Series6 fix.