From patchwork Fri Jan 13 11:23:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 9515267 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 264CD6077E for ; Fri, 13 Jan 2017 11:23:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 19C5D285AE for ; Fri, 13 Jan 2017 11:23:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0E6A2285F0; Fri, 13 Jan 2017 11:23:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6CFEC285AE for ; Fri, 13 Jan 2017 11:23:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751448AbdAMLXs (ORCPT ); Fri, 13 Jan 2017 06:23:48 -0500 Received: from mail-lf0-f68.google.com ([209.85.215.68]:36324 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751419AbdAMLXq (ORCPT ); Fri, 13 Jan 2017 06:23:46 -0500 Received: by mail-lf0-f68.google.com with SMTP id h65so5236027lfi.3 for ; Fri, 13 Jan 2017 03:23:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=78mdHJM7ifreUvwKyEUnf8qkDe0vE6MLDY9sAqxN4KQ=; b=XLldaLFuZVDBRX4oK+bp6zz2iJUC1TkUdIq5CEWutlhs2aiDIHhj/t88+MVInt9XoG Merlb9YyHaeGsZVSDmc9/4OtNLuqoEPI8d3wr4PHnug1BWCCv8HonPPKqEIiaDfs6kCr dREJheQbpFo/0KA3QHNZ3m500bomIWkOiBeBWnwChB+hmltaWK6SWIFdyyCOqTWzLZ92 ZvKF6x3ou4kmlePtawFd2TTaOG4706W9h6osLxN0Fhl19BN5Ej74KAnlgClYNV5NYhTA /VyjffT0EodOLHf64rjGpg0Q69urBXHLtvIsh2AkPSxRCChq2SVuevotK8GI80LPmKUU rYhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=78mdHJM7ifreUvwKyEUnf8qkDe0vE6MLDY9sAqxN4KQ=; b=lBg6vVDcERmiBNkq9KcMEON/ZLUHT230CzInmxa57cfzWblsmoyt++qfmbWF7X4qdw Aguzj2qRgsUEoNrU5EX+TZk0s+yOKwN93o8jixmmKjg/BaxHhxjNt0AJMaIIyC2lme+9 gGShHQATU8H/uT7RYbnYUd30uLzWIirUODdmEJ6xAHv0n5dqlExMBM0wo8ok7OoYR0Nj XMywg8VQF+o1dJkbygPgqu7jDBW8dx/h1EXxz0qVfbfIFw78fOg1jMcihRsoXzDrbwA6 55SfwdPxieuchd9/0Q3R9QJarcJLir+M7ixE7hiWGgg22NZARDsC9RmAB8aKLPE8mzjU KuWw== X-Gm-Message-State: AIkVDXLUeAKU6rAFTMpLvLyYtStKkTjXc9UHc91izWowBQEzVE4xGSpDt167fIrQ3W3WaA== X-Received: by 10.25.79.71 with SMTP id a7mr7877804lfk.67.1484306624318; Fri, 13 Jan 2017 03:23:44 -0800 (PST) Received: from linux-samsung.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id c75sm3696094lfe.28.2017.01.13.03.23.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Jan 2017 03:23:43 -0800 (PST) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: Kalle Valo Cc: linux-wireless@vger.kernel.org, Felix Fietkau , =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Subject: [PATCH 4.10 fix V2] Revert "bcma: init serial console directly from ChipCommon code" Date: Fri, 13 Jan 2017 12:23:35 +0100 Message-Id: <20170113112335.23730-1-zajec5@gmail.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20170112174451.7124-1-zajec5@gmail.com> References: <20170112174451.7124-1-zajec5@gmail.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Rafał Miłecki 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 Cc: stable@vger.kernel.org # 4.6+ Signed-off-by: Rafał Miłecki --- V2: Update commit message (regression part), add Fixes & Cc. Thanks Kalle! --- drivers/bcma/bcma_private.h | 3 +++ drivers/bcma/driver_chipcommon.c | 11 +++-------- drivers/bcma/driver_mips.c | 3 +++ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/bcma/bcma_private.h b/drivers/bcma/bcma_private.h index f642c42..168fa17 100644 --- a/drivers/bcma/bcma_private.h +++ b/drivers/bcma/bcma_private.h @@ -45,6 +45,9 @@ int bcma_sprom_get(struct bcma_bus *bus); void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc); void bcma_core_chipcommon_init(struct bcma_drv_cc *cc); void bcma_chipco_bcm4331_ext_pa_lines_ctl(struct bcma_drv_cc *cc, bool enable); +#ifdef CONFIG_BCMA_DRIVER_MIPS +void bcma_chipco_serial_init(struct bcma_drv_cc *cc); +#endif /* CONFIG_BCMA_DRIVER_MIPS */ /* driver_chipcommon_b.c */ int bcma_core_chipcommon_b_init(struct bcma_drv_cc_b *ccb); diff --git a/drivers/bcma/driver_chipcommon.c b/drivers/bcma/driver_chipcommon.c index b4f6520..62f5bfa 100644 --- a/drivers/bcma/driver_chipcommon.c +++ b/drivers/bcma/driver_chipcommon.c @@ -15,8 +15,6 @@ #include #include -static void bcma_chipco_serial_init(struct bcma_drv_cc *cc); - static inline u32 bcma_cc_write32_masked(struct bcma_drv_cc *cc, u16 offset, u32 mask, u32 value) { @@ -186,9 +184,6 @@ void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc) if (cc->capabilities & BCMA_CC_CAP_PMU) bcma_pmu_early_init(cc); - if (IS_BUILTIN(CONFIG_BCM47XX) && bus->hosttype == BCMA_HOSTTYPE_SOC) - bcma_chipco_serial_init(cc); - if (bus->hosttype == BCMA_HOSTTYPE_SOC) bcma_core_chipcommon_flash_detect(cc); @@ -378,9 +373,9 @@ u32 bcma_chipco_gpio_pulldown(struct bcma_drv_cc *cc, u32 mask, u32 value) return res; } -static void bcma_chipco_serial_init(struct bcma_drv_cc *cc) +#ifdef CONFIG_BCMA_DRIVER_MIPS +void bcma_chipco_serial_init(struct bcma_drv_cc *cc) { -#if IS_BUILTIN(CONFIG_BCM47XX) unsigned int irq; u32 baud_base; u32 i; @@ -422,5 +417,5 @@ static void bcma_chipco_serial_init(struct bcma_drv_cc *cc) ports[i].baud_base = baud_base; ports[i].reg_shift = 0; } -#endif /* CONFIG_BCM47XX */ } +#endif /* CONFIG_BCMA_DRIVER_MIPS */ diff --git a/drivers/bcma/driver_mips.c b/drivers/bcma/driver_mips.c index 96f1713..89af807 100644 --- a/drivers/bcma/driver_mips.c +++ b/drivers/bcma/driver_mips.c @@ -278,9 +278,12 @@ static void bcma_core_mips_nvram_init(struct bcma_drv_mips *mcore) void bcma_core_mips_early_init(struct bcma_drv_mips *mcore) { + struct bcma_bus *bus = mcore->core->bus; + if (mcore->early_setup_done) return; + bcma_chipco_serial_init(&bus->drv_cc); bcma_core_mips_nvram_init(mcore); mcore->early_setup_done = true;