From patchwork Mon Feb 18 22:13:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Borislav Petkov X-Patchwork-Id: 2160601 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 233833FDF1 for ; Mon, 18 Feb 2013 22:13:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757232Ab3BRWNM (ORCPT ); Mon, 18 Feb 2013 17:13:12 -0500 Received: from mail.skyhub.de ([78.46.96.112]:43528 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757027Ab3BRWNK (ORCPT ); Mon, 18 Feb 2013 17:13:10 -0500 X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alien8.de; s=alien8; t=1361225589; bh=nk/xyxWY+lC4sfoxluujFQOIWlGZbQwdW7gnOFf8DLI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=VOymU5sEXazwFqgK7oWiV4GeVByp8M9g+ohGpw a095+fU83DttYuDspxaHF1T0/hpEGT09UUNUOnnPR0lnGUy8vOHJKiJwXblpMd5fCMN 1YKvlSOU44niamL6M0XUdABNoX0fXDmyhARv+5ygjxjMkjrnlahzDTFr7oiLSQTGak= Received: from mail.skyhub.de ([127.0.0.1]) by localhost (door.skyhub.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id BYFr9mIIgcUN; Mon, 18 Feb 2013 23:13:09 +0100 (CET) Received: from liondog.tnic (p4FF1CEBA.dip.t-dialin.net [79.241.206.186]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id AFD0A1D9CF8; Mon, 18 Feb 2013 23:13:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alien8.de; s=alien8; t=1361225588; bh=nk/xyxWY+lC4sfoxluujFQOIWlGZbQwdW7gnOFf8DLI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=ql72jZGx9J1Ti9167nAHJ3lffb8wSPTaJc4Nby Lg2IY4XdFFiB+zIcAZxOLDXY1wUkvqcCgpCmYSie6k8yKc7jYbrSb/26Vxnk8uyupKF uXtuz/0oB3G5jFQLQ4ycr961tTuobsguZPoeGKjHxVaq+IdiPeZVxAqxbqA6Ez5GH4= Received: by liondog.tnic (Postfix, from userid 1000) id E811A10070F; Mon, 18 Feb 2013 23:13:06 +0100 (CET) Date: Mon, 18 Feb 2013 23:13:06 +0100 From: Borislav Petkov To: Greg KH Cc: Mauro Carvalho Chehab , balbi@ti.com, Linux Kernel Mailing List , Steven Rostedt , Frederic Weisbecker , Ingo Molnar , JBottomley@parallels.com, linux-scsi@vger.kernel.org, davem@davemloft.net, netdev@vger.kernel.org, Doug Thompson , linux-edac@vger.kernel.org, rjw@sisk.pl, linux-pm@vger.kernel.org Subject: Re: SYSFS "errors" Message-ID: <20130218221306.GA21493@pd.tnic> Mail-Followup-To: Borislav Petkov , Greg KH , Mauro Carvalho Chehab , balbi@ti.com, Linux Kernel Mailing List , Steven Rostedt , Frederic Weisbecker , Ingo Molnar , JBottomley@parallels.com, linux-scsi@vger.kernel.org, davem@davemloft.net, netdev@vger.kernel.org, Doug Thompson , linux-edac@vger.kernel.org, rjw@sisk.pl, linux-pm@vger.kernel.org References: <20130218155012.GA30974@kroah.com> <20130218155215.GB2663@arwen.pp.htv.fi> <20130218171334.GA31329@kroah.com> <20130218172700.GH2663@arwen.pp.htv.fi> <20130218174916.GA2070@kroah.com> <20130218184633.GC10755@arwen.pp.htv.fi> <20130218164638.7cb53baa@redhat.com> <20130218200542.GB20137@arwen.pp.htv.fi> <20130218184742.5a4c3c06@redhat.com> <20130218215434.GB16794@kroah.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20130218215434.GB16794@kroah.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org On Mon, Feb 18, 2013 at 01:54:34PM -0800, Greg KH wrote: > Because sysfs is "one value per file" the lack of a file showing up > shouldn't cause any userspace tools any problems, that is why we did > things this way. > > But, of course, userspace programmers do know how to mess things up... How about what I proposed earlier to Felipe: --- -- Would that hurt the sysfs policy? In this case we *can* read the file and it correctly tells us that scrub rate reading is not supported instead of having a number there. Hmm. diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c index 0ca1ca71157f..d2eef76d1d46 100644 --- a/drivers/edac/edac_mc_sysfs.c +++ b/drivers/edac/edac_mc_sysfs.c @@ -704,7 +704,7 @@ static ssize_t mci_sdram_scrub_rate_show(struct device *dev, int bandwidth = 0; if (!mci->get_sdram_scrub_rate) - return -ENODEV; + return sprintf(data, "N/A"); bandwidth = mci->get_sdram_scrub_rate(mci); if (bandwidth < 0) {