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=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 E0737C43331 for ; Thu, 2 Apr 2020 01:31:45 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9C33D20721 for ; Thu, 2 Apr 2020 01:31:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9C33D20721 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=perches.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 32E018E0008; Wed, 1 Apr 2020 21:31:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2B81E8E0007; Wed, 1 Apr 2020 21:31:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 180118E0008; Wed, 1 Apr 2020 21:31:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0191.hostedemail.com [216.40.44.191]) by kanga.kvack.org (Postfix) with ESMTP id F0BA28E0007 for ; Wed, 1 Apr 2020 21:31:44 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id ACF992DFA for ; Thu, 2 Apr 2020 01:31:44 +0000 (UTC) X-FDA: 76661188128.27.home22_f324eee5895a X-HE-Tag: home22_f324eee5895a X-Filterd-Recvd-Size: 5244 Received: from smtprelay.hostedemail.com (smtprelay0243.hostedemail.com [216.40.44.243]) by imf01.hostedemail.com (Postfix) with ESMTP for ; Thu, 2 Apr 2020 01:31:44 +0000 (UTC) Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay05.hostedemail.com (Postfix) with ESMTP id 0FB2E1802914A; Thu, 2 Apr 2020 01:31:44 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: magic31_e7601e651344 X-Filterd-Recvd-Size: 4003 Received: from XPS-9350.home (unknown [47.151.136.130]) (Authenticated sender: joe@perches.com) by omf11.hostedemail.com (Postfix) with ESMTPA; Thu, 2 Apr 2020 01:31:39 +0000 (UTC) Message-ID: Subject: Re: [PATCH v4 08/25] ocxl: Emit a log message showing how much LPC memory was detected From: Joe Perches To: Dan Williams , Alastair D'Silva Cc: "Aneesh Kumar K . V" , Oliver O'Halloran , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Frederic Barrat , Andrew Donnellan , Arnd Bergmann , Greg Kroah-Hartman , Vishal Verma , Dave Jiang , Ira Weiny , Andrew Morton , Mauro Carvalho Chehab , "David S. Miller" , Rob Herring , Anton Blanchard , Krzysztof Kozlowski , Mahesh Salgaonkar , Madhavan Srinivasan , =?ISO-8859-1?Q?C=E9dric?= Le Goater , Anju T Sudhakar , Hari Bathini , Thomas Gleixner , Greg Kurz , Nicholas Piggin , Masahiro Yamada , Alexey Kardashevskiy , Linux Kernel Mailing List , linuxppc-dev , linux-nvdimm , Linux MM Date: Wed, 01 Apr 2020 18:29:42 -0700 In-Reply-To: References: <20200327071202.2159885-1-alastair@d-silva.org> <20200327071202.2159885-9-alastair@d-silva.org> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.34.1-2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, 2020-04-01 at 01:49 -0700, Dan Williams wrote: > On Sun, Mar 29, 2020 at 10:23 PM Alastair D'Silva wrote: > > This patch emits a message showing how much LPC memory & special purpose > > memory was detected on an OCXL device. [] > > diff --git a/drivers/misc/ocxl/config.c b/drivers/misc/ocxl/config.c [] > > @@ -568,6 +568,10 @@ static int read_afu_lpc_memory_info(struct pci_dev *dev, > > afu->special_purpose_mem_size = > > total_mem_size - lpc_mem_size; > > } > > + > > + dev_info(&dev->dev, "Probed LPC memory of %#llx bytes and special purpose memory of %#llx bytes\n", > > + afu->lpc_mem_size, afu->special_purpose_mem_size); > > A patch for a single log message is too fine grained for my taste, > let's squash this into another patch in the series. Is the granularity of lpc_mem_size actually bytes? Might this be better as KiB or something using functions Maybe something like: unsigned long si_val(unsigned long val) { static const char units[] = "BKMGTPE"; const char *unit = units; while (!(val & 1023) && unit[1]) { val >>= 10; unit++; } return val; } char si_type(unsigned long val) { static const char units[] = "BKMGTPE"; const char *unit = units; while (!(val & 1023) && unit[1]) { val >>= 10; unit++; } return *unit; } so this could be something like: dev_info(&dev->dev, "Probed LPC memory of %#llu%c and special purpose memory of %#llu%c\n", si_val(afu->lpc_mem_size), si_type(afu->lpc_mem_size), si_val(afu->special_purpose_mem_size), si_type(afu->special_purpose_mem_size));