From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933005AbcBYOlw (ORCPT ); Thu, 25 Feb 2016 09:41:52 -0500 Received: from mail-by2on0078.outbound.protection.outlook.com ([207.46.100.78]:26813 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1760202AbcBYOlt (ORCPT ); Thu, 25 Feb 2016 09:41:49 -0500 Authentication-Results: spf=fail (sender IP is 66.35.236.227) smtp.mailfrom=opensource.altera.com; ettus.com; dkim=pass (signature was verified) header.d=altera.onmicrosoft.com;ettus.com; dmarc=none action=none header.from=opensource.altera.com; Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=opensource.altera.com; Date: Thu, 25 Feb 2016 08:41:33 -0600 From: atull X-X-Sender: atull@atull-730U3E-740U3E To: Rob Herring CC: Pantelis Antoniou , Frank Rowand , Grant Likely , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Moritz Fischer , Pantelis Antoniou , Alan Tull , Dinh Nguyen Subject: Re: [PATCH] of: add pre-operation notifications In-Reply-To: Message-ID: References: <1456352937-28311-1-git-send-email-atull@opensource.altera.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [71.42.185.2] X-ClientProxiedBy: SN1PR0501CA0031.namprd05.prod.outlook.com (25.163.126.169) To CY1PR03MB1520.namprd03.prod.outlook.com (25.163.17.26) X-MS-Office365-Filtering-Correlation-Id: 4cb84a38-8011-40a8-019c-08d33df1c93d X-Microsoft-Exchange-Diagnostics-untrusted: 1;CY1PR03MB1520;2:3ebpuT6owFc20BeaMfvr+z8Z/D3oLG+3F6C1dqtUaPoEWvT2Q6rWYqr+OGEozAIgVZWB8Ff5awd5g6tMu5w4NjbdE8Yc0e3g71RukLl6GJdFp/slDPlERQqOUHJatmpgY3uFm6I/xSkxCikuC5H22kEpMdQUrM3e07Tgn0IwdlwJFwpXTmc5w1XNHb6YBGSk;3:uZcsqaTv/uu5xB8Q/laAUNurpURTOSBcJEkrU7HMQ/pB1sHIgmOg071OpL1ghYGLYnqUhwyw+3kWW6Y1kfAcCDoiCd9IQQeuhmwVHSZuIKbQ0Us7k/UQ+vAhsMJEydhp;25:YztxV2H7Jj/iLyxGZyPEvk8QZ29htNl9fm/1zqtDFS437FW5VI+HmLsEZvjqWvp+Q6mmVbRMtDfm23Xh/F0m79RMiU15GG5OLFlct8H8QylgrPgCm9vtQF37rWHn4Y1t3ioHCfJODxzaPkfdOtxhzyb6Ir6ucoQbT3e/JzfhvF2PD8RIIh3NxXK0YiswCq+/7+xUHqjzogHAGQoFOq+GmTMYUdDmGrtaZYqNRo9NacJHtC4bAoIoYoHhnDZHkJ8z8u1zFTy6XUjp+wRsjUe629LF5fIMniHgNWqbJvjsTlWV368hzoxiAR2aVflJbP1UPCpXBaBoGwGxWnNeXi/3UA==;20:4ZsX5Ya4vNQ3iWP5R/4yuc6dhkTmtKwg3YLJabxuUe5na55+VNXV+I5OBlrXgnTMD/GoXjDtGD1Bp8Z3MP5i/fGQB9NRBe/MjwcBdfAWjCGYVRQiBkNUYtF7QXUZQc5OO5ksk0YhjxfxORAbMdKrpsKKUFHcfIpY/u2YS1bUJYI= X-Microsoft-Antispam-Untrusted: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR03MB1520; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:;UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046);SRVR:CY1PR03MB1520;BCL:0;PCL:0;RULEID:;SRVR:CY1PR03MB1520;BCL:0;PCL:0;RULEID:(601004)(2401047)(13023025)(13015025)(13017025)(5005006)(13018025)(13024025)(8121501046)(3002001)(10201501046);SRVR:BY2PR03MB044;BCL:0;PCL:0;RULEID:;SRVR:BY2PR03MB044; X-Microsoft-Exchange-Diagnostics-untrusted: 1;CY1PR03MB1520;4:1weZttHwuns78JpS/Qs+N1rHwIILblZ5ddPpkK51noLWd/275rDmRSxl8xS4ny54Lt/GEyGxsBd4OyzsOt8AoB+PNI05AtPngLIGLhVi0Ou7LqSfIp2u1g/eQHjqWq5Lz3FJwO+bi3Ip8ZHkrKuMY8O1K41VJ8whFzWjRKkmRvfRcIG/h81Z3djV3uKHV4oECGfgPnV4mos/M3uuHbeWhsaGWRdLMEp0f9iA+4nm5A7ORFb7HpGA+ydEbX40FxsssZalId0psTRI9mHHqUZgQe75KobA2tBfUHzVYz9J8uJNL4q3x5FLQqYMOH75/4GhCJZzG9geAsbHmZaQp18cn3dAo0qSYT2MULZMSKHOh8q6O/c64tpi+nMsKwFFEahm X-Forefront-PRVS: 08635C03D4 X-Forefront-Antispam-Report-Untrusted: SFV:NSPM;SFS:(10009020)(4630300001)(6049001)(6009001)(377454003)(24454002)(47776003)(19580405001)(19580395003)(5004730100002)(86362001)(42186005)(86152002)(87976001)(117156001)(40100003)(76176999)(92566002)(4326007)(4001430100002)(4001350100001)(107886002)(5008740100001)(6116002)(586003)(1096002)(122386002)(50466002)(2906002)(77096005)(23726003)(33716001)(50986999)(3846002)(5001960100002)(2950100001)(66066001)(15650500001)(189998001)(54356999)(46406003)(110136002)(5005980100003);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR03MB1520;H:[192.168.1.113];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics-untrusted: =?us-ascii?Q?1;CY1PR03MB1520;23:WP0LIwA5N2XLDGev1U+qvz4KEztpgstBv1LYQaSFt?= =?us-ascii?Q?7OLrutMcLugdte7UZ6ojT5tuz9bVvJZsfekaCmhkk03M2fMCMy6aJLK3b7gB?= =?us-ascii?Q?e91L9wdGaAgolnX2fqNRR8nct357//lpfP3NQgWs1fYF5KnAShuN+QgJV6jX?= =?us-ascii?Q?63jOqh/UTxqgzbWIEQiz2Pz0KSBu7NBdReyzDG+7kTyUUrgYB68bnHydEy3b?= =?us-ascii?Q?PSYSUJuDjsalS7NqBxSrLynm19vOhyb+O4RpBUF8LQWimfo/scTw4zS1u6RB?= =?us-ascii?Q?SOvcbVNxtpKCrIF0EnakjROZxXKkKfh9X4YsDajlTUAYuaj6PjZixuQu64Et?= =?us-ascii?Q?I3OcTnIjaRAiH3hCy5FJAOw+s7pmEgUB6vsQuFQcme/N+gbBhHGFZT09HfsG?= =?us-ascii?Q?HLVFx/l60daMm6r+46T0uDYVNHFtAZm79CYw/sJiJBQPbxNIBeyLA4JN0bGX?= =?us-ascii?Q?DlcCADmPdmQk6bxKjE5t0JOoAh1B73koy/XHRiM1ov5pBGZXC3R+mr8jV9gP?= =?us-ascii?Q?d5Ziycezi1pIYa4+eDQc0eeC+DHg79fmDeXRCpBLX59PUS8ymkYd0Ljkd1/V?= =?us-ascii?Q?dBn6EmR9p4ChHNdwy6rB397OTGPOvK309veLmaE1GN13xKoC+qxurTw/mxub?= =?us-ascii?Q?zuwXjbSxh7N9C99om1NprGU84pHUm/W3lxZ69cTli5fzQsdlKqrZuvc1vh0B?= =?us-ascii?Q?RI9SnNkF0HGr5BPSYGK+fOzK8wt+fyywYJuPED5XK8pj2YlUO9GSJXnw2EL1?= =?us-ascii?Q?hI5hVnHqP7ocJgne9aJQaPM0n7xiZxT2F+AQ0c2s0wfNh9gYTtQtDSXSu/oy?= =?us-ascii?Q?2UDCS/07N415YMITe1nDdWS52h/stG1CyzZ6sOyYWO5P1zLwhs6GqgN/GF/a?= =?us-ascii?Q?xQD3dNNGfB7smXvJFGZRLb15pkigLva7OugvE/js51LPrH1Y+q17hRlPR3UA?= =?us-ascii?Q?G4askYg0Lj6f2FwUOjVGIolL1RPoyuc9aa3XlRDJGFkeo8sXbbuaChb3TqbN?= =?us-ascii?Q?JorIdq3qUnc/SnR/ciaYino+mBA22igw723jT5R6L+N26URE0OWv3H6doHeR?= =?us-ascii?Q?FuRScZ2QugTwzGHGZOHdPH9EsJ/1twv5Ek8V6g28nxaZaOLZMcWBw/lqlxSN?= =?us-ascii?Q?y8PxFELB6RGLbT2x3JnxPeL1a9/XPnT?= X-Microsoft-Exchange-Diagnostics-untrusted: 1;CY1PR03MB1520;5:jDm7h2szysyW1RmOwYlc4bsYZSh3HfpLXVbFBZoRuDUhI3LFxgvm9POQHrIibMD/+FqBE+mP6UqM8gsisKlnBYVTYgvKkWx2iZf+aexHg1c1fYPeRF2FJFMx88bihcxs3CG/SJFsaK87NVy/H2I4xQ==;24:pooZnAe25kg4ni5q+KdFPOYl31+F/g0Zx10Wf4bEzhhqrrNWuDlFyVonOvhCd7CKqCpwuFsdTaSpDQAGqGwsNwGomMOMx9/oByYFBtFvKBI=;20:Bh7KfAi7q+J0Zxbp9VddD9wTfJ2myrnAiD2YwnbbZEDDjvaKm/RId1rpJqEUHRmWa8QHoAw6P6xW5dnQe5GbfRKtus/gt85C0li4fhoRssJjD76SKkRcxhxvhy/PrAAGkBgf5g+k9WIauV863uUQxlUA0oxMl+yyFkBMGBb9qoA= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR03MB1520 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: BY2FFO11FD047.protection.gbl X-Forefront-Antispam-Report: CPI:66.35.236.227;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(24454002)(377454003)(4326007)(87936001)(40100003)(956001)(3720700001)(50986999)(16796002)(3846002)(21840400001)(11100500001)(6806005)(54356999)(189998001)(110136002)(15650500001)(107886002)(4001430100002)(5008740100001)(5001960100002)(76176999)(105606002)(1220700001)(86152002)(2906002)(47776003)(1096002)(117156001)(586003)(5004730100002)(33716001)(50466002)(122386002)(23726003)(2950100001)(85426001)(4001350100001)(86362001)(106466001)(46406003)(77096005)(19580395003)(19580405001)(92566002)(66066001)(6116002)(7099028)(5005980100003);DIR:OUT;SFP:1101;SCL:1;SRVR:BY2PR03MB044;H:sj-itexedge03.altera.priv.altera.com;FPR:;SPF:Fail;MLV:sfv;A:0;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BY2FFO11FD047;1:9eUCfjlTRFljX55X0z97Yd1nCPmZH5AaNN/n8c+rNOfTJTdGktCgMdO+81SQvf5sua/jPJjg3PUXH6oly9nP4U+SI1T4VUiOvHf4GfM5Ehh74lxL8eQ46j7pEhLLIbZGzD/29TojPlXZ6MdXkyG9XlukMtCkids9yHNFuO15SnMeGly3zzNBTozfhE1IZ+HTN6gD/6M0eadGdC15nBUORgYCGjeHRuF1DZjmbFXPjGeKnVJI36sKKYazxEl7yMqJGoIexbHRJDaVBcSpe5Wwz9hz2ywnKVlFOB3K8s4tTKFPBmtrv60fTen0MjUaLZN+B5QzpAXD33S065QUgVb75rlu4JXX+DEpSr5M+hxLnKpcVIizuQ0vIF11v9uJka+6bT3NNC3lpawcfEBI+NKrK1mYT9RWbSTrJyzuW7eFbtY65Xg49AK8D9Pzk6c3cqA5zYhp+38I3EDsrzb08RUdEw== X-Microsoft-Exchange-Diagnostics: 1;BY2PR03MB044;2:E3bR7lvA34fGd2JPvbf2agf0AzNTqfdtWiDjj/FWPBqjn7rtIGHRA0RICUeYsM7A14ch9ygS3W8M+uAx648wWj8miFwF6Mm4lcFQ9T20SeaZw5TSI9IDiKR+9i5FllJNTAY9jmbFYc068gzHjlA3a54vOoLnUfYe/eLGWFiwjLVBUVNNAe1gUM/lrQETGDLa;3:cmKHhTlRU3DSsmTz7JPpJ6StK5K9AuuATHMj0gJ97r3KrCxTTq0qwmANNlcn+YFO66VArGtdjDrxh1Xs9EJ9kXuXYt7E7fMXlvQfbmKyPprDUW2CPmmif5eH4XDAfbzZs25XzRpT1lTe05KXEXlVMm+m521RiDdtaCbNcLWerHd0Fd8ZgHCO3vobLeDkNEZ4q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ljk0cZqZI71waH5V8W8e1eQORzU0r+lV3YMrwxrvmgii3yeQ== X-Forefront-PRVS: 08635C03D4 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BY2PR03MB044;23:AoKtb77a/StR+WkOYM2iiLmint03rZQgwkKG33l3+X?= =?us-ascii?Q?RMD1VJa+5KOk+IDnO22rFA7v8MjQptGVJ/PlWf1yfBSV7qn9OWpCuyDmkdXR?= =?us-ascii?Q?0qDT01tO6j9XP+gOCeed52FxXJCEbBR9fZIro3EgaQ+KWO0smT6HL0QlqqzA?= =?us-ascii?Q?lqymixXg0xfeKvjy0gwjZvLz2sURFfuwcvp7qeD5ZEfIWFPqL9eILGyplrnv?= =?us-ascii?Q?lBjbSn7dSrFm4vwaH8zSWCzbjNBZVSUEqGOTOyW3QBqRdXSPhVkFhrCT7eO3?= =?us-ascii?Q?rJO2Ikivwc8tbaHKhkWHd+k8nIGxKNk3+r6SrU3yS/UpeQ5B5vLIOWTso1qs?= =?us-ascii?Q?IRxc27rKTX96DEQCsraaXEwo2vo76ZFj4tKBBJ0PCgS7ILszksdFFih/po4u?= =?us-ascii?Q?vvE8OU05PW7NVhSm9nd6KN2NkFssabXiR/iv0qnkZSRA3c683QsNRrCdD1JZ?= =?us-ascii?Q?6AMTg9dByk16cG4M4gvt5/JyctbvoxLcl1PfKJ+P0qqCUErJYf1SLBCy9jiO?= =?us-ascii?Q?VTvzy/Fe1MBZMfBnyYhDCPzXCXl5/sf+ZSnS2KZMQB49y82Y4oG4h2HXfqhA?= =?us-ascii?Q?eRJ95oqkZhO2aQBBcIe2jbOFZQa0F65SkY288DbcvjmQd+nDorUZQNHyaepJ?= =?us-ascii?Q?rdG+Nzv8/QLbPfPRM1qz2M9RtE1Hku1z07bHHrUAc/kZsmRArb4WI1FEEt7t?= =?us-ascii?Q?w6lw8C8I45brMIKukm0MRpJiwZhym3NRehrTZb5ZXQZZQr2pNP9gHaul0mYy?= =?us-ascii?Q?v/qIkU3N+kBOAtOzaP0A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U6vsUQlRYsmyDjGQQ4DiIZyw3blxSyS/lkPV5vY=;20:BjVCPFQF5OAPyBSCrIe2Av82wbZ2kat8bzT6U/dOXO4EBs3xwbSRD0isACfRx4EkYR9K6n4Ly05EhCCJPQ8wy6EYN3/5h3JWgTiWkCJBwlZAXZHw7jLHXa2SMhx0OwFg0Tmmpt+IVIQsL2BnrhlxxFWh1KkzeTrDrkeGugL08jw= X-OriginatorOrg: opensource.altera.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Feb 2016 14:41:45.9819 (UTC) X-MS-Exchange-CrossTenant-Id: fbd72e03-d4a5-4110-adce-614d51f2077a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fbd72e03-d4a5-4110-adce-614d51f2077a;Ip=[66.35.236.227];Helo=[sj-itexedge03.altera.priv.altera.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR03MB044 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 25 Feb 2016, Rob Herring wrote: > On Wed, Feb 24, 2016 at 4:28 PM, Alan Tull wrote: > > Add pre-apply and pre-remove notifications. > > > > For pre-apply notifications that result from creating an overlay, > > include a device node to the overlay fragment in of_reconfig_data. > > > > If a pre-apply notifier return error, reject the changeset. > > A couple of high level comments. > > > > > Signed-off-by: Alan Tull > > --- > > drivers/of/base.c | 20 +++++++++++++ > > drivers/of/dynamic.c | 79 +++++++++++++++++++++++++++++++++++++++++++++----- > > drivers/of/overlay.c | 46 +++++++++++++++++++++++++---- > > include/linux/of.h | 7 +++++ > > 4 files changed, 138 insertions(+), 14 deletions(-) > > > > diff --git a/drivers/of/base.c b/drivers/of/base.c > > index 017dd94..6d170e0 100644 > > --- a/drivers/of/base.c > > +++ b/drivers/of/base.c > > @@ -1719,6 +1719,12 @@ int of_add_property(struct device_node *np, struct property *prop) > > > > mutex_lock(&of_mutex); > > > > + rc = of_property_notify(OF_RECONFIG_PRE_ADD_PROPERTY, np, prop, NULL); > > Do we really need these for properties too? I thought nodes would be enough. Yes, in my case programming the FPGA is triggered by properties being added to a pre-existing node. The pre-existing node is a fpga-region which has phandles to the FPGA managers and bridges, so this stuff would be in the tree before the overlay is applied. When properties are added (firmware-name, partial-fpga-config), the fpga region code reprograms the FPGA and either returns success or error from the notifier. If programming succeeds, it returns success and the overlay goes into the live tree as post-configuration information. I've cleaned up my bindings further, I should submit the latest version of them. > > [...] > > > diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c > > index 8225081..9d0c0d9 100644 > > --- a/drivers/of/overlay.c > > +++ b/drivers/of/overlay.c > > @@ -53,13 +53,30 @@ struct of_overlay { > > struct of_changeset cset; > > }; > > > > +static int of_overlay_notify(unsigned long action, struct device_node *np, > > + struct property *prop, struct property *old_prop, > > + struct device_node *overlay) > > +{ > > + struct of_reconfig_data rd; > > + > > + memset(&rd, 0, sizeof(rd)); > > + rd.dn = np; > > + rd.prop = prop; > > + rd.old_prop = old_prop; > > + rd.overlay = overlay; > > + return of_reconfig_notify(action, &rd); > > +} > > + > > static int of_overlay_apply_one(struct of_overlay *ov, > > - struct device_node *target, const struct device_node *overlay); > > + struct device_node *target, struct device_node *overlay); > > > > static int of_overlay_apply_single_property(struct of_overlay *ov, > > - struct device_node *target, struct property *prop) > > + struct device_node *target, struct property *prop, > > + struct device_node *overlay) > > { > > struct property *propn, *tprop; > > + unsigned long action; > > + int ret; > > > > /* NOTE: Multiple changes of single properties not supported */ > > tprop = of_find_property(target, prop->name, NULL); > > @@ -74,6 +91,15 @@ static int of_overlay_apply_single_property(struct of_overlay *ov, > > if (propn == NULL) > > return -ENOMEM; > > > > + if (!tprop) > > + action = OF_RECONFIG_PRE_ADD_PROPERTY; > > + else > > + action = OF_RECONFIG_PRE_UPDATE_PROPERTY; > > + > > + ret = of_overlay_notify(action, target, propn, tprop, overlay); > > + if (ret) > > + return ret; > > + > I don't understand why the notifier is in the overlay code. All the > notifiers should be contained within the changeset code. Or if we do > need changeset and overlay notifiers, they should be distinct. Yes it's not great. The only reason I put the notifier in the overlay code was to include a pointer to the overlay. That's only needed for pre-apply notifiers as the rest of the notifiers have the rest of the overlay available to be perused as part of the live tree, but not pre-apply. I could easily implement overlay notifications. That code will be a lot more compact than this patch. It will only impact of.h and overlay.c similar to the callback patch I proposed a few days ago. Alan > > > /* not found? add */ > > if (tprop == NULL) > > return of_changeset_add_property(&ov->cset, target, propn); > From mboxrd@z Thu Jan 1 00:00:00 1970 From: atull Subject: Re: [PATCH] of: add pre-operation notifications Date: Thu, 25 Feb 2016 08:41:33 -0600 Message-ID: References: <1456352937-28311-1-git-send-email-atull@opensource.altera.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Return-path: In-Reply-To: Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Rob Herring Cc: Pantelis Antoniou , Frank Rowand , Grant Likely , "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Moritz Fischer , Pantelis Antoniou , Alan Tull , Dinh Nguyen List-Id: devicetree@vger.kernel.org On Thu, 25 Feb 2016, Rob Herring wrote: > On Wed, Feb 24, 2016 at 4:28 PM, Alan Tull wrote: > > Add pre-apply and pre-remove notifications. > > > > For pre-apply notifications that result from creating an overlay, > > include a device node to the overlay fragment in of_reconfig_data. > > > > If a pre-apply notifier return error, reject the changeset. > > A couple of high level comments. > > > > > Signed-off-by: Alan Tull > > --- > > drivers/of/base.c | 20 +++++++++++++ > > drivers/of/dynamic.c | 79 +++++++++++++++++++++++++++++++++++++++++++++----- > > drivers/of/overlay.c | 46 +++++++++++++++++++++++++---- > > include/linux/of.h | 7 +++++ > > 4 files changed, 138 insertions(+), 14 deletions(-) > > > > diff --git a/drivers/of/base.c b/drivers/of/base.c > > index 017dd94..6d170e0 100644 > > --- a/drivers/of/base.c > > +++ b/drivers/of/base.c > > @@ -1719,6 +1719,12 @@ int of_add_property(struct device_node *np, struct property *prop) > > > > mutex_lock(&of_mutex); > > > > + rc = of_property_notify(OF_RECONFIG_PRE_ADD_PROPERTY, np, prop, NULL); > > Do we really need these for properties too? I thought nodes would be enough. Yes, in my case programming the FPGA is triggered by properties being added to a pre-existing node. The pre-existing node is a fpga-region which has phandles to the FPGA managers and bridges, so this stuff would be in the tree before the overlay is applied. When properties are added (firmware-name, partial-fpga-config), the fpga region code reprograms the FPGA and either returns success or error from the notifier. If programming succeeds, it returns success and the overlay goes into the live tree as post-configuration information. I've cleaned up my bindings further, I should submit the latest version of them. > > [...] > > > diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c > > index 8225081..9d0c0d9 100644 > > --- a/drivers/of/overlay.c > > +++ b/drivers/of/overlay.c > > @@ -53,13 +53,30 @@ struct of_overlay { > > struct of_changeset cset; > > }; > > > > +static int of_overlay_notify(unsigned long action, struct device_node *np, > > + struct property *prop, struct property *old_prop, > > + struct device_node *overlay) > > +{ > > + struct of_reconfig_data rd; > > + > > + memset(&rd, 0, sizeof(rd)); > > + rd.dn = np; > > + rd.prop = prop; > > + rd.old_prop = old_prop; > > + rd.overlay = overlay; > > + return of_reconfig_notify(action, &rd); > > +} > > + > > static int of_overlay_apply_one(struct of_overlay *ov, > > - struct device_node *target, const struct device_node *overlay); > > + struct device_node *target, struct device_node *overlay); > > > > static int of_overlay_apply_single_property(struct of_overlay *ov, > > - struct device_node *target, struct property *prop) > > + struct device_node *target, struct property *prop, > > + struct device_node *overlay) > > { > > struct property *propn, *tprop; > > + unsigned long action; > > + int ret; > > > > /* NOTE: Multiple changes of single properties not supported */ > > tprop = of_find_property(target, prop->name, NULL); > > @@ -74,6 +91,15 @@ static int of_overlay_apply_single_property(struct of_overlay *ov, > > if (propn == NULL) > > return -ENOMEM; > > > > + if (!tprop) > > + action = OF_RECONFIG_PRE_ADD_PROPERTY; > > + else > > + action = OF_RECONFIG_PRE_UPDATE_PROPERTY; > > + > > + ret = of_overlay_notify(action, target, propn, tprop, overlay); > > + if (ret) > > + return ret; > > + > I don't understand why the notifier is in the overlay code. All the > notifiers should be contained within the changeset code. Or if we do > need changeset and overlay notifiers, they should be distinct. Yes it's not great. The only reason I put the notifier in the overlay code was to include a pointer to the overlay. That's only needed for pre-apply notifiers as the rest of the notifiers have the rest of the overlay available to be perused as part of the live tree, but not pre-apply. I could easily implement overlay notifications. That code will be a lot more compact than this patch. It will only impact of.h and overlay.c similar to the callback patch I proposed a few days ago. Alan > > > /* not found? add */ > > if (tprop == NULL) > > return of_changeset_add_property(&ov->cset, target, propn); > -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html