From patchwork Sat May 12 00:18:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Vorontsov X-Patchwork-Id: 8545 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 021F423E20 for ; Sat, 12 May 2012 00:20:27 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id C6234A18C52 for ; Sat, 12 May 2012 00:20:26 +0000 (UTC) Received: by yhpp61 with SMTP id p61so4055416yhp.11 for ; Fri, 11 May 2012 17:20:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:date:from :to:cc:subject:message-id:references:mime-version:content-type :content-disposition:in-reply-to:user-agent:x-gm-message-state; bh=MM/AFStZUf8/VuACNzL0Go8USJ1akq3zutzN1aFyvSM=; b=AK5fSxEjR5gSnpdcRPMRtxRso5kz1H18VXd3BjjaOKXwaJvn5GTELXIvsRs2K0/TM/ taUsaAq78HOh3mEElrbvH+jDBC+KfvjNzIJSerTyW7UciBkOq9RavwUFySthTu33nF71 ySO+/YFP3CdoIY/yM7tRedi/rnsr4ebBeqUXfoZwHOmNLJyYFFMOrzdMRIrLeQT0j8ED +Puj5kFDOgDR/YUrAHHlm8Hk9khAQ6wf22cb7JZvqXSw0AsmhIp4R6DhuEQDRc9w8MtS i1BydCxXf2Sg5M9/xnwxIGhdYk3tFlOq3EtcxwRLEoTkx+ipzWurNkkeKRuLHg5ha02/ i7yw== Received: by 10.50.89.168 with SMTP id bp8mr44899igb.3.1336782026203; Fri, 11 May 2012 17:20:26 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.73.147 with SMTP id q19csp211566ibj; Fri, 11 May 2012 17:20:25 -0700 (PDT) Received: by 10.68.236.101 with SMTP id ut5mr68691pbc.167.1336782025516; Fri, 11 May 2012 17:20:25 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id p7si16197983pbk.104.2012.05.11.17.20.25 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 11 May 2012 17:20:25 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of anton.vorontsov@linaro.org) client-ip=209.85.160.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of anton.vorontsov@linaro.org) smtp.mail=anton.vorontsov@linaro.org Received: by mail-pb0-f50.google.com with SMTP id rr4so4860215pbb.37 for ; Fri, 11 May 2012 17:20:25 -0700 (PDT) Received: by 10.68.116.203 with SMTP id jy11mr143394pbb.129.1336782025201; Fri, 11 May 2012 17:20:25 -0700 (PDT) Received: from localhost (c-71-204-165-222.hsd1.ca.comcast.net. [71.204.165.222]) by mx.google.com with ESMTPS id wn3sm14216565pbc.74.2012.05.11.17.20.22 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 11 May 2012 17:20:24 -0700 (PDT) Date: Fri, 11 May 2012 17:18:57 -0700 From: Anton Vorontsov To: Greg Kroah-Hartman , Kees Cook , Colin Cross Cc: Arnd Bergmann , John Stultz , arve@android.com, Rebecca Schultz Zavin , Jesper Juhl , Randy Dunlap , Stephen Boyd , Thomas Meyer , Andrew Morton , Marco Stornelli , WANG Cong , linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, linaro-kernel@lists.linaro.org, patches@linaro.org, kernel-team@android.com Subject: [PATCH 11/11] pstore/ram: Add ECC support Message-ID: <20120512001857.GK14782@lizard> References: <20120512001506.GA8653@lizard> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20120512001506.GA8653@lizard> User-Agent: Mutt/1.5.21 (2010-09-15) X-Gm-Message-State: ALoCoQm+3dEbBuFdv2dP6e5dUxrieKJ6iU0h6Yyoqwgv1WJ4O1LikVGjiLewxDqAorXbny1slMHu This is now straightforward: just introduce a module parameter and pass the needed value to persistent_ram_new(). Signed-off-by: Anton Vorontsov Acked-by: Kees Cook --- fs/pstore/ram.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c index cf0ad92..eeb4e32 100644 --- a/fs/pstore/ram.c +++ b/fs/pstore/ram.c @@ -61,6 +61,11 @@ module_param(dump_oops, int, 0600); MODULE_PARM_DESC(dump_oops, "set to 1 to dump oopses, 0 to only dump panics (default 1)"); +static int ramoops_ecc; +module_param_named(ecc, ramoops_ecc, int, 0600); +MODULE_PARM_DESC(ramoops_ecc, + "set to 1 to enable ECC support"); + struct ramoops_context { struct persistent_ram_zone **przs; phys_addr_t phys_addr; @@ -251,7 +256,7 @@ static int __init ramoops_probe(struct platform_device *pdev) size_t sz = cxt->record_size; phys_addr_t start = cxt->phys_addr + sz * i; - cxt->przs[i] = persistent_ram_new(start, sz, 0); + cxt->przs[i] = persistent_ram_new(start, sz, ramoops_ecc); if (IS_ERR(cxt->przs[i])) { err = PTR_ERR(cxt->przs[i]); pr_err("failed to initialize a prz\n"); @@ -283,9 +288,10 @@ static int __init ramoops_probe(struct platform_device *pdev) record_size = pdata->record_size; dump_oops = pdata->dump_oops; - pr_info("attached 0x%lx@0x%llx (%ux0x%zx)\n", + pr_info("attached 0x%lx@0x%llx (%ux0x%zx), ecc: %s\n", cxt->size, (unsigned long long)cxt->phys_addr, - cxt->max_count, cxt->record_size); + cxt->max_count, cxt->record_size, + ramoops_ecc ? "on" : "off"); return 0;