Re: [PATCH 00/63] i7core_edac and edac_mce

From: Hidetoshi Seto
Date: Thu Sep 24 2009 - 22:49:42 EST


Mauro Carvalho Chehab wrote:
> The content of this patch series is at:
> git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/i7core.git for_linus
>
> The first submission were done on Sept, 5 but weren't reviewed until
> yesterday.
>
> It is not yet a pull request. It is just the last version, after the
> last review.
>
> My intention is to submit likely tomorrow a git pull request if
> everything is ok and hoping that Linus will still accept it for 2.6.32.
>
> This time I'm sending the it as a patch series for better review. The complete
> patchset is being sent to EDAC ML (bluesmoke-devel@xxxxxxxxxxxxxxxxxxxxx).
>
> Only this email and two others of this series is c/c at LKML. If more people is
> interested on reviewing it, you can always look at -git and/or bluesmoke archives.
>
> The two patches c/c at LKML are:
> - the one that touches at PCI, for probing buses 254 and 255 - since, by
> default, ACPI bios doesn't announce those buses with MCU registers;
> - edac_mce glue driver, that add two hooks on mce that are called only if a
> driver is registered for receiving mce log events. This is needed in order to
> get corrected error reports at the EDAC driver.
>
> Cheers,
> Mauro

Interesting, but yes, definitely it needs more reviews.

Thanks,
H.Seto


Subject: [UNTESTED PATCH] i7core_edac: avoid spinlock on fatal error

Be careful on MCE context, or it might cause a deadlock.

Signed-off-by: Hidetoshi Seto <seto.hidetoshi@xxxxxxxxxxxxxx>
---
drivers/edac/i7core_edac.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c
index 97f6d17..f915a39 100644
--- a/drivers/edac/i7core_edac.c
+++ b/drivers/edac/i7core_edac.c
@@ -1679,6 +1679,12 @@ static int i7core_mce_check_error(void *priv, struct mce *mce)
return 0;
}

+ /* Handle fatal errors immediately */
+ if (mce->mcgstatus & 1) {
+ i7core_mce_output_error(mci, mce);
+ return 1;
+ }
+
spin_lock_irqsave(&pvt->mce_lock, flags);
if (pvt->mce_count < MCE_LOG_LEN) {
memcpy(&pvt->mce_entry[pvt->mce_count], mce, sizeof(*mce));
@@ -1686,10 +1692,6 @@ static int i7core_mce_check_error(void *priv, struct mce *mce)
}
spin_unlock_irqrestore(&pvt->mce_lock, flags);

- /* Handle fatal errors immediately */
- if (mce->mcgstatus & 1)
- i7core_check_error(mci);
-
/* Advice mcelog that the error were handled */
return 1;
}
--
1.6.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/