Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp2312717ybm; Thu, 23 May 2019 15:00:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqyGnDOxPiV093V6sM0jt/L2PGTtJ5e0mysC++JSY5N4caJOPUvVe1VRxJ3iG14TPKaVv5SK X-Received: by 2002:a17:90a:33c5:: with SMTP id n63mr4675208pjb.16.1558648807252; Thu, 23 May 2019 15:00:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558648807; cv=none; d=google.com; s=arc-20160816; b=RskMhpF6sd3iDtKZvEGpN1HfyMMmyvdpNKm/AgJPi+R4Dugulqk3lZ6lMYRPzhvSxu Fl/3RDceaLKKuvwFmHFkLZfHb/kN4zWc9Zfu9A/jSRq8s+n3O+1mbx2l9g051H96CDV1 ZOv5POdeYjjlEwDnhaaEwvKWKYB+9tFhswu/XcLPzCEZckCKGAc3rtFsg+/EWqNhB95+ xoYT+DKHb3UVZ6EzOCx27Ml6v58efOLvg09qFK3iw+1tXOezA9HfUPl4mdFQxfciJcFQ 3TMaMpkxigvZKeS9yaIW+WpABkCXYbmfSZoBKjDOEMS/7DP5UpwMrs+77fFFYGzoHg4V T5Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=5bG8FDPCw5QDc0u1AHZFZoHnM7vNJL8HNA0ePZzdpDk=; b=PH/jSO3W8G2B/gv1GjWh8lFHsRHLb8GbiQOFeVoD5Mp6AQnw1W4WExO6y8RkphIn+K +JrOte2DdYqW+1zCQoTTQIFCV2GLiJ5zFUhQReGf1yaPPgZ6Mn4+M0erprAnY2j/n1WS hEaLTOfEW/GJ4d+Jwut08DvnFZgt5uAea8XaB4W8HxJlmbwJMMU6K7IOJBxYeQKLRArb Hx01RtKUpn9YT23wy5vxzw4o8yV4J0e7yTpDolz2uIeHGIVE6B+bseO4g7JACRG9Vi+m CdhfvnSKDXoD/iOs8K7oL2S7AKdfd5SbAy8vZbXkgYGPpTgX1iORKxbV2yvyYg1w4Y77 f45g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b="Fl3Pw/aW"; 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 90si1220487plb.86.2019.05.23.14.59.50; Thu, 23 May 2019 15:00:06 -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="Fl3Pw/aW"; 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 S2388465AbfEWV5j (ORCPT + 99 others); Thu, 23 May 2019 17:57:39 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:40063 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387616AbfEWV5i (ORCPT ); Thu, 23 May 2019 17:57:38 -0400 Received: by mail-pf1-f195.google.com with SMTP id u17so3986444pfn.7 for ; Thu, 23 May 2019 14:57:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id; bh=5bG8FDPCw5QDc0u1AHZFZoHnM7vNJL8HNA0ePZzdpDk=; b=Fl3Pw/aWVCJMn6SdFWbo1CqRqGB0mnVIW3e7yT0Jp6ccc/IaYhJGmLRABpEpkm4chI hzN1v219lL1YsQYsp8ulmY3B7xLKFqj+lHIIPnadVhUbsM1kceLOAUawiv/G4mx8sror d3mgOjFFOkJjmEG08rzXgIEcVizuEjC23kgWJoheQr2kmJWyapUxyxsN55q8T5Mz3arE A33k6AviekRkWiRb7uTEoj6NDqlxJYfQaEv7m5ZbfSUqcS+uRBsGdZcO7ruHsqiydTy0 O8ju2Wgv+gipF2XFbz6z/arhAzMKA5M30weGAWeVW/ApnJcLxzNUYkrQjkDBZ//BkRrf tjHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=5bG8FDPCw5QDc0u1AHZFZoHnM7vNJL8HNA0ePZzdpDk=; b=Lguyz9YNQWLUhvhAf6MKHK/FG/NIlK2l4U35UZGDdVPKQc9kzojNFf549CRGVAVhV2 jkhwwDXBd0YLCmL1U7jVfUPCIab+xV9u2/czGyGjicw4xp/G1nb8w6eHywUNwcD9cJD6 1hGWByhNLcfkqEKmzifruifg0WkRuwHZoInEkLNYMcz241VgFEVsF3kkZJgn0C5/BxA+ G/CGPE84EW9B+lUN/9hWPmLY8OWqEuxK2k5+gdySSCbrjVlAq6xDZiUzO4mqKsr/BpLN tGeS9a0iZO6YEgemcpElTro83dMTGXoSDOcYK6QVyhTC4PR3k0ZzJu43MKEapSlTxo1i wnGw== X-Gm-Message-State: APjAAAUENPsMsIsDqoYlIqzOcEQsvJb2Oq9HkIidEOEgpeTcRhLoUB5J ZG8aJIdx85Hd1TbkVYsVDvTYwQ== X-Received: by 2002:a63:1e5b:: with SMTP id p27mr100433871pgm.213.1558648658166; Thu, 23 May 2019 14:57:38 -0700 (PDT) Received: from nuc7.sifive.com ([12.206.222.2]) by smtp.gmail.com with ESMTPSA id n37sm321966pjb.0.2019.05.23.14.57.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 23 May 2019 14:57:37 -0700 (PDT) From: Alan Mikhak X-Google-Original-From: Alan Mikhak < alan.mikhak@sifive.com > To: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, kishon@ti.com, lorenzo.pieralisi@arm.com, linux-riscv@lists.infradead.org, palmer@sifive.com, paul.walmsley@sifive.com Cc: Alan Mikhak Subject: [PATCH v2] PCI: endpoint: Clear BAR before freeing its space Date: Thu, 23 May 2019 14:57:27 -0700 Message-Id: <1558648647-14324-1-git-send-email-alan.mikhak@sifive.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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