From: Toshi Kani <toshi.kani@hpe.com>
To: "bp@alien8.de" <bp@alien8.de>,
"linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>
Cc: "mchehab@infradead.org" <mchehab@infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"tony.luck@intel.com" <tony.luck@intel.com>,
"rjw@rjwysocki.net" <rjw@rjwysocki.net>
Subject: [3/3] EDAC, ghes: Make it a proper module
Date: Fri, 28 Jul 2017 18:50:56 +0000 [thread overview]
Message-ID: <1501267290.2042.89.camel@hpe.com> (raw)
On Wed, 2017-07-26 at 10:48 +0200, Borislav Petkov wrote:
> From: Borislav Petkov <bp@suse.de>
>
> Register with the GHES notifier chain so that there's no need to call
> into the module with ghes_edac_report_mem_error().
>
> Signed-off-by: Borislav Petkov <bp@suse.de>
:
> +static int report_mem_error(struct notifier_block *nb, unsigned long
> sev, void *data)
> {
> + struct cper_sec_mem_err *mem_err = data;
> enum hw_event_mc_err_type type;
> struct edac_raw_error_desc *e;
> struct mem_ctl_info *mci;
> - struct ghes_edac_pvt *pvt = NULL;
> - char *p;
> + struct ghes_edac_pvt *pvt = ghes_pvt;
> u8 grain_bits;
> + char *p;
>
> - list_for_each_entry(pvt, &ghes_reglist, list) {
> - if (ghes == pvt->ghes)
> - break;
> - }
> if (!pvt) {
I think it always hits this error condition. See below.
> - pr_err("Internal error: Can't find EDAC
> structure\n");
> - return;
> + edac_pr_err("Internal error: Can't find EDAC
> structure\n");
> + return NOTIFY_DONE;
> }
> +
:
> +static int __init ghes_edac_register(void)
> {
> + struct ghes_edac_pvt *pvt = ghes_pvt;
This simply sets NULL to pvt, and does not initialize ghes_pvt.
> bool fake = false;
> int rc, num_dimm = 0;
> struct mem_ctl_info *mci;
> struct edac_mc_layer layers[1];
> - struct ghes_edac_pvt *pvt;
> struct ghes_edac_dimm_fill dimm_fill;
>
:
> -EXPORT_SYMBOL_GPL(ghes_edac_register);
> +module_init(ghes_edac_register);
Since this patch has removed the GHES-presence check and ordering hack
for ghes_edac, it now registers itself per the module_init() ordering
regardless of the presence of GHES. As Mauro pointed out, some type of
GHES check needs to be in place before making this change.
Thanks,
-Toshi
next reply other threads:[~2017-07-28 18:50 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-28 18:50 Toshi Kani [this message]
-- strict thread matches above, loose matches on Subject: below --
2017-08-02 22:41 [3/3] EDAC, ghes: Make it a proper module Toshi Kani
2017-08-02 3:18 Borislav Petkov
2017-08-02 0:19 Toshi Kani
2017-08-01 9:46 Borislav Petkov
2017-07-31 20:19 Toshi Kani
2017-07-29 6:47 Borislav Petkov
2017-07-27 5:20 Borislav Petkov
2017-07-26 19:49 Toshi Kani
2017-07-26 19:24 Toshi Kani
2017-07-26 18:17 Mauro Carvalho Chehab
2017-07-26 17:27 Luck, Tony
2017-07-26 10:51 Mauro Carvalho Chehab
2017-07-26 10:37 Borislav Petkov
2017-07-26 10:24 Mauro Carvalho Chehab
2017-07-26 8:48 Borislav Petkov
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=1501267290.2042.89.camel@hpe.com \
--to=toshi.kani@hpe.com \
--cc=bp@alien8.de \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab@infradead.org \
--cc=rjw@rjwysocki.net \
--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;
as well as URLs for NNTP newsgroup(s).