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 0CFC6C77B7E for ; Thu, 1 Jun 2023 15:15:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233969AbjFAPPn (ORCPT ); Thu, 1 Jun 2023 11:15:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233675AbjFAPPm (ORCPT ); Thu, 1 Jun 2023 11:15:42 -0400 Received: from muru.com (muru.com [72.249.23.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AD00C12C; Thu, 1 Jun 2023 08:15:40 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 1142B80F1; Thu, 1 Jun 2023 15:07:08 +0000 (UTC) Date: Thu, 1 Jun 2023 18:07:06 +0300 From: Tony Lindgren To: Greg Kroah-Hartman Cc: Jiri Slaby , Andy Shevchenko , Andy Shevchenko , Dhruva Gole , Ilpo =?utf-8?B?SsOkcnZpbmVu?= , John Ogness , Johan Hovold , Sebastian Andrzej Siewior , Vignesh Raghavendra , linux-omap@vger.kernel.org, Marek Szyprowski , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] serial: core: Fix probing serial_base_bus devices Message-ID: <20230601150706.GD14287@atomide.com> References: <20230601141445.11321-1-tony@atomide.com> <2023060112-onion-disparate-8ce8@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2023060112-onion-disparate-8ce8@gregkh> Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org * Greg Kroah-Hartman [230601 14:21]: > On Thu, Jun 01, 2023 at 05:14:44PM +0300, Tony Lindgren wrote: > > If a physical serial port device driver uses arch_initcall() we fail to > > probe the serial_base_bus devices and the serial port tx fails. This is > > because as serial_base_bus uses module_initcall(). > > > > Let's fix the issue by changing serial_base_bus to use arch_initcall(). > > This will only work if the linking order is such that this will always > come before the drivers. Is that the case here? I guess based on Makefile. And also if serial drivers are modules as we export uart_add_one_port() from serial_base.ko. But yeah this is pretty fragile potentially. Hmm maybe we could keep module_init() and then also call serial_base_init() on uart_add_one_port() path if not yet initialized? Probably the module_init() should be still there for case when no serial port device drivers are loaded and serial_base is unloaded.. Regards, Tony