Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp687410ybv; Thu, 13 Feb 2020 07:46:58 -0800 (PST) X-Google-Smtp-Source: APXvYqzWLfrj5h2dpV0unm+b4R6kYfQwCqc8kiN7ApsmXMGDIg1CCQRWN2oOwoJSNQSRkRXnLp7K X-Received: by 2002:a9d:68da:: with SMTP id i26mr14042453oto.65.1581608818623; Thu, 13 Feb 2020 07:46:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581608818; cv=none; d=google.com; s=arc-20160816; b=wHicZBKhs2Lp1B+cn5vof2lWhRWSg9nuzN4ioiBDaqp6NQd0HlBtqP0KiCmNzsqKz4 npUtDMxI/9ZWVRPXuDmaelWOMz1CrRtAQNVkC4BHSB/8WNvzVtgZcJwC/x3cjpy1tfhB bFlHqzPvj2HXKz5PbhES4KuRNlA3CaNcdXga3zBaw+Q5/Sk9DgKcWSW08dvra5kenC9j rZJ6bcdkCpswYJeS1Mh2F3Ma34gcv25qujOCKxmfNRoTL/zVSyPayzEzzQNS0z8WVPnY Xh4AnFzIwcZ7aBTi2j3qesiXDGd45Mhj6IgHQ85SxfZYgPiz+rDp5PXIqQ8ifi/FkRtC 5+KA== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=6G79idB+RhZ7nxVhESstjvKnvTSPIJzCIBjG3K1qPCU=; b=AxZslxSbLD+z5AP2uyvcK160MD6+WDZeqoC4jtej3ZemtHLycyrnrUMr7SUUj1fCGl HGJsc8eJWBI8T1BaGPvOnIYHmiKxwIu1sCoFvnj7ktX8+SNMU1xAgiluCKGThe9KXC8b QgZVbPdL0pu0TspjeXCJC+44kWaYX0FEKae6caBDK5wRLaLqzPIurSBipJYDlZYP/DEk JAXWJnzZon0ev881Wd5iybRA6T57ciWJgQaUgCbawftaKWANulkTXLjVPWtkhUobdLnr Ifo5Mhq319bGjJwjtNb+MCNh3xKESBwj9p9KfbekmyPcYoAgOs2iJKRC8TSfAtgVAfIG oPDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jPp1XSQl; 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 k19si1276295otp.33.2020.02.13.07.46.46; Thu, 13 Feb 2020 07:46:58 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=jPp1XSQl; 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 S1729435AbgBMPqf (ORCPT + 99 others); Thu, 13 Feb 2020 10:46:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:49514 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729331AbgBMP1O (ORCPT ); Thu, 13 Feb 2020 10:27:14 -0500 Received: from localhost (unknown [104.132.1.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1A82D24676; Thu, 13 Feb 2020 15:27:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581607634; bh=jQfY7XU1tHvH0sV+8wi4VdPGQNr5e3cMW4fXX/ijlL8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jPp1XSQlgqE5PxmPB6GXKFyZpMEihQfUKt4mk4GhGrfra607dFHrU2DWVs4rsSlCj KKDbHxFZw3JSj7K6soGg1Ye4CC9lv4+c1WOH9PKsG4r60xwOAFxSQOdsvaSKbLGyU3 +v1EJXuLerK4Y3KYTrQ177niDdTHDM0n3QoYpeeA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dongdong Liu , Bjorn Helgaas Subject: [PATCH 5.4 19/96] PCI/AER: Initialize aer_fifo Date: Thu, 13 Feb 2020 07:20:26 -0800 Message-Id: <20200213151846.722858494@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200213151839.156309910@linuxfoundation.org> References: <20200213151839.156309910@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dongdong Liu commit d95f20c4f07020ebc605f3b46af4b6db9eb5fc99 upstream. Previously we did not call INIT_KFIFO() for aer_fifo. This leads to kfifo_put() sometimes returning 0 (queue full) when in fact it is not. It is easy to reproduce the problem by using aer-inject: $ aer-inject -s :82:00.0 multiple-corr-nonfatal The content of the multiple-corr-nonfatal file is as below: AER COR RCVR HL 0 1 2 3 AER UNCOR POISON_TLP HL 4 5 6 7 Fixes: 27c1ce8bbed7 ("PCI/AER: Use kfifo for tracking events instead of reimplementing it") Link: https://lore.kernel.org/r/1579767991-103898-1-git-send-email-liudongdong3@huawei.com Signed-off-by: Dongdong Liu Signed-off-by: Bjorn Helgaas Signed-off-by: Greg Kroah-Hartman --- drivers/pci/pcie/aer.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/pci/pcie/aer.c +++ b/drivers/pci/pcie/aer.c @@ -1387,6 +1387,7 @@ static int aer_probe(struct pcie_device return -ENOMEM; rpc->rpd = port; + INIT_KFIFO(rpc->aer_fifo); set_service_data(dev, rpc); status = devm_request_threaded_irq(device, dev->irq, aer_irq, aer_isr,