Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp168758ybi; Fri, 24 May 2019 01:53:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqyyGemaQLP4fh9PuoiDAI+w0vcy5Ohd5Y3+I+HJB2lkYkI7INak+cozqgXRieFMcNVMbVSz X-Received: by 2002:a17:902:1347:: with SMTP id r7mr60454159ple.45.1558688039607; Fri, 24 May 2019 01:53:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558688039; cv=none; d=google.com; s=arc-20160816; b=sTT65sSUCAKKN0RwHlUKtR66RzUd0Q4JfMjvOibHUpVrIYnYGW3O+agyowsJZUQl6G qiNb61osKIXDpRouyWxTZxPWUxW14kVDtUHxU2GCneSP21tEzPyEdiptFmCn9Fsa3Flr nQf2ir13RnsmPVwHgnje8uqAqki93zQ4jlUlgv5NCrr8RZ6TUOfoLQZWEnci2iOG9x2q 7WNqXPvXP1D+Qt/9LymwL9kqXqT2AUcbO9wtG9eq/VIXMeJNEg9a80XIh20ZJOwTdz2z 8iJ+z1TCSqJQzRiFAFSusEK4SrCVK4DWHpRos0lbBkA7TIUs6gHDi8PiF5c5kFb7zLO8 +fEg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:dkim-signature; bh=tVT52Dzdto40qLgUQsoiwvxwFkE3lFwq1Lgc68900vM=; b=dkRyxVFZwFYKGpp40pPA5+jcrapqA//bQyiEhbabDAkKRIp4mcCHqlBe0t+9axzu/F LYmZAlZaIpO+y+XFYSCUq1n8Y5R8Nxg0oYIeGq9NEUnq4+md+OY+7lA+wnd/r0U7srml Rq7tYXvpR/9Gr/0LieAQxpRnFArslj3/LaU5JAV32W05K/uyBJKiRjmCe8qp7g5eCpB8 /mnysvG3ncb9RcGGeL2F7UwYBJ6EnxCIqP/pUjs2kbp6UtyMcr+kdtc5Y3sZp0bzy7ES b/MfhnZ0XDdGK/ur85IUpO6FYfa+8vX23zyb4wJWYYHDdl/BnnFiFdXruETS+PKEBB96 Jj/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Kcvrh1kX; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m8si2988730pgt.140.2019.05.24.01.53.40; Fri, 24 May 2019 01:53:59 -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=@ti.com header.s=ti-com-17Q1 header.b=Kcvrh1kX; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389745AbfEXIwC (ORCPT + 99 others); Fri, 24 May 2019 04:52:02 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:34044 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389542AbfEXIwC (ORCPT ); Fri, 24 May 2019 04:52:02 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x4O8psb4026496; Fri, 24 May 2019 03:51:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1558687914; bh=tVT52Dzdto40qLgUQsoiwvxwFkE3lFwq1Lgc68900vM=; h=Subject:To:References:From:Date:In-Reply-To; b=Kcvrh1kXVoX/YJiWEs8BfbWsIDglItrja6+dBLtuB9DVYFkvrV0oRVqmyjZk4oTp7 grZVsyeaA5YhCj8O6plfJUE8oIS279hb7BaWMb/8nIEa55c8C9QM97qR75Kj193kCD SMgZoWRxEJuw2ANWHSTkyUNAbtbzE+Ks3V0XzjJU= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x4O8psvr094843 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 24 May 2019 03:51:54 -0500 Received: from DFLE103.ent.ti.com (10.64.6.24) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 24 May 2019 03:51:54 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Fri, 24 May 2019 03:51:54 -0500 Received: from [172.24.190.233] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id x4O8poJT045361; Fri, 24 May 2019 03:51:50 -0500 Subject: Re: [PATCH v2] PCI: endpoint: Clear BAR before freeing its space To: Alan Mikhak , , , , , Palmer Dabbelt , Paul Walmsley , Bjorn Helgaas , , , References: <1558648647-14324-1-git-send-email-alan.mikhak@sifive.com> From: Kishon Vijay Abraham I Message-ID: Date: Fri, 24 May 2019 14:20:36 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24/05/19 5:20 AM, Alan Mikhak wrote: > +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 Acked-by: Kishon Vijay Abraham I >> --- >> 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 >>