public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chen Gong <gong.chen@linux.intel.com>
To: Betty Dall <betty.dall@hp.com>
Cc: rjw@sisk.pl, bhelgaas@google.com, ying.huang@intel.com,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-pci@vger.kernel.org
Subject: Re: [PATCH v2 1/3] PCI/AER: Fix incorrect return from aer_hest_parse()
Date: Tue, 4 Jun 2013 03:42:00 -0400	[thread overview]
Message-ID: <20130604074159.GB20448@gchen.bj.intel.com> (raw)
In-Reply-To: <1369924769-17183-2-git-send-email-betty.dall@hp.com>

[-- Attachment #1: Type: text/plain, Size: 2185 bytes --]

On Thu, May 30, 2013 at 08:39:27AM -0600, Betty Dall wrote:
> Date:	Thu, 30 May 2013 08:39:27 -0600
> From: Betty Dall <betty.dall@hp.com>
> To: rjw@sisk.pl, bhelgaas@google.com
> Cc: ying.huang@intel.com, linux-acpi@vger.kernel.org,
>  linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Betty Dall
>  <betty.dall@hp.com>
> Subject: [PATCH v2 1/3] PCI/AER: Fix incorrect return from aer_hest_parse()
> X-Mailer: git-send-email 1.7.7.6
> 
> The function aer_hest_parse() is called to determine if the given
> PCI device is firmware first or not. The code loops through each
> section of the HEST table to look for a match. The bug is that
> the function always returns whether the last HEST section is firmware
> first. The fix stops the iteration once the info.firmware_first
> variable is set.  This is similar to how the function aer_hest_parse_aff()
> stops the iteration.
> 
> Signed-off-by: Betty Dall <betty.dall@hp.com>

The patch is good. But I have further concern based on your patch.
1) aer_hest_parse never checks the 2nd input parameter (void *data),
which means once it is NULL, it will crash the kernel.

2) both aer_hest_parse and aer_hest_parse_aff utilize some flag
as shortcut, if so, why not adding similar logic in apei_hest_parse
to stop meaningless loops once FFM is confirmed as enabled.

> ---
> 
>  drivers/pci/pcie/aer/aerdrv_acpi.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> 
> diff --git a/drivers/pci/pcie/aer/aerdrv_acpi.c b/drivers/pci/pcie/aer/aerdrv_acpi.c
> index 5194a7d..39b8671 100644
> --- a/drivers/pci/pcie/aer/aerdrv_acpi.c
> +++ b/drivers/pci/pcie/aer/aerdrv_acpi.c
> @@ -42,6 +42,9 @@ static int aer_hest_parse(struct acpi_hest_header *hest_hdr, void *data)
>  	u8 bridge = 0;
>  	int ff = 0;
>  
> +	if (info->firmware_first)
> +		return 0;
> +
>  	switch (hest_hdr->type) {
>  	case ACPI_HEST_TYPE_AER_ROOT_PORT:
>  		pcie_type = PCI_EXP_TYPE_ROOT_PORT;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  parent reply	other threads:[~2013-06-04  7:49 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-30 14:39 [PATCH v2 0/3] PCI/ACPI: Fix firmware first error recovery with root port in reset Betty Dall
2013-05-30 14:39 ` [PATCH v2 1/3] PCI/AER: Fix incorrect return from aer_hest_parse() Betty Dall
2013-06-02  0:38   ` Bjorn Helgaas
2013-06-03 21:18     ` Betty Dall
2013-06-04 17:39       ` Bjorn Helgaas
2013-06-04  7:42   ` Chen Gong [this message]
2013-06-04 13:13   ` Bjorn Helgaas
2013-06-05  2:48     ` Chen Gong
2013-06-05 13:38       ` Bjorn Helgaas
2013-05-30 14:39 ` [PATCH v2 2/3] ACPI/APEI: Force fatal AER severity when bus has been reset Betty Dall
2013-06-04  7:53   ` Chen Gong
2013-06-04 16:20     ` Betty Dall
2013-06-04 17:54     ` Bjorn Helgaas
2013-06-05  1:56       ` Chen Gong
2013-05-30 14:39 ` [PATCH v2 3/3] PCI/AER: Provide reset_link for firmware first root port Betty Dall
2013-06-04  8:36   ` Chen Gong
2013-06-04 18:31     ` Bjorn Helgaas
2013-06-04 21:38     ` Betty Dall
2013-06-04 22:15       ` Bjorn Helgaas
2013-06-05  1:56         ` Chen Gong
2013-06-05 13:22         ` Betty Dall

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=20130604074159.GB20448@gchen.bj.intel.com \
    --to=gong.chen@linux.intel.com \
    --cc=betty.dall@hp.com \
    --cc=bhelgaas@google.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=rjw@sisk.pl \
    --cc=ying.huang@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox