Re: Getting Bullseye/Bookworm kernel running on Loongson 3A boards

Jiaxun Yang <[email protected]> Sun, 6 Aug 2023 10:34:44 +0800
Newsgroups gmane.linux.ports.mips,gmane.linux.debian.ports.mips
Message-ID <[email protected]>

在 2023/8/6 6:20, Thomas Bogendoerfer 写道:
> On Sun, Jul 23, 2023 at 06:16:39PM +0200, Aurelien Jarno wrote:
>> Dear MIPS porters,
>>
>> DSA would like to upgrade the remaining mips*el buildds to bullseye (and
>> later to bookworm), however we have trouble running the Bullseye or
>> Bookworm kernel on the LS3A-RS780-1w ones.
>>
>> Both Bullseye and Bookworm kernels boot fine up to the userland, but the
>> network card does not work. It *seems* to an interrupt issue as the
>> corresponding counter in /proc/interrupts does not change, and in
>> addition the kernel logs show the following warnings:
>>
>> [    5.077846] pcieport 0000:00:02.0: of_irq_parse_pci: failed with rc=-22
>> [    5.084744] pcieport 0000:00:03.0: of_irq_parse_pci: failed with rc=-22
>> [    5.170772] ahci 0000:00:11.0: of_irq_parse_pci: failed with rc=-22
>> [    7.376554] pci 0000:00:07.0: of_irq_parse_pci: failed with rc=-22
>> [    7.444769] ata_generic 0000:00:14.1: of_irq_parse_pci: failed with rc=-22
>> [    7.495993] ehci-pci 0000:00:12.2: of_irq_parse_pci: failed with rc=-22
>> [    7.624868] ehci-pci 0000:00:13.2: of_irq_parse_pci: failed with rc=-22
>> [    7.753230] ohci-pci 0000:00:12.0: of_irq_parse_pci: failed with rc=-22
>> [    7.886362] ohci-pci 0000:00:12.1: of_irq_parse_pci: failed with rc=-22
>> [    8.018045] ohci-pci 0000:00:13.0: of_irq_parse_pci: failed with rc=-22
>> [    8.150168] ohci-pci 0000:00:13.1: of_irq_parse_pci: failed with rc=-22
>> [    8.294391] ohci-pci 0000:00:14.5: of_irq_parse_pci: failed with rc=-22
>> [   18.398222] snd_hda_intel 0000:00:14.2: of_irq_parse_pci: failed with rc=-22
>> [   18.547932] pci 0000:00:01.0: of_irq_parse_pci: failed with rc=-22
>>
>> Any idea how to solve this issue? I have attached a full 6.1 kernel boot
>> log for reference.
> asking on [email protected] might get more feedback on the issue...
>  From the quick look at kernel code and device tree of the board IMHO
> the DTS is missing interrupt mapping entries for the PCI bus.
>
> Could someone from Loongson have a look at the issue ?

Hi,

This error meesage is expected because we are not using devicetree to parse
interrupt, it is falling back to legacy PCI interrupt on i8259.

```

static int loongson_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
     int irq;
     u8 val;

     irq = of_irq_parse_and_map_pci(dev, slot, pin);
     if (irq > 0)
         return irq;

     /* Care i8259 legacy systems */
     pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &val);
     /* i8259 only have 15 IRQs */
     if (val > 15)
         return 0;

     return val;
}
```

Is there any other error message regarding NIC in dmesg?

Thanks
- Jiaxun

>
> Thomas.
>