Skip to contentSkip to conversation

linux-next: manual merge of the edac-amd tree with the edac tree

PATCH In review Stephen Rothwell 5 participants 13 messages Nov 28, 2016 – Dec 1, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi Borislav,

Today's linux-next merge of the edac-amd tree got a conflict in:

drivers/edac/edac_mc.c

between commit:

ef91afa61088 ("edac: move documentation from edac_mc.c to edac_core.h")

from the edac tree and commit:

c73e8833bec5 ("EDAC, mc: Fix locking around mc_devices list")

from the edac-amd tree.

I fixed it up (see below - there may be more fixes needed in edac_core.h) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.

Signature · 52 lines
Cheers,
Stephen Rothwell

diff --cc drivers/edac/edac_mc.c
index d50653d36918,d2ea9c4f1824..000000000000
--- a/drivers/edac/edac_mc.c
+++ b/drivers/edac/edac_mc.c
@@@ -470,6 -499,24 +470,17 @@@ static struct mem_ctl_info *__find_mci_
  
  	return NULL;
  }
+ 
 -/**
 - * find_mci_by_dev
 - *
 - *	scan list of controllers looking for the one that manages
 - *	the 'dev' device
 - * @dev: pointer to a struct device related with the MCI
 - */
+ struct mem_ctl_info *find_mci_by_dev(struct device *dev)
+ {
+ 	struct mem_ctl_info *ret;
+ 
+ 	mutex_lock(&mem_ctls_mutex);
+ 	ret = __find_mci_by_dev(dev);
+ 	mutex_unlock(&mem_ctls_mutex);
+ 
+ 	return ret;
+ }
  EXPORT_SYMBOL_GPL(find_mci_by_dev);
  
  /*
@@@ -599,10 -646,18 +610,12 @@@ static int del_mc_from_global_list(stru
  	return handlers;
  }
  
 -/**
 - * edac_mc_find: Search for a mem_ctl_info structure whose index is 'idx'.
 - *
 - * If found, return a pointer to the structure.
 - * Else return NULL.
 - */
  struct mem_ctl_info *edac_mc_find(int idx)
  {
+ 	struct mem_ctl_info *mci = NULL;
  	struct list_head *item;
- 	struct mem_ctl_info *mci;
+ 
+ 	mutex_lock(&mem_ctls_mutex);
  
  	list_for_each(item, &mc_devices) {
  		mci = list_entry(item, struct mem_ctl_info, link);
maintainer
#1 lore raw
Quoted 14 lines · Stephen Rothwell

Hi Borislav,

Today's linux-next merge of the edac-amd tree got a conflict in:

drivers/edac/edac_mc.c

between commit:

ef91afa61088 ("edac: move documentation from edac_mc.c to edac_core.h")

from the edac tree and commit:

c73e8833bec5 ("EDAC, mc: Fix locking around mc_devices list")

Quoted 8 lines

from the edac-amd tree.

I fixed it up (see below - there may be more fixes needed in edac_core.h) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.

Just one issue which has nothing to do with linux-next. There's still that in ef91afa61088:

Quoted 10 lines

+/**
+ * edac_mc_find: Search for a mem_ctl_info structure whose index is @idx.
+ *
+ * @idx: index to be seek
+ *
+ * If found, return a pointer to the structure.
+ * Else return NULL.
+ *
+ * Caller must hold mem_ctls_mutex.
+ */

That last sentence in the comment is not true anymore - edac_mc_find() is grabbing the mutex itself as it should be. Mauro, please fix that in your tree.

Thanks.

Signature · 4 lines
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.
#2 lore raw

Em Mon, 28 Nov 2016 09:27:35 +0100
Borislav Petkov <[email protected]> escreveu:

Quoted 38 lines · Stephen Rothwell
Quoted 14 lines

Hi Borislav,

Today's linux-next merge of the edac-amd tree got a conflict in:

drivers/edac/edac_mc.c

between commit:

ef91afa61088 ("edac: move documentation from edac_mc.c to edac_core.h")

from the edac tree and commit:

c73e8833bec5 ("EDAC, mc: Fix locking around mc_devices list")

Quoted 8 lines

from the edac-amd tree.

I fixed it up (see below - there may be more fixes needed in edac_core.h) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.

Just one issue which has nothing to do with linux-next. There's still that in ef91afa61088:

Quoted 10 lines

+/**
+ * edac_mc_find: Search for a mem_ctl_info structure whose index is @idx.
+ *
+ * @idx: index to be seek
+ *
+ * If found, return a pointer to the structure.
+ * Else return NULL.
+ *
+ * Caller must hold mem_ctls_mutex.
+ */

Quoted 3 lines

That last sentence in the comment is not true anymore - edac_mc_find() is grabbing the mutex itself as it should be. Mauro, please fix that in your tree.

Fixed. If you have a stable branch, I can rebase it on the top of your patches, in order to avoid the confict at linux-next.

Regards,
Mauro

maintainer
#3 lore raw
Quoted 2 lines · Mauro Carvalho Chehab

Fixed. If you have a stable branch, I can rebase it on the top of your patches, in order to avoid the confict at linux-next.

http://git.kernel.org/cgit/linux/kernel/git/bp/bp.git/log/?h=for-next

but with that fixed, shouldn't the merge work without a conflict?

Signature · 4 lines
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.
#4 lore raw

Em Thu, 1 Dec 2016 11:48:46 +0100
Borislav Petkov <[email protected]> escreveu:

Quoted 5 lines · Mauro Carvalho Chehab
Quoted 2 lines

Fixed. If you have a stable branch, I can rebase it on the top of your patches, in order to avoid the confict at linux-next.

http://git.kernel.org/cgit/linux/kernel/git/bp/bp.git/log/?h=for-next

Thanks!

Quoted 1 line

but with that fixed, shouldn't the merge work without a conflict?

Well, we're removing some lines from one file and adding them on another one. Git is not smart enough to solve such conflicts automatically:

CONFLICT (content): Merge conflict in drivers/edac/edac_mc.c Recorded preimage for 'drivers/edac/edac_mc.c' Automatic merge failed; fix conflicts and then commit the result.

Anyway, I rebased my work on the top of your branch. The conflict is now gone:

https://git.kernel.org/cgit/linux/kernel/git/mchehab/linux-edac.git/log/?h=linux_next

You can see the generated documentation at:
https://mchehab.fedorapeople.org/kernel_docs/admin-guide/ras.html
(user and admin guide)
and:
https://mchehab.fedorapeople.org/kernel_docs/driver-api/edac.html
(kernel API)

However, rebasing over your tree showed a new documentation gap:
./include/linux/edac.h:144: warning: Enum value 'HW_EVENT_ERR_DEFERRED' not described in enum 'hw_event_mc_err_type'

With was introduced by this commit:

commit d12a969ebbfcfc25853c4147d42b388f758e8784
Author: Yazen Ghannam <[email protected]>
Date: Thu Nov 17 17:57:32 2016 -0500

EDAC, amd64: Add Deferred Error type

Currently, deferred errors are classified as correctable in EDAC. Add a new error type for deferred errors so that they are correctly reported to the user.

Yazen introduced a "deferred error" code (whatever it means), but didn't document what's that. Unfortunately, the patch description is also not clear enough about what a "deferred error" means or how userspace is supposed to handle it.

Yazen,

Could you please send us a patch adding a proper description for this new error code?

Thanks!
Mauro

maintainer
#5 lore raw
Quoted 28 lines · Mauro Carvalho Chehab

However, rebasing over your tree showed a new documentation gap:
./include/linux/edac.h:144: warning: Enum value 'HW_EVENT_ERR_DEFERRED' not described in enum 'hw_event_mc_err_type'

With was introduced by this commit:

commit d12a969ebbfcfc25853c4147d42b388f758e8784
Author: Yazen Ghannam <[email protected]>
Date: Thu Nov 17 17:57:32 2016 -0500

EDAC, amd64: Add Deferred Error type

Currently, deferred errors are classified as correctable in EDAC. Add a new error type for deferred errors so that they are correctly reported to the user.

Yazen introduced a "deferred error" code (whatever it means), but didn't document what's that. Unfortunately, the patch description is also not clear enough about what a "deferred error" means or how userspace is supposed to handle it.

Quoted 5 lines

Yazen,

Could you please send us a patch adding a proper description for this new error code?

Hi Mauro,
A deferred error is an uncorrectable error whose handling can be deferred, i.e. it's not urgent. This affects the system behavior, but I'm now thinking that this shouldn't affect users' behavior. I think it would be simpler to just classify deferred errors as uncorrectable errors so that users treat them as such.

Boris,
Can we drop or revert commit d12a969ebbfc?

And can we apply a fixup like this to commit 713ad54675fd?

---
From: Yazen Ghannam <[email protected]>
Date: Thu, 1 Dec 2016 08:54:49 -0600
Subject: [PATCH] fixup! EDAC, amd64: Define and register UMC error decode
function

---
 drivers/edac/amd64_edac.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/edac/amd64_edac.c +2 -1
index 991b36c..245b9a0 100644
@@ -2480,8 +2480,9 @@ static void decode_umc_error(int node_id, struct mce *m)
 
        memset(&err, 0, sizeof(err));
 
+       /* Log deferred errors as uncorrectable errors. */
        if (m->status & MCI_STATUS_DEFERRED)
-               ecc_type = 3;
+               ecc_type = 1;
 
        err.channel = find_umc_channel(pvt, m);
        if (err.channel < 0) {
Signature · 6 lines
2.7.4

---

Thanks,
Yazen
maintainer
#6 lore raw
Quoted 5 lines · Yazen Ghannam

A deferred error is an uncorrectable error whose handling can be deferred, i.e. it's not urgent. This affects the system behavior, but I'm now thinking that this shouldn't affect users' behavior. I think it would be simpler to just classify deferred errors as uncorrectable errors so that users treat them as such.

Why would we want to lie about deferred errors being uncorrectable?

And I believe deferred errors can be handled differently like freeze the process using the page instead of killing it. And so on...

Why aren't you simply adding the documentation about HW_EVENT_ERR_DEFERRED and be done with it? The downstream path like tracepoint and all can handle all that just fine.

Quoted 2 lines

Boris,
Can we drop or revert commit d12a969ebbfc?

No can do. It is a public branch and there's no touching it.

Signature · 4 lines
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.
maintainer
#7 lore raw
Quoted 9 lines · Borislav Petkov
Quoted 5 lines · Yazen Ghannam

A deferred error is an uncorrectable error whose handling can be deferred, i.e. it's not urgent. This affects the system behavior, but I'm now thinking that this shouldn't affect users' behavior. I think it would be simpler to just classify deferred errors as uncorrectable errors so that users treat them as such.

Why would we want to lie about deferred errors being uncorrectable?

They are uncorrectable errors that can be handled differently. If you can't handle them then there's not much difference.

Quoted 3 lines

And I believe deferred errors can be handled differently like freeze the process using the page instead of killing it. And so on...

If deferred errors can be handled differently in userspace, then you're right we should maintain the distinction. I was thinking we'd only handle them in the kernel.

Quoted 4 lines

Why aren't you simply adding the documentation about HW_EVENT_ERR_DEFERRED and be done with it? The downstream path like tracepoint and all can handle all that just fine.

Okay, will do.

Quoted 5 lines
Quoted 2 lines

Boris,
Can we drop or revert commit d12a969ebbfc?

No can do. It is a public branch and there's no touching it.

Okay, got it.

Thanks,
Yazen

maintainer
#8 lore raw

PATCH 1/1 EDAC: Document HW_EVENT_ERR_DEFERRED type

Add a description of the HW_EVENT_ERR_DEFERRED type that wasn't included with commit d12a969ebbfc ("EDAC, amd64: Add Deferred Error type").

Cc Mauro Carvalho Chehab <[email protected]>
Cc Borislav Petkov <[email protected]>
---
 include/linux/edac.h | 6 ++++++
 1 file changed, 6 insertions(+)
include/linux/edac.h +6 -0
index cb56dcb..43cd51d 100644
@@ -128,6 +128,12 @@ enum dev_type {
  *				fatal (maybe it is on an unused memory area,
  *				or the memory controller could recover from
  *				it for example, by re-trying the operation).
+ * @HW_EVENT_ERR_DEFERRED:	Deferred Error - Indicates an uncorrectable
+ *				error whose handling is not urgent. This could
+ *				be due to hardware data poisoning where the
+ *				system can continue operation until the poisoned
+ *				data is consumed. Preemptive measures may also
+ *				be taken, e.g. offlining pages, etc.
  * @HW_EVENT_ERR_FATAL:		Fatal Error - Uncorrected error that could not
  *				be recovered.
  */
Signature · 1 line
2.7.4
Acked-by on v1 1/1
#9 lore raw

Re: [PATCH] EDAC: Document HW_EVENT_ERR_DEFERRED type

Quoted 18 lines · Yazen Ghannam

Add a description of the HW_EVENT_ERR_DEFERRED type that wasn't included with commit d12a969ebbfc ("EDAC, amd64: Add Deferred Error type").

Cc Mauro Carvalho Chehab <[email protected]>
Cc Borislav Petkov <[email protected]>
---
 include/linux/edac.h | 6 ++++++
 1 file changed, 6 insertions(+)
include/linux/edac.h +0 -0
index cb56dcb..43cd51d 100644
@@ -128,6 +128,12 @@ enum dev_type {
  *				fatal (maybe it is on an unused memory area,
  *				or the memory controller could recover from

include/linux/edac.h enum dev_type { · line 139

Quoted 10 lines
include/linux/edac.h +6 -0
  *				it for example, by re-trying the operation).
+ * @HW_EVENT_ERR_DEFERRED:	Deferred Error - Indicates an uncorrectable
+ *				error whose handling is not urgent. This could
+ *				be due to hardware data poisoning where the
+ *				system can continue operation until the poisoned
+ *				data is consumed. Preemptive measures may also
+ *				be taken, e.g. offlining pages, etc.
  * @HW_EVENT_ERR_FATAL:		Fatal Error - Uncorrected error that could not
  *				be recovered.
  */

Mauro, are you taking this through your tree or should I?

Signature · 5 lines
Regards/Gruss,
    Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
-- 
#10 lore raw

Re: [PATCH] EDAC: Document HW_EVENT_ERR_DEFERRED type

Em Thu, 1 Dec 2016 21:27:42 +0100
Borislav Petkov <[email protected]> escreveu:

Quoted 3 lines · Yazen Ghannam
Quoted 2 lines

Add a description of the HW_EVENT_ERR_DEFERRED type that wasn't included with commit d12a969ebbfc ("EDAC, amd64: Add Deferred Error type").

Thanks for the patch!

Quoted 8 lines
Quoted 8 lines
Cc Mauro Carvalho Chehab <[email protected]>
Cc Borislav Petkov <[email protected]>
---
 include/linux/edac.h | 6 ++++++
 1 file changed, 6 insertions(+)
Quoted 14 lines
Quoted 5 lines
include/linux/edac.h +0 -0
index cb56dcb..43cd51d 100644

include/linux/edac.h enum dev_type { · line 136

Quoted 9 lines
include/linux/edac.h +6 -0
@@ -128,6 +128,12 @@ enum dev_type {
  *				fatal (maybe it is on an unused memory area,
  *				or the memory controller could recover from
  *				it for example, by re-trying the operation).
+ * @HW_EVENT_ERR_DEFERRED:	Deferred Error - Indicates an uncorrectable
+ *				error whose handling is not urgent. This could
+ *				be due to hardware data poisoning where the
+ *				system can continue operation until the poisoned
+ *				data is consumed. Preemptive measures may also
+ *				be taken, e.g. offlining pages, etc.

I'm wandering if DEFERRED is the best name here... Maybe it could be called, instead HW_EVENT_ERR_NON_URGENT or something like that.

Anyway, the description itself looks good.

Quoted 8 lines

include/linux/edac.h enum dev_type { · line 139

Quoted 4 lines
include/linux/edac.h +0 -0
  * @HW_EVENT_ERR_FATAL:		Fatal Error - Uncorrected error that could not
  *				be recovered.
  */

Mauro, are you taking this through your tree or should I?

Boris, yeah, I can take care on it. I'll send my pull request after yours, to avoid any issues.

Signature · 2 lines
Thanks,
Mauro
#11 lore raw

Re: [PATCH] EDAC: Document HW_EVENT_ERR_DEFERRED type

Quoted 2 lines · Mauro Carvalho Chehab

I'm wandering if DEFERRED is the best name here... Maybe it could be called, instead HW_EVENT_ERR_NON_URGENT or something like that.

No, that's what the error is called in the hw documentation. It is really a *deferred* uncorrectable error. Deferred in the sense that it hasn't been consumed yet.

Quoted 2 lines

Boris, yeah, I can take care on it. I'll send my pull request after yours, to avoid any issues.

Ok, cool.

Thanks.

Signature · 5 lines
Regards/Gruss,
    Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
-- 
#12 lore raw

Re: [PATCH] EDAC: Document HW_EVENT_ERR_DEFERRED type

Em Thu, 1 Dec 2016 22:49:18 +0100
Borislav Petkov <[email protected]> escreveu:

Quoted 7 lines · Mauro Carvalho Chehab
Quoted 2 lines

I'm wandering if DEFERRED is the best name here... Maybe it could be called, instead HW_EVENT_ERR_NON_URGENT or something like that.

No, that's what the error is called in the hw documentation. It is really a *deferred* uncorrectable error. Deferred in the sense that it hasn't been consumed yet.

OK.

Quoted 6 lines
Quoted 2 lines

Boris, yeah, I can take care on it. I'll send my pull request after yours, to avoid any issues.

Ok, cool.

Thanks.

Patch applied.

Thanks!
Mauro