Received: by 10.192.165.148 with SMTP id m20csp943738imm; Fri, 27 Apr 2018 09:58:20 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqpmAxbVAxq3CvLYP2MoOM9VA83N5/GsYvNN9bCQH1hHGK+fJkzSDvTC8ZFRTe+oD/N28db X-Received: by 2002:a65:4309:: with SMTP id j9-v6mr2693715pgq.375.1524848300696; Fri, 27 Apr 2018 09:58:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524848300; cv=none; d=google.com; s=arc-20160816; b=YqBU5PHp8qfBGX7v8LInJs9XYMdZ0oJNa/zj9POUfTjXp0lLJQZZdG8XUlzPne7IZ7 zBHGVChg7RZ8zI5enBOJCSudWhraIrddaW9srYRGOo14lIhIWx5XbiAluSb7nwjoVRxZ nS8qbay6oZxPU0dutNBRVS7ODpNjBZ130aJoyMnqyUVB2RyxX6BkDTH3vKuc4mkCMZuC H2hoN8X+cPWIrV+KLq9sTtisMPJHR8zQuCCacu3FvaVa36z3v/x9hHQ8pnHAZ7O+KFuv Ius72inG85qgkLX1cylCVR3ro5VcM8actprqBspxZzlW0ccnaOrM91U9hSlysvw3YLTk Y40Q== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date:arc-authentication-results; bh=qih4TmSlRvGBHxvPDhXLnzpC87N6MVLk9p0S7g/G0/k=; b=oIICMO+2wzfxX2E1OulMzVTJHJIA3ZSa59QqBnuEC8wEqxfNccmOxy6pSoC+JkslHY UyzVuk8ZUuTW0q71TY2fjWXfKkn/n2af1LSysz5f+nk7+OEmrZqxJLe3w1yhs8/3x+LT +1ik5HBDSRWgeS7JLNx4SlbDshX/AhIZ1MUcK3gUJMyH3u8/4A7pA/dPVXMMcMUkWqSU 7jincAycRnP+FDk7LrsgZcCf40erghu7cHyUoPav/KlDkU1r2HGasnkfZC06hEojJeWi 4Kqzpxhg01aZLATuEmtAmgy69TsHzzzWVZswrtzrss9OO2qhUuL3oe3a2zbcnXxGML/Q +5oA== 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 p5-v6si1497720plk.537.2018.04.27.09.58.06; Fri, 27 Apr 2018 09:58:20 -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 S1758857AbeD0Q42 (ORCPT + 99 others); Fri, 27 Apr 2018 12:56:28 -0400 Received: from foss.arm.com ([217.140.101.70]:43798 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757569AbeD0Q40 (ORCPT ); Fri, 27 Apr 2018 12:56:26 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6213615AD; Fri, 27 Apr 2018 09:56:26 -0700 (PDT) Received: from dupont (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BD9FB3F4FF; Fri, 27 Apr 2018 09:56:25 -0700 (PDT) Date: Fri, 27 Apr 2018 11:56:25 -0500 From: Kim Phillips To: Will Deacon Cc: Mark Rutland , Ganapatrao Kulkarni , , , , , , , , Subject: Re: [PATCH v4 2/2] ThunderX2: Add Cavium ThunderX2 SoC UNCORE PMU driver Message-Id: <20180427115625.b5191d381cd41e7ee092fea1@arm.com> In-Reply-To: <20180427160914.GA5286@arm.com> References: <20180425090047.6485-1-ganapatrao.kulkarni@cavium.com> <20180425090047.6485-3-ganapatrao.kulkarni@cavium.com> <20180426170624.bfcba885431d57d0de2a3ddd@arm.com> <20180427093027.ngtuoezyh6mtz26p@lakrids.cambridge.arm.com> <20180427081525.f9dcc756678baf3bb6e6e473@arm.com> <20180427143719.GA5093@arm.com> <20180427104629.2bff4b4b683a93ddf39f8df5@arm.com> <20180427160914.GA5286@arm.com> Organization: Arm X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 27 Apr 2018 17:09:14 +0100 Will Deacon wrote: > Kim, > > [Ganapat: please don't let this discussion disrupt your PMU driver > development. You can safely ignore it for now :)] > > On Fri, Apr 27, 2018 at 10:46:29AM -0500, Kim Phillips wrote: > > On Fri, 27 Apr 2018 15:37:20 +0100 > > Will Deacon wrote: > > > > > On Fri, Apr 27, 2018 at 08:15:25AM -0500, Kim Phillips wrote: > > > > On Fri, 27 Apr 2018 10:30:27 +0100 > > > > Mark Rutland wrote: > > > > > On Thu, Apr 26, 2018 at 05:06:24PM -0500, Kim Phillips wrote: > > > > > > On Wed, 25 Apr 2018 14:30:47 +0530 > > > > > > Ganapatrao Kulkarni wrote: > > > > > > > > > > > > > +static int thunderx2_uncore_event_init(struct perf_event *event) > > > > > > > > > > > This PMU driver can be made more user-friendly by not just silently > > > > > > returning an error code such as -EINVAL, but by emitting a useful > > > > > > message describing the specific error via dmesg. > > > > > > > > > > As has previously been discussed on several occasions, patches which log > > > > > to dmesg in a pmu::event_init() path at any level above pr_debug() are > > > > > not acceptable -- dmesg is not intended as a mechanism to inform users > > > > > of driver-specific constraints. > > > > > > > > I disagree - drivers do it all the time, using dev_err(), dev_warn(), etc. > > > > > > > > > I would appreciate if in future you could qualify your suggestion with > > > > > the requirement that pr_debug() is used. > > > > > > > > It shouldn't - the driver isn't being debugged, it's in regular use. > > > > > > For anything under drivers/perf/, I'd prefer not to have these prints > > > and instead see efforts to improve error reporting via the perf system > > > call interface. > > > > We'd all prefer that, and for all PMU drivers, why should ones under > > drivers/perf be treated differently? > > Because they're the ones I maintain... You represent a minority on your opinion on this matter though. > > As you are already aware, I've personally tried to fix this problem - > > that has existed since before the introduction of the perf tool (I > > consider it a syscall-independent enhanced error interface), multiple > > times, and failed. > > Why is that my problem? Try harder? It's your problem because we're here reviewing a patch that happens to fall under your maintainership. I'll be the first person to tell you I'm obviously incompetent and haven't been able to come up with a solution that is acceptable for everyone up to and including Linus Torvalds. I'm just noticing a chronic usability problem that can be easily alleviated in the context of this patch review. > > So until someone comes up with a solution that works for everyone > > up to and including Linus Torvalds (who hasn't put up a problem > > pulling PMU drivers emitting things to dmesg so far, by the way), this > > keep PMU drivers' errors silent preference of yours is unnecessarily > > impeding people trying to measure system performance on Arm based > > machines - all other archs' maintainers are fine with PMU drivers using > > dmesg. > > Good for them, although I'm pretty sure that at least the x86 folks are > against this crap too. Unfortunately, it doesn't affect them nearly as much as it does our more diverse platforms, which is why I don't think they care to do much about it. > > > Anyway, I think this driver has bigger problems that need addressing. > > > > To me it represents yet another PMU driver submission - as the years go > > by - that is lacking in the user messaging area. Which reminds me, can > > you take another look at applying this?: > > As I said before, I'm not going to take anything that logs above pr_debug > for things that are directly triggerable from userspace. Spin a version Why? There are plenty of things that emit stuff into dmesg that are directly triggerable from userspace. Is it because it upsets fuzzing tests? How about those be run with a patched kernel that somehow mitigates the printing? > using pr_debug and I'll queue it. How about using a ratelimited dev_err variant? > Have a good weekend, You too. Kim