Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752289AbbFBU0s (ORCPT ); Tue, 2 Jun 2015 16:26:48 -0400 Received: from mail-bn1on0115.outbound.protection.outlook.com ([157.56.110.115]:45154 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751917AbbFBU0U (ORCPT ); Tue, 2 Jun 2015 16:26:20 -0400 Authentication-Results: spf=none (sender IP is 165.204.84.221) smtp.mailfrom=amd.com; alien8.de; dkim=none (message not signed) header.d=none; X-WSS-ID: 0NPC3FT-07-71D-02 X-M-MSG: From: Aravind Gopalakrishnan To: , , CC: , , Subject: [PATCH V2 6/9] edac, mce_amd_inj: Add README file Date: Tue, 2 Jun 2015 15:35:59 -0500 Message-ID: <1433277362-10911-7-git-send-email-Aravind.Gopalakrishnan@amd.com> X-Mailer: git-send-email 2.4.0 In-Reply-To: <1433277362-10911-1-git-send-email-Aravind.Gopalakrishnan@amd.com> References: <1433277362-10911-1-git-send-email-Aravind.Gopalakrishnan@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BY2FFO11FD038;1:fkGEiXOrVIg015AiS4TlzJPUD0DnzWw6DrnfMhHFuvdxzuNwW3MzT08+ibSXiOzjOMYBkgB5vBCX8YqgTQ3tNxS7kuVXh4l9/BAp/n582MGvUv/8BzUys8nXbVmpG2I9Xin3VlJ1ixxDkNB8PVqvvS8USetTzyyZ3HaykccYIEFxC/T3toZRYpsp9fTmnqXALAx368mPa90m06v6MOg6w63vT9M72avvaYRqetNbH6xozzhqTmWD1ft5FGsYU2BDHS17GRNuSAbnRtamjhYg2w== X-Forefront-Antispam-Report: CIP:165.204.84.221;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(428002)(199003)(189002)(64706001)(2201001)(77096005)(62966003)(77156002)(87936001)(50226001)(229853001)(106466001)(46102003)(47776003)(53416004)(19580395003)(19580405001)(48376002)(92566002)(50466002)(50986999)(86362001)(101416001)(76176999)(5001860100001)(105586002)(4001540100001)(5001830100001)(5001770100001)(68736005)(189998001)(5001920100001)(97736004)(2950100001)(36756003);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR02MB1114;H:atltwp01.amd.com;FPR:;SPF:None;PTR:InfoDomainNonexistent;A:1;MX:1;LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR02MB1114; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(520003)(3002001);SRVR:BY1PR02MB1114;BCL:0;PCL:0;RULEID:;SRVR:BY1PR02MB1114; X-Forefront-PRVS: 05954A7C45 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jun 2015 20:26:17.6587 (UTC) X-MS-Exchange-CrossTenant-Id: fde4dada-be84-483f-92cc-e026cbee8e96 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fde4dada-be84-483f-92cc-e026cbee8e96;Ip=[165.204.84.221];Helo=[atltwp01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR02MB1114 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3569 Lines: 86 Provides information about each file and the usages. Signed-off-by: Aravind Gopalakrishnan --- drivers/edac/mce_amd_inj.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/drivers/edac/mce_amd_inj.c b/drivers/edac/mce_amd_inj.c index ad18913..b7e108c 100644 --- a/drivers/edac/mce_amd_inj.c +++ b/drivers/edac/mce_amd_inj.c @@ -290,6 +290,57 @@ MCE_INJECT_GET(bank); DEFINE_SIMPLE_ATTRIBUTE(bank_fops, inj_bank_get, inj_bank_set, "%llu\n"); +static const char readme_msg[] = + "\nDescription of the files and their usages:\n\n" + "status: Set a value to be programmed into MCx_STATUS(bank)\n" + "\t The status bits provide insight into the type of\n" + "\t error that caused the MCE.\n\n" + "misc: Set value of MCx_MISC(bank)\n" + "\t misc register provides auxiliary info about the error. This\n" + "\t register is typically used for error thresholding purpose and\n" + "\t validity of the register is indicated by MCx_STATUS[MiscV]\n\n" + "addr: Error address value to be written to MCx_ADDR(bank)\n" + "\t This register is used to log address information associated\n" + "\t with the error.\n\n" + "Note: See respective BKDGs for the exact bit definitions of the\n" + "\t above registers as they mirror the MCi_[STATUS | MISC | ADDR]\n" + "\t hardware registers.\n\n" + "bank: Specify the bank you want to inject the error into.\n" + "\t The number of banks in a processor varies and is family/model\n" + "\t dependent. So, a sanity check performed while writing.\n" + "\t Writing to this file will trigger a #MC or APIC interrupts or\n" + "\t invoke the error decoder routines for AMD processors. The value\n" + "\t in 'flags' file decides which of above actions is triggered.\n\n" + "flags: Write to this file to speficy the error injection policy.\n" + "\t Allowed values:\n" + "\t\t\"sw\" - SW error injection, Only calls error decoder\n" + "\t\t\troutines to print error info in human readable format\n" + "\t\t\"hw\" - HW error injection, Forces a #MC,\n" + "\t\t\tcauses exception handler to handle the error\n" + "\t\t\tif UC or poll handler catches it if CE\n" + "\t\t\tWarning: Might cause system panic if MCx_STATUS[PCC]\n" + "\t\t\tis set. For debug purposes, consider setting\n" + "\t\t\t//mce/fake_panic\n" + "\t\t\"dfr\" - Trigger APIC interrupt for Deferred error\n" + "\t\t\tError is handled by deferred error apic handler if\n" + "\t\t\tfeature is present in HW.\n" + "\t\t\"thr\" - Trigger APIC interrupt for threshold error\n" + "\t\t\tError is handled by threshold apic handler\n\n" + "cpu: The cpu to inject the error on.\n\n" +; + +static ssize_t +inj_readme_read(struct file *filp, char __user *ubuf, + size_t cnt, loff_t *ppos) +{ + return simple_read_from_buffer(ubuf, cnt, ppos, + readme_msg, strlen(readme_msg)); +} + +static const struct file_operations readme_fops = { + .read = inj_readme_read, +}; + static struct dfs_node { char *name; struct dentry *d; @@ -308,6 +359,8 @@ static struct dfs_node { .perm = S_IRUSR | S_IWUSR }, { .name = "cpu", .fops = &extcpu_fops, .perm = S_IRUSR | S_IWUSR }, + { .name = "README", .fops = &readme_fops, + .perm = S_IRUSR | S_IRGRP | S_IROTH }, }; static int __init init_mce_inject(void) -- 2.4.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/