Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3047294pxu; Tue, 8 Dec 2020 01:57:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJzPOWhXy9RSEnNmdZ3A9S35h0tFBy9Jd69l7SEQht0pcKsbydQN7LyWAnNrUj9LBtFkZ5Ak X-Received: by 2002:a50:ed17:: with SMTP id j23mr24135402eds.218.1607421478917; Tue, 08 Dec 2020 01:57:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607421478; cv=none; d=google.com; s=arc-20160816; b=O7l9dDFfeTS8aBYkHndpkGDb5UPhVCnwNOwLxE0bjw1+OPOTlBbIRxZcHAaMp/nvRW kLVWcmXiZjhQ0h8hZC9vcX7qZ2318CP1Gst08GuFVIi+c07/qpjJe39/DPfq/sROK5yX kVcuYk2TSoCkXlbQ8bn3MAGl9RW5PPBx55sIFQSoNasmCW94+T99LSn0lSmtCzc+HZQn 4fvvQheF9ZWDsWt/CzCdzpAzk9SQf3lXQp+hW0CRJ1Zk/6iNtyRx3YB32h1/cZ8QLkZE Mwbm5SL4JMGaCHcfV56bjv6oGjhCcJxEDBho3255pbktOW1dBp1fxqsaq5vKplUGPx9L 55DA== 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:dkim-signature:date; bh=Z4+x+jHPAZcPLuiSDtbeobeD2D+4/LqKNMH609mu9ow=; b=OtyWDD7FmF3+KIk+67LcGTd+8XZoP+v32HMmFay+S89Kzr713XDsIl6+DqLwdRVu36 AQPZOCrm9o6Aauru8wu/kF3oTLSrEoR8hdWrOkJfkQmE6yLUoxB0yNytwbNpAdQltcpU YQMjVdXLft/xZcC6lPJKHYfLow34HTPgzmvgNHy1fWkn9f1tv7hjLhn7I3m66eJAr/00 fit+53AFnfpvaIIewCdQ5FNzlGyR6MyjZ2bBTV2rEEnImJKxWZwpJ9jkwyIJ3t+fsQDL FUwM4g3cBAQj3Fu1Uc4SR0nPrjDEAGayfU4CZuvqVo98mEc0DfNHd/swhg4h9/pWYHLq VU/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QaB10O3r; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m2si7814831ejj.36.2020.12.08.01.57.36; Tue, 08 Dec 2020 01:57:58 -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=@kernel.org header.s=k20201202 header.b=QaB10O3r; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727273AbgLHJzU (ORCPT + 99 others); Tue, 8 Dec 2020 04:55:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:53052 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726334AbgLHJzU (ORCPT ); Tue, 8 Dec 2020 04:55:20 -0500 Date: Tue, 8 Dec 2020 11:54:32 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1607421279; bh=XaAiKY++wv+M/pEQ1YMGklfnktr6P64K75FF//gLABU=; h=From:To:Cc:Subject:References:In-Reply-To:From; b=QaB10O3rXRlsz3jL/My6bXO3XK0Nt8oWAtezsz2d6c8xEOp09HWJfMHLPyW47A9o5 acD+9HQ8TOhBioB6ICPp8erOZNmu0tqsM0cSLPQxiCXt30p5namEDToHhhfxHygra1 ijoy3TJghKlWlRBo20u+fHI8krrFK1qWWBjWmieU090Pk4QglIxsfAzFWEYBXo6zcD ozrHclftiywg7TvFA+UMAEyDRDuc6C2IzCtzf3bucwszo/yl7WU/r0nsxgd9l7kUBe gdFo1qPgEJgJM98lQ5pNlGd8UIwdL+KLpFLA8Y5mBgy/4jmooYgc9ga4jc+IWUTar2 KJ9EghZZxxaTQ== From: Jarkko Sakkinen To: Thomas Gleixner Cc: Jerry Snitselaar , linux-kernel@vger.kernel.org, linux-integrity@vger.kernel.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Jani Nikula , Rodrigo Vivi , David Airlie , Daniel Vetter , 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 Message-ID: <20201208095432.GA44672@kernel.org> References: <20201205014340.148235-1-jsnitsel@redhat.com> <20201205014340.148235-3-jsnitsel@redhat.com> <875z5e99ez.fsf@nanos.tec.linutronix.de> <87o8j67h7u.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87o8j67h7u.fsf@nanos.tec.linutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Dec 06, 2020 at 10:33:09PM +0100, Thomas Gleixner wrote: > 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... I'm fine with that. > Thanks, > > tglx /Jarkko