From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754025Ab3CRPZU (ORCPT ); Mon, 18 Mar 2013 11:25:20 -0400 Received: from mail-pb0-f48.google.com ([209.85.160.48]:44129 "EHLO mail-pb0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752935Ab3CRPZQ (ORCPT ); Mon, 18 Mar 2013 11:25:16 -0400 Date: Mon, 18 Mar 2013 08:26:31 -0700 From: Greg Kroah-Hartman To: Fengguang Wu , Clark Williams , Ingo Molnar Cc: linux-kernel@vger.kernel.org, Felipe Balbi , Paul Gortmaker , "Rafael J. Wysocki" , Arnd Bergmann , Kay Sievers , Thomas Gleixner Subject: Re: [rttest] WARNING: at drivers/base/core.c:569 device_create_file() Message-ID: <20130318152631.GC3249@kroah.com> References: <20130318135234.GA31564@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130318135234.GA31564@localhost> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 18, 2013 at 09:52:34PM +0800, Fengguang Wu wrote: > Greetings, > > I got the below dmesg and the first bad commit is Adding the owners of the kernel/rtmutext-tester.c file. > > commit 8f46baaa7ec6cd0851794020b31958e64679dd26 > Author: Felipe Balbi > Date: Wed Feb 20 10:31:42 2013 +0200 > > base: core: WARN() about bogus permissions on device attributes > > Whenever a struct device_attribute is registered > with mismatched permissions - read permission without > a show routine or write permission without store > routine - we will issue a big warning so we catch > those early enough. > > Signed-off-by: Felipe Balbi > Signed-off-by: Greg Kroah-Hartman > > Judging from the dmesg, CC the rttest developers for possible fixes. > > [ 11.581068] bus: 'rttest': add device rttest0 > [ 11.581813] ------------[ cut here ]------------ > [ 11.582568] WARNING: at /c/kernel-tests/src/linux/drivers/base/core.c:569 device_create_file+0x5a/0xa0() > [ 11.584035] Write permission without 'store' > [ 11.584793] Pid: 1, comm: swapper/0 Not tainted 3.9.0-rc2-next-20130318 #21 > [ 11.585902] Call Trace: > [ 11.586318] [<8102d888>] warn_slowpath_common+0x68/0xa0 > [ 11.587146] [<8151b77a>] ? device_create_file+0x5a/0xa0 > [ 11.587982] [<8151b77a>] ? device_create_file+0x5a/0xa0 > [ 11.588820] [<8102d91e>] warn_slowpath_fmt+0x2e/0x30 > [ 11.589618] [<8151b77a>] device_create_file+0x5a/0xa0 > [ 11.590523] [<81081faa>] init_rttest+0xaa/0x150 Turns out that the sysfs attributes this function (init_rttest()) is creating, isn't correct. The "command" file is mode 0600, yet has no read function, and the "status" file is the same mode, with no write function. These should be fixed, which is what the patch from Felipe is pointing out. Don't shoot the messenger :) thanks, greg k-h