public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sb_edac: fix TAD presence check for sbridge_mci_bind_devs()
@ 2015-08-05 18:16 Seth Jennings
  2015-08-05 18:20 ` Aristeu Rozanski
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Seth Jennings @ 2015-08-05 18:16 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Seth Jennings, Tony Luck, Aristeu Rozanski, linux-edac,
	linux-kernel

In 7d375bff, NUM_CHANNELS was changed to 8 and the channel space was
renumerated to handle EN, EP, and EX configurations.

The *_mci_bind_devs functions, except for sbridge_mci_bind_devs(), got a
new device presence check in the form of saw_chan_mask.  However,
sbridge_mci_bind_devs() still uses the NUM_CHANNELS for loop.

With the increase in NUM_CHANNELS, this loop fails at index 4 since
SB only has 4 TADs.  This results in the following error on SB machines:

EDAC sbridge: Some needed devices are missing
EDAC sbridge: Couldn't find mci handler
EDAC sbridge: Couldn't find mci handle

This patch adapts the saw_chan_mask logic for sbridge_mci_bind_devs() as
well.

After this patch:

EDAC MC0: Giving out device to module sbridge_edac.c controller Sandy Bridge Socket#0: DEV 0000:3f:0e.0 (POLLED)
EDAC MC1: Giving out device to module sbridge_edac.c controller Sandy Bridge Socket#1: DEV 0000:7f:0e.0 (POLLED)

Signed-off-by: Seth Jennings <sjenning@redhat.com>
---
 drivers/edac/sb_edac.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c
index ca78311..91cf710 100644
--- a/drivers/edac/sb_edac.c
+++ b/drivers/edac/sb_edac.c
@@ -1648,6 +1648,7 @@ static int sbridge_mci_bind_devs(struct mem_ctl_info *mci,
 {
 	struct sbridge_pvt *pvt = mci->pvt_info;
 	struct pci_dev *pdev;
+	u8 saw_chan_mask = 0;
 	int i;
 
 	for (i = 0; i < sbridge_dev->n_devs; i++) {
@@ -1681,6 +1682,7 @@ static int sbridge_mci_bind_devs(struct mem_ctl_info *mci,
 		{
 			int id = pdev->device - PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_TAD0;
 			pvt->pci_tad[id] = pdev;
+			saw_chan_mask |= 1 << id;
 		}
 			break;
 		case PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_DDRIO:
@@ -1701,10 +1703,8 @@ static int sbridge_mci_bind_devs(struct mem_ctl_info *mci,
 	    !pvt-> pci_tad || !pvt->pci_ras  || !pvt->pci_ta)
 		goto enodev;
 
-	for (i = 0; i < NUM_CHANNELS; i++) {
-		if (!pvt->pci_tad[i])
-			goto enodev;
-	}
+	if (saw_chan_mask != 0x0f)
+		goto enodev;
 	return 0;
 
 enodev:
-- 
2.4.3


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

* Re: [PATCH] sb_edac: fix TAD presence check for sbridge_mci_bind_devs()
  2015-08-05 18:16 [PATCH] sb_edac: fix TAD presence check for sbridge_mci_bind_devs() Seth Jennings
@ 2015-08-05 18:20 ` Aristeu Rozanski
  2015-08-05 19:18 ` Luck, Tony
  2015-09-24 17:11 ` Borislav Petkov
  2 siblings, 0 replies; 4+ messages in thread
From: Aristeu Rozanski @ 2015-08-05 18:20 UTC (permalink / raw)
  To: Seth Jennings; +Cc: Mauro Carvalho Chehab, Tony Luck, linux-edac, linux-kernel

On Wed, Aug 05, 2015 at 01:16:01PM -0500, Seth Jennings wrote:
> In 7d375bff, NUM_CHANNELS was changed to 8 and the channel space was
> renumerated to handle EN, EP, and EX configurations.
> 
> The *_mci_bind_devs functions, except for sbridge_mci_bind_devs(), got a
> new device presence check in the form of saw_chan_mask.  However,
> sbridge_mci_bind_devs() still uses the NUM_CHANNELS for loop.
> 
> With the increase in NUM_CHANNELS, this loop fails at index 4 since
> SB only has 4 TADs.  This results in the following error on SB machines:
> 
> EDAC sbridge: Some needed devices are missing
> EDAC sbridge: Couldn't find mci handler
> EDAC sbridge: Couldn't find mci handle
> 
> This patch adapts the saw_chan_mask logic for sbridge_mci_bind_devs() as
> well.
> 
> After this patch:
> 
> EDAC MC0: Giving out device to module sbridge_edac.c controller Sandy Bridge Socket#0: DEV 0000:3f:0e.0 (POLLED)
> EDAC MC1: Giving out device to module sbridge_edac.c controller Sandy Bridge Socket#1: DEV 0000:7f:0e.0 (POLLED)

Acked-by: Aristeu Rozanski <aris@redhat.com>

> 
> Signed-off-by: Seth Jennings <sjenning@redhat.com>
> ---
>  drivers/edac/sb_edac.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c
> index ca78311..91cf710 100644
> --- a/drivers/edac/sb_edac.c
> +++ b/drivers/edac/sb_edac.c
> @@ -1648,6 +1648,7 @@ static int sbridge_mci_bind_devs(struct mem_ctl_info *mci,
>  {
>  	struct sbridge_pvt *pvt = mci->pvt_info;
>  	struct pci_dev *pdev;
> +	u8 saw_chan_mask = 0;
>  	int i;
>  
>  	for (i = 0; i < sbridge_dev->n_devs; i++) {
> @@ -1681,6 +1682,7 @@ static int sbridge_mci_bind_devs(struct mem_ctl_info *mci,
>  		{
>  			int id = pdev->device - PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_TAD0;
>  			pvt->pci_tad[id] = pdev;
> +			saw_chan_mask |= 1 << id;
>  		}
>  			break;
>  		case PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_DDRIO:
> @@ -1701,10 +1703,8 @@ static int sbridge_mci_bind_devs(struct mem_ctl_info *mci,
>  	    !pvt-> pci_tad || !pvt->pci_ras  || !pvt->pci_ta)
>  		goto enodev;
>  
> -	for (i = 0; i < NUM_CHANNELS; i++) {
> -		if (!pvt->pci_tad[i])
> -			goto enodev;
> -	}
> +	if (saw_chan_mask != 0x0f)
> +		goto enodev;
>  	return 0;
>  
>  enodev:
> -- 
> 2.4.3
> 

-- 
Aristeu


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

* RE: [PATCH] sb_edac: fix TAD presence check for sbridge_mci_bind_devs()
  2015-08-05 18:16 [PATCH] sb_edac: fix TAD presence check for sbridge_mci_bind_devs() Seth Jennings
  2015-08-05 18:20 ` Aristeu Rozanski
@ 2015-08-05 19:18 ` Luck, Tony
  2015-09-24 17:11 ` Borislav Petkov
  2 siblings, 0 replies; 4+ messages in thread
From: Luck, Tony @ 2015-08-05 19:18 UTC (permalink / raw)
  To: Seth Jennings, Mauro Carvalho Chehab
  Cc: Aristeu Rozanski, linux-edac@vger.kernel.org,
	linux-kernel@vger.kernel.org

> In 7d375bff, NUM_CHANNELS was changed to 8 and the channel space was
> renumerated to handle EN, EP, and EX configurations.
>
> The *_mci_bind_devs functions, except for sbridge_mci_bind_devs(), got a
> new device presence check in the form of saw_chan_mask.  However,
> sbridge_mci_bind_devs() still uses the NUM_CHANNELS for loop.

> This patch adapts the saw_chan_mask logic for sbridge_mci_bind_devs() as
> well.

Oops. Sorry I missed that.  Looks good.

Acked-by: Tony Luck <tony.luck@intel.com>


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

* Re: [PATCH] sb_edac: fix TAD presence check for sbridge_mci_bind_devs()
  2015-08-05 18:16 [PATCH] sb_edac: fix TAD presence check for sbridge_mci_bind_devs() Seth Jennings
  2015-08-05 18:20 ` Aristeu Rozanski
  2015-08-05 19:18 ` Luck, Tony
@ 2015-09-24 17:11 ` Borislav Petkov
  2 siblings, 0 replies; 4+ messages in thread
From: Borislav Petkov @ 2015-09-24 17:11 UTC (permalink / raw)
  To: Seth Jennings
  Cc: Mauro Carvalho Chehab, Tony Luck, Aristeu Rozanski, linux-edac,
	linux-kernel

On Wed, Aug 05, 2015 at 01:16:01PM -0500, Seth Jennings wrote:
> In 7d375bff, NUM_CHANNELS was changed to 8 and the channel space was
> renumerated to handle EN, EP, and EX configurations.
> 
> The *_mci_bind_devs functions, except for sbridge_mci_bind_devs(), got a
> new device presence check in the form of saw_chan_mask.  However,
> sbridge_mci_bind_devs() still uses the NUM_CHANNELS for loop.
> 
> With the increase in NUM_CHANNELS, this loop fails at index 4 since
> SB only has 4 TADs.  This results in the following error on SB machines:
> 
> EDAC sbridge: Some needed devices are missing
> EDAC sbridge: Couldn't find mci handler
> EDAC sbridge: Couldn't find mci handle
> 
> This patch adapts the saw_chan_mask logic for sbridge_mci_bind_devs() as
> well.
> 
> After this patch:
> 
> EDAC MC0: Giving out device to module sbridge_edac.c controller Sandy Bridge Socket#0: DEV 0000:3f:0e.0 (POLLED)
> EDAC MC1: Giving out device to module sbridge_edac.c controller Sandy Bridge Socket#1: DEV 0000:7f:0e.0 (POLLED)
> 
> Signed-off-by: Seth Jennings <sjenning@redhat.com>
> ---
>  drivers/edac/sb_edac.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Applied, thanks.

-- 
Regards/Gruss,
    Boris.

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

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

end of thread, other threads:[~2015-09-24 17:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-05 18:16 [PATCH] sb_edac: fix TAD presence check for sbridge_mci_bind_devs() Seth Jennings
2015-08-05 18:20 ` Aristeu Rozanski
2015-08-05 19:18 ` Luck, Tony
2015-09-24 17:11 ` Borislav Petkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox