Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1223137imj; Sun, 17 Feb 2019 00:36:16 -0800 (PST) X-Google-Smtp-Source: AHgI3IY3o82+BDL+IDOe9sNV1+8ViLjPUCyAwBFzFcjW9V0FsCD1XNGKnDuSvV5BDevd/97lIs5U X-Received: by 2002:a62:3c1:: with SMTP id 184mr18452010pfd.56.1550392576319; Sun, 17 Feb 2019 00:36:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550392576; cv=none; d=google.com; s=arc-20160816; b=OMCOeJS0o5nfe08V2HfUfw3W+YK8wo/TCH0TeAZDJOoZ1aYrt2tbzdJOpLxoRezW7C +JwXFdtQHWA4IWUhR3WUVi+HC5Jxo44cUs3OEpzRJ34y4HEAa21018Awr/g+0OcrlO9q u4yGS9Ke137VoPiYmlu+/IQT67+1fah2rBgJcAY3N2aeRwKxJL1psqgDy2GLM3d4AjRS z+1z4q/T6sXNMHtEzpNazor5u3G2GpaOQPUr0+BVQo6vhncyV0kqATtQt0zLNt0D3FZX rZLPvJ2JUR7saVtR76mgLUmmHd/CxskblEgKkCd5PTpJrf15Lpg3q5m0M3Gg1edPniyk 2VXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=RzQj1NGmKPBMIQT5kWb4j66t8myM+09reZU6Hsr4BOU=; b=ZwHE1K7iepW+pp5iUB2leCJlHB0fbUqex5Kjbo4p+rScws//HrruYzWq8FrCjtYo1C dMXgzXrxZKLC7RIRUzbgsejQnMy6NlzRL9okX7qJnDmxz/em5H3lgY782Uy7/KbOnC8r BbeD94Da28f8nzhlYxGxRNwgLdWvHQgr3fIgoDuWzt/UxRimHDD5VcRy4f007QEMM2ID IPfGNokpC22KISzAHLqlEKjm6wCHnQ48x8zgzTXnPQPqybsJ+DUJYMmmkzrtArJ0NgKr pxJUVX/Jx3PD6Q6gYH7l6UlWUhdMVriKjBwZ58U4WAdv0hnn97RQteomiEuIQI2Oic1F Mb+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RqKMiD5W; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d1si8649127pll.283.2019.02.17.00.36.00; Sun, 17 Feb 2019 00:36:16 -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=@linaro.org header.s=google header.b=RqKMiD5W; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728481AbfBQHPG (ORCPT + 99 others); Sun, 17 Feb 2019 02:15:06 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:45896 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726788AbfBQHPG (ORCPT ); Sun, 17 Feb 2019 02:15:06 -0500 Received: by mail-pf1-f195.google.com with SMTP id v21so3969042pfm.12 for ; Sat, 16 Feb 2019 23:15:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=RzQj1NGmKPBMIQT5kWb4j66t8myM+09reZU6Hsr4BOU=; b=RqKMiD5W92BgljRqKwTDquAqF5RuHVNMDp6mbOfOEfjhsk+pl6L/AnCq0wwOhhLJfw 6FphS0isJPrczBxuymDuoqfDdiWdLG1THH0emSx3ubaAMlphQXkyLzE45Z7NwuywL51f 3keUix1JrToRuiDy6AXtRJvb7sxRrW7HggfB+XvTmlYtfIvPdFEPk6ZTh3l/DBQgByKT P+42RmxWYLshobjFmtl7k0QfyVILoR8laBdfco9ixr549c19TDRPydG7Zsb24kdsXb3t DioDjz7nCofLD1rJDJqPGHbXJkJEpxJng8BJXmoOPTGQNcPUK+EXUJxVpx8tLGQ+cYnn lPyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=RzQj1NGmKPBMIQT5kWb4j66t8myM+09reZU6Hsr4BOU=; b=WggWKAoiR2y+jwyFMkfw0p+XmtmHjhcmTuZgtudvxOKuBjmYqS4tnr7g2VwQ61tVNU sf+UlkeH8oVRadcf1ppid4qmtaMBp9i1UIP2POLnjBOSKMqPqyFCg/cFcBrOUDz7h3Vn bILfIE0mGnLX93lB6YQwgC3HE/cdTqiCcUJidglY9QZ0x0qcNj0o2hT3CrjiBuDd/A4A GxitT6PLvENRAqlXIh68DZZAul+53NAZ5o4n5COMtF5XhOaYqa4HagbyyunfTgC5n/Zw v05xkjIwLXZFxhu3gOtpwblcSzzXrYkiRUVhq4nI//o+5+/ZkolzjxT68ZSPetve7Sd7 CisA== X-Gm-Message-State: AHQUAuZ8O8tmpTOIVwtBo1JI4nPO6bC2qEbEIyPaQOEIHE/u2g1uDsK2 /MzXbxfOn/ioQOK3aI3KIfTVWg== X-Received: by 2002:a63:981:: with SMTP id 123mr13226992pgj.444.1550387704676; Sat, 16 Feb 2019 23:15:04 -0800 (PST) Received: from tuxbook-pro (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id e21sm42542773pfh.45.2019.02.16.23.15.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 16 Feb 2019 23:15:03 -0800 (PST) Date: Sat, 16 Feb 2019 23:14:55 -0800 From: Bjorn Andersson To: Jeffrey Hugo Cc: andy.gross@linaro.org, david.brown@linaro.org, gregkh@linuxfoundation.org, jslaby@suse.com, linux-arm-msm@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] tty: serial: msm_serial: Remove __init from msm_console_setup() Message-ID: <20190217071455.GH2173@tuxbook-pro> References: <1550379952-19457-1-git-send-email-jhugo@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1550379952-19457-1-git-send-email-jhugo@codeaurora.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat 16 Feb 21:05 PST 2019, Jeffrey Hugo wrote: > 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(). I'm pretty sure I've stumbled upon this several times without knowing what hit me. Reviewed-by: Bjorn Andersson Regards, Bjorn > > 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. >