public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: linux-edac <linux-edac@vger.kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Tony Luck <tony.luck@intel.com>,
	Aristeu Rozanski <aris@redhat.com>,
	Mauro Carvalho Chehab <m.chehab@samsung.com>,
	Andy Lutomirski <luto@amacapital.net>
Subject: Re: [PATCH] sb_edac: Fix detection on SNB machines
Date: Thu, 5 Feb 2015 13:37:16 +0100	[thread overview]
Message-ID: <20150205123716.GF23980@pd.tnic> (raw)
In-Reply-To: <1423137035-16506-1-git-send-email-bp@alien8.de>

On Thu, Feb 05, 2015 at 12:50:35PM +0100, Borislav Petkov wrote:
> From: Borislav Petkov <bp@suse.de>
> 
> Commit 50d1bb93672f ("sb_edac: add support for Haswell based systems")
> broke the driver on my SNB box with PCI ID 0x3ca0:
> 
> 3f:0e.0 System peripheral: Intel Corporation Xeon E5/Core i7 Processor Home Agent (rev 07)
> 00: 86 80 a0 3c 00 00 00 00 07 00 80 08 00 00 80 00
> ...
> 
> because its probe routine gets handed in pdev->device: 0x3ca0 but we're
> matching for 0x3ca8, i.e. PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_TA and the
> probing fails.

Or was it Andy who broke it?!

>From looking at

d0585cd815fa ("sb_edac: Claim a different PCI device")

 static const struct pci_device_id sbridge_pci_tbl[] = {
-       {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_TA)},
+       {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_HA0)},

Yeah, it looks like it:

We're working with the IMC_TA device for matching but we get handed in
the IMC_HA0 device after this patch which confirms with my observations.

tztztz, people, can we decide on one PCI device and stick with it?

:-)

 [ Leaving in the rest for Andy. ]

> Adding 0x3ca0 fixes the issue and driver loads successfully again:
> 
> [ 2449.013120] EDAC DEBUG: sbridge_init:
> [ 2449.017029] EDAC sbridge: Seeking for: PCI ID 8086:3ca0
> [ 2449.022368] EDAC DEBUG: sbridge_get_onedevice: Detected 8086:3ca0
> [ 2449.028498] EDAC sbridge: Seeking for: PCI ID 8086:3ca0
> [ 2449.033768] EDAC sbridge: Seeking for: PCI ID 8086:3ca8
> [ 2449.039028] EDAC DEBUG: sbridge_get_onedevice: Detected 8086:3ca8
> [ 2449.045155] EDAC sbridge: Seeking for: PCI ID 8086:3ca8
> ...
> 
> Add a debug printk while at it to be able to catch the failure in the
> future and dump driver version on successful load.
> 
> Cc: Tony Luck <tony.luck@intel.com>
> Cc: Aristeu Rozanski <aris@redhat.com>
> Cc: Mauro Carvalho Chehab <m.chehab@samsung.com>
> Signed-off-by: Borislav Petkov <bp@suse.de>
> ---
>  drivers/edac/sb_edac.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c
> index 63aa6730e89e..2e1c03a64751 100644
> --- a/drivers/edac/sb_edac.c
> +++ b/drivers/edac/sb_edac.c
> @@ -2448,6 +2448,7 @@ static int sbridge_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  		type = IVY_BRIDGE;
>  		break;
>  	case PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_TA:
> +	case PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_HA0:
>  		rc = sbridge_get_all_devices(&num_mc, pci_dev_descr_sbridge_table);
>  		type = SANDY_BRIDGE;
>  		break;
> @@ -2460,8 +2461,11 @@ static int sbridge_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  		type = BROADWELL;
>  		break;
>  	}
> -	if (unlikely(rc < 0))
> +	if (unlikely(rc < 0)) {
> +		edac_dbg(0, "couldn't get all devices for 0x%x\n", pdev->device);
>  		goto fail0;
> +	}
> +
>  	mc = 0;
>  
>  	list_for_each_entry(sbridge_dev, &sbridge_edac_list, list) {
> @@ -2474,7 +2478,7 @@ static int sbridge_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  			goto fail1;
>  	}
>  
> -	sbridge_printk(KERN_INFO, "Driver loaded.\n");
> +	sbridge_printk(KERN_INFO, "%s\n", SBRIDGE_REVISION);
>  
>  	mutex_unlock(&sbridge_edac_lock);
>  	return 0;
> -- 
> 2.2.0.33.gc18b867
> 
> 

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.
--

  reply	other threads:[~2015-02-05 12:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-05 11:50 [PATCH] sb_edac: Fix detection on SNB machines Borislav Petkov
2015-02-05 12:37 ` Borislav Petkov [this message]
2015-02-08 16:54   ` Andy Lutomirski
2015-02-08 18:19     ` Borislav Petkov
2015-02-09 12:17       ` Borislav Petkov
2015-02-09 14:20         ` Aristeu Rozanski
2015-02-09 15:23           ` Mauro Carvalho Chehab
2015-02-09 15:33             ` Andy Lutomirski

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=20150205123716.GF23980@pd.tnic \
    --to=bp@alien8.de \
    --cc=aris@redhat.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=m.chehab@samsung.com \
    --cc=tony.luck@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