Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2540148ybl; Thu, 29 Aug 2019 09:30:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqwL7g9V2vFE+6YpGHl/8daX0MFsPZsdNaE5fMx5vSo1f2rFbFBTM6zCz6oY9w6EQeoUgYsG X-Received: by 2002:a62:87c8:: with SMTP id i191mr12582753pfe.133.1567096212326; Thu, 29 Aug 2019 09:30:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567096212; cv=none; d=google.com; s=arc-20160816; b=kCHXQ6652HVrbEFWqMQjqOBPE7aywu49CuRxk/q5OwspfKTAVqdiP0MlVRqSlBvCdr FtbGPKHKaS3oiVrgVNrh4fvBzah9PGbku4nG9ZCkR27pN1W/iwj9FtaJn3MKYXA6MXd1 C7JraO2hxCvqN9Tukt+Nk/2fM6gqEEugPIaeet8J9j8jyZ7ie0Imk6v3hnpjvHhCrFx/ JBov/nLWN5cC+WWf1YLXX92No8wEpgVS0TgNYTugwDzOqpdYGKxcOgIpluISAI3M0WD0 4izV2FbTSpHAWbANl8b9yNywMKtkY4x14v+MwEP1oOTxw6WjcqQGvIWYMlzT/7sBO/ZC 1VSQ== 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=/3XYAj9CTeqNvEs/5WFosqWbeVIGIJC89BWHtEUKy6o=; b=UQkhDouycgxQ/tqqH8MNxzQCYCydVbczwctti1Zq/lTfH+BPiLXMzedKRQZcBKho/k 7Nh7Bre/v2j0Al04K7aMIW3e9KEDReEB8uLEa64UBbgwubyLODTZ7jLycqHaRpyUJzk6 ZHM57Jf+e7/4id8CCEGQlv4Fco22vM+F3GHUaIRsDUAeiTKUGAjRtWKvHSY8rW3Z+fQZ 5B/u217mnHfiaCodbqGVQpn30pV7WOnAPx+diT2rIsXi7Cvge+0foCM5D1gcJ2V34orV QB6hwo1BL+cdgDbpoe887A9cBVopdjpSDH+voWsjlZCKyXObutF1HLpuswSyklADgmQV LOgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Vh8jxTE9; 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 d1si2440655pla.79.2019.08.29.09.29.56; Thu, 29 Aug 2019 09:30:12 -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=Vh8jxTE9; 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 S1727944AbfH2Q2a (ORCPT + 99 others); Thu, 29 Aug 2019 12:28:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:40704 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727118AbfH2Q2a (ORCPT ); Thu, 29 Aug 2019 12:28:30 -0400 Received: from mail-qt1-f173.google.com (mail-qt1-f173.google.com [209.85.160.173]) (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 10ABC21874; Thu, 29 Aug 2019 16:28:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567096109; bh=/3XYAj9CTeqNvEs/5WFosqWbeVIGIJC89BWHtEUKy6o=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Vh8jxTE9WDNlVqN9nDyLo2hP/zQwl5fieofWR+NvbRQ0Fv1BtBJnVyV4sS6QDZAcw iTy7+1VajtoKlu7vrbo2eAcnUFDTFHaQTrTDVNWkroiQULkDdlO6Vdf1JAe11jWUuq WqyZS2jf+CwCos5xrIbDtP6XzmJ+Fz50WKcdDTKk= Received: by mail-qt1-f173.google.com with SMTP id y26so4350279qto.4; Thu, 29 Aug 2019 09:28:29 -0700 (PDT) X-Gm-Message-State: APjAAAVq4y2DvizS27hlIsKkOTOCXVC3nTyaS/Tp0jDXioUHgzMPCX2I hAMHNOw6Zltq9RY1xU2/JcpDh3GhJZBQbUkagA== X-Received: by 2002:aed:24f4:: with SMTP id u49mr10849544qtc.110.1567096108264; Thu, 29 Aug 2019 09:28:28 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Rob Herring Date: Thu, 29 Aug 2019 11:28:16 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Adding depends-on DT binding to break cyclic dependencies To: Saravana Kannan Cc: Mark Rutland , Greg Kroah-Hartman , Frank Rowand , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , LKML , Android Kernel Team 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 Thu, Aug 22, 2019 at 1:55 AM Saravana Kannan wrote: > > Hi Rob, > > Frank, Greg and I got together during ELC and had an extensive and > very productive discussion about my "postboot supplier state cleanup" > patch series [1]. The three of us are on the same page now -- the > series as it stands is the direction we want to go in, with some minor > refactoring, documentation and naming changes. > > However, one of the things Frank is concerned about (and Greg and I > agree) in the current patch series is that the "cyclic dependency > breaking" logic has been pushed off to individual drivers using the > edit_links() callback. I would think the core can detect this condition. There's nothing device specific once you have the dependency tree. You still need to know what device needs to probe first and the drivers are going to have that knowledge anyways. So wouldn't it be enough to allow probe to proceed for devices in the loop. Once 1 driver succeeds, then you can enforce the dependencies on the rest. > The concern being, there are going to be multiple device specific ad > hoc implementations to break a cyclic dependency. Also, if a device > can be part of a cyclic dependency, the driver for that device has to > check for specific system/products in which the device is part of a > cyclic dependency (because it might not always be part of a cycle), > and then potentially have cycle/product specific code to break the > cycle (since the cycle can be different on each system/product). > > One way to avoid all of the device/driver specific code and simplify > my patch series by a non-trivial amount would be by adding a > "depends-on" DT binding that can ONLY be used to break cycles. We can > document it as such and reject any attempts to use it for other > purposes. When a depends-on property is present in a device node, that > specific device's supplier list will be parsed ONLY from the > depends-on property and the other properties won't be parsed for > deriving dependency information for that device. Seems like only ignoring the dependencies with a cycle would be sufficient. For example, consider a clock controller which has 2 clock inputs from other clock controllers where one has a cycle and one doesn't. Also consider it has a regulator dependency. We only need to ignore the dependency for 1 of the clock inputs. The rest of the dependencies should be honored. > Frank, Greg and I like this usage model for a new depends-on DT > binding. Is this something you'd be willing to accept? To do the above, it needs to be inverted. Convince me that cycles are really a problem anywhere besides clocks. I'd be more comfortable with a clock specific property if we only need it for clocks and I'm having a hard time imagining cycles for other dependencies. Rob