Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp11385207rwr; Sat, 13 May 2023 02:29:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7nDbwBvBpAj1Et4rZ9yytpRJa7LLkdhwWmKV5yVxHAPGsD36/mJGSdqrPFnXyV/9BwrHwC X-Received: by 2002:a05:6a00:2441:b0:643:4d69:efe0 with SMTP id d1-20020a056a00244100b006434d69efe0mr32616557pfj.4.1683970185879; Sat, 13 May 2023 02:29:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683970185; cv=none; d=google.com; s=arc-20160816; b=TXpZ+0RkR+27T438CzglohAIiMxevIw2oA8b/iZMKTaM5YtkW2uHPgAqbenstCYFki 1W8uIXipuXulfctXSA8S8nHW3zcy9/tnelmhIM6SjjpTz8PDwOh4EkjLS+Y9NC4fLo0J t1jCcA9ClY+hR2zqtOGhD2no8d3AzGWI1tH0O6wSsP73fGO9Rxrk+wyKbn9zcXiO9TE5 9rVdzUgP9ZkeDHSWRc0NKWrdqa8Jrsw9t/gnLEAG5/Rn0nzqZngbvSdpPXyp5yDi+kWq YWeWArV0rFhmLzbcnfE+SYMsu6ix9OfMUSgpazVqalZtd3ZA3Cokv8Toit0syYrV5HsG 0iHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ntoTH3Ce82m84EFqkKO7vQ0Tp2niIWV5RNbg36QZGog=; b=GAvq3V+bPU7ep/qjfDhkYtKCdRkB8W63ANw2sT6LMik4+yO+p4xLvdnpZtFeh3LGAG PlxIIxs4ulCagFQzWdbd1sWES+EEh8JhHFGp4FQxxFGT7yx/23wAYC2oNIlr2+l/z0kP r7/wd6b/B+/V4uRwudj5DBS4xRmgYqJTV6Ha9Vxvt4MKgH479X0o0juV1N/lJmH77Afk WyQDH8UNi/YaLCZYxB1YRLPOiTtucBUnxgt7lY6UesbU3DKiKE366ch5JrfHD0cKHZ7z J1JORrJzbNA5pJDRrSbuLQONKI3JLBvNeyH5K49H1aHsImDSxmna78oDNwMLJhjFL3v8 Rx/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="slhfgg2/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h13-20020a056a00000d00b00625e7f9b859si12529954pfk.339.2023.05.13.02.29.33; Sat, 13 May 2023 02:29:45 -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=@kernel.org header.s=k20201202 header.b="slhfgg2/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237329AbjEMJOF (ORCPT + 99 others); Sat, 13 May 2023 05:14:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235448AbjEMJOE (ORCPT ); Sat, 13 May 2023 05:14:04 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AA1E30F1 for ; Sat, 13 May 2023 02:14:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B4C9A60C88 for ; Sat, 13 May 2023 09:14:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C9152C433D2; Sat, 13 May 2023 09:14:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683969242; bh=R8BaXvrEqkDtkKLwWmr0dANy8SCHQgwY/EbJ9khwnXo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=slhfgg2/AWnHNrzIZxddnKGXkyOmDvpcHXzF2mTBQ2ok81VA4ycpZV3005Jsx9z1K MuE5pHI7/jTrY9dBlQdZEySom/ao2+H4XppHAz7r8eq0xkR+eg6pCBV1mi1Cg1CGW4 5+wyYHRf/a0dgK1AbYCLi6THyDZMyQGcpMYajQUCd/ZfaFLSX/T5L6Om1LpxTYi5mX O3dxg3CXzsXwkgS9wJInVewBTTHM0mumqOoNO5+NWeoSg7yJ5DrL6KEE9hEbtYFdqR qvn5Dcg5CbmYcCUslNnKwYZRokqik4UqzwSTLiU+DqxPewHLga1c+dHKUcukL07aW4 Mr7YPtKexBuhg== Received: by pali.im (Postfix) id D53FF7F9; Sat, 13 May 2023 11:13:58 +0200 (CEST) Date: Sat, 13 May 2023 11:13:58 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Randy Dunlap Cc: linux-kernel@vger.kernel.org, Michael Ellerman , Nicholas Piggin , Christophe Leroy , linuxppc-dev@lists.ozlabs.org, Arnd Bergmann Subject: Re: [RFC PATCH] powerpc: udbg: export udbg_putc Message-ID: <20230513091358.pzlexqnff5ydhlzf@pali> References: <20230513055804.23775-1-rdunlap@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230513055804.23775-1-rdunlap@infradead.org> User-Agent: NeoMutt/20180716 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 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 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. Any other opinion?