Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934003AbcLHC21 (ORCPT ); Wed, 7 Dec 2016 21:28:27 -0500 Received: from mfo1500.mxl.2iij.net ([203.180.99.17]:60407 "EHLO mfo.mxl.2iij.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752989AbcLHC2Z (ORCPT ); Wed, 7 Dec 2016 21:28:25 -0500 X-Greylist: delayed 741 seconds by postgrey-1.27 at vger.kernel.org; Wed, 07 Dec 2016 21:28:25 EST X-MXL-Hash: 5848c2587125c347-b10186413cceaf29d64d01b15c661450fbce1e6a From: fx IWATA NOBUO To: Andrey Konovalov , Shuah Khan CC: Greg Kroah-Hartman , Valentina Manea , Shuah Khan , "linux-usb@vger.kernel.org" , LKML Subject: RE: [PATCH] usbip: fix warning in vhci_hcd_probe/lockdep_init_map Thread-Topic: [PATCH] usbip: fix warning in vhci_hcd_probe/lockdep_init_map Thread-Index: AQHSTzHDm8PVADuBJkahYzYll8fkK6D5xhOAgAEN8ACAAneiwA== Date: Thu, 8 Dec 2016 02:15:50 +0000 Message-ID: References: <20161205195638.7005-1-shuahkh@osg.samsung.com> <4a3b7e4f-6b5c-d9e8-f26c-1286d4e1f630@osg.samsung.com> In-Reply-To: Accept-Language: ja-JP, en-US Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [2001:240:bb5e:1850::1:237] x-ms-office365-filtering-correlation-id: cff64b30-0dab-4515-c31c-08d41f102179 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:HK2PR06MB1569; x-microsoft-exchange-diagnostics: 1;HK2PR06MB1569;7:Sj1NK/lHDiQAudTVLCAvn3F62tXAtPCZbUm3nrSUTzsV+R0TUFroHNlwX/bo+BbNwxQyJzqxtZrBUCBI7bdCCQHAUajnnBqP83tx9RagSIVMF9/D/CDTqWU3RwBQB0v6z48LlwEMiwlyEtIb4lpHKeUBoXKmoa7SvFu9mtL3v3QfqCzrJ0x6aegCfQkodgtMHhljWun8oWpVeWZhwtwFWw57o5Oukf/DFkybKZmcCsTXvJpGiP/skVZihq5h8mXs75fZNJ/+xZT70eVicmjusZYiTF3mWpZdOldqQTnqg5ItQSk4J0KJi/wAoHZnICeBogoEGAYBLAhvhida/sztwkwhqG2/sykqKuWFcuu0e2woFdlkp3lkg1+uO9JsVkzFr/Ts7eub091l+c+nv5E5eGRqapNSQefP1S8lfnDudyZLJkcz1pH9SQ6IT8VeQ/YzzRKhnrQDQAJLQ/TKIsMCKA== x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(9452136761055)(211936372134217)(7411616537696); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026)(6041248)(20161123564025)(20161123560025)(20161123555025)(20161123562025)(6042181)(6072148);SRVR:HK2PR06MB1569;BCL:0;PCL:0;RULEID:;SRVR:HK2PR06MB1569; x-forefront-prvs: 0150F3F97D x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(7916002)(199003)(377454003)(24454002)(13464003)(189002)(8676002)(106356001)(92566002)(105586002)(106116001)(74316002)(305945005)(2900100001)(6506006)(3660700001)(7846002)(68736007)(3280700002)(74482002)(9686002)(122556002)(2906002)(4326007)(189998001)(5001770100001)(50986999)(76176999)(97736004)(54356999)(7696004)(38730400001)(229853002)(39060400001)(5660300001)(76576001)(33656002)(7736002)(81166006)(81156014)(8936002)(42882006)(2950100002)(101416001)(6116002)(86362001)(77096006)(102836003)(422495003);DIR:OUT;SFP:1102;SCL:1;SRVR:HK2PR06MB1569;H:HK2PR06MB1569.apcprd06.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-OriginatorOrg: fujixerox.co.jp X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Dec 2016 02:15:50.5986 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 176c9cc7-bcae-4c9a-9d8f-1b9322aff6ab X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2PR06MB1569 X-MAIL-FROM: X-SOURCE-IP: [210.173.21.247] X-Spam: exempt Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id uB82SWGF010262 Content-Length: 3887 Lines: 101 Dear Shuah, I'm afraid there's one thing I have concerned. I think it's better to move sysfs_attr_init() before status->attr.attr.name = status->name; Best Regards, nobuo.iwata // > -----Original Message----- > From: linux-usb-owner@vger.kernel.org > [mailto:linux-usb-owner@vger.kernel.org] On Behalf Of Andrey Konovalov > Sent: Tuesday, December 06, 2016 9:07 PM > To: Shuah Khan > Cc: Greg Kroah-Hartman; Valentina Manea; Shuah Khan; > linux-usb@vger.kernel.org; LKML > Subject: Re: [PATCH] usbip: fix warning in vhci_hcd_probe/lockdep_init_map > > On Mon, Dec 5, 2016 at 9:00 PM, Shuah Khan wrote: > > Hi Andrey, > > > > On 12/05/2016 12:56 PM, Shuah Khan wrote: > >> vhci_hcd calls sysfs_create_group() with dynamically allocated sysfs > >> attributes triggering the lock-class key not persistent warning. Call > >> sysfs_attr_init() for dynamically allocated sysfs attributes to fix it. > >> > >> vhci_hcd vhci_hcd: USB/IP Virtual Host Controller vhci_hcd vhci_hcd: > >> new USB bus registered, assigned bus number 2 > >> BUG: key ffff88006a7e8d18 not in .data! > >> ------------[ cut here ]------------ > >> WARNING: CPU: 0 PID: 1 at kernel/locking/lockdep.c:3131 > >> lockdep_init_map+0x60c/0x770 > >> DEBUG_LOCKS_WARN_ON(1)[ 1.567044] Modules linked in: > >> CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.9.0-rc7+ #58 Hardware > >> name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 > >> ffff88006bce6eb8 ffffffff81f96c8a ffffffff00000a02 1ffff1000d79cd6a > >> ffffed000d79cd62 000000046bce6ed8 0000000041b58ab3 ffffffff8598af40 > >> ffffffff81f969f8 0000000000000000 0000000041b58ab3 0000000000000200 > >> Call Trace: > >> [< inline >] __dump_stack lib/dump_stack.c:15 > >> [] dump_stack+0x292/0x398 lib/dump_stack.c:51 > >> [] __warn+0x19f/0x1e0 kernel/panic.c:550 > >> [] warn_slowpath_fmt+0xc5/0x110 kernel/panic.c:565 > >> [] lockdep_init_map+0x60c/0x770 > >> kernel/locking/lockdep.c:3131 [] > >> __kernfs_create_file+0x114/0x2a0 fs/kernfs/file.c:954 > [] sysfs_add_file_mode_ns+0x225/0x520 > fs/sysfs/file.c:305 > >> [< inline >] create_files fs/sysfs/group.c:64 > >> [] internal_create_group+0x239/0x8f0 > >> fs/sysfs/group.c:134 [] > >> sysfs_create_group+0x1f/0x30 fs/sysfs/group.c:156 > >> [] vhci_start+0x5b4/0x7a0 > >> drivers/usb/usbip/vhci_hcd.c:978 [] > >> usb_add_hcd+0x8da/0x1c60 drivers/usb/core/hcd.c:2867 > >> [] vhci_hcd_probe+0x97/0x130 > >> drivers/usb/usbip/vhci_hcd.c:1103 > >> --- > >> --- > >> ---[ end trace c33c7b202cf3aac8 ]--- > >> > >> Signed-off-by: Shuah Khan > >> Reported-by: Andrey Konovalov > > > > Here is the fix. Fixed the warning I reproduced on my system. > > Let me know if it works for you. > > Hi Shuah, > > This fixes the warning I've been seeing. > > Thanks! > > > > > thanks, > > -- Shuah > > > >> --- > >> drivers/usb/usbip/vhci_sysfs.c | 1 + > >> 1 file changed, 1 insertion(+) > >> > >> diff --git a/drivers/usb/usbip/vhci_sysfs.c > >> b/drivers/usb/usbip/vhci_sysfs.c index c404017..b96e5b1 100644 > >> --- a/drivers/usb/usbip/vhci_sysfs.c > >> +++ b/drivers/usb/usbip/vhci_sysfs.c > >> @@ -361,6 +361,7 @@ static void set_status_attr(int id) > >> status->attr.attr.name = status->name; > >> status->attr.attr.mode = S_IRUGO; > >> status->attr.show = status_show; > >> + sysfs_attr_init(&status->attr.attr); > >> } > >> > >> static int init_status_attrs(void) > >> > > > -- > To unsubscribe from this list: send the line "unsubscribe linux-usb" in > the body of a message to majordomo@vger.kernel.org More majordomo info at > http://vger.kernel.org/majordomo-info.html