All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] IB/hfi1: change PCI bar addr assignments to Linux API functions
@ 2017-05-10 19:58 Steven L. Roberts
       [not found] ` <1494446293-60448-1-git-send-email-robers97-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Steven L. Roberts @ 2017-05-10 19:58 UTC (permalink / raw)
  To: dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA
  Cc: Steven L. Roberts

From: "Steven L. Roberts" <robers97-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

The Omni-path adapter driver fails to load the ppc64le platform
due to invalid PCI setup.

This patch makes the PCI configuration more robust and will
fix 64 bit addressing for ppc64le.

Signed-off-by: Steven L Roberts <robers97-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Acked-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

---
 drivers/infiniband/hw/hfi1/pcie.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/hfi1/pcie.c b/drivers/infiniband/hw/hfi1/pcie.c
index 93faf86..6a9f6f9 100644
--- a/drivers/infiniband/hw/hfi1/pcie.c
+++ b/drivers/infiniband/hw/hfi1/pcie.c
@@ -207,8 +207,8 @@ int hfi1_pcie_ddinit(struct hfi1_devdata *dd, struct pci_dev *pdev)
 	/*
 	 * Save BARs and command to rewrite after device reset.
 	 */
-	dd->pcibar0 = addr;
-	dd->pcibar1 = addr >> 32;
+	pci_read_config_dword(dd->pcidev, PCI_BASE_ADDRESS_0, &dd->pcibar0);
+	pci_read_config_dword(dd->pcidev, PCI_BASE_ADDRESS_1, &dd->pcibar1);
 	pci_read_config_dword(dd->pcidev, PCI_ROM_ADDRESS, &dd->pci_rom);
 	pci_read_config_word(dd->pcidev, PCI_COMMAND, &dd->pci_command);
 	pcie_capability_read_word(dd->pcidev, PCI_EXP_DEVCTL, &dd->pcie_devctl);
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] IB/hfi1: change PCI bar addr assignments to Linux API functions
       [not found] ` <1494446293-60448-1-git-send-email-robers97-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2017-06-01 22:06   ` Doug Ledford
  0 siblings, 0 replies; 6+ messages in thread
From: Doug Ledford @ 2017-06-01 22:06 UTC (permalink / raw)
  To: Steven L. Roberts, dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Wed, 2017-05-10 at 14:58 -0500, Steven L. Roberts wrote:
> The Omni-path adapter driver fails to load the ppc64le platform
> due to invalid PCI setup.
> 
> This patch makes the PCI configuration more robust and will
> fix 64 bit addressing for ppc64le.
> 
> Signed-off-by: Steven L Roberts <robers97-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Acked-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

Thanks, applied.

-- 
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
    GPG KeyID: B826A3330E572FDD
   
Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] IB/hfi1: change PCI bar addr assignments to Linux API functions
       [not found] ` <1494442093-3590-1-git-send-email-robers97-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2017-05-10 18:52   ` Christoph Hellwig
@ 2017-05-10 19:20   ` Dennis Dalessandro
  1 sibling, 0 replies; 6+ messages in thread
From: Dennis Dalessandro @ 2017-05-10 19:20 UTC (permalink / raw)
  To: Steven L. Roberts, linux-rdma-u79uwXL29TY76Z2rM5mHXA

On 5/10/2017 2:48 PM, Steven L. Roberts wrote:
> From: "Steven L. Roberts" <robers97-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>
> The Ominpath adapter driver fails to load the ppc64le platform
> due to invalid PCI setup.

Omnipath -> Omni-Path


> This patch makes the PCI configuration more robust and will
> fixes 64 bit addressing for ppc64le.

fixes -> fix

> Signed-off-by: Steven L Roberts <robers97-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Please touch up those two typos and add:

Acked-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

Thanks for the patch!

-Denny
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] IB/hfi1: change PCI bar addr assignments to Linux API functions
       [not found]     ` <20170510185238.GA25924-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
@ 2017-05-10 19:16       ` Dennis Dalessandro
  0 siblings, 0 replies; 6+ messages in thread
From: Dennis Dalessandro @ 2017-05-10 19:16 UTC (permalink / raw)
  To: Christoph Hellwig, Steven L. Roberts; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

On 5/10/2017 2:52 PM, Christoph Hellwig wrote:
> On Wed, May 10, 2017 at 01:48:13PM -0500, Steven L. Roberts wrote:
>> From: "Steven L. Roberts" <robers97-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>
>> The Ominpath adapter driver fails to load the ppc64le platform
>> due to invalid PCI setup.
>>
>> This patch makes the PCI configuration more robust and will
>> fixes 64 bit addressing for ppc64le.
>>
>> Signed-off-by: Steven L Roberts <robers97-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> ---
>>  drivers/infiniband/hw/hfi1/pcie.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/infiniband/hw/hfi1/pcie.c b/drivers/infiniband/hw/hfi1/pcie.c
>> index 93faf86..6a9f6f9 100644
>> --- a/drivers/infiniband/hw/hfi1/pcie.c
>> +++ b/drivers/infiniband/hw/hfi1/pcie.c
>> @@ -207,8 +207,8 @@ int hfi1_pcie_ddinit(struct hfi1_devdata *dd, struct pci_dev *pdev)
>>  	/*
>>  	 * Save BARs and command to rewrite after device reset.
>>  	 */
>> -	dd->pcibar0 = addr;
>> -	dd->pcibar1 = addr >> 32;
>> +	pci_read_config_dword(dd->pcidev, PCI_BASE_ADDRESS_0, &dd->pcibar0);
>> +	pci_read_config_dword(dd->pcidev, PCI_BASE_ADDRESS_1, &dd->pcibar1);
>
> Why do you even read / re-write them?  Thjis isn't the drivers job.

We save them off so we can restore after a reset wipes them out. See 
restore_pci_variables().

The restore function already uses the PCI_BASE_ADDRESS_* values so the 
only change was needed here.

-Denny


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] IB/hfi1: change PCI bar addr assignments to Linux API functions
       [not found] ` <1494442093-3590-1-git-send-email-robers97-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2017-05-10 18:52   ` Christoph Hellwig
       [not found]     ` <20170510185238.GA25924-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
  2017-05-10 19:20   ` Dennis Dalessandro
  1 sibling, 1 reply; 6+ messages in thread
From: Christoph Hellwig @ 2017-05-10 18:52 UTC (permalink / raw)
  To: Steven L. Roberts
  Cc: dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Wed, May 10, 2017 at 01:48:13PM -0500, Steven L. Roberts wrote:
> From: "Steven L. Roberts" <robers97-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> 
> The Ominpath adapter driver fails to load the ppc64le platform
> due to invalid PCI setup.
> 
> This patch makes the PCI configuration more robust and will
> fixes 64 bit addressing for ppc64le.
> 
> Signed-off-by: Steven L Roberts <robers97-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
>  drivers/infiniband/hw/hfi1/pcie.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/hfi1/pcie.c b/drivers/infiniband/hw/hfi1/pcie.c
> index 93faf86..6a9f6f9 100644
> --- a/drivers/infiniband/hw/hfi1/pcie.c
> +++ b/drivers/infiniband/hw/hfi1/pcie.c
> @@ -207,8 +207,8 @@ int hfi1_pcie_ddinit(struct hfi1_devdata *dd, struct pci_dev *pdev)
>  	/*
>  	 * Save BARs and command to rewrite after device reset.
>  	 */
> -	dd->pcibar0 = addr;
> -	dd->pcibar1 = addr >> 32;
> +	pci_read_config_dword(dd->pcidev, PCI_BASE_ADDRESS_0, &dd->pcibar0);
> +	pci_read_config_dword(dd->pcidev, PCI_BASE_ADDRESS_1, &dd->pcibar1);

Why do you even read / re-write them?  Thjis isn't the drivers job.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH] IB/hfi1: change PCI bar addr assignments to Linux API functions
@ 2017-05-10 18:48 Steven L. Roberts
       [not found] ` <1494442093-3590-1-git-send-email-robers97-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Steven L. Roberts @ 2017-05-10 18:48 UTC (permalink / raw)
  To: dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA
  Cc: Steven L. Roberts

From: "Steven L. Roberts" <robers97-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

The Ominpath adapter driver fails to load the ppc64le platform
due to invalid PCI setup.

This patch makes the PCI configuration more robust and will
fixes 64 bit addressing for ppc64le.

Signed-off-by: Steven L Roberts <robers97-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/hw/hfi1/pcie.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/hfi1/pcie.c b/drivers/infiniband/hw/hfi1/pcie.c
index 93faf86..6a9f6f9 100644
--- a/drivers/infiniband/hw/hfi1/pcie.c
+++ b/drivers/infiniband/hw/hfi1/pcie.c
@@ -207,8 +207,8 @@ int hfi1_pcie_ddinit(struct hfi1_devdata *dd, struct pci_dev *pdev)
 	/*
 	 * Save BARs and command to rewrite after device reset.
 	 */
-	dd->pcibar0 = addr;
-	dd->pcibar1 = addr >> 32;
+	pci_read_config_dword(dd->pcidev, PCI_BASE_ADDRESS_0, &dd->pcibar0);
+	pci_read_config_dword(dd->pcidev, PCI_BASE_ADDRESS_1, &dd->pcibar1);
 	pci_read_config_dword(dd->pcidev, PCI_ROM_ADDRESS, &dd->pci_rom);
 	pci_read_config_word(dd->pcidev, PCI_COMMAND, &dd->pci_command);
 	pcie_capability_read_word(dd->pcidev, PCI_EXP_DEVCTL, &dd->pcie_devctl);
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2017-06-01 22:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-10 19:58 [PATCH] IB/hfi1: change PCI bar addr assignments to Linux API functions Steven L. Roberts
     [not found] ` <1494446293-60448-1-git-send-email-robers97-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-06-01 22:06   ` Doug Ledford
  -- strict thread matches above, loose matches on Subject: below --
2017-05-10 18:48 Steven L. Roberts
     [not found] ` <1494442093-3590-1-git-send-email-robers97-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-05-10 18:52   ` Christoph Hellwig
     [not found]     ` <20170510185238.GA25924-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2017-05-10 19:16       ` Dennis Dalessandro
2017-05-10 19:20   ` Dennis Dalessandro

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.