* EDAC, skx_edac: Fix for PCI multi-segment system
@ 2017-10-05 10:14 Borislav Petkov
0 siblings, 0 replies; 4+ messages in thread
From: Borislav Petkov @ 2017-10-05 10:14 UTC (permalink / raw)
To: Masayoshi Mizuma; +Cc: Tony Luck, linux-edac
On Thu, Oct 05, 2017 at 06:46:30PM +0900, Masayoshi Mizuma wrote:
> Currently, skx_edac is not handled correctly the PCI segment
> except segment #0 because get_sky_dev() is only check the
> bus number of the uncore devices. If the system has milti-segment
> and each bus number of the devices are the same number,
> skx_edac driver initializes the devices only segment #0.
>
> So, if skx_edac module is loaded to PCI multi-segment system,
> kernel panic occurs because of reference of the uninitialized
> segment #1 or more.
>
> This patch introduces to check the segment to get_sky_dev()
> and fix the panic.
>
> Signed-off-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
> ---
> drivers/edac/skx_edac.c | 9 ++++++---
> 1 files changed, 6 insertions(+), 3 deletions(-)
https://git.kernel.org/pub/scm/linux/kernel/git/bp/bp.git/commit/?h=for-next&id=88ae80aa609c7db3e3cc98e97e05badbcc6347dc
^ permalink raw reply [flat|nested] 4+ messages in thread
* EDAC, skx_edac: Fix for PCI multi-segment system
@ 2017-10-06 1:17 Masayoshi Mizuma
0 siblings, 0 replies; 4+ messages in thread
From: Masayoshi Mizuma @ 2017-10-06 1:17 UTC (permalink / raw)
To: Luck, Tony, Borislav Petkov; +Cc: linux-edac
Hi Boris and Tony,
On Thu, 5 Oct 2017 10:26:12 -0700 Luck, Tony wrote:
> On Thu, Oct 05, 2017 at 12:14:17PM +0200, Borislav Petkov wrote:
> > On Thu, Oct 05, 2017 at 06:46:30PM +0900, Masayoshi Mizuma wrote:
> > > This patch introduces to check the segment to get_sky_dev()
> > > and fix the panic.
> > >
> > > Signed-off-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
> > > ---
> > > drivers/edac/skx_edac.c | 9 ++++++---
> > > 1 files changed, 6 insertions(+), 3 deletions(-)
> >
> > https://git.kernel.org/pub/scm/linux/kernel/git/bp/bp.git/commit/?h=for-next&id=88ae80aa609c7db3e3cc98e97e05badbcc6347dc
Thank you for letting me know.
>
> Looks like your patch is functionally the same as the one
> that Boris took from me a few days ago. Funny how an issue
> like this sits around for a while, then three people find
> it at once (While I was writing the patch as a result of the
> first report, a second one came in ... now you found it too!).
>
> Please check that my patch works on your system (it has seen
> limited testing in different configurations).
I checked your patch and it works good for me.
Thank you for the patch!
- Masayoshi Mizuma
---
To unsubscribe from this list: send the line "unsubscribe linux-edac" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* EDAC, skx_edac: Fix for PCI multi-segment system
@ 2017-10-05 17:26 Luck, Tony
0 siblings, 0 replies; 4+ messages in thread
From: Luck, Tony @ 2017-10-05 17:26 UTC (permalink / raw)
To: Borislav Petkov; +Cc: Masayoshi Mizuma, linux-edac
On Thu, Oct 05, 2017 at 12:14:17PM +0200, Borislav Petkov wrote:
> On Thu, Oct 05, 2017 at 06:46:30PM +0900, Masayoshi Mizuma wrote:
> > This patch introduces to check the segment to get_sky_dev()
> > and fix the panic.
> >
> > Signed-off-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
> > ---
> > drivers/edac/skx_edac.c | 9 ++++++---
> > 1 files changed, 6 insertions(+), 3 deletions(-)
>
> https://git.kernel.org/pub/scm/linux/kernel/git/bp/bp.git/commit/?h=for-next&id=88ae80aa609c7db3e3cc98e97e05badbcc6347dc
Looks like your patch is functionally the same as the one
that Boris took from me a few days ago. Funny how an issue
like this sits around for a while, then three people find
it at once (While I was writing the patch as a result of the
first report, a second one came in ... now you found it too!).
Please check that my patch works on your system (it has seen
limited testing in different configurations).
-Tony
---
To unsubscribe from this list: send the line "unsubscribe linux-edac" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* EDAC, skx_edac: Fix for PCI multi-segment system
@ 2017-10-05 9:46 Masayoshi Mizuma
0 siblings, 0 replies; 4+ messages in thread
From: Masayoshi Mizuma @ 2017-10-05 9:46 UTC (permalink / raw)
To: Tony Luck; +Cc: linux-edac
Currently, skx_edac is not handled correctly the PCI segment
except segment #0 because get_sky_dev() is only check the
bus number of the uncore devices. If the system has milti-segment
and each bus number of the devices are the same number,
skx_edac driver initializes the devices only segment #0.
So, if skx_edac module is loaded to PCI multi-segment system,
kernel panic occurs because of reference of the uninitialized
segment #1 or more.
This patch introduces to check the segment to get_sky_dev()
and fix the panic.
Signed-off-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
---
drivers/edac/skx_edac.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/edac/skx_edac.c b/drivers/edac/skx_edac.c
index 16dea97..7f56044 100644
--- a/drivers/edac/skx_edac.c
+++ b/drivers/edac/skx_edac.c
@@ -68,6 +68,7 @@ struct skx_dev {
struct pci_dev *sad_all;
struct pci_dev *util_all;
u32 mcroute;
+ int domain;
struct skx_imc {
struct mem_ctl_info *mci;
u8 mc; /* system wide mc# */
@@ -110,12 +111,12 @@ struct decoded_addr {
int bank_group;
};
-static struct skx_dev *get_skx_dev(u8 bus, u8 idx)
+static struct skx_dev *get_skx_dev(int domain, u8 bus, u8 idx)
{
struct skx_dev *d;
list_for_each_entry(d, &skx_edac_list, list) {
- if (d->bus[idx] == bus)
+ if ((d->bus[idx] == bus) && (d->domain == domain))
return d;
}
@@ -179,6 +180,7 @@ static int get_all_bus_mappings(void)
d->bus[3] = GET_BITFIELD(reg, 24, 31);
edac_dbg(2, "busses: %x, %x, %x, %x\n",
d->bus[0], d->bus[1], d->bus[2], d->bus[3]);
+ d->domain = pci_domain_nr(pdev->bus);
list_add_tail(&d->list, &skx_edac_list);
skx_num_sockets++;
prev = pdev;
@@ -207,7 +209,8 @@ static int get_all_munits(const struct munit *m)
if (i == NUM_IMC)
goto fail;
}
- d = get_skx_dev(pdev->bus->number, m->busidx);
+ d = get_skx_dev(pci_domain_nr(pdev->bus), pdev->bus->number,
+ m->busidx);
if (!d)
goto fail;
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-10-06 1:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-05 10:14 EDAC, skx_edac: Fix for PCI multi-segment system Borislav Petkov
-- strict thread matches above, loose matches on Subject: below --
2017-10-06 1:17 Masayoshi Mizuma
2017-10-05 17:26 Luck, Tony
2017-10-05 9:46 Masayoshi Mizuma
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.