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 64FC3C433EF for ; Tue, 26 Jul 2022 06:57:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232056AbiGZG5s (ORCPT ); Tue, 26 Jul 2022 02:57:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229952AbiGZG5p (ORCPT ); Tue, 26 Jul 2022 02:57:45 -0400 Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A033D2715E for ; Mon, 25 Jul 2022 23:57:43 -0700 (PDT) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4LsSQq2lPSz4x1f; Tue, 26 Jul 2022 16:57:39 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1658818661; bh=g/ZRqB0p6ohpHeie0cs0FL1sIIleC/KZ3LH0jCnnNXA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=o+F2eptfMZFXVJJw+G1G2BMAZWxeIymUGkiaKj5XwBob0XFsM1igSY1T+PMnumncD 2fkZhAbSyQajpxcIhBafQUPy9FoFCDtu5xsg/0dC8WAiLZGHLyjlp3Np4HHw5QW2Ml uINL3YlDsxZdT537dHXbJfp8aa64GkdO8x5ej0U88sNtfTsjrwrHKmHm4hnMKdncOj cqnoCgO8SeDpioGiIvOC+NWwYteGQgW0lGxDm6rD2+eZ80Hvkz09xYyDcvAXYCYi9z t06g0vLq3Jk8QPhpTy5kIsa6+80B0parsxOw+U2AkvzLCkiy+GuwSlmdlOPpb+w6Lm 7vtz0SMGAyDyg== From: Michael Ellerman To: Yury Norov , Andy Shevchenko Cc: Linux Kernel Mailing List , Andy Shevchenko , Rasmus Villemoes , "open list:LINUX FOR POWERPC PA SEMI PWRFICIENT" , Benjamin Herrenschmidt , Paul Mackerras , Stephen Rothwell , "Jason A. Donenfeld" Subject: Re: [PATCH 1/2] powerpc: drop dependency on in archrandom.h In-Reply-To: References: <20220723214537.2054208-1-yury.norov@gmail.com> <20220723214537.2054208-2-yury.norov@gmail.com> Date: Tue, 26 Jul 2022 16:57:38 +1000 Message-ID: <87edy8bbtp.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Yury Norov writes: > On Mon, Jul 25, 2022 at 09:28:12AM +0200, Andy Shevchenko wrote: >> On Sun, Jul 24, 2022 at 12:19 AM Yury Norov wrote: >> > >> > archrandom.h includes to refer ppc_md. This causes >> > circular header dependency, if generic nodemask.h includes random.h: >> > >> > In file included from include/linux/cred.h:16, >> > from include/linux/seq_file.h:13, >> > from arch/powerpc/include/asm/machdep.h:6, >> > from arch/powerpc/include/asm/archrandom.h:5, >> > from include/linux/random.h:109, >> > from include/linux/nodemask.h:97, >> > from include/linux/list_lru.h:12, >> > from include/linux/fs.h:13, >> > from include/linux/compat.h:17, >> > from arch/powerpc/kernel/asm-offsets.c:12: >> > include/linux/sched.h:1203:9: error: unknown type name 'nodemask_t' >> > 1203 | nodemask_t mems_allowed; >> > | ^~~~~~~~~~ >> > >> > Fix it by removing dependency from archrandom.h >> >> ... >> >> > EXPORT_SYMBOL_GPL(pm_power_off); >> >> ^^^ (Note this and read below) >> >> ... >> >> > +EXPORT_SYMBOL(arch_get_random_seed_long); >> >> It can't be like this. Brief browsing of the callees shows that. > > Is my understanding correct that you're suggesting to make it GPL? > > ppc_md is exported with EXPORT_SYMBOL(), and the function is in header, > so it's available for non-GPL code now. I don't want to change it. That's true, your change maintains the status quo. But I think we actually don't need it exported to modules, I think it's a private detail of the RNG <-> architecture interface, not something that modules should be calling. So I think it's OK to drop the EXPORT_SYMBOL, either in this patch or a subsequent one if you don't want to rebase. cheers