From 3b53d6fdbc241173b4264aa49142ba94d406a806 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Thu, 4 Oct 2018 15:12:27 +0200 Subject: [PATCH] ar71xx: fix pci irq init on kernel 4.14 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The IRQ init structs are marked as __initconst which means this memory can be free after init. On this platform, the PCI IRQ init happens very late _after_ the kernel already freed the memory allocated for these structs. During IRQ allocation, the allocation function is passed with invalid data at this point leading to following error: [ 0.000000] SoC: Qualcomm Atheros QCA9533 ver 2 rev 0 [ 2.382828] Freeing unused kernel memory: 264K [ 34.414816] pci 0000:00:00.0: no irq found for pin 1 and [ 0.000000] SoC: Qualcomm Atheros QCA956X ver 1 rev 0 [ 2.125401] Freeing unused kernel memory: 284K [ 9.526479] pci 0000:00:00.0: no irq found for pin 1 After this patch: [ 14.960814] pci 0000:00:00.0: using irq 40 for pin 1 Commit 318e19ba6755 ("ar71xx: add v4.14 support") fixed this for the default targets already present in the source by default but forgot to remove the __initconst attribute for targets QCA953x and QCA956x which are only added later through platform patches. Fixes: 318e19ba6755 ("ar71xx: add v4.14 support") Reported-by: Sven Schönhoff Reported-by: Dirk Brenken Signed-off-by: Koen Vandeputte Tested-by: Dirk Brenken --- .../621-MIPS-ath79-add-support-for-QCA956x-SoC.patch | 2 +- .../patches-4.14/740-MIPS-ath79-add-PCI-for-QCA953x-SoC.patch | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/ar71xx/patches-4.14/621-MIPS-ath79-add-support-for-QCA956x-SoC.patch b/target/linux/ar71xx/patches-4.14/621-MIPS-ath79-add-support-for-QCA956x-SoC.patch index 5107b4019d..3d79463545 100644 --- a/target/linux/ar71xx/patches-4.14/621-MIPS-ath79-add-support-for-QCA956x-SoC.patch +++ b/target/linux/ar71xx/patches-4.14/621-MIPS-ath79-add-support-for-QCA956x-SoC.patch @@ -403,7 +403,7 @@ }, }; -+static const struct ath79_pci_irq qca956x_pci_irq_map[] __initconst = { ++static const struct ath79_pci_irq qca956x_pci_irq_map[] = { + { + .bus = 0, + .slot = 0, diff --git a/target/linux/ar71xx/patches-4.14/740-MIPS-ath79-add-PCI-for-QCA953x-SoC.patch b/target/linux/ar71xx/patches-4.14/740-MIPS-ath79-add-PCI-for-QCA953x-SoC.patch index 1a866740b5..659f74451c 100644 --- a/target/linux/ar71xx/patches-4.14/740-MIPS-ath79-add-PCI-for-QCA953x-SoC.patch +++ b/target/linux/ar71xx/patches-4.14/740-MIPS-ath79-add-PCI-for-QCA953x-SoC.patch @@ -4,7 +4,7 @@ } }; -+static const struct ath79_pci_irq qca953x_pci_irq_map[] __initconst = { ++static const struct ath79_pci_irq qca953x_pci_irq_map[] = { + { + .bus = 0, + .slot = 0, -- 2.30.2