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 X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A784C169C4 for ; Tue, 29 Jan 2019 09:33:56 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D62E1214DA for ; Tue, 29 Jan 2019 09:33:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D62E1214DA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 43phC60fLSzDq5Y for ; Tue, 29 Jan 2019 20:33:54 +1100 (AEDT) Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 43ph8k753TzDqGp for ; Tue, 29 Jan 2019 20:31:50 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au 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 (2048 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPSA id 43ph8k4Qm4z9sDB; Tue, 29 Jan 2019 20:31:50 +1100 (AEDT) From: Michael Ellerman To: Tyrel Datwyler , Michael Bringmann , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [RFC 1/6] powerpc:/drc Define interface to acquire arch-specific drc info In-Reply-To: References: <20181214204914.16435.59083.stgit@powerkvm6.aus.stglabs.ibm.com> <20181214204957.16435.29255.stgit@powerkvm6.aus.stglabs.ibm.com> Date: Tue, 29 Jan 2019 20:31:49 +1100 Message-ID: <87a7jjstbu.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Juliet Kim , Thomas Falcon , Tyrel Datwyler Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Tyrel Datwyler writes: > On 12/14/2018 12:50 PM, Michael Bringmann wrote: >> Define interface to acquire arch-specific drc info to match against >> hotpluggable devices. The current implementation exposes several >> pseries-specific dynamic memory properties in generic kernel code. >> This patch set provides an interface to pull that code out of the >> generic kernel. >> >> Signed-off-by: Michael Bringmann >> --- >> include/linux/topology.h | 9 +++++++++ >> 1 file changed, 9 insertions(+) >> >> diff --git a/include/linux/topology.h b/include/linux/topology.h >> index cb0775e..df97f5f 100644 >> --- a/include/linux/topology.h >> +++ b/include/linux/topology.h >> @@ -44,6 +44,15 @@ > > As far as I know pseries is the only platform that uses DR connectors, and I > highly doubt that any other powerpc platform or arch ever will. So, I'm not sure > that this is really generic enough to belong in topology.h. Right. This does not belong in include/linux. > If anything I would > suggest putting this in an include in arch/powerpc/include/ named something like > drcinfo.h or pseries-drc.h. That will make it visible to modules like rpaphp > that want/need to use this functionality. Yeah that would make more sense. Using "arch" in the name is wrong, it's pseries specific so pseries_find_drc_match() would be more appropriate. >> +int arch_find_drc_match(struct device_node *dn, >> + bool (*usercb)(struct device_node *dn, >> + u32 drc_index, char *drc_name, >> + char *drc_type, u32 drc_power_domain, >> + void *data), >> + char *opt_drc_type, char *opt_drc_name, >> + bool match_drc_index, bool ck_php_type, >> + void *data); This function signature is kind of insane. You end with calls like: + return arch_find_drc_match(dn, rpaphp_add_slot_cb, + NULL, NULL, false, true, NULL); Which is impossible to parse. I feel like maybe this isn't the right level of abstraction. cheers