Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp505942imm; Wed, 19 Sep 2018 02:29:09 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYPe890OgCXiZCYQarwnbPxi80mGK1XwNGdzYHfXLB7qR+A+m1Cgjjny1163xEZN6dnM0oQ X-Received: by 2002:a62:2f84:: with SMTP id v126-v6mr35261398pfv.115.1537349349112; Wed, 19 Sep 2018 02:29:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537349349; cv=none; d=google.com; s=arc-20160816; b=FaoYvX5uQIQnbndmKvGsccm6kCi8iYdUofNbAga3tirAxcFro/pCU0YeQVId2fxGM0 p/NnUqsT+le7xq2p03zg+UXPFLkG5GLK4+QytlY6cpgYoylkm1qs7A06lJpwS1w4rrAB 6EpVzpDLcTYZ+6zhflD8lkiEpPuPVr+k93Jq067UjKg/HS5wm9QFGo/LuOZnTFVvTZKF ClSbvndvy/NOQbi+mSTpFt9avtgoqbdv3uTWFBRF+EOG+eYuY62/oxFrEfYxv6NE3CzC EMg/Jta5h3CDwf+A46w/qw1ZLzDtZDawXm7PA6FfCQxnQNmYQyH2rIrdzqM2JrYh8yKh KRYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from; bh=+zi/T5YfR/34hddNqKPG89zlmwg3GAEcq8ruD1BHDTc=; b=Jt9Y9nbG9K+in039gsYVm1yqaD1oj3XUyBDgryZzOOo96Q4REMUaEE7py5GJcx5fbx Gad8GcBr2SncC+PKNcnCxFHR6g2G/1V5STZ11KSTWu5Q5VW4WQO43uuo+Vn6Dk9BZGAZ 1OuklP+/mYqzUOH0udTOwKnxhaeZtPcSNnITSI3KC2saMbUdoWMPUtQ5o9zh7FKmoeKg TMFLfMQe4OD2mhNc4D8pNGLSgToGZwEsgWtL/FE5ol8MZq2ymjjFwDJJ3t47n7Q5E6+9 WlmlTjQcGp+yYHugeU8R2b4Q02ZEfxNn2Dn2jiFN7h0k7a37W3xTpve5/pIn3EgJth/v d4lQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z16-v6si18078594pgi.252.2018.09.19.02.28.53; Wed, 19 Sep 2018 02:29:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731068AbeISPF1 convert rfc822-to-8bit (ORCPT + 99 others); Wed, 19 Sep 2018 11:05:27 -0400 Received: from msgsrv4.atosorigin.de ([194.8.120.226]:56644 "EHLO msgsrv4.atosorigin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726986AbeISPF1 (ORCPT ); Wed, 19 Sep 2018 11:05:27 -0400 Received: from unknown (HELO julia-mo2.ccsn.de.ao-srv.com) ([194.8.124.179]) by msgsrv-out2.atosorigin.de with ESMTP; 19 Sep 2018 11:28:22 +0200 Received: from julia-mo2.ccsn.de.ao-srv.com (unknown [194.8.124.179]) by MCS01-MA1.atosorigin.de with smtp id 5b23_0780_72663a8c_fa64_4044_91b8_b63e40b167b9; Wed, 19 Sep 2018 11:28:22 +0200 Received: from julia-mo2 (localhost [127.0.0.1]) by julia-mo2.ccsn.de.ao-srv.com (Postfix) with ESMTP id 1CFDDA9BFB9; Wed, 19 Sep 2018 11:28:23 +0200 (CEST) Received: from MCS01-MA1.atosorigin.de (mcs01-ma1.deuser.de.intra [194.8.120.185]) by julia-mo2.ccsn.de.ao-srv.com (Postfix) with ESMTP id EF3FCA9BFBA; Wed, 19 Sep 2018 11:28:22 +0200 (CEST) Received: from SVR-DE-EXMBX-01.sma.de (unknown [10.99.42.82]) by MCS01-MA1.atosorigin.de with smtp id 5b23_0730_a093f2f4_1ca8_4ebb_bfc9_a4e425247756; Wed, 19 Sep 2018 11:28:17 +0200 Received: from EUR02-VE1-obe.outbound.protection.outlook.com (10.0.42.37) by webmail.sma.de (10.0.42.161) with Microsoft SMTP Server (TLS) id 14.3.389.1; Wed, 19 Sep 2018 11:28:05 +0200 Received: from DB7PR04MB5243.eurprd04.prod.outlook.com (20.176.236.87) by DB7PR04MB4394.eurprd04.prod.outlook.com (52.135.137.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Wed, 19 Sep 2018 09:25:32 +0000 Received: from DB7PR04MB5243.eurprd04.prod.outlook.com ([fe80::f198:36b7:1793:542b]) by DB7PR04MB5243.eurprd04.prod.outlook.com ([fe80::f198:36b7:1793:542b%3]) with mapi id 15.20.1143.017; Wed, 19 Sep 2018 09:25:32 +0000 From: Andre Kalb To: Rob Herring CC: Frank Rowand , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH v2] of: __of_update_property_sysfs only call __of_sysfs_remove_bin_file if of_node_is_attached Thread-Topic: [PATCH v2] of: __of_update_property_sysfs only call __of_sysfs_remove_bin_file if of_node_is_attached Thread-Index: AdREZxxSehcX9yb4Tui0YlbCxpETAwCflhgAAIFiuDAACG4qAAG7OyRA Date: Wed, 19 Sep 2018 09:25:32 +0000 Message-ID: References: In-Reply-To: Accept-Language: de-DE, en-US Content-Language: de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Andre.Kalb@sma.de; x-originating-ip: [62.157.91.9] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DB7PR04MB4394;6:4WKoMvMODz7mqfSx4ezR6PCOC8VLaV0v5eKeeJYpE39o/+qMSPFakgCofRs3PCM8FaEZ8nVD+y94vbTCPyXhGDtgdJKVGPmxJDrpK5u3h9aglACPM+CjWFEBg0kL6J6YZVKrRV7tI2A6Af130kzCUDre3qGD+qMuam4aKdnkwncM9ZQikubPlECy521gDNfsw6wnnRvCCuMmezvMwhKxQd9BBFyU5Q2Vh5GTi9Dnr2wIb0I3PuM/AKq6jgVmkP/XSKokVQmcDeRHaF+b1wXYeomSpTGoHltG+Tt86JXDbNl45JvZPT1nBhiUFvMjYBAFC3A2rXgGiBKzWgc6zp4bZKHLnIe46l33hJkqu/e/YGuwXfuTOVdWmu+yTY/RKeLYFz52HzP/rJPPn/HPFmhXtfb+jEnt8Lad1exIJPHWgC5YZB1OnN63dTMmjMkP5lYnRHziZEqd3yok6oMeGPeWKg==;5:4PZXFTObq3E+7uyjVaAvCs7kxiLP+v3Cd1w8bhPLnWFMMrYq3lop/DCJO6XHklzwbCbrTkzbdOgInggSv2WzHqPqEQD4Lzy6tul1rXzDWMwXndr5oTv3NpVVMqJoIygpKoBktX8rhG+annb/nfHgmtfrbWim/qCViurBQ6BKpQs=;7:vPXsWRs3YyWH3lYcp+7dW3CLSqiudKvZve5bSkENuskJWqmv3H6/u8q6yOefOCk+zAsVASmuqqW/sP5mhA6HEC1ng0Mb7I+AYSl7hu1t6tUaeEkEp5dAmKyGx0yTBcBjD+woQc6Cx8mex9SvXNy2j1zqZ/LqrPpK3WfXsjLixXd/59Kr63h3oVnQFCjVUbUx0J/ibyxinVfzmKZQIGXN0yzZYdYqq7xG1jdEn8NVdb8NcR4QyeckfkDWiMz3DGKu x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: c405e72a-62df-4540-3500-08d61e11d936 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:DB7PR04MB4394; x-ms-traffictypediagnostic: DB7PR04MB4394: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(9452136761055)(85827821059158); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231355)(944501410)(52105095)(3002001)(10201501046)(93006095)(93001095)(149027)(150027)(6041310)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699050);SRVR:DB7PR04MB4394;BCL:0;PCL:0;RULEID:;SRVR:DB7PR04MB4394; x-forefront-prvs: 0800C0C167 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(136003)(396003)(39860400002)(346002)(376002)(189003)(199004)(54906003)(5250100002)(305945005)(6436002)(7696005)(68736007)(99286004)(105586002)(66066001)(74316002)(9686003)(6306002)(39060400002)(33656002)(75402003)(76176011)(3846002)(55016002)(97736004)(316002)(7736002)(6506007)(6116002)(106356001)(446003)(478600001)(45080400002)(476003)(14454004)(11346002)(486006)(102836004)(25786009)(53936002)(53546011)(72206003)(8936002)(26005)(2906002)(81156014)(74482002)(93886005)(5024004)(86362001)(5660300001)(4326008)(8676002)(186003)(966005)(81166006)(14444005)(256004)(2900100001);DIR:OUT;SFP:1102;SCL:1;SRVR:DB7PR04MB4394;H:DB7PR04MB5243.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: sma.de does not designate permitted sender hosts) x-microsoft-antispam-message-info: kXjACFvZlhMDKdSxhNX/r2uUxkHBInZQsPKfHGc6Ic+l/DRy+cc8PcCPpxXxVi5SqQpkHm8ZV29zuXDm35z1GdVVl9u+LBCoXD1FxqMMtvPALIfnLvyjgvuOg65XCvm1TP8JOyToRgqQhaO1f7ilOyZfrYut+EHxkevGizStGZbkIwCKgQ2uO1z83bwDKqmjwWfBHs1pivQNiGV6L/tWNkK3A5nl/r7ycZowA15KEWnkPKshzX5OyQRhJ7IIsUKTR92uzhBKCFNapKz4nUaBbREx/9/HM60Y0osyDMcMHvfHEeG+4/T17Dm8spwAgDcLU7eUjqtK+S7oUHGQFvKO4G2Np8At5Vz7fUf8uWPVFt0= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: c405e72a-62df-4540-3500-08d61e11d936 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Sep 2018 09:25:32.5888 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a059b96c-2829-4d11-8837-4cc1ff84735d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4394 X-OriginatorOrg: sma.de X-NAI-Spam-Flag: NO X-NAI-Spam-Level: X-NAI-Spam-Threshold: 8 X-NAI-Spam-Score: 0.9 X-NAI-Spam-Version: 2.3.0.9418 : core <6376> : inlines <6884> : streams <1798889> : uri <2713604> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rob, I have used an other hardware to check the patch. I hope it doesn't matter. I added few lines at the untitest.c. All existing unittest use an attached sysfs, therefore the bug isn't detectable. The patch of the unittest is posted: https://lore.kernel.org/patchwork/patch/985738/ ------------[ cut here ]------------ WARNING: CPU: 0 PID: 1 at fs/kernfs/dir.c:1481 kernfs_remove_by_name_ns+0x9c/0xa4 kernfs: can not remove '(null)', no directory Modules linked in: CPU: 0 PID: 1 Comm: swapper Not tainted 4.18.7 #3 Hardware name: Freescale i.MX6 Ultralite (Device Tree) [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [] (show_stack) from [] (__warn+0xe0/0xf8) [] (__warn) from [] (warn_slowpath_fmt+0x44/0x68) [] (warn_slowpath_fmt) from [] (kernfs_remove_by_name_ns+0x9c/0xa4) [] (kernfs_remove_by_name_ns) from [] (__of_update_property_sysfs+0x38/0x50) [] (__of_update_property_sysfs) from [] (of_update_property+0xc0/0x104) [] (of_update_property) from [] (of_unittest+0x1b8/0x28d4) [] (of_unittest) from [] (do_one_initcall+0x40/0x218) [] (do_one_initcall) from [] (kernel_init_freeable+0x24c/0x2e4) [] (kernel_init_freeable) from [] (kernel_init+0x8/0x110) [] (kernel_init) from [] (ret_from_fork+0x14/0x2c) Exception stack(0xcc099fb0 to 0xcc099ff8) 9fa0: 00000000 00000000 00000000 00000000 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 ---[ end trace 4522f69e0760e4d5 ]--- Best regards Andre Kalb > -----Urspr?ngliche Nachricht----- > Von: Rob Herring [mailto:robh+dt@kernel.org] > Gesendet: Montag, 10. September 2018 15:47 > An: Andre Kalb > Cc: Frank Rowand; devicetree@vger.kernel.org; linux-kernel@vger.kernel.org > Betreff: Re: [PATCH v2] of: __of_update_property_sysfs only call > __of_sysfs_remove_bin_file if of_node_is_attached > > On Mon, Sep 10, 2018 at 4:51 AM Andre Kalb wrote: > > > > Hi Frank, > > > > > -----Urspr?ngliche Nachricht----- > > > Von: Frank Rowand [mailto:frowand.list@gmail.com] > > > Gesendet: Freitag, 7. September 2018 22:01 > > > An: Andre Kalb; robh+dt@kernel.org; devicetree@vger.kernel.org; > > > linux- kernel@vger.kernel.org > > > Betreff: Re: [PATCH v2] of: __of_update_property_sysfs only call > > > __of_sysfs_remove_bin_file if of_node_is_attached > > > > > > Hi Andred, > > > > > > On 09/04/18 08:51, Andre Kalb wrote: > > > > To prevent warning "kernfs: can not remove '(null)', no directory" > > > > if an overlay > > > isn't applied to the active devicetree. > > > > > > > > Using of_remove_property and then of_add_property doesn't show the > > > warning. > > [...] > > > > What is the calling path that results in the warning? > > > > > > -Frank > > > > There is the callstack of the warning. > > > > [ 10.782830] ------------[ cut here ]------------ > > [ 10.830357] WARNING: CPU: 0 PID: 170 at /linux-4.x/fs/kernfs/dir.c:1276 > kernfs_remove_by_name_ns+0x30/0x80() > > [ 10.928997] kernfs: can not remove '(null)', no directory > > [ 10.993107] Modules linked in: module_capemgr(+) > > [ 11.045750] CPU: 0 PID: 170 Comm: systemd-udevd Not tainted 4.4.143- > 00158-g8e5ca65ec7ee-dirty #114 > > 158 patches on top of an almost 3 year old kernel... > > > [ 12.011373] [] (module_capemgr_slot_scan [module_capemgr]) > from [] (module_capemgr_probe+0x3c/0x58 [module_capemgr]) > > And a driver that's not upstream. > > Not saying the fix isn't valid, but please reproduce on recent mainline. Add a > unittest if you have to. > > Rob ___________________________________________________ SMA Solar Technology AG Aufsichtsrat: Dr. Erik Ehrentraut (Vorsitzender) Vorstand: Ulrich Hadding, Dr.-Ing. Juergen Reinert, Pierre-Pascal Urbon Handelsregister: Amtsgericht Kassel HRB 3972 Sitz der Gesellschaft: 34266 Niestetal USt-ID-Nr. DE 113 08 59 54 WEEE-Reg.-Nr. DE 95881150 ___________________________________________________