Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp645436pxa; Fri, 14 Aug 2020 13:55:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQ3U1N2b9QTMSrDV+xDQqX6q90vqcwO3pDxAl91k4RJQH/wUbnD3dz4ir95QveYi+QbBj8 X-Received: by 2002:a17:906:4acd:: with SMTP id u13mr4213336ejt.4.1597438557808; Fri, 14 Aug 2020 13:55:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597438557; cv=none; d=google.com; s=arc-20160816; b=S06KrLepA4FDZ4ZVgYSADPfM76KNDkyv/Z2bjXciTBqvt1Oy6tsjIccK/pgV7HfmmA omlw2bxicypJp0eQ3Bk/kHvI2I6P/LhrcakaIkm+2nTE0XUII6gikPaW48qRYfeEbUYk 8XXOkrt+x5mMp7UHV7kU9IyQYe5jbUEq/mrhG1/1Y/vHhoD82ihPMTmbXX4rbzrskOnJ D4s1BSOAH8Ii3V/3lhvQOWV2rqeG6UaFmtIxWHLHDb7SyjAI6x3vcEcwoIl8C5tt6oOR LzPQsRLHmweGdWiIbQ8s2JZUxuBlt9IHLwlJFgIP7Aq9fELsF5JUGgtlz60v38ofTgE8 aOCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=n2Ni9359dcr16qHd7uex6bvG3qB/zLCaoKn6OD0jAmk=; b=VEh2EjfLAkZ1wKzz/+cqYqhP0Vq+A4eqlclLDiCba7AzODKK84uccnEI6KA3YT+2xP 9r5BugBCfNNNc3j6mBpOyIQZjF1FnJVBlYO45L3b2lZC56P0jle7zH4HJ26d9ZxMBU0a mpDSIr4vRHLNzGa1eJts9fQ8XqvIJdyH1hNhsJWRU/8lSjvpw+wvqt0SFFGWGGc+hv95 f1IdfVhaY4b87IEbkXvmKzwjE0gu05flHbRT0VRNlR8oWGGV4vqMzJZCUfZusrA8DBkD WB2ESHSbnvMYX09YKTaWU3MF/p4Zow3xYe4u+ItzgpSpSgxmtvE1B/l62xjp+BB3rKwr a3Gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZAQA2SeR; 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 r21si7063577edc.313.2020.08.14.13.55.34; Fri, 14 Aug 2020 13:55:57 -0700 (PDT) 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=default header.b=ZAQA2SeR; 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 S1728342AbgHNRpX (ORCPT + 99 others); Fri, 14 Aug 2020 13:45:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:36322 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726213AbgHNRpX (ORCPT ); Fri, 14 Aug 2020 13:45:23 -0400 Received: from mail-ot1-f52.google.com (mail-ot1-f52.google.com [209.85.210.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F2D1420838; Fri, 14 Aug 2020 17:45:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597427123; bh=FiIcjZUHsrXzXH0x/aRcjN5xj+GMmd6ZOirtzojIXcY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ZAQA2SeRvHDUZUCMEMhk/0up8jQO6zukqnZPWP2/qF2LxON+B1HgoWgA/aPl1RNA7 qtJbKBIz4H7GgYO6dX6Ge62lOOT16nrHFZKhmD2Ez7iBwdidw6GnjDn+71qIYW6vVB eQC7EmThFZFXHOkecVbdctpD+ccrkYJynET6VPu4= Received: by mail-ot1-f52.google.com with SMTP id k12so8229332otr.1; Fri, 14 Aug 2020 10:45:22 -0700 (PDT) X-Gm-Message-State: AOAM531YlG85wTcCJPTgxKfXDXmXdX6Isun3I0FwukXkSoIASwQ196bI WOR24Obi5zLDD5MzFJpKmI9+Zkm3OCXKPaaC3Q== X-Received: by 2002:a05:6830:1b79:: with SMTP id d25mr2509020ote.107.1597427122326; Fri, 14 Aug 2020 10:45:22 -0700 (PDT) MIME-Version: 1.0 References: <20200806041455.11070-1-mark.tomlinson@alliedtelesis.co.nz> In-Reply-To: <20200806041455.11070-1-mark.tomlinson@alliedtelesis.co.nz> From: Rob Herring Date: Fri, 14 Aug 2020 11:45:10 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4] PCI: Reduce warnings on possible RW1C corruption To: Mark Tomlinson Cc: Ray Jui , Bjorn Helgaas , Scott Branden , Florian Fainelli , Lorenzo Pieralisi , PCI , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 5, 2020 at 10:15 PM Mark Tomlinson wrote: > > For hardware that only supports 32-bit writes to PCI there is the > possibility of clearing RW1C (write-one-to-clear) bits. A rate-limited > messages was introduced by fb2659230120, but rate-limiting is not the > best choice here. Some devices may not show the warnings they should if > another device has just produced a bunch of warnings. Also, the number > of messages can be a nuisance on devices which are otherwise working > fine. > > This patch changes the ratelimit to a single warning per bus. This > ensures no bus is 'starved' of emitting a warning and also that there > isn't a continuous stream of warnings. It would be preferable to have a > warning per device, but the pci_dev structure is not available here, and > a lookup from devfn would be far too slow. > > Suggested-by: Bjorn Helgaas > Fixes: fb2659230120 ("PCI: Warn on possible RW1C corruption for sub-32 bit config writes") > Signed-off-by: Mark Tomlinson > --- > changes in v4: > - Use bitfield rather than bool to save memory (was meant to be in v3). > > drivers/pci/access.c | 9 ++++++--- > include/linux/pci.h | 1 + > 2 files changed, 7 insertions(+), 3 deletions(-) Reviewed-by: Rob Herring