Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1217545ybb; Wed, 1 Apr 2020 18:33:41 -0700 (PDT) X-Google-Smtp-Source: APiQypIy5TKZorvblrk4y+KOJKfAQ5pTz3dUKlSiTg87HjghVlGC/t8NsFvbGJqYdKKhWnsZM/l0 X-Received: by 2002:a4a:da48:: with SMTP id f8mr901106oou.44.1585791221313; Wed, 01 Apr 2020 18:33:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585791221; cv=none; d=google.com; s=arc-20160816; b=rj7Ue3u4oHGsagY30h6K8VLLfvXtZkJT32dKL9mLERa9h71P8Us851uLKmhVU/ETRa BWK88Qb+AY6boPDS7e4AzWWKhoMteXnTkhJSM4pVF/TnmuFjuegsex5lez2TRbzMYkyC DmTGFuWtT93CgIVjFkL/dGsEG+QADrK+WRIoo8hh7rWLkCqAfPXp5L9MH51ve4JZeR1i KMEquyxJ+1d9PQ7S8Ca8RpxLqoAepBCSA5xqj8HEac+hixiM1+VpYvxLv2/c1RFhfaes TKUIpQdlEWsR5q4Xb3tXvExsmyUzC2Crzcxr3yItop/wEqM9l//IP/a5JCqw+ju4Onab DDSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=ey9tSf9jVmYM5euzOfgdkkElgtNyX6b9YwgjW3/jcys=; b=ElcQDh1/5T0zqPusQc647gTvy7L09Y5WwqE5Xh9KmL0D9gtDAK5fpVpcksUaPoSRoY FA7mds7WugyQeK92wWwNEG2xo9US8z+tkWUdmpF0rCG56vv1Zz135HaVDsMQBIqxr6iJ /rocPZVpgr1GXBm80S55DEYpuaruURhAFldKNy3nT7iQaZDaaTJa6Tq97GT7RufFTfii V1+vXC7KbHZMkb00IzHAn/17xMPGIO+Zov/+8rrGAI2tZ6/lrQ03fikGgeANGmmhXucL C9kTYUM8ZImTeXOj8NwD3pVKx0zbbaaKIv33RcPWS/jm0Pg8vmTbXE1Uq840ikfnpr7N L6IA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n26si1618186otr.78.2020.04.01.18.33.28; Wed, 01 Apr 2020 18:33:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732739AbgDBBbq (ORCPT + 99 others); Wed, 1 Apr 2020 21:31:46 -0400 Received: from smtprelay0003.hostedemail.com ([216.40.44.3]:35042 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732462AbgDBBbp (ORCPT ); Wed, 1 Apr 2020 21:31:45 -0400 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-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,,RULES_HIT:41:355:379:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1431:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:1801:2198:2199:2393:2553:2559:2562:2828:3138:3139:3140:3141:3142:3353:3622:3865:3866:3868:3870:3871:4250:4321:4605:5007:6119:6120:6742:6743:7901:7903:9036:10004:10400:10848:11026:11232:11658:11914:12043:12296:12297:12438:12679:12740:12760:12895:13019:13069:13095:13255:13311:13357:13439:14181:14659:14721:21080:21088:21212:21433:21627:21660:21990:30054:30060:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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));