Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4225900ybi; Tue, 11 Jun 2019 03:08:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqzBisV5nb5eng/QJlOPm6FGerT1zlhhT/fHSAOOhol4Hqsi9cBdxw2MPV9ViNYqT/aFbp1H X-Received: by 2002:a63:5d05:: with SMTP id r5mr13321883pgb.222.1560247710425; Tue, 11 Jun 2019 03:08:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560247710; cv=none; d=google.com; s=arc-20160816; b=yovv3/4Dn10m12qBmIWdHAiz/pIlol2FzJ44fcAceGz59heQgK9nijzipJN8HVoj5D 8Zn9p4sd2QbPKj6lW8A1kz2KHQJ6jcNoF4o7slVIaIIQHI3H8JFsHEwyUdzuNgAFMBzS k1TWg7kmLkykJNNujFHyZvjU+oZDF5YX3bfyvnmSsB9+xFve15v04KjM6HcoPEaZw+Ac CBimhzz/Xrf2+0Z7FHwYoulzzdroUlTSDUnDNyHDoU67AXtR9MH9sR03atxTXg7MoWOe qXtJGduzqsfRL07FznWMhLGnd+enpy0yh+MQFl/2dcV24UX7wGVMLpD4nf0nmvSBGt+2 Kbsg== 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; bh=KCRFD1W9H9hYMCcPjJwEmQTHwQmh2asmT34as49mu7s=; b=g9x0thoqKTzSOtjkWN8BbkJoQX4DBv2tCEAgVGCEZAA0AuKXFX3fTmPD8Lr0S2vP1n 3CMA5rF0bpEETO4G5lXY4UcbPncvOKmyjm4ncJyidrSdZworb3vk+8135LO09FhoMT/F Zzah0n1yAb3av+p8Vls8RPuqktPtv/SipQ0s16XcX6n+KU1xIqqRKO/JmNX+EBQSwMes 8Yq4yHi1lGp2sHlGD5ETlK43kkzcN6+WhV2nDlxx2yUD70P4az4TdUr55KiCXE+5TWYj wyGuTRrMGqj8RoBGybWYUsErtzComaNDgLMsQkora7/zziSvLYbDzjUyLMQ6IWDm41SA iRFQ== ARC-Authentication-Results: i=1; mx.google.com; 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 k22si11105901pgh.268.2019.06.11.03.08.13; Tue, 11 Jun 2019 03:08:30 -0700 (PDT) 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; 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 S2405132AbfFKKHs (ORCPT + 99 others); Tue, 11 Jun 2019 06:07:48 -0400 Received: from foss.arm.com ([217.140.110.172]:57354 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404406AbfFKKHs (ORCPT ); Tue, 11 Jun 2019 06:07:48 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A7D65337; Tue, 11 Jun 2019 03:07:47 -0700 (PDT) Received: from redmoon (unknown [10.1.196.255]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0681F3F557; Tue, 11 Jun 2019 03:09:28 -0700 (PDT) Date: Tue, 11 Jun 2019 11:07:42 +0100 From: Lorenzo Pieralisi To: Alan Mikhak Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, kishon@ti.com, linux-riscv@lists.infradead.org, palmer@sifive.com, paul.walmsley@sifive.com Subject: Re: [PATCH v2] PCI: endpoint: Set endpoint controller pointer to null Message-ID: <20190611100742.GA29976@redmoon> References: <1558647944-13816-1-git-send-email-alan.mikhak@sifive.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1558647944-13816-1-git-send-email-alan.mikhak@sifive.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 23, 2019 at 02:45:44PM -0700, Alan Mikhak wrote: > Set endpoint controller pointer to null in pci_epc_remove_epf() > to avoid -EBUSY on subsequent call to pci_epc_add_epf(). > > Requires checking for null endpoint function pointer. > > Signed-off-by: Alan Mikhak > --- > drivers/pci/endpoint/pci-epc-core.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) Applied to pci/endpoint for v5.3, thanks. Lorenzo > diff --git a/drivers/pci/endpoint/pci-epc-core.c b/drivers/pci/endpoint/pci-epc-core.c > index e4712a0f249c..2091508c1620 100644 > --- a/drivers/pci/endpoint/pci-epc-core.c > +++ b/drivers/pci/endpoint/pci-epc-core.c > @@ -519,11 +519,12 @@ void pci_epc_remove_epf(struct pci_epc *epc, struct pci_epf *epf) > { > unsigned long flags; > > - if (!epc || IS_ERR(epc)) > + if (!epc || IS_ERR(epc) || !epf) > return; > > spin_lock_irqsave(&epc->lock, flags); > list_del(&epf->list); > + epf->epc = NULL; > spin_unlock_irqrestore(&epc->lock, flags); > } > EXPORT_SYMBOL_GPL(pci_epc_remove_epf); > -- > 2.7.4 >