All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESUBMIT 0/3] remove unnecessary read of PCI_CAP_ID_EXP
@ 2012-07-10 21:57 Jon Mason
  2012-07-10 21:57 ` [PATCH RESUBMIT 1/3] qla4xxx: " Jon Mason
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Jon Mason @ 2012-07-10 21:57 UTC (permalink / raw)
  To: James Bottomley; +Cc: linux-scsi

This is a resubmission of 3 of 19 patches from ~1 year ago.  The rest were
integrated by the other subsystem maintainers at the time.  I believe the
hiccup was some confusion as to whether this would cause an issue on PPC
(http://www.spinics.net/lists/linux-scsi/msg53079.html).  However, this was
later refuted (https://patchwork.kernel.org/patch/937012/) and was ack'ed
(http://www.spinics.net/lists/linux-scsi/msg53169.html).

I recently found these collecting dust and would appreciate them being included.

Thanks,
Jon


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

* [PATCH RESUBMIT 1/3] qla4xxx: remove unnecessary read of PCI_CAP_ID_EXP
  2012-07-10 21:57 [PATCH RESUBMIT 0/3] remove unnecessary read of PCI_CAP_ID_EXP Jon Mason
@ 2012-07-10 21:57 ` Jon Mason
  2012-07-11 13:16   ` Vikas Chaudhary
  2012-07-10 21:57 ` [PATCH RESUBMIT 2/3] qla2xxx: remove unnecessary reads " Jon Mason
  2012-07-10 21:57 ` [PATCH RESUBMIT 3/3] lpfc: remove unnecessary read " Jon Mason
  2 siblings, 1 reply; 7+ messages in thread
From: Jon Mason @ 2012-07-10 21:57 UTC (permalink / raw)
  To: James Bottomley; +Cc: linux-scsi, Ravi Anand, Vikas Chaudhary, iscsi-driver

The PCIE capability offset is saved during PCI bus walking.  It will
remove an unnecessary search in the PCI configuration space if this
value is referenced instead of reacquiring it.

Signed-off-by: Jon Mason <jdmason@kudzu.us>
Cc: Ravi Anand <ravi.anand@qlogic.com>
Cc: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Cc: iscsi-driver@qlogic.com
---
 drivers/scsi/qla4xxx/ql4_nx.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qla4xxx/ql4_nx.c b/drivers/scsi/qla4xxx/ql4_nx.c
index 228b670..939d726 100644
--- a/drivers/scsi/qla4xxx/ql4_nx.c
+++ b/drivers/scsi/qla4xxx/ql4_nx.c
@@ -1590,7 +1590,7 @@ qla4_8xxx_start_firmware(struct scsi_qla_host *ha, uint32_t image_start)
 	}
 
 	/* Negotiated Link width */
-	pcie_cap = pci_find_capability(ha->pdev, PCI_CAP_ID_EXP);
+	pcie_cap = pci_pcie_cap(ha->pdev);
 	pci_read_config_word(ha->pdev, pcie_cap + PCI_EXP_LNKSTA, &lnk);
 	ha->link_width = (lnk >> 4) & 0x3f;
 
-- 
1.7.9.5


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

* [PATCH RESUBMIT 2/3] qla2xxx: remove unnecessary reads of PCI_CAP_ID_EXP
  2012-07-10 21:57 [PATCH RESUBMIT 0/3] remove unnecessary read of PCI_CAP_ID_EXP Jon Mason
  2012-07-10 21:57 ` [PATCH RESUBMIT 1/3] qla4xxx: " Jon Mason
@ 2012-07-10 21:57 ` Jon Mason
  2012-07-11 12:27   ` Chad Dupuis
  2012-07-10 21:57 ` [PATCH RESUBMIT 3/3] lpfc: remove unnecessary read " Jon Mason
  2 siblings, 1 reply; 7+ messages in thread
From: Jon Mason @ 2012-07-10 21:57 UTC (permalink / raw)
  To: James Bottomley; +Cc: linux-scsi, Andrew Vasquez, linux-driver

The PCIE capability offset is saved during PCI bus walking.  It will
remove an unnecessary search in the PCI configuration space if this
value is referenced instead of reacquiring it.  Also, pci_is_pcie is a
better way of determining if the device is PCIE or not (as it uses the
same saved PCIE capability offset).

Signed-off-by: Jon Mason <jdmason@kudzu.us>
Cc: Andrew Vasquez <andrew.vasquez@qlogic.com>
Cc: linux-driver@qlogic.com
---
 drivers/scsi/qla2xxx/qla_init.c |    4 ++--
 drivers/scsi/qla2xxx/qla_nx.c   |    4 ++--
 drivers/scsi/qla2xxx/qla_os.c   |    4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index ca50847..a44653b 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -685,7 +685,7 @@ qla24xx_pci_config(scsi_qla_host_t *vha)
 		pcix_set_mmrbc(ha->pdev, 2048);
 
 	/* PCIe -- adjust Maximum Read Request Size (2048). */
-	if (pci_find_capability(ha->pdev, PCI_CAP_ID_EXP))
+	if (pci_is_pcie(ha->pdev))
 		pcie_set_readrq(ha->pdev, 2048);
 
 	pci_disable_rom(ha->pdev);
@@ -721,7 +721,7 @@ qla25xx_pci_config(scsi_qla_host_t *vha)
 	pci_write_config_word(ha->pdev, PCI_COMMAND, w);
 
 	/* PCIe -- adjust Maximum Read Request Size (2048). */
-	if (pci_find_capability(ha->pdev, PCI_CAP_ID_EXP))
+	if (pci_is_pcie(ha->pdev))
 		pcie_set_readrq(ha->pdev, 2048);
 
 	pci_disable_rom(ha->pdev);
diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c
index caf627b..9ce3a8f 100644
--- a/drivers/scsi/qla2xxx/qla_nx.c
+++ b/drivers/scsi/qla2xxx/qla_nx.c
@@ -1620,7 +1620,7 @@ qla82xx_pci_info_str(struct scsi_qla_host *vha, char *str)
 	char lwstr[6];
 	uint16_t lnk;
 
-	pcie_reg = pci_find_capability(ha->pdev, PCI_CAP_ID_EXP);
+	pcie_reg = pci_pcie_cap(ha->pdev);
 	pci_read_config_word(ha->pdev, pcie_reg + PCI_EXP_LNKSTA, &lnk);
 	ha->link_width = (lnk >> 4) & 0x3f;
 
@@ -2528,7 +2528,7 @@ qla82xx_start_firmware(scsi_qla_host_t *vha)
 	}
 
 	/* Negotiated Link width */
-	pcie_cap = pci_find_capability(ha->pdev, PCI_CAP_ID_EXP);
+	pcie_cap = pci_pcie_cap(ha->pdev);
 	pci_read_config_word(ha->pdev, pcie_cap + PCI_EXP_LNKSTA, &lnk);
 	ha->link_width = (lnk >> 4) & 0x3f;
 
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 6d1d873..fb8cd38 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -482,12 +482,12 @@ qla24xx_pci_info_str(struct scsi_qla_host *vha, char *str)
 	uint32_t pci_bus;
 	int pcie_reg;
 
-	pcie_reg = pci_find_capability(ha->pdev, PCI_CAP_ID_EXP);
+	pcie_reg = pci_pcie_cap(ha->pdev);
 	if (pcie_reg) {
 		char lwstr[6];
 		uint16_t pcie_lstat, lspeed, lwidth;
 
-		pcie_reg += 0x12;
+		pcie_reg += PCI_EXP_LNKCAP;
 		pci_read_config_word(ha->pdev, pcie_reg, &pcie_lstat);
 		lspeed = pcie_lstat & (BIT_0 | BIT_1 | BIT_2 | BIT_3);
 		lwidth = (pcie_lstat &
-- 
1.7.9.5


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

* [PATCH RESUBMIT 3/3] lpfc: remove unnecessary read of PCI_CAP_ID_EXP
  2012-07-10 21:57 [PATCH RESUBMIT 0/3] remove unnecessary read of PCI_CAP_ID_EXP Jon Mason
  2012-07-10 21:57 ` [PATCH RESUBMIT 1/3] qla4xxx: " Jon Mason
  2012-07-10 21:57 ` [PATCH RESUBMIT 2/3] qla2xxx: remove unnecessary reads " Jon Mason
@ 2012-07-10 21:57 ` Jon Mason
  2012-08-15 13:55   ` James Smart
  2 siblings, 1 reply; 7+ messages in thread
From: Jon Mason @ 2012-07-10 21:57 UTC (permalink / raw)
  To: James Bottomley; +Cc: linux-scsi, James Smart

The PCIE capability offset is saved during PCI bus walking.  It will
remove an unnecessary search in the PCI configuration space if this
value is referenced instead of reacquiring it.  Also, pci_is_pcie is a
better way of determining if the device is PCIE or not (as it uses the
same saved PCIE capability offset).

Signed-off-by: Jon Mason <jdmason@kudzu.us>
Cc: James Smart <james.smart@emulex.com>
---
 drivers/scsi/lpfc/lpfc_init.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 411ed48..f30b3d2 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -4253,7 +4253,7 @@ lpfc_enable_pci_dev(struct lpfc_hba *phba)
 	pci_save_state(pdev);
 
 	/* PCIe EEH recovery on powerpc platforms needs fundamental reset */
-	if (pci_find_capability(pdev, PCI_CAP_ID_EXP))
+	if (pci_is_pcie(pdev))
 		pdev->needs_freset = 1;
 
 	return 0;
-- 
1.7.9.5


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

* Re: [PATCH RESUBMIT 2/3] qla2xxx: remove unnecessary reads of PCI_CAP_ID_EXP
  2012-07-10 21:57 ` [PATCH RESUBMIT 2/3] qla2xxx: remove unnecessary reads " Jon Mason
@ 2012-07-11 12:27   ` Chad Dupuis
  0 siblings, 0 replies; 7+ messages in thread
From: Chad Dupuis @ 2012-07-11 12:27 UTC (permalink / raw)
  To: Jon Mason
  Cc: James Bottomley, linux-scsi, Andrew Vasquez, Dept-Eng Linux Driver


On Tue, 10 Jul 2012, Jon Mason wrote:

> The PCIE capability offset is saved during PCI bus walking.  It will
> remove an unnecessary search in the PCI configuration space if this
> value is referenced instead of reacquiring it.  Also, pci_is_pcie is a
> better way of determining if the device is PCIE or not (as it uses the
> same saved PCIE capability offset).
>
> Signed-off-by: Jon Mason <jdmason@kudzu.us>
> Cc: Andrew Vasquez <andrew.vasquez@qlogic.com>
> Cc: linux-driver@qlogic.com
> ---
> drivers/scsi/qla2xxx/qla_init.c |    4 ++--
> drivers/scsi/qla2xxx/qla_nx.c   |    4 ++--
> drivers/scsi/qla2xxx/qla_os.c   |    4 ++--
> 3 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
> index ca50847..a44653b 100644
> --- a/drivers/scsi/qla2xxx/qla_init.c
> +++ b/drivers/scsi/qla2xxx/qla_init.c
> @@ -685,7 +685,7 @@ qla24xx_pci_config(scsi_qla_host_t *vha)
>               pcix_set_mmrbc(ha->pdev, 2048);
>
>       /* PCIe -- adjust Maximum Read Request Size (2048). */
> -     if (pci_find_capability(ha->pdev, PCI_CAP_ID_EXP))
> +     if (pci_is_pcie(ha->pdev))
>               pcie_set_readrq(ha->pdev, 2048);
>
>       pci_disable_rom(ha->pdev);
> @@ -721,7 +721,7 @@ qla25xx_pci_config(scsi_qla_host_t *vha)
>       pci_write_config_word(ha->pdev, PCI_COMMAND, w);
>
>       /* PCIe -- adjust Maximum Read Request Size (2048). */
> -     if (pci_find_capability(ha->pdev, PCI_CAP_ID_EXP))
> +     if (pci_is_pcie(ha->pdev))
>               pcie_set_readrq(ha->pdev, 2048);
>
>       pci_disable_rom(ha->pdev);
> diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c
> index caf627b..9ce3a8f 100644
> --- a/drivers/scsi/qla2xxx/qla_nx.c
> +++ b/drivers/scsi/qla2xxx/qla_nx.c
> @@ -1620,7 +1620,7 @@ qla82xx_pci_info_str(struct scsi_qla_host *vha, char *str)
>       char lwstr[6];
>       uint16_t lnk;
>
> -     pcie_reg = pci_find_capability(ha->pdev, PCI_CAP_ID_EXP);
> +     pcie_reg = pci_pcie_cap(ha->pdev);
>       pci_read_config_word(ha->pdev, pcie_reg + PCI_EXP_LNKSTA, &lnk);
>       ha->link_width = (lnk >> 4) & 0x3f;
>
> @@ -2528,7 +2528,7 @@ qla82xx_start_firmware(scsi_qla_host_t *vha)
>       }
>
>       /* Negotiated Link width */
> -     pcie_cap = pci_find_capability(ha->pdev, PCI_CAP_ID_EXP);
> +     pcie_cap = pci_pcie_cap(ha->pdev);
>       pci_read_config_word(ha->pdev, pcie_cap + PCI_EXP_LNKSTA, &lnk);
>       ha->link_width = (lnk >> 4) & 0x3f;
>
> diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
> index 6d1d873..fb8cd38 100644
> --- a/drivers/scsi/qla2xxx/qla_os.c
> +++ b/drivers/scsi/qla2xxx/qla_os.c
> @@ -482,12 +482,12 @@ qla24xx_pci_info_str(struct scsi_qla_host *vha, char *str)
>       uint32_t pci_bus;
>       int pcie_reg;
>
> -     pcie_reg = pci_find_capability(ha->pdev, PCI_CAP_ID_EXP);
> +     pcie_reg = pci_pcie_cap(ha->pdev);
>       if (pcie_reg) {
>               char lwstr[6];
>               uint16_t pcie_lstat, lspeed, lwidth;
>
> -             pcie_reg += 0x12;
> +             pcie_reg += PCI_EXP_LNKCAP;
>               pci_read_config_word(ha->pdev, pcie_reg, &pcie_lstat);
>               lspeed = pcie_lstat & (BIT_0 | BIT_1 | BIT_2 | BIT_3);
>               lwidth = (pcie_lstat &
>

Looks good, thanks.

Acked-by: Chad Dupuis <chad.dupuis@qlogic.com>

This message and any attached documents contain information from QLogic Corporation or its wholly-owned subsidiaries that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.


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

* Re: [PATCH RESUBMIT 1/3] qla4xxx: remove unnecessary read of PCI_CAP_ID_EXP
  2012-07-10 21:57 ` [PATCH RESUBMIT 1/3] qla4xxx: " Jon Mason
@ 2012-07-11 13:16   ` Vikas Chaudhary
  0 siblings, 0 replies; 7+ messages in thread
From: Vikas Chaudhary @ 2012-07-11 13:16 UTC (permalink / raw)
  To: Jon Mason, James Bottomley; +Cc: linux-scsi, Ravi Anand, Dept-Eng iSCSI Driver



-----Original Message-----
From: Jon Mason <jdmason@kudzu.us>
To: James Bottomley <JBottomley@Parallels.com>
Cc: scsi <linux-scsi@vger.kernel.org>, Ravi Anand <ravi.anand@qlogic.com>,
Vikas <vikas.chaudhary@qlogic.com>, Dept-Eng iSCSI Driver
<Dept-iSCSIDriver@qlogic.com>
Subject: [PATCH RESUBMIT 1/3] qla4xxx: remove unnecessary read of
PCI_CAP_ID_EXP

>The PCIE capability offset is saved during PCI bus walking.  It will
>remove an unnecessary search in the PCI configuration space if this
>value is referenced instead of reacquiring it.
>
>Signed-off-by: Jon Mason <jdmason@kudzu.us>
>Cc: Ravi Anand <ravi.anand@qlogic.com>
>Cc: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
>Cc: iscsi-driver@qlogic.com
>---
> drivers/scsi/qla4xxx/ql4_nx.c |    2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/scsi/qla4xxx/ql4_nx.c b/drivers/scsi/qla4xxx/ql4_nx.c
>index 228b670..939d726 100644
>--- a/drivers/scsi/qla4xxx/ql4_nx.c
>+++ b/drivers/scsi/qla4xxx/ql4_nx.c
>@@ -1590,7 +1590,7 @@ qla4_8xxx_start_firmware(struct scsi_qla_host *ha,
>uint32_t image_start)
>       }
>
>       /* Negotiated Link width */
>-      pcie_cap = pci_find_capability(ha->pdev, PCI_CAP_ID_EXP);
>+      pcie_cap = pci_pcie_cap(ha->pdev);
>       pci_read_config_word(ha->pdev, pcie_cap + PCI_EXP_LNKSTA, &lnk);
>       ha->link_width = (lnk >> 4) & 0x3f;

Acked-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>



This message and any attached documents contain information from QLogic Corporation or its wholly-owned subsidiaries that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.


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

* Re: [PATCH RESUBMIT 3/3] lpfc: remove unnecessary read of PCI_CAP_ID_EXP
  2012-07-10 21:57 ` [PATCH RESUBMIT 3/3] lpfc: remove unnecessary read " Jon Mason
@ 2012-08-15 13:55   ` James Smart
  0 siblings, 0 replies; 7+ messages in thread
From: James Smart @ 2012-08-15 13:55 UTC (permalink / raw)
  To: Jon Mason; +Cc: James Bottomley, linux-scsi

Acked-By:  James Smart <james.smart@emulex.com>

-- james


On 7/10/2012 5:57 PM, Jon Mason wrote:
> The PCIE capability offset is saved during PCI bus walking.  It will
> remove an unnecessary search in the PCI configuration space if this
> value is referenced instead of reacquiring it.  Also, pci_is_pcie is a
> better way of determining if the device is PCIE or not (as it uses the
> same saved PCIE capability offset).
>
> Signed-off-by: Jon Mason <jdmason@kudzu.us>
> Cc: James Smart <james.smart@emulex.com>
> ---
>   drivers/scsi/lpfc/lpfc_init.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
> index 411ed48..f30b3d2 100644
> --- a/drivers/scsi/lpfc/lpfc_init.c
> +++ b/drivers/scsi/lpfc/lpfc_init.c
> @@ -4253,7 +4253,7 @@ lpfc_enable_pci_dev(struct lpfc_hba *phba)
>   	pci_save_state(pdev);
>   
>   	/* PCIe EEH recovery on powerpc platforms needs fundamental reset */
> -	if (pci_find_capability(pdev, PCI_CAP_ID_EXP))
> +	if (pci_is_pcie(pdev))
>   		pdev->needs_freset = 1;
>   
>   	return 0;


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

end of thread, other threads:[~2012-08-15 13:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-10 21:57 [PATCH RESUBMIT 0/3] remove unnecessary read of PCI_CAP_ID_EXP Jon Mason
2012-07-10 21:57 ` [PATCH RESUBMIT 1/3] qla4xxx: " Jon Mason
2012-07-11 13:16   ` Vikas Chaudhary
2012-07-10 21:57 ` [PATCH RESUBMIT 2/3] qla2xxx: remove unnecessary reads " Jon Mason
2012-07-11 12:27   ` Chad Dupuis
2012-07-10 21:57 ` [PATCH RESUBMIT 3/3] lpfc: remove unnecessary read " Jon Mason
2012-08-15 13:55   ` James Smart

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.