All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Smart <james.smart@emulex.com>
To: Jon Mason <jdmason@kudzu.us>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH 03/19] lpfc: remove unnecessary read of PCI_CAP_ID_EXP
Date: Thu, 30 Jun 2011 16:40:54 -0400	[thread overview]
Message-ID: <4E0CDF56.7050107@emulex.com> (raw)
In-Reply-To: <1309196346-15749-1-git-send-email-jdmason@kudzu.us>

Jon,

I must NACK this patch to the lpfc driver and recommend that all other patches 
which replace pci_find_capability(pdef, PCI_CAP_ID_EXP) with 
"pci_is_pcie(pdev)" are NACK'd as well.

The reason is due to an issue on PPC platforms whereby use of "pdev->is_pcie" 
and pci_is_pcie() will erroneously fail under some conditions, but explicit 
search for the capability struct via pci_find_capability() is always 
successful.   I expect this to be due a shadowing of pci config space in the 
hal/platform that isn't sufficiently built up.  We detected this issue while 
testing AER/EEH, and are functional only if the pci_find_capability() option 
is used.

-- james s



On 6/27/2011 1:39 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>
> ---
>   drivers/scsi/lpfc/lpfc_init.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
> index 148b98d..9000ad0 100644
> --- a/drivers/scsi/lpfc/lpfc_init.c
> +++ b/drivers/scsi/lpfc/lpfc_init.c
> @@ -3970,7 +3970,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;

  reply	other threads:[~2011-06-30 20:41 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-27 17:39 [PATCH 03/19] lpfc: remove unnecessary read of PCI_CAP_ID_EXP Jon Mason
2011-06-30 20:40 ` James Smart [this message]
2011-06-30 20:41 ` James Smart
2011-07-01 14:48   ` Warning: qla4xxx/qla2xxx/lpfc : removal " James Smart
2011-07-01 15:10     ` Jon Mason
2011-07-06  3:15       ` Jon Mason
2011-07-01 14:49   ` Warning: iwlegacy/iwlwifi/rtlwifi " James Smart
2011-07-01 15:08     ` Jon Mason
2011-07-02 16:49       ` Larry Finger
2011-07-02 17:04         ` Jon Mason
2011-07-04  1:47         ` Adrian Chadd
2011-07-06  3:15       ` Jon Mason
     [not found]   ` <4E0CDF8B.3020505-laKkSmNT4hbQT0dZR+AlfA@public.gmane.org>
2011-07-01 14:49     ` Warning: mthca/qib " James Smart
     [not found]       ` <6dbdff99-df75-4456-ac0e-b35ac475f079-nbYkmrCdWxmgMrCBcu8zE0EOCMrvLtNR@public.gmane.org>
2011-07-01 15:01         ` Mike Marciniszyn
     [not found]           ` <35AAF1E4A771E142979F27B51793A4888838F2367E-HolNjIBXvBOXx9kJd3VG2h2eb7JE58TQ@public.gmane.org>
2011-07-01 15:07             ` Jon Mason
     [not found]               ` <BANLkTimT5SaRupWoC+60sgdgsvW2a_T3_g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-07-06  3:16                 ` Jon Mason
2011-07-01 15:05   ` [PATCH 03/19] lpfc: remove unnecessary read " Jon Mason
     [not found]   ` <9c96a4a4-c1e3-4af2-a129-db1ce80a2973@exht1.ad.emulex.com>
     [not found]     ` <BANLkTi=BCC3PO_LecW77ht+kBAAVD6=Kgw@mail.gmail.com>
2011-07-06  3:14       ` Warning: myri10ge/sky2/vxge/r8169/niu/bnx2/bnx2x/igb/e100e/cxgb3/mlx4/tg3/vxge : removal " Jon Mason
     [not found]   ` <4E0DDE55.30006@emulex.com>
2011-07-06 14:38     ` Warning: qla4xxx/qla2xxx/lpfc " James Smart
     [not found]   ` <4E0DDE5D.8040904@emulex.com>
2011-07-06 14:38     ` Warning: iwlegacy/iwlwifi/rtlwifi " James Smart
     [not found]   ` <4E0DDE68.5040904@emulex.com>
     [not found]     ` <4E0DDE68.5040904-laKkSmNT4hbQT0dZR+AlfA@public.gmane.org>
2011-07-06 14:38       ` Warning: mthca/qib " James Smart
2011-07-06 14:39 ` [PATCH 03/19] lpfc: remove unnecessary read " James Smart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E0CDF56.7050107@emulex.com \
    --to=james.smart@emulex.com \
    --cc=jdmason@kudzu.us \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.