Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp253992rwd; Sat, 13 May 2023 17:52:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4pYE/dhXAGl0TNY4tLhLT/5gYO7vNeOKSvAc3E24j0G0xkHMA39XBa93jHW0LeIENlvPq8 X-Received: by 2002:a05:6a21:32a8:b0:100:60f3:2975 with SMTP id yt40-20020a056a2132a800b0010060f32975mr29082069pzb.4.1684025555042; Sat, 13 May 2023 17:52:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684025555; cv=none; d=google.com; s=arc-20160816; b=LFD6t8fYpb93rW3HUNKV8YFMOp8cca42b/xeGRJos9Rq8y/EsEIvFt5wjphAlRVdoe Ov8aKVQsGPmyidbq8L+jonVOzWaLa4XK+wvsQ4fFbCzvtowADuf3s16rFzT9SFU+zfah H8ar7+KjrXPVLzgUADKGXESmfg7YwPTB3jFGu1ic6L+n4GGv8VvUaWOp5FJ5aM8NJNEb kIYpAO/wmU+PzLt9Y6FAi2iGdtu3FKw/xs/OIqvln+WdVgj7/IB5R/ZefiJW+QdztduD NxCJhja0LCZiW/Eht+FrRXYUAOolsKHvfzOGn8/IN2IUodTKFttMJ5nuXWgbqfczeIZN CbsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=21LjgyiapTUL0VEn9Xqdm4tKxcyDelWIOS3CqQVfj1Y=; b=JQsT5lNllqa4e1Nw+LjA78OzB2hRxeUN7jN9yI9BMRLp0EHk+7WonfDHoXYkMJI9XX wTut+fkGL230O1vIILnLsWsBCHOjPLwXgohnknGH4QLigtJ8hWDM01Z2bZdNEbikf2wa unDorlWE2uWS9PW9Ycmwr3Cbs+tyo9+DksNhiODOO9xUHu0/DIGuj+aOMIbZcadgU9As qTvr9XjsjRAZzpTBYfHURlX6kRX1Z5u5HfHv5K5yrI/iIuKOHanJwxhUu6WTHoCL5/2W 8ZHccU7neQuX6QMmQQmCDuaTVmbR3RR3sSd5mwy21QNu+QqasY0XWvTGsNT0D3M5PWZy vUiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=yWzM8woi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i128-20020a639d86000000b0052cb8690805si12311398pgd.393.2023.05.13.17.52.20; Sat, 13 May 2023 17:52:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=yWzM8woi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231128AbjEMWx0 (ORCPT + 99 others); Sat, 13 May 2023 18:53:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbjEMWxY (ORCPT ); Sat, 13 May 2023 18:53:24 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 945E426A1 for ; Sat, 13 May 2023 15:53:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Sender:Reply-To:Content-ID:Content-Description; bh=21LjgyiapTUL0VEn9Xqdm4tKxcyDelWIOS3CqQVfj1Y=; b=yWzM8woiWwu2moOmOeJ4jiRGut w5FOmu4pwQ8Jwo5bwUffog4DhfzVxbga44RsDyc83vzl0xMC9L84XjHe2VUuJUk596DIfth8Ti9Mk OTvrhrSJ1OlTdRhBSIPEj02oUBrS8Hft0rV98d+7tjrWcv+/TMGTVUwzmzawyZbfLvXyz6GYEnk03 fhnjoeoCMgsU0n7qBhMUJn8fpUJ9MFxqa+vC+fCHbw48i+ZbnFTXBODcKApSllyCdVmAqgQunD+iW wQM/zPUo/iDxdVJdRhRHqqT6iq//4mb70fkTfMUCXxolzEz2ucnxzlEmXtHe+0BpzB98zMjgI/wgC pzOeFzDQ==; Received: from [2601:1c2:980:9ec0::2764] by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1pxy75-00G1hD-2t; Sat, 13 May 2023 22:53:19 +0000 Message-ID: Date: Sat, 13 May 2023 15:53:19 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: [RFC PATCH] powerpc: udbg: export udbg_putc Content-Language: en-US To: =?UTF-8?Q?Pali_Roh=c3=a1r?= Cc: linux-kernel@vger.kernel.org, Michael Ellerman , Nicholas Piggin , Christophe Leroy , linuxppc-dev@lists.ozlabs.org, Arnd Bergmann References: <20230513055804.23775-1-rdunlap@infradead.org> <20230513091358.pzlexqnff5ydhlzf@pali> From: Randy Dunlap In-Reply-To: <20230513091358.pzlexqnff5ydhlzf@pali> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Pali, On 5/13/23 02:13, Pali Rohár wrote: > On Friday 12 May 2023 22:58:04 Randy Dunlap wrote: >> In a randconfig with CONFIG_SERIAL_CPM=m and >> CONFIG_PPC_EARLY_DEBUG_CPM=y, there is a build error: >> ERROR: modpost: "udbg_putc" [drivers/tty/serial/cpm_uart/cpm_uart.ko] undefined! >> >> The build can be fixed by exporting "udbg_putc" in udbg.c. >> >> OTOH, maybe something like this is more appropriate in >> arch/powerpc/Kconfig.debug? >> >> config PPC_EARLY_DEBUG_CPM >> bool "Early serial debugging for Freescale CPM-based serial ports" >> - depends on SERIAL_CPM >> + depends on SERIAL_CPM=y >> >> Signed-off-by: Randy Dunlap >> Cc: Michael Ellerman >> Cc: Nicholas Piggin >> Cc: Christophe Leroy >> Cc: linuxppc-dev@lists.ozlabs.org >> Cc: Arnd Bergmann >> Cc: "Pali Rohár" >> --- >> arch/powerpc/kernel/udbg.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff -- a/arch/powerpc/kernel/udbg.c b/arch/powerpc/kernel/udbg.c >> --- a/arch/powerpc/kernel/udbg.c >> +++ b/arch/powerpc/kernel/udbg.c >> @@ -14,6 +14,7 @@ >> #include >> >> void (*udbg_putc)(char c); >> +EXPORT_SYMBOL(udbg_putc); >> void (*udbg_flush)(void); >> int (*udbg_getc)(void); >> int (*udbg_getc_poll)(void); > > Hello! I do not think that it is a good idea to export udbg functions > for kernel modules. I have quickly looked at the cpm_uart driver file Sure, that was just a conversation starter. > drivers/tty/serial/cpm_uart/cpm_uart_core.c and it looks like that once > udbg from it is registered then there is no code for unregistering it. > So I have feeling that compiling cpm_uart driver as module should not be > allowed when CONFIG_SERIAL_CPM_CONSOLE is enabled, and early debug > should depend on CONFIG_CONSOLE_POLL || CONFIG_SERIAL_CPM_CONSOLE. The other change above also fixes the build error: (Option 2) >> config PPC_EARLY_DEBUG_CPM >> bool "Early serial debugging for Freescale CPM-based serial ports" >> - depends on SERIAL_CPM >> + depends on SERIAL_CPM=y Also, making SERIAL_CPM (cpm_uart driver) be restricted to not allow it as a module when SERIAL_CPM_CONSOLE is enabled [how does one express that in Kconfig language?] will cause a circular dependency since SERIAL_CPM_CONSOLE depends on SERIAL_CPM=y. It looks like you are suggesting reversing the dependencies. > Any other opinion? Yes, please. Otherwise I prefer my option 2. -- ~Randy