Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1217962imj; Sun, 17 Feb 2019 00:28:28 -0800 (PST) X-Google-Smtp-Source: AHgI3Iao22ZJy6AmJ984zTPxo2IFj4IIso6B3FYcWinRx3ie/dqO3fPdT1bWRzesh/ty1hxldK0+ X-Received: by 2002:a17:902:34a:: with SMTP id 68mr19384547pld.268.1550392108656; Sun, 17 Feb 2019 00:28:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550392108; cv=none; d=google.com; s=arc-20160816; b=joFUlehPGgw3EamPf7AH5K3U1TIy63L7AkDmf92InUMYO4ckSrIKDpN5ahxuFuGFvT 0Dz1iZTkaWORE/mGg6aJ1stjgY2p+4e+Yn5mTWOiOV7QsUcbmTyLT/Nc+lj6jiPru8xb j5MQHcHo1gbKedEXV00LAPqEh3tzxu0Mof6TH5s226chjgx2WBmYxq7qWZgXJ3mu3Udj RzOsYHmDf9M4HWL05LIh5JaEsAcCh5reHHX8/Eq8qBL9I75c4yF7svYme088nDIoqwLE K3bs86VJ9l1zZ6WoNXISnvJw22PRFxBnrGRFVXiwzwP872YJQV/uh4ySKNpDxXB7F9ME L1gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dmarc-filter:dkim-signature:dkim-signature; bh=YkYm8pnMImZ01EuJrAtbTWzM/I0NfPl9btKof2CkwTE=; b=n+g7ICHjZnR7jDSnNwsjhgyJijRfGkkbxU/aB4sMEdcBrZnuNdanFw95+7a0yJRE8s IUmzfWKQj1UQO/OYkex6qnp3Ri7NFgAbS4hPvkmkuLSVH9jD0KAiDHChq963+3fIdjWU q/iAwBXzLlp/8f+e+8ryeM534j8J1EsKxfr0l5wREi8H32oIHdm8hxuYDQbaxezEx97i qShLEmCvxR/MTd/K2k6ZEg1AbhIpsoAD0EO2utz9Uopkb2G7IbO7itUuFqVUbX95Oarg aDE200HObQQWlzV85GsDr/6NnV5Z3rtUEe4H5uiKgFO8r0ysVRKaki9NAaTV/Q9+u42c Duwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=FijtRViz; dkim=pass header.i=@codeaurora.org header.s=default header.b=FijtRViz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i11si1519940plt.280.2019.02.17.00.28.13; Sun, 17 Feb 2019 00:28:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=FijtRViz; dkim=pass header.i=@codeaurora.org header.s=default header.b=FijtRViz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726151AbfBQFGF (ORCPT + 99 others); Sun, 17 Feb 2019 00:06:05 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:43468 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725372AbfBQFGE (ORCPT ); Sun, 17 Feb 2019 00:06:04 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id AE1896081B; Sun, 17 Feb 2019 05:06:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1550379963; bh=AFUgXgq7Cy+33lynzOffSN3VRuEjlhTpEi8maDQKxto=; h=From:To:Cc:Subject:Date:From; b=FijtRVizMXkp0EPhQPXnMdGCVTLI/CsKY/7o0llOMNtfg6s/sBQwqEBIogzuWg5y+ eK9z4Hi0R7kNr5u3e7O0warm238MywJd8XHRDInT0aHHuxPmnW/STQ9+/o50eyf1cL thSOV0ofICO+jXqv9q6ewzkJiH+qf9wyEMinsdGE= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.0 Received: from jhugo-perf-lnx.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jhugo@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 3900860709; Sun, 17 Feb 2019 05:06:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1550379963; bh=AFUgXgq7Cy+33lynzOffSN3VRuEjlhTpEi8maDQKxto=; h=From:To:Cc:Subject:Date:From; b=FijtRVizMXkp0EPhQPXnMdGCVTLI/CsKY/7o0llOMNtfg6s/sBQwqEBIogzuWg5y+ eK9z4Hi0R7kNr5u3e7O0warm238MywJd8XHRDInT0aHHuxPmnW/STQ9+/o50eyf1cL thSOV0ofICO+jXqv9q6ewzkJiH+qf9wyEMinsdGE= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 3900860709 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=jhugo@codeaurora.org From: Jeffrey Hugo To: bjorn.andersson@linaro.org, andy.gross@linaro.org, david.brown@linaro.org, gregkh@linuxfoundation.org Cc: jslaby@suse.com, linux-arm-msm@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Jeffrey Hugo Subject: [PATCH] tty: serial: msm_serial: Remove __init from msm_console_setup() Date: Sat, 16 Feb 2019 22:05:52 -0700 Message-Id: <1550379952-19457-1-git-send-email-jhugo@codeaurora.org> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Due to the complexities of modern Qualcomm SoCs, about a half dozen drivers must successfully probe before the clocks for the console are present, and the console can successfully probe. Depending on several random factors such as probe order and modules vs builtin, msm_serial may not be able to successfully probe for some, at which point, __init annotated functions may become unmapped. If this occurs, msm_console_setup() will be called from the probe path, but will no longer exist, resulting in a kernel panic. Resolve this issue by removing the __init annotation from msm_console_setup(). Signed-off-by: Jeffrey Hugo --- drivers/tty/serial/msm_serial.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c index 736b74f..1090960 100644 --- a/drivers/tty/serial/msm_serial.c +++ b/drivers/tty/serial/msm_serial.c @@ -1634,7 +1634,7 @@ static void msm_console_write(struct console *co, const char *s, __msm_console_write(port, s, count, msm_port->is_uartdm); } -static int __init msm_console_setup(struct console *co, char *options) +static int msm_console_setup(struct console *co, char *options) { struct uart_port *port; int baud = 115200; -- Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.