Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp2407853ybm; Thu, 23 May 2019 16:53:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqxW1666fgZ+GQJV4DF4ShXRn0sSmBtQ+NQ8bcT/sxQdl6ecNN9rnjQ4XG+IZ6ZDLOH9phgk X-Received: by 2002:a17:90a:840a:: with SMTP id j10mr5325742pjn.29.1558655581824; Thu, 23 May 2019 16:53:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558655581; cv=none; d=google.com; s=arc-20160816; b=Z3nI4DkGbSeJzFpxKYxRYUEaiuIC09JYUGN5Vn1uhQvF3qVZuWQubw7Gr9Kp+qE5Bc 7PLmLlXm7plXs9s0mVkJJ14Eo8zzsGBrebrn869Pp89p+jcwkq/DFm1w6RjOZexgajGB 6py0Nm36RyHonx+VUQGTwxWGn2XYnYjgHtZqKBshp0BefPHBbzi8VGXZD1yDa/YFdaCW NwfuptiMxNemRC4Wr5L3Spau/f6FqmLu0NhIf2SSpGaok1gmF24qtX1lF2y3pj6m2Hc+ fpn4+5yrcV80TrH2IaFiYDyhyR1Js1QGVo0EDzMALmh/gh14QiZUpLVagXtd8ITweGV4 ZFIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=fhBZncJ2MpAJBlQB8zRObQZP1s/1ENOk1yYHyMaqLDc=; b=o2tPmFa0kDYzQUTY38NmY33ZxqzkwwVHAs9WiX4ZhoSANIK70jSN10jMDyvjNG/hgR uuH8NPjWWVb4+zRrTpLDNUWPT+b4fMypsEcUgJKjJh06xOaZ8fQvfNgGp7a0j4IExHve BucSlO0xbJjMngy2zQ6gBwLYgHn19ENtkIBEUPmVv5c2GntdVt89epi1ARhdmybXF7jt IkBijcEiIHaDBovcODyRgPWCGJCmhJ3KZJU41Hs4Ht+9h/8WjvqjPyB6T3ACusbQ0D5L XLCO/IBupCiT2tCviLfAkziZ/Gqbgrw9A8MSMoziT/1MVdRVaW3PadaQv+j/ll+rV5Wf l38w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=CwBpnrcY; 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 w207si1631403pff.69.2019.05.23.16.52.42; Thu, 23 May 2019 16:53:01 -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; dkim=pass header.i=@sifive.com header.s=google header.b=CwBpnrcY; 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 S2388664AbfEWXvD (ORCPT + 99 others); Thu, 23 May 2019 19:51:03 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:41721 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388232AbfEWXvC (ORCPT ); Thu, 23 May 2019 19:51:02 -0400 Received: by mail-lf1-f66.google.com with SMTP id d8so5662759lfb.8 for ; Thu, 23 May 2019 16:51:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=fhBZncJ2MpAJBlQB8zRObQZP1s/1ENOk1yYHyMaqLDc=; b=CwBpnrcYLEefMJFuxPFCRN4iTwN5WamdydpeCsRT71D0rSxVvB/+yh7YpZYxb0y/st 5uIc3/aNLUiHEsPWzhZUOxFhlgrSOswawfDUiHAURx0ICrBTwtC4fGeRzeK+bQ9fxzO2 AUqaFa327tG+7cjZlXV0TpFwev6e76lpur/kCU2/RB8eCN98srXtjhNhv3+3AfiHhVYt VOUOoJ5Pj7J83Mghc5cBnVxIjhyDuj/U6gaRNjvAzyqixszSffdBW835Yysw9I2gNvPW YuzNr3ULFt2eu7hOGS1lkEYi8akIZfNoRkPNDZvD25cMEQQZ5axf+KYvtbiHXAS7lkDn qbMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=fhBZncJ2MpAJBlQB8zRObQZP1s/1ENOk1yYHyMaqLDc=; b=lutgcQo9i2PCExsx4KXacj2lUy2JCK7lDKvSr7dUTBslG9XS4o5d24MBJJJulDUSvL XCsjAnjNDwpzOioj0XA5R004FX1kQxyFDrqPFIf+RC/+NnM3nasptd/lU1Bcby6BIP15 VzkfV1F6akN7BG370bMIlvxY85j8GV/38HfOW8x7Iuw306XnDC0+7XnbvdVAH914rJ54 UT8MkQ03QKqQKueau8Eu+H/mzzE8rOWk8z0+OKWNedU1IHHgSvee5twE4SdWxdLeK4RW wZV2KuUef3ifQYyS44SLgPxPq4T10LWglbQrMVoBgAr8Q18dfx+c7uYSCPlAtefsS/ts J8Ww== X-Gm-Message-State: APjAAAX8EP7afjQ8KFrvcDwcKiC9wVPADqJQKsFxJK5Ma4G/5Q6avb1F 4y/PiOzxuMe8HVy1QieDmt1itM988ulHk4vEM/dJEA== X-Received: by 2002:ac2:4286:: with SMTP id m6mr7494929lfh.150.1558655461095; Thu, 23 May 2019 16:51:01 -0700 (PDT) MIME-Version: 1.0 References: <1558648647-14324-1-git-send-email-alan.mikhak@sifive.com> In-Reply-To: <1558648647-14324-1-git-send-email-alan.mikhak@sifive.com> From: Alan Mikhak Date: Thu, 23 May 2019 16:50:50 -0700 Message-ID: Subject: Re: [PATCH v2] PCI: endpoint: Clear BAR before freeing its space To: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, kishon@ti.com, lorenzo.pieralisi@arm.com, linux-riscv@lists.infradead.org, Palmer Dabbelt , Paul Walmsley , Bjorn Helgaas , gustavo.pimentel@synopsys.com, wen.yang99@zte.com.cn, kjlu@umn.edu 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 +Bjorn Helgaas, +Gustavo Pimentel, +Wen Yang, +Kangjie Lu On Thu, May 23, 2019 at 2:57 PM Alan Mikhak wrote: > > Associated pci_epf_bar structure is needed in pci_epc_clear_bar() but > would be cleared in pci_epf_free_space(), if called first, and BAR > would not get cleared. > > Signed-off-by: Alan Mikhak > --- > drivers/pci/endpoint/functions/pci-epf-test.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c > index 27806987e93b..f81a219dde5b 100644 > --- a/drivers/pci/endpoint/functions/pci-epf-test.c > +++ b/drivers/pci/endpoint/functions/pci-epf-test.c > @@ -381,8 +381,8 @@ static void pci_epf_test_unbind(struct pci_epf *epf) > epf_bar = &epf->bar[bar]; > > if (epf_test->reg[bar]) { > - pci_epf_free_space(epf, epf_test->reg[bar], bar); > pci_epc_clear_bar(epc, epf->func_no, epf_bar); > + pci_epf_free_space(epf, epf_test->reg[bar], bar); > } > } > } > -- > 2.7.4 >