NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/59010: viaide(4): CX700 IDE controller in RAID mode is not attached properly



>Number:         59010
>Category:       kern
>Synopsis:       viaide(4): CX700 IDE controller in RAID mode is not attached properly
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 19 11:20:01 +0000 2025
>Originator:     Andrius V
>Release:        NetBSD 9+
>Organization:
>Environment:
>Description:
Back in the day support for the VX800 IDE controller was improved on PR port-amd64/43309, which is also present in VX700, CX700, CX700M2 chipsets (at least they use same device ids). However, it was a bit unclear at that point why RAID mode needed via_sata_chip_map_new() method to attach, which was intended for VT6421 RAID controller. Also it was unclear why CX700_IDE is visible in the pci devices list in RAID mode instead of CX700M2_IDE (visible on IDE mode) controller. The changes seemingly worked with SATA drives (I only tested those at that time), however with recent testing PATA disks fail to attach at all (going into to the loop of errors making boot impossible) and verbose dmesg shows failing to attach sata regs.

After some research (including VX800 system programming manual) and testing I have a bit more understanding:
1) Controller device ID changes depending on the mode (IDE or RAID). Thus our CX700M2 IDE or CX00_IDE definitions are just same controller but one is for IDE mode and another for RAID accordingly.
2) CX700 IDE controller seemingly doesn't use BAR(5), which likely causes failed to map SATA regs.
3) Contrary to some other VIA IDE/SATA controllers (VT8237, VT8261), RAID mode has one device ID for both SATA and PATA.

Failing to map sata regs making via_sata_chip_map_7 to fail completely (return error code), but pass via_sata_chip_map_new(), since it doesn't fail on this. Also, via_sata_chip_map() enforces atac_probe = wdc_sataprobe, making it unsuitable for to use via_sata_chip_map_7() even if sata regs would map without additional modifications to handle PATA interface. Using via_sata_chip_map_new() is still not correct, since VT6421 has different reg base and uses BAR 5.

The third point means, that IDE controller doesn't have its own device id in RAID mode and it doesn't attach separately with via_chip_map through PCIB match like some other chipsets do. However, if via_chip_map is used for RAID mode controller, it almost works too, but wires to pci compatible interrupt instead of native one currently, leading to no drives being attached.

Not sure which way to exactly go from here. The easiest would be making via_chip_map to use native interrupt for this controller. Somehow OpenBSD seems to be doing that and that works. But likely more correct way is some more sophisticated way of recognizing channels for PATA and SATA. I am not sure yet.
>How-To-Repeat:

>Fix:



Home | Main Index | Thread Index | Old Index