Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Revert "bcma: init serial console directly from ChipCommon code"

This reverts commit 4c81acab3816 ("bcma: init serial console directly
from ChipCommon code") as it broke IRQ assignment. Getting IRQ with
bcma_core_irq helper on SoC requires MIPS core to be set. It happens
*after* ChipCommon initialization so we can't do this so early.

This fixes a user reported regression. It wasn't critical as serial was
still somehow working but lack of IRQs was making in unreliable.

Fixes: 4c81acab3816 ("bcma: init serial console directly from ChipCommon code")
Reported-by: Felix Fietkau <nbd@nbd.name>
Cc: stable@vger.kernel.org # 4.6+
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

authored by

Rafał Miłecki and committed by
Kalle Valo
7195439d 60f59ce0

+9 -8
+3
drivers/bcma/bcma_private.h
··· 45 45 void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc); 46 46 void bcma_core_chipcommon_init(struct bcma_drv_cc *cc); 47 47 void bcma_chipco_bcm4331_ext_pa_lines_ctl(struct bcma_drv_cc *cc, bool enable); 48 + #ifdef CONFIG_BCMA_DRIVER_MIPS 49 + void bcma_chipco_serial_init(struct bcma_drv_cc *cc); 50 + #endif /* CONFIG_BCMA_DRIVER_MIPS */ 48 51 49 52 /* driver_chipcommon_b.c */ 50 53 int bcma_core_chipcommon_b_init(struct bcma_drv_cc_b *ccb);
+3 -8
drivers/bcma/driver_chipcommon.c
··· 15 15 #include <linux/platform_device.h> 16 16 #include <linux/bcma/bcma.h> 17 17 18 - static void bcma_chipco_serial_init(struct bcma_drv_cc *cc); 19 - 20 18 static inline u32 bcma_cc_write32_masked(struct bcma_drv_cc *cc, u16 offset, 21 19 u32 mask, u32 value) 22 20 { ··· 183 185 184 186 if (cc->capabilities & BCMA_CC_CAP_PMU) 185 187 bcma_pmu_early_init(cc); 186 - 187 - if (IS_BUILTIN(CONFIG_BCM47XX) && bus->hosttype == BCMA_HOSTTYPE_SOC) 188 - bcma_chipco_serial_init(cc); 189 188 190 189 if (bus->hosttype == BCMA_HOSTTYPE_SOC) 191 190 bcma_core_chipcommon_flash_detect(cc); ··· 373 378 return res; 374 379 } 375 380 376 - static void bcma_chipco_serial_init(struct bcma_drv_cc *cc) 381 + #ifdef CONFIG_BCMA_DRIVER_MIPS 382 + void bcma_chipco_serial_init(struct bcma_drv_cc *cc) 377 383 { 378 - #if IS_BUILTIN(CONFIG_BCM47XX) 379 384 unsigned int irq; 380 385 u32 baud_base; 381 386 u32 i; ··· 417 422 ports[i].baud_base = baud_base; 418 423 ports[i].reg_shift = 0; 419 424 } 420 - #endif /* CONFIG_BCM47XX */ 421 425 } 426 + #endif /* CONFIG_BCMA_DRIVER_MIPS */
+3
drivers/bcma/driver_mips.c
··· 278 278 279 279 void bcma_core_mips_early_init(struct bcma_drv_mips *mcore) 280 280 { 281 + struct bcma_bus *bus = mcore->core->bus; 282 + 281 283 if (mcore->early_setup_done) 282 284 return; 283 285 286 + bcma_chipco_serial_init(&bus->drv_cc); 284 287 bcma_core_mips_nvram_init(mcore); 285 288 286 289 mcore->early_setup_done = true;