linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Tony Luck <tony.luck@intel.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] RAS/CEC: Add debugfs switch to disable at run time
Date: Sat, 20 Apr 2019 21:50:45 +0200	[thread overview]
Message-ID: <20190420195045.GG29704@zn.tnic> (raw)
In-Reply-To: <20190418220229.32133-1-tony.luck@intel.com>

On Thu, Apr 18, 2019 at 03:02:29PM -0700, Tony Luck wrote:
> Useful when running error injection tests that want to
> see all of the MCi_(STATUS|ADDR|MISC) data via /dev/mcelog.
> 
> Signed-off-by: Tony Luck <tony.luck@intel.com>
> ---
>  drivers/ras/cec.c | 20 +++++++++++++++++++-
>  1 file changed, 19 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/ras/cec.c b/drivers/ras/cec.c
> index 2d9ec378a8bc..a2ceedcd8516 100644
> --- a/drivers/ras/cec.c
> +++ b/drivers/ras/cec.c
> @@ -123,6 +123,9 @@ static u64 dfs_pfn;
>  /* Amount of errors after which we offline */
>  static unsigned int count_threshold = COUNT_MASK;
>  
> +/* debugfs switch to enable/disable CEC */
> +static u64 cec_enabled = 1;
> +
>  /*
>   * The timer "decays" element count each timer_interval which is 24hrs by
>   * default.
> @@ -400,6 +403,14 @@ static int count_threshold_set(void *data, u64 val)
>  }
>  DEFINE_DEBUGFS_ATTRIBUTE(count_threshold_ops, u64_get, count_threshold_set, "%lld\n");
>  
> +static int enable_set(void *data, u64 val)
> +{
> +	ce_arr.disabled = !val;

Btw, regardless of what we end up doing wrt hiding this switch under
RAS_CEC_DEBUG or exposing it, that ce_arr.disabled flag is not
needed anymore and you can remove it along with the flags union in
ce_array with the next version of this. Because one of the cec_enabled
or ce_arr.disabled is now redundant and I think you want to have
cec_enabled. :)

Thx.

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

      parent reply	other threads:[~2019-04-20 19:51 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-18 22:02 [PATCH] RAS/CEC: Add debugfs switch to disable at run time Tony Luck
2019-04-18 22:51 ` Cong Wang
2019-04-18 23:29   ` Borislav Petkov
2019-04-18 23:58     ` Cong Wang
2019-04-19  0:26       ` Borislav Petkov
2019-04-20  5:43         ` Cong Wang
2019-04-20  9:13           ` Borislav Petkov
2019-04-20 18:18             ` Cong Wang
2019-04-20 18:47               ` Borislav Petkov
2019-04-20 19:08                 ` Cong Wang
2019-04-22 16:29                 ` Luck, Tony
2019-04-22 16:31                   ` Borislav Petkov
2019-04-22 16:43                     ` Luck, Tony
2019-04-22 17:05                       ` Borislav Petkov
2019-04-22 17:23                         ` Luck, Tony
2019-04-19  0:07     ` Luck, Tony
2019-04-19  0:29       ` Borislav Petkov
2019-04-19 15:04         ` Luck, Tony
2019-04-20  9:41           ` Borislav Petkov
2019-04-22 15:59             ` Luck, Tony
2019-04-22 17:15               ` Borislav Petkov
2019-04-22 17:44                 ` Luck, Tony
2019-04-22 18:08                   ` Borislav Petkov
2019-04-20  5:50       ` Cong Wang
2019-04-20 19:50 ` Borislav Petkov [this message]

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=20190420195045.GG29704@zn.tnic \
    --to=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --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).