diff options
author | Alan Mikhak <alan.mikhak@sifive.com> | 2019-05-24 00:57:27 +0300 |
---|---|---|
committer | Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> | 2019-06-11 12:57:54 +0300 |
commit | dbb7bbcc8ad248b1ab05bd27dfdb587ef4023dab (patch) | |
tree | 897ba4e75074e961113d697d4e21676705403862 /drivers/pci/endpoint/functions/pci-epf-test.c | |
parent | 3041a643613a2530ade35a9ae97709a9da4c0c72 (diff) | |
download | linux-dbb7bbcc8ad248b1ab05bd27dfdb587ef4023dab.tar.xz |
PCI: endpoint: Clear BAR before freeing its space
Associated pci_epf_bar structure is needed in pci_epc_clear_bar() to
clear a BAR correctly but it is reset in pci_epf_free_space() (that
is called first) which results in pci_epc_clear_bar() failure.
Reorder the pci_epc_clear_bar()/pci_epf_free_space() calls execution
to fix the issue.
Signed-off-by: Alan Mikhak <alan.mikhak@sifive.com>
[lorenzo.pieralisi@arm.com: reworded the commit log]
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
Diffstat (limited to 'drivers/pci/endpoint/functions/pci-epf-test.c')
-rw-r--r-- | drivers/pci/endpoint/functions/pci-epf-test.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c index e8bcc924dbf8..1cfe3687a211 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); } } } |