Skip to content

Commit 7195439

Browse files
Rafał MiłeckiKalle Valo
authored andcommitted
Revert "bcma: init serial console directly from ChipCommon code"
This reverts commit 4c81aca ("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: 4c81aca ("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>
1 parent 60f59ce commit 7195439

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

drivers/bcma/bcma_private.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ int bcma_sprom_get(struct bcma_bus *bus);
4545
void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc);
4646
void bcma_core_chipcommon_init(struct bcma_drv_cc *cc);
4747
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 */
4851

4952
/* driver_chipcommon_b.c */
5053
int bcma_core_chipcommon_b_init(struct bcma_drv_cc_b *ccb);

drivers/bcma/driver_chipcommon.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
#include <linux/platform_device.h>
1616
#include <linux/bcma/bcma.h>
1717

18-
static void bcma_chipco_serial_init(struct bcma_drv_cc *cc);
19-
2018
static inline u32 bcma_cc_write32_masked(struct bcma_drv_cc *cc, u16 offset,
2119
u32 mask, u32 value)
2220
{
@@ -186,9 +184,6 @@ void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc)
186184
if (cc->capabilities & BCMA_CC_CAP_PMU)
187185
bcma_pmu_early_init(cc);
188186

189-
if (IS_BUILTIN(CONFIG_BCM47XX) && bus->hosttype == BCMA_HOSTTYPE_SOC)
190-
bcma_chipco_serial_init(cc);
191-
192187
if (bus->hosttype == BCMA_HOSTTYPE_SOC)
193188
bcma_core_chipcommon_flash_detect(cc);
194189

@@ -378,9 +373,9 @@ u32 bcma_chipco_gpio_pulldown(struct bcma_drv_cc *cc, u32 mask, u32 value)
378373
return res;
379374
}
380375

381-
static void bcma_chipco_serial_init(struct bcma_drv_cc *cc)
376+
#ifdef CONFIG_BCMA_DRIVER_MIPS
377+
void bcma_chipco_serial_init(struct bcma_drv_cc *cc)
382378
{
383-
#if IS_BUILTIN(CONFIG_BCM47XX)
384379
unsigned int irq;
385380
u32 baud_base;
386381
u32 i;
@@ -422,5 +417,5 @@ static void bcma_chipco_serial_init(struct bcma_drv_cc *cc)
422417
ports[i].baud_base = baud_base;
423418
ports[i].reg_shift = 0;
424419
}
425-
#endif /* CONFIG_BCM47XX */
426420
}
421+
#endif /* CONFIG_BCMA_DRIVER_MIPS */

drivers/bcma/driver_mips.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,12 @@ static void bcma_core_mips_nvram_init(struct bcma_drv_mips *mcore)
278278

279279
void bcma_core_mips_early_init(struct bcma_drv_mips *mcore)
280280
{
281+
struct bcma_bus *bus = mcore->core->bus;
282+
281283
if (mcore->early_setup_done)
282284
return;
283285

286+
bcma_chipco_serial_init(&bus->drv_cc);
284287
bcma_core_mips_nvram_init(mcore);
285288

286289
mcore->early_setup_done = true;

0 commit comments

Comments
 (0)