Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4369520imm; Mon, 15 Oct 2018 13:40:13 -0700 (PDT) X-Google-Smtp-Source: ACcGV60TH00pHCmB3rd0dxC36sZnwrzeRoVK3FsN6HspgUezuMurHB0y3zBm9LUrepDFKrOcm744 X-Received: by 2002:a17:902:bc42:: with SMTP id t2-v6mr11904931plz.168.1539636013733; Mon, 15 Oct 2018 13:40:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539636013; cv=none; d=google.com; s=arc-20160816; b=tHFUs3uqTZ8msR31vCXHd+GBXrP8SzfnEl8lzZR+9+dHWIvuQRxcYtSsqattO+9n+v n/AHqWAUTsaf/LWxZQ47Yt9TdUAmEh0PMbSUT2vdvn41wLixY/KH25DT+TCp4z/8sILz mYp85gi4XHssMKQLcMuwNZ4U0gXKKWuJnfcn4kXKoi+PhPfis1QvPVM3lfDkfycs7Z9k Sw9HjhPKM0DgY7GtdbrFbec88UIm2+BSk9Chu4gs4vy3y+jGRm/QepEBZZBTjeWGXhkS GGl98ho0SeYttsugWRNAcCCPdGVPSOP7kRnCvsF8x13UjGPZ5IH+hVgKpQ28e9T7ZJUX ycHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=3R6it/zOOOHKyggmhZZXrz1wcuXLsUrcqAYtIvHQS/Y=; b=vCYtK4S22Ug2o2ceXUHm6BAdiWYPa3g0OexXFjSZOFntmmsrPO6gx7Ep9I9zWFBuV/ DEG3j/3zGkMQaIPVVpK8h91A7/l4muP+1mVoKM/utW6gppqzNFNsIlz/HVxRtsVjLKq3 7Yb6VQXYQAyPqy8wXAdkXc63WudeGAXapJSipgxi7gYccEZBAsM/x9daH6UngnrlXLyl i5nbt83623ne6E2vDh1VbMTLxmr/ytIhTJDhTqLpTrvWiykwt/XQH3wJdbBZYzBPdv0U 7xys8SDVjOaM3H1oKvFtMekBjjZ0DRcQvMfpBaVEAUIIlRsiXxLE1bdOdwTZV/vfnEIM nN9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZrzrL2KR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cd15-v6si12128031plb.219.2018.10.15.13.39.56; Mon, 15 Oct 2018 13:40:13 -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; dkim=pass header.i=@kernel.org header.s=default header.b=ZrzrL2KR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726106AbeJPE00 (ORCPT + 99 others); Tue, 16 Oct 2018 00:26:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:48540 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725917AbeJPE00 (ORCPT ); Tue, 16 Oct 2018 00:26:26 -0400 Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 350ED21471; Mon, 15 Oct 2018 20:39:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539635973; bh=THHYoNaTLkRDFJWkRyI5CLYM20a/EMclstlhzFjHCII=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ZrzrL2KRNf9fpmah+RJsf9MDm2VneExGuGDF2dj/TvbBFvvxYNkaFpRcEr4eFPilB gLKVRzSD3wH2QsPpVgU91+UlNbEllbuPlA8YOhx8MfbDe4odPdqr273atNcauxrX/n 0MaJAXSVerpO093dIA0t4lylXW09tX+p90Hj/PCE= Received: by mail-ed1-f44.google.com with SMTP id b7-v6so19132797edd.9; Mon, 15 Oct 2018 13:39:33 -0700 (PDT) X-Gm-Message-State: ABuFfoj/kGCpujdY/WZ9BAIvUT4U6jLpW8Xwq13TPRGn+J5p7b+h91v1 L1Ep8DGd8f4EoUXGtLycR+jQKQg8LxmQXZVjiVM= X-Received: by 2002:a50:fc06:: with SMTP id i6-v6mr22757977edr.153.1539635971545; Mon, 15 Oct 2018 13:39:31 -0700 (PDT) MIME-Version: 1.0 References: <1539567282-1326-1-git-send-email-frowand.list@gmail.com> In-Reply-To: From: Alan Tull Date: Mon, 15 Oct 2018 15:38:55 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] of: overlay: user space synchronization To: Frank Rowand Cc: Geert Uytterhoeven , Rob Herring , Pantelis Antoniou , Pantelis Antoniou , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , linux-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 15, 2018 at 1:09 PM Frank Rowand wrote: > > On 10/15/18 01:24, Geert Uytterhoeven wrote: > > > > Please say explicitly that tree_version contains a 32-bit unsigned > > decimal number, which is incremented before and after every change. > > I had to deduce that from the code. > > Good point. I'll add that. Looking at the code, tree_version being odd or even means something. tree_version is incremented every time the of_mutex is locked or unlocked, such that: * tree_version is odd == of_mutex is locked and the tree is currently be in the process of being changed * tree_version is even == of_version is unlocked again and the changes are finished. How about making this explicit in the interface by breaking it up into two attributes: /sys/firmware/devicetree/tree_lock == "locked" or "unlocked". If the tree is locked, you know that the tree may still be changing and the sysfs can't be trusted to be stable yet. Or maybe even more specifically tree_overlay_lock? /sys/firmware/devicetree/tree_version = a u32 that is incremented once for every overlay added or removed. Alan > > > > > > IMHO that is more important than having the sample script here. > > > > Gr{oetje,eeting}s, > > > > Geert > > >