From patchwork Thu Jan 12 17:44:51 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: 9513705 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 BE0CD601E7 for ; Thu, 12 Jan 2017 17:45:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B406C286F8 for ; Thu, 12 Jan 2017 17:45:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A9084286FD; Thu, 12 Jan 2017 17:45:49 +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 E3909286F8 for ; Thu, 12 Jan 2017 17:45:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751118AbdALRp0 (ORCPT ); Thu, 12 Jan 2017 12:45:26 -0500 Received: from mail-lf0-f66.google.com ([209.85.215.66]:35723 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750803AbdALRpR (ORCPT ); Thu, 12 Jan 2017 12:45:17 -0500 Received: by mail-lf0-f66.google.com with SMTP id v186so2903489lfa.2 for ; Thu, 12 Jan 2017 09:45:16 -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:mime-version :content-transfer-encoding; bh=LzJdH6vXhAiEkuLYwW3LY/AbEGTiE8McpziFZUclcvk=; b=gqCwbxJY1WoD3eKhcNLubulhId+5CBLT8afsjjyBU7Evh6ckx1fni/8AZJU0Z1gO2Y LiYfosgON+7ojpQiQEi6SR2CpSa6IRLbkFHkgn5edJ9GqQiRritvwzAii1XYNkSv/gsi 275qp8l7YhridmFRMdHVt3plppIMZVLJF9kZnrVY6PCPVIexOd1YkvhDssGvLXHzZuK8 egfLjjImPzVNvNUlrhpqauGpQX0qUB4icIBXbtrKatR9XEAiOqbPYRcQWrcOyJDEQTqi U3pR8LU1HClJpetHDXgOdcaBuQADB1T1KNYj7qeCRZkOhMekf9+2OKbW1S1EyhRtGUQs Vapg== 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:mime-version :content-transfer-encoding; bh=LzJdH6vXhAiEkuLYwW3LY/AbEGTiE8McpziFZUclcvk=; b=Jg5HvaSZ8rgibCK3mZ9U7JzGaTC6c7XERvl1BEytg9xdA17nRlGPqnBoJSCyLXv+D4 tSd879G1AvAFze23yNRQdHPEaHQKpkiQQWhkVKA3a8E2yO9kAGnhhHVIZl1bRWrSZ3th jxYwowHP1kaxaAVBiYQNKZa+oUPxyxPMMa8pAJN2NJ8u9HSmJGia7nihMJrBDnqXcDyx s4ONxBQJTWuI/qRk29BJLSvIsvPCohnaUjZAlHqyJpIibqAxUuEM/EqAUKuQmuKltaqK tCP0cxaUw9TeWVEIFRfTCh1EqyaYfpmN9SI7SuH0BnQFZ/l/onZY270+NsrhqAnXoHIA ninw== X-Gm-Message-State: AIkVDXLFThhrwpPmoZqVQ4pjtLzMZKCz6W8ewRREz0T1xmWEHx/sxMu6GwUsqy32h6royQ== X-Received: by 10.25.25.71 with SMTP id 68mr6116180lfz.9.1484243115288; Thu, 12 Jan 2017 09:45:15 -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 j87sm2667241lfi.25.2017.01.12.09.45.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Jan 2017 09:45:14 -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] Revert "bcma: init serial console directly from ChipCommon code" Date: Thu, 12 Jan 2017 18:44:51 +0100 Message-Id: <20170112174451.7124-1-zajec5@gmail.com> X-Mailer: git-send-email 2.10.1 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 regression but it seems noone noticed it for about a year. It could be it was because serial was still somehow working, just without IRQs. It doesn't look like a critical patch / fix. Reported-by: Felix Fietkau Signed-off-by: Rafał Miłecki --- 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;