Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp675467pxu; Wed, 14 Oct 2020 10:44:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrYnoklCVTiJVmXHjCqPtbCPBfVIbMXp1ZIs72bY0li6m09ZBE3Jd1DDZAnPsHVZm7S0Tm X-Received: by 2002:a17:906:e2d1:: with SMTP id gr17mr128371ejb.433.1602697481763; Wed, 14 Oct 2020 10:44:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602697481; cv=none; d=google.com; s=arc-20160816; b=bMdaY9bwJ4ngOfTPidVht0d1f9V8ay7CQjzXdzcxaQr6tab876Ljr39XaIZd00wS50 FyuMcXZZFC8Oui9kVVNBtka/ozXNepmpEj0OYmNaPoethNapgqrrogdmlgbVMP+3Pmgk TdU5Rriukp2M+gdAtEg10r3uMrqASYhvaWE9uo1PtjNDS83RonLvhNuFrIzehQ8yI58N 6LXMB3Lx78Z4OOvU3jaV8FoqLz5oXigX0wBdUOu9Utfb3cy4CRcuPjGvpM4fEg4dCbkh vWVy3TO2+UcI7ROp9+q6PiXXHRhXoFC9SFcyKhcerLOBFDWd0ooJdI1NHaMQMtVFLQBR LNnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=a1/6B+ExNOLwgHkYd/gzHX5f5j+4YiWZyKHmyXxDUj8=; b=k86CJusuZ6krsSiwCGFPWU/2CIMkEG3kZXZI7D5ddVrjPFzb+6cVc3ukCh0facgxr8 xW4OpWM9SyI4/SLs88tUHt5ONnxP/DeB/yLg/4eS1/PFwoyiiVvZmuau5ef4fdqK+nsh pk8ohSOxvpxYi65rFBQYOs0SLHamQAZ6q3m2XM6apVkihEYi5jseWorxki84kMhl/5gw Q6Hd1ZvdGKgXsrf1fwClZ98gqsEvLOUs8u5ZWmF+UJDC+O18uKAWuid5v6JgejnpeIMW WEuDDI3nADewy31coeNo9N3A0AEnJ+6BggS27QNhIRYyfFRRf9LOP27ld/CcMuI6AheE ZAGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=bwAPSOwC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s11si257698eju.335.2020.10.14.10.44.19; Wed, 14 Oct 2020 10:44:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=bwAPSOwC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731537AbgJNRaO (ORCPT + 99 others); Wed, 14 Oct 2020 13:30:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728813AbgJNRaO (ORCPT ); Wed, 14 Oct 2020 13:30:14 -0400 Received: from mail-yb1-xb2f.google.com (mail-yb1-xb2f.google.com [IPv6:2607:f8b0:4864:20::b2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39359C0613D2 for ; Wed, 14 Oct 2020 10:30:14 -0700 (PDT) Received: by mail-yb1-xb2f.google.com with SMTP id x20so3301114ybs.8 for ; Wed, 14 Oct 2020 10:30:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=a1/6B+ExNOLwgHkYd/gzHX5f5j+4YiWZyKHmyXxDUj8=; b=bwAPSOwC22OH911dd3OisC2/Hvt/5qIPNsp88vJ1KjQXGMq/HVkn2c0Vw5uPjr+/ev uCMef1wuAtuM35lViNYCJdKNHm22MfB+SkiGhgCh+61xjy8UjfWnm90lrIJTxcLqz09A rykWA+Ci/aFYw1en70dLT+ftggFXmOcwTQqv2ppwNBrjrELvDG+3XLQ2KVrjOBDmk40i lF0ucEusyIApuevLPSUaXmGZRmTteaRWqtUCn8wf9w2kVg7J2YpQDa2TU77T1i8rvlKW YOy6MTg+ApFlgYHuU1zXzXSVtsXXvez5QvyOZTAOkTn0N1UU0itA+s5S5PSN86eFS/vS Y02w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=a1/6B+ExNOLwgHkYd/gzHX5f5j+4YiWZyKHmyXxDUj8=; b=ZhEdzg/d0lSNLjFRbgGo0xVP9rRSlDQSqbEEtMVD3tNg0znBlTlDmA3VqaesJf5Yww T7+oXX2u6X7iQ/FRU/RXPc56W8SpAi8NO4BwXUWDRVgIpKVbnyjYjpA0CkIhV8YYitvM 05RiDEoGD2CF3OPUXXS8MdUsZ+TcNAc4lDPBISCz8GI44do4VE0rbmx0son79ekw0j05 RlvGWxiqwKnnQRG+vhbLwqn5g7hni+c1Ez6M9JuMQG0x1d2MJoOLQew+yYRFbiegfH1k bhRzcksI2+V9Ay4B/HMhhGTd+DA51SwD7nZbWpli62ZkCFEV0AD51DSTYbOa0cwZwoxj xBEg== X-Gm-Message-State: AOAM531lRLhy/6vYIjOrSp1+iZKlONdjKIPG6HBC2W9VlGiWWcyLzq3e rPGtCMuoToB2EWNI6hwl6G5SCwKFmyWc92+KLYC19g== X-Received: by 2002:a25:244c:: with SMTP id k73mr742738ybk.96.1602696612942; Wed, 14 Oct 2020 10:30:12 -0700 (PDT) MIME-Version: 1.0 References: <20201014191235.7f71fcb4@xhacker.debian> In-Reply-To: <20201014191235.7f71fcb4@xhacker.debian> From: Saravana Kannan Date: Wed, 14 Oct 2020 10:29:36 -0700 Message-ID: Subject: Re: fw_devlink on will break all snps,dw-apb-gpio users To: Jisheng Zhang Cc: Greg Kroah-Hartman , "Rafael J. Wysocki" , LKML , Rob Herring , Frank Rowand , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , linux-arm-kernel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 14, 2020 at 4:12 AM Jisheng Zhang wrote: > > Hi, > > If set fw_devlink as on, any consumers of dw apb gpio won't probe. > > The related dts looks like: > > gpio0: gpio@2400 { > compatible = "snps,dw-apb-gpio"; > #address-cells = <1>; > #size-cells = <0>; > > porta: gpio-port@0 { > compatible = "snps,dw-apb-gpio-port"; > gpio-controller; > #gpio-cells = <2>; > ngpios = <32>; > reg = <0>; > }; > }; > > device_foo { > status = "okay" > ...; > reset-gpio = <&porta, 0, GPIO_ACTIVE_HIGH>; > }; > > If I change the reset-gpio property to use another kind of gpio phandle, > e.g gpio expander, then device_foo can be probed successfully. > > The gpio expander dt node looks like: > > expander3: gpio@44 { > compatible = "fcs,fxl6408"; > pinctrl-names = "default"; > pinctrl-0 = <&expander3_pmux>; > reg = <0x44>; > gpio-controller; > #gpio-cells = <2>; > interrupt-parent = <&portb>; > interrupts = <23 IRQ_TYPE_NONE>; > interrupt-controller; > #interrupt-cells = <2>; > }; > > The common pattern looks like the devlink can't cope with suppliers from > child dt node. fw_devlink doesn't have any problem dealing with child devices being suppliers. The problem with your case is that the drivers/gpio/gpio-dwapb.c driver directly parses the child nodes and never creates struct devices for them. If you have a node with compatible string, fw_devlink expects you to create and probe a struct device for it. So change your driver to add the child devices as devices instead of just parsing the node directly and doing stuff with it. Either that, or stop putting "compatible" string in a node if you don't plan to actually treat it as a device -- but that's too late for this driver (it needs to be backward compatible). So change the driver to add of_platform_populate() and write a driver that probes "snps,dw-apb-gpio-port". -Saravana