All of lore.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Tony Luck <tony.luck@intel.com>
Cc: Qiuxu Zhuo <qiuxu.zhuo@intel.com>,
	Aristeu Rozanski <aris@redhat.com>,
	Mauro Carvalho Chehab <mchehab@s-opensource.com>,
	linux-edac@vger.kernel.org
Subject: [3/5] EDAC, skx_edac: Clean up debugfs
Date: Wed, 26 Sep 2018 17:55:02 +0200	[thread overview]
Message-ID: <20180926155502.GH5584@zn.tnic> (raw)

On Mon, Sep 24, 2018 at 01:16:11PM -0700, Tony Luck wrote:
> @@ -1072,6 +1025,48 @@ static struct notifier_block skx_mce_dec = {
>  	.priority	= MCE_PRIO_EDAC,
>  };
>  
> +#ifdef CONFIG_EDAC_DEBUG
> +/*
> + * Debug feature. Make /sys/kernel/debug/edac/skx_edac_test/addr.
> + * Write an address to this file to exercise the address decode
> + * logic in this driver.
> + */

This whole comment needs massaging into proper english.

> +static struct dentry *skx_test;
> +static u64 skx_fake_addr;
> +
> +static int debugfs_u64_set(void *data, u64 val)
> +{
> +	struct mce m;
> +
> +	m.mcgstatus = 0;
> +	/* ADDRV + MemRd + Unknown channel */
> +	m.status = MCI_STATUS_ADDRV + 0x90;
> +	/* One corrected error */
> +	m.status |= 1ULL << MCI_STATUS_CEC_SHIFT;
> +	m.addr = val;
> +	m.socketid = 0;
> +	skx_mce_check_error(NULL, 0, &m);
> +
> +	return 0;
> +}
> +DEFINE_SIMPLE_ATTRIBUTE(fops_u64_wo, NULL, debugfs_u64_set, "%llu\n");
> +
> +static void setup_skx_debug(void)
> +{
> +	skx_test = edac_debugfs_create_dir("skx_edac_test");

Error handling.

> +	edac_debugfs_create_file("addr", 0200, skx_test,
> +				 &skx_fake_addr, &fops_u64_wo);

Ditto.

             reply	other threads:[~2018-09-26 15:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-26 15:55 Borislav Petkov [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-09-24 20:16 [3/5] EDAC, skx_edac: Clean up debugfs Luck, Tony

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=20180926155502.GH5584@zn.tnic \
    --to=bp@alien8.de \
    --cc=aris@redhat.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=mchehab@s-opensource.com \
    --cc=qiuxu.zhuo@intel.com \
    --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 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.