Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp252305iob; Wed, 18 May 2022 01:10:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynaaUqqmyjeoB1rGMsgzKSsaBYMH5yLdwNo89SOasHIqIEuxN/5PCV/yprvS3EYBPhHdBO X-Received: by 2002:a17:90a:940d:b0:1df:359b:2f9e with SMTP id r13-20020a17090a940d00b001df359b2f9emr18389904pjo.235.1652861428115; Wed, 18 May 2022 01:10:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652861428; cv=none; d=google.com; s=arc-20160816; b=shj8AtLra415rogqZM6h/6ePKIW1tlJA6oHcwsKsyW2laDF5AO4niBgHKXuLtXVe74 BFswbWZsDL81M7IrNGb2WXpCjoN2/h26O4kkL6d1EGbIeRRXE9X+HYQYbwnmzqrTK9Yf /5TfHTsOSz1/uPnZnHRU2yqgY8Phg3sf13Pl4wQoZPpW9YpJkFGdZhEQmb6GRkd77TPT nSDkG+iDlNP/tHjf/B74y6G6HGizNbnpOdA/416D6XBs3XvjD+BsWZsdmgk5lFhv5ePI QGQe4DHlkh9Pb+6nBuDCfu5h9BfVR817uFAx4+R2KoRRdZZMsbR3BZ6XD7Tx5EjixaTd Cb6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=OU2r3ndLVLZSWGk/2sjKDH+rpFBxg12x0Rgx+8y4HgM=; b=qYcmz2f+vfB1qvvkwaDsDabl6LfOIgDII4zyEV1q59oIR/btN61Hh6xA1KxibxN+PO qDZ3WoyW/BeO1bQgA4gy8ViweuhiD+3HssIZyyxYbcv4hXRIzzFS/nOb/1NWp5t6LW7c 0EkEIx9Bvk/3FISNFF9abe171EYWKxhLcio17YQY4//V+pCaDpQYxofQbUCPJ68RQC00 0c9S6X7Y07EHuR9tJ+MHg5lVvmji8btExBKrq1sXESH4cz1vHOGy4yIU9wOC+0Nzr3PY UXDsiNl/gdBeTvQzDmDw9Q3efqBz2W7fBecvueNqzHe0AyNJAF9ofMPLKjYMUPxHqlsP 6oWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=e2FTJ+Qa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id mq4-20020a17090b380400b001dfad1f5c55si2240626pjb.164.2022.05.18.01.10.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 01:10:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=e2FTJ+Qa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 57E072C133; Wed, 18 May 2022 01:10:26 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232721AbiERIKT (ORCPT + 99 others); Wed, 18 May 2022 04:10:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232697AbiERIKQ (ORCPT ); Wed, 18 May 2022 04:10:16 -0400 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 077BA25EBC; Wed, 18 May 2022 01:10:15 -0700 (PDT) Received: from zn.tnic (p200300ea974657d0329c23fffea6a903.dip0.t-ipconnect.de [IPv6:2003:ea:9746:57d0:329c:23ff:fea6:a903]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 385BC1EC054C; Wed, 18 May 2022 10:10:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1652861410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=OU2r3ndLVLZSWGk/2sjKDH+rpFBxg12x0Rgx+8y4HgM=; b=e2FTJ+QaJQ8Ao+EsjaQTEozFWCOYTpSdLqG6Ll38gR7gX0/1ndoQiVGhQkF14aDsSTuSSe 8DijoeDr+Z3gw9rGRzvDrVuCk5cNfiThrHsOcwq//5JhUp0O/HMfetcRdWrfVIQPWQ4JUC 8ZiY3AmOMzTa+W4+KlV3XqqFgGaTBGY= Date: Wed, 18 May 2022 10:10:05 +0200 From: Borislav Petkov To: Yazen Ghannam Cc: linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, Smita.KoralahalliChannabasappa@amd.com, muralidhara.mk@amd.com, naveenkrishna.chatradhi@amd.com Subject: Re: [PATCH 06/18] EDAC/amd64: Add prep_chip_selects() into pvt->ops Message-ID: References: <20220509145534.44912-1-yazen.ghannam@amd.com> <20220509145534.44912-7-yazen.ghannam@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220509145534.44912-7-yazen.ghannam@amd.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Mon, May 09, 2022 at 02:55:22PM +0000, Yazen Ghannam wrote: > From: Muralidhara M K > > GPU Nodes will need to set the number of available Chip Selects, i.e. > Base and Mask values, differently than existing systems. A function > pointer should be used rather than introduce another branching condition. Yeah, it looks to me like all that detection logic should be split eventually. Looking at read_mc_regs(), it has if (pvt->umc) { __read_mc_regs_df(pvt); goto skip; } at the top, then a whole bunch of legacy stuff and then at the skip label some common stuff... Another thing you could consider is to have common functionality carved out into helpers with "common" in the name and then call those from both UMC and DCT paths. Perhaps that'll help keep the init paths sane. That is, short of splitting this driver. We did the splitting for Intel and there we have a common, librarized code which gets linked into a couple of drivers. You don't have to do this too - just putting it out there as an alternative. The per-family function pointers design could be good too, if done right. The advantage being, you have a single driver for all, yadda yadda... > Prepare for this by adding prep_chip_selects() to pvt->ops and set it > as needed based on currently supported systems. > > Use a "umc" prefix for modern systems, since these use Unified Memory > Controllers (UMCs). > > Use a "dct" prefix for newly-defined legacy functions, since these > systems use DRAM Controllers (DCTs). > > Signed-off-by: Muralidhara M K > Signed-off-by: Naveen Krishna Chatradhi What does Naveen's SOB mean here? Co-developed-by perhaps? -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette