Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1961490pxu; Sun, 6 Dec 2020 13:36:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJwlBPyTUyc8MEBkxVnWCnMgObwjIdJpoIygpOQP9ux84gr2yz2YDX40KfGo02x5m8CdGagi X-Received: by 2002:a05:6402:1421:: with SMTP id c1mr17493040edx.247.1607290603927; Sun, 06 Dec 2020 13:36:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607290603; cv=none; d=google.com; s=arc-20160816; b=Uxm/KlpFXCtE3RM0w4RQBNan/NXWxIF53fZWMATZI5ZniFHzXYWskIsKUX/hDlbOvt 0Q1RBHohHCxnHW/7hBbFGjXns/uIOf7UkHtD6XEtYuCtGcq45QMN3rbC8SczLEmRFawU qRZXHAKD6PjFwDIK5GyTUAyDTQhFGLGMkj92aeQzMO2GI7xViwKlgN1VZMu2RNNUj0J9 vDoh5D6GrVDM4uam9/b8IQhpPeV5pnSR5Te3s38STQYLmwUt6lyIrEr33Wq6iuvz5zPD xvJrITq69mSkMGi54DW3luPP2Xfd+bi640hikRNIF/eTY8djBVtNxGzaXMRlQQROFKqh AtnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=i0kvt6ku7dAshK929r0L7tdGjX3+YC59SkyEOBkJSfw=; b=OsBy1rWQ+iCu/OJ64mtL5ZJ6GNiphKFi4nnfmnz9xYijQDTta8p0RUw2QgJGKAwOzZ IUvU/ABIC4fWLzUxuTOSnpKXNyLByEbEJbHbycP6h/YTkiAR5d3q2Sfy/frC4YAsei8S ZtXv+zx8ghAMTP9YPalwbfCWQNzOXiX+z556eCLzux4UpLzBbpMsnTchMLjRqkTPIm98 LacCmuYhj7Gush88JTQa33s1YJ4CNJf1nS2CJNrBEUZXt6cK/l7b4R2vkhR/V7HrOdUK 41Ay+Ne0CXRNps9neRwG5SUjRYDznSTRya+1jSJqxyyRcCAclxziyfwiAOkuq+HA6/n5 TMBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ViQOkJ7y; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=qW6VGJay; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q23si5480459ejn.17.2020.12.06.13.36.19; Sun, 06 Dec 2020 13:36:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ViQOkJ7y; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=qW6VGJay; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727930AbgLFVdw (ORCPT + 99 others); Sun, 6 Dec 2020 16:33:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725977AbgLFVdv (ORCPT ); Sun, 6 Dec 2020 16:33:51 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58E43C0613D0; Sun, 6 Dec 2020 13:33:11 -0800 (PST) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1607290389; 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: in-reply-to:in-reply-to:references:references; bh=i0kvt6ku7dAshK929r0L7tdGjX3+YC59SkyEOBkJSfw=; b=ViQOkJ7y6DMyLlYw2pFNCVTsHYT9GQX+KFN7FN+6iKVQCrO3nwmjriqX669EFSMG5yd329 v3a0aGmc7aViLV60ceiXGva2d7J/MXBparmVZo+0UOOtHkGm6MHksfFAuZ7uvo/tq7WXwd l+banRKjlAmprFfZDb8wu5DFOhVf/7wrK/7xjdmys22NF43KBmReMl0yw1qDBotj4lDcB6 syzd5dIGhzb1SQpegOTY4TBmxTLuAq/ocxhhaPDBae/XoqbSuSViXRmKYotaqdYZFrPpBR zPmdc3AOy62qlpBZtmGzMga5lt2JAk15B4I+2Yo1WCxGnYphkC/oRDbHURsFNw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1607290389; 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: in-reply-to:in-reply-to:references:references; bh=i0kvt6ku7dAshK929r0L7tdGjX3+YC59SkyEOBkJSfw=; b=qW6VGJay7Y1fRfpZcbDGnE0csxZUMMAVFl/445dozitpWgLzD9ZrsjtZhGTYRnXTNR7Y5U O+a1wpKLG8xbaeAg== To: Jerry Snitselaar , linux-kernel@vger.kernel.org Cc: linux-integrity@vger.kernel.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Jani Nikula , Rodrigo Vivi , David Airlie , Daniel Vetter , Jarkko Sakkinen , Jason Gunthorpe , Peter Huewe , James Bottomley , Matthew Garrett , Hans de Goede , Peter Zijlstra Subject: Re: [PATCH v3 2/4] drm/i915/pmu: Use kstat_irqs to get interrupt count In-Reply-To: <875z5e99ez.fsf@nanos.tec.linutronix.de> References: <20201205014340.148235-1-jsnitsel@redhat.com> <20201205014340.148235-3-jsnitsel@redhat.com> <875z5e99ez.fsf@nanos.tec.linutronix.de> Date: Sun, 06 Dec 2020 22:33:09 +0100 Message-ID: <87o8j67h7u.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Dec 06 2020 at 17:38, Thomas Gleixner wrote: > On Fri, Dec 04 2020 at 18:43, Jerry Snitselaar wrote: >> Now that kstat_irqs is exported, get rid of count_interrupts in >> i915_pmu.c > > May I ask why this has been merged in the first place? > > Nothing in a driver has ever to fiddle with the internals of an irq > descriptor. We have functions for properly accessing them. Just because > C allows to fiddle with everything is not a justification. If the > required function is not exported then adding the export with a proper > explanation is not asked too much. > > Also this lacks protection or at least a comment why this can be called > safely and is not subject to a concurrent removal of the irq descriptor. > The same problem exists when calling kstat_irqs(). It's even documented > at the top of the function. And as pointed out vs. that TPM thing this really could have been a trivial i915->irqs++; in the interrupt handler and a read of that instead of iterating over all possible cpus and summing it up. Oh well... Thanks, tglx