Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2355020imu; Fri, 14 Dec 2018 09:38:39 -0800 (PST) X-Google-Smtp-Source: AFSGD/X0LjLkVsBEa6ud0xLUuzr0TQvlrCVmFrF8a2bJ+dSHRY4A4/mSvKRQdiuOEEXUX6a0yqW2 X-Received: by 2002:a63:6346:: with SMTP id x67mr3448403pgb.183.1544809119580; Fri, 14 Dec 2018 09:38:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544809119; cv=none; d=google.com; s=arc-20160816; b=suwGBpWEEXl1uQBUXzp3V2m1tGkJGiWzKHTf4W7SkzORSuXGELRo4XTpHcvUGPcQyR WJtWOsdzPqluAjGe9JsOr5zy6qy/NJ8Q3Byc9PmsOingbYqxSvTxjCagz5qVQNi20nJU OznHlxyFJlb1SsUumMmpGbeqinBh6qhkzqxuzADnyPu7TPa6LokoLfkzGle7WyaXiWfF UqZtFMi4b+RiuybMxeMhjMdMvdfQTRDgik4bEhYXi01KpvNfZmwQlMizhPrQA8hpVg4n O6dvGw0uIYJyvWHPqypSHT2kwGTFO5bRURDGjXwtOGj44X49AqOjcn3soyud9SjXya/Z 5AGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=W7w658+/MxXzo1Bg42TjiSleDO8mj07G78t+sihBwxE=; b=phyF3UO83aRlRw/7ti87K9YrYd0DaSV9py2Kxh/GCp3OvgUHidnHSrSomFeaGcD8Wu KFgoo8H4R9TVjAFJZIaOiIV+2okgBNfgtPhuXw/b1fA0f+gQWCZryKgrV6RDTNqDo+iO rtMMvInPR6AD+QfQLRE2TiFt5y8uZsJSWGgwa+k85kS7E4wUDegzsWlsw4UWQvVGZj47 +vC7Gc3Q9EXfIO/D3Kl+xWaEKMdsp7eurja6bnVbdCPxp1dREGHh0RzHfYpXS+yEvuxr SaqPwJ10B/KQVihYRs060IDwc5gY2nBGESixBY7+ycbdMRffOQrKWPJwmUCbiTcNgbiD Z06Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Blvvmt3B; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d4si4700477pfa.150.2018.12.14.09.38.23; Fri, 14 Dec 2018 09:38:39 -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=Blvvmt3B; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730395AbeLNRhB (ORCPT + 99 others); Fri, 14 Dec 2018 12:37:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:46168 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729127AbeLNRhB (ORCPT ); Fri, 14 Dec 2018 12:37:01 -0500 Received: from localhost (unknown [69.71.4.100]) (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 49658206C0; Fri, 14 Dec 2018 17:37:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544809021; bh=uS4FOfupJ3N5V32Gc9tDOTHOpl6Gtpm4zCVkokL6+8A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Blvvmt3BWGQ1W3SV0R9HAVyCJVZWjKYJnNOU5FmZllMIJnFvGqBWeDP9AtaTkeDLi U+Z53blD156yEbm0PudPmUsskS1yatBvNcKFuLy/SqOGS2kCgnan9v2sIQa+3IxMmv 2AwsY2xqsfwrhQl4eAdjCIPCYw9LNYRrwGleGOHQ= Date: Fri, 14 Dec 2018 11:36:58 -0600 From: Bjorn Helgaas To: Yanjiang Jin Cc: keith.busch@intel.com, yu.zheng@hxt-semitech.com, ruscur@russell.cc, sbobroff@linux.ibm.com, oohall@gmail.com, jinyanjiang@gmail.com, linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] PCI/AER: only insert one element into kfifo Message-ID: <20181214173658.GB20725@google.com> References: <1544603550-14208-1-git-send-email-yanjiang.jin@hxt-semitech.com> <1544603550-14208-2-git-send-email-yanjiang.jin@hxt-semitech.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1544603550-14208-2-git-send-email-yanjiang.jin@hxt-semitech.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 12, 2018 at 04:32:30PM +0800, Yanjiang Jin wrote: > 'commit ecae65e133f2 ("PCI/AER: Use kfifo_in_spinlocked() to > insert locked elements")' replace kfifo_put() with kfifo_in_spinlocked(). > > But as "kfifo_in(fifo, buf, n)" describes: > " * @n: number of elements to be added". > > We want to insert only one element into kfifo, not "sizeof(entry) = 16". > Without this patch, we would get 15 uninitialized elements. > > Signed-off-by: Yanjiang Jin Since this fixes ecae65e133f2, which was applied for v4.20, I applied this with Keith's reviewed-by to for-linus so we can get it into v4.20. For some reason the patch didn't apply, but I can't see why, so I just applied it by hand. Thanks! > --- > drivers/pci/pcie/aer.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c > index a90a919..fed29de 100644 > --- a/drivers/pci/pcie/aer.c > +++ b/drivers/pci/pcie/aer.c > @@ -1064,7 +1064,7 @@ void aer_recover_queue(int domain, unsigned int bus, unsigned int devfn, > .regs = aer_regs, > }; > > - if (kfifo_in_spinlocked(&aer_recover_ring, &entry, sizeof(entry), > + if (kfifo_in_spinlocked(&aer_recover_ring, &entry, 1, > &aer_recover_ring_lock)) > schedule_work(&aer_recover_work); > else > -- > 1.8.3.1 > > > > > This email is intended only for the named addressee. It may contain information that is confidential/private, legally privileged, or copyright-protected, and you should handle it accordingly. If you are not the intended recipient, you do not have legal rights to retain, copy, or distribute this email or its contents, and should promptly delete the email and all electronic copies in your system; do not retain copies in any media. If you have received this email in error, please notify the sender promptly. Thank you. > >