All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] PCI: endpoint: Clear BAR before freeing its space
@ 2019-05-23 21:57 ` Alan Mikhak
  0 siblings, 0 replies; 8+ messages in thread
From: Alan Mikhak @ 2019-05-23 21:57 UTC (permalink / raw)
  To: linux-pci, linux-kernel, kishon, lorenzo.pieralisi, linux-riscv,
	palmer, paul.walmsley
  Cc: Alan Mikhak

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 <alan.mikhak@sifive.com>
---
 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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v2] PCI: endpoint: Clear BAR before freeing its space
@ 2019-05-23 21:57 ` Alan Mikhak
  0 siblings, 0 replies; 8+ messages in thread
From: Alan Mikhak @ 2019-05-23 21:57 UTC (permalink / raw)
  To: linux-pci, linux-kernel, kishon, lorenzo.pieralisi, linux-riscv,
	palmer, paul.walmsley
  Cc: Alan Mikhak

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 <alan.mikhak@sifive.com>
---
 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


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] PCI: endpoint: Clear BAR before freeing its space
  2019-05-23 21:57 ` Alan Mikhak
@ 2019-05-23 23:50   ` Alan Mikhak
  -1 siblings, 0 replies; 8+ messages in thread
From: Alan Mikhak @ 2019-05-23 23:50 UTC (permalink / raw)
  To: linux-pci, linux-kernel, kishon, lorenzo.pieralisi, linux-riscv,
	Palmer Dabbelt, Paul Walmsley, Bjorn Helgaas, gustavo.pimentel,
	wen.yang99, kjlu

+Bjorn Helgaas, +Gustavo Pimentel, +Wen Yang, +Kangjie Lu


On Thu, May 23, 2019 at 2:57 PM Alan Mikhak <alan.mikhak@sifive.com> 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 <alan.mikhak@sifive.com>
> ---
>  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
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] PCI: endpoint: Clear BAR before freeing its space
@ 2019-05-23 23:50   ` Alan Mikhak
  0 siblings, 0 replies; 8+ messages in thread
From: Alan Mikhak @ 2019-05-23 23:50 UTC (permalink / raw)
  To: linux-pci, linux-kernel, kishon, lorenzo.pieralisi, linux-riscv,
	Palmer Dabbelt, Paul Walmsley, Bjorn Helgaas, gustavo.pimentel,
	wen.yang99, kjlu

+Bjorn Helgaas, +Gustavo Pimentel, +Wen Yang, +Kangjie Lu


On Thu, May 23, 2019 at 2:57 PM Alan Mikhak <alan.mikhak@sifive.com> 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 <alan.mikhak@sifive.com>
> ---
>  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
>

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] PCI: endpoint: Clear BAR before freeing its space
  2019-05-23 23:50   ` Alan Mikhak
@ 2019-05-24  8:50     ` Kishon Vijay Abraham I
  -1 siblings, 0 replies; 8+ messages in thread
From: Kishon Vijay Abraham I @ 2019-05-24  8:50 UTC (permalink / raw)
  To: Alan Mikhak, linux-pci, linux-kernel, lorenzo.pieralisi,
	linux-riscv, Palmer Dabbelt, Paul Walmsley, Bjorn Helgaas,
	gustavo.pimentel, wen.yang99, kjlu



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 <alan.mikhak@sifive.com> 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 <alan.mikhak@sifive.com>

Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
>> ---
>>  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
>>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] PCI: endpoint: Clear BAR before freeing its space
@ 2019-05-24  8:50     ` Kishon Vijay Abraham I
  0 siblings, 0 replies; 8+ messages in thread
From: Kishon Vijay Abraham I @ 2019-05-24  8:50 UTC (permalink / raw)
  To: Alan Mikhak, linux-pci, linux-kernel, lorenzo.pieralisi,
	linux-riscv, Palmer Dabbelt, Paul Walmsley, Bjorn Helgaas,
	gustavo.pimentel, wen.yang99, kjlu



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 <alan.mikhak@sifive.com> 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 <alan.mikhak@sifive.com>

Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
>> ---
>>  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
>>

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] PCI: endpoint: Clear BAR before freeing its space
  2019-05-23 21:57 ` Alan Mikhak
@ 2019-06-11 10:09   ` Lorenzo Pieralisi
  -1 siblings, 0 replies; 8+ messages in thread
From: Lorenzo Pieralisi @ 2019-06-11 10:09 UTC (permalink / raw)
  To: Alan Mikhak
  Cc: linux-pci, linux-kernel, kishon, linux-riscv, palmer, paul.walmsley

On Thu, May 23, 2019 at 02:57:27PM -0700, 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 <alan.mikhak@sifive.com>
> ---
>  drivers/pci/endpoint/functions/pci-epf-test.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to pci/endpoint for v5.3, thanks.

Lorenzo

> 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
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] PCI: endpoint: Clear BAR before freeing its space
@ 2019-06-11 10:09   ` Lorenzo Pieralisi
  0 siblings, 0 replies; 8+ messages in thread
From: Lorenzo Pieralisi @ 2019-06-11 10:09 UTC (permalink / raw)
  To: Alan Mikhak
  Cc: linux-pci, palmer, linux-kernel, kishon, paul.walmsley, linux-riscv

On Thu, May 23, 2019 at 02:57:27PM -0700, 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 <alan.mikhak@sifive.com>
> ---
>  drivers/pci/endpoint/functions/pci-epf-test.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to pci/endpoint for v5.3, thanks.

Lorenzo

> 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
> 

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-06-11 10:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-23 21:57 [PATCH v2] PCI: endpoint: Clear BAR before freeing its space Alan Mikhak
2019-05-23 21:57 ` Alan Mikhak
2019-05-23 23:50 ` Alan Mikhak
2019-05-23 23:50   ` Alan Mikhak
2019-05-24  8:50   ` Kishon Vijay Abraham I
2019-05-24  8:50     ` Kishon Vijay Abraham I
2019-06-11 10:09 ` Lorenzo Pieralisi
2019-06-11 10:09   ` Lorenzo Pieralisi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.