From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F18DC7EE2C for ; Thu, 1 Jun 2023 13:20:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233193AbjFANUZ (ORCPT ); Thu, 1 Jun 2023 09:20:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230268AbjFANUX (ORCPT ); Thu, 1 Jun 2023 09:20:23 -0400 Received: from muru.com (muru.com [72.249.23.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6414397; Thu, 1 Jun 2023 06:20:14 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 4C6A380F1; Thu, 1 Jun 2023 13:20:13 +0000 (UTC) Date: Thu, 1 Jun 2023 16:20:12 +0300 From: Tony Lindgren To: Marek Szyprowski Cc: Greg Kroah-Hartman , Jiri Slaby , Andy Shevchenko , Dhruva Gole , Ilpo =?utf-8?B?SsOkcnZpbmVu?= , John Ogness , Johan Hovold , Sebastian Andrzej Siewior , Vignesh Raghavendra , linux-omap@vger.kernel.org, Andy Shevchenko , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: Re: [PATCH v12 1/1] serial: core: Start managing serial controllers to enable runtime PM Message-ID: <20230601132012.GB14287@atomide.com> References: <20230525113034.46880-1-tony@atomide.com> <88d9edfe-2f39-b15f-f513-463eac6bf473@samsung.com> <20230601111147.GA14287@atomide.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230601111147.GA14287@atomide.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Tony Lindgren [230601 11:12]: > * Marek Szyprowski [230601 11:00]: > > This patch landed in today's linux next-20230601 as commit 84a9582fd203 > > ("serial: core: Start managing serial controllers to enable runtime > > PM"). Unfortunately it breaks booting some of my test boards. This can > > be easily reproduced with QEMU and ARM64 virt machine. The last message > > I see in the log is: > > > > [    3.084743] Run /sbin/init as init process > > OK thanks for the report. I wonder if this issue is specific to ttyAM > serial port devices somehow? Looks like the problem happens with serial port drivers that use arch_initcall(): $ git grep arch_initcall drivers/tty/serial/ drivers/tty/serial/amba-pl011.c:arch_initcall(pl011_init); drivers/tty/serial/mps2-uart.c:arch_initcall(mps2_uart_init); drivers/tty/serial/mvebu-uart.c:arch_initcall(mvebu_uart_init); drivers/tty/serial/pic32_uart.c:arch_initcall(pic32_uart_init); drivers/tty/serial/serial_base_bus.c:arch_initcall(serial_base_init); drivers/tty/serial/xilinx_uartps.c:arch_initcall(cdns_uart_init); We have serial_base_bus use module_init() so the serial core controller and port device associated with the physical serial port are not probed. The patch below should fix the problem you're seeing, care to test and if it works I'll post a proper fix? Note that if we ever have cases where uart_add_one_port() gets called even earlier, we should just call serial_base_init() directly when adding the first port. Regards, Tony 8< ------------------ diff --git a/drivers/tty/serial/serial_base_bus.c b/drivers/tty/serial/serial_base_bus.c --- a/drivers/tty/serial/serial_base_bus.c +++ b/drivers/tty/serial/serial_base_bus.c @@ -186,7 +186,7 @@ static int serial_base_init(void) return ret; } -module_init(serial_base_init); +arch_initcall(serial_base_init); static void serial_base_exit(void) { -- 2.40.1