From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7AB28C433F5 for ; Sat, 9 Oct 2021 03:12:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4FC1C60F38 for ; Sat, 9 Oct 2021 03:12:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244133AbhJIDOY (ORCPT ); Fri, 8 Oct 2021 23:14:24 -0400 Received: from mail-qv1-f51.google.com ([209.85.219.51]:36683 "EHLO mail-qv1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230400AbhJIDOW (ORCPT ); Fri, 8 Oct 2021 23:14:22 -0400 Received: by mail-qv1-f51.google.com with SMTP id jo30so7622260qvb.3; Fri, 08 Oct 2021 20:12:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RZSR3JWmSBMwGLbANGREyXBTPWcaZYMU43ykvJz+HmI=; b=vV3l25w8bCYVo3pxMIZTJ+32rLJyILCf3do8JCbFKZGJqjf6OyaeyRNO+d+oRlwf3i dXGvjakaTuo7cd8Kw5VA3lMWEbILVo2GW/sOMX1nEtXRETWOAqB5/WirLqgyGf376Xfl qvZt36Bp+SGnTC5jift3UgDGiSLMeaNM9oz0Sg/3htt+cyYY3aueOyO6FngwKRgRQzVF a8p8ZEowOjcxEwt3qG2z8E0MdyA6VLLEHrjpx11+zXB2GpTwXaZMg/wKQBrx4AKm8K4d tsV9btbbhnmXEJbgSNUlOn+GG3/5S+sH7li1RzUyaNuRKNkgDKVOzrFN8NMzhqteVZRn kBRw== X-Gm-Message-State: AOAM532sQGfeQEP2wRuhH4/U+OtVgWqk/NU/+1hJ6rJC/jEEP0yyiKBG qtEQoy14CTIshql9uUNm2+eyVOetKYo= X-Google-Smtp-Source: ABdhPJy/tr6e6T8hkvh04q9zNBiSwDkHyyvIf4ohzDR2hiO8Wb6yXpt8g/Li6dCVl7n8bq537HwqRA== X-Received: by 2002:a05:6214:1022:: with SMTP id k2mr13642992qvr.53.1633749145983; Fri, 08 Oct 2021 20:12:25 -0700 (PDT) Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com. [209.85.222.181]) by smtp.gmail.com with ESMTPSA id g27sm935407qkl.27.2021.10.08.20.12.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 Oct 2021 20:12:25 -0700 (PDT) Received: by mail-qk1-f181.google.com with SMTP id x12so11431055qkf.9; Fri, 08 Oct 2021 20:12:25 -0700 (PDT) X-Received: by 2002:a37:b842:: with SMTP id i63mr5942720qkf.262.1633749145064; Fri, 08 Oct 2021 20:12:25 -0700 (PDT) MIME-Version: 1.0 References: <20211001000924.15421-1-leoyang.li@nxp.com> <20211001000924.15421-3-leoyang.li@nxp.com> In-Reply-To: From: Li Yang Date: Fri, 8 Oct 2021 22:12:13 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/5] memory: fsl_ifc: populate child devices without relying on simple-bus To: Rob Herring Cc: "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Shawn Guo , lkml , Krzysztof Kozlowski , linuxppc-dev , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 4, 2021 at 12:14 PM Rob Herring wrote: > > On Thu, Sep 30, 2021 at 07:09:21PM -0500, Li Yang wrote: > > After we update the binding to not use simple-bus compatible for the > > controller, we need the driver to populate the child devices explicitly. > > > > Signed-off-by: Li Yang > > --- > > drivers/memory/fsl_ifc.c | 9 +++++++++ > > 1 file changed, 9 insertions(+) > > > > diff --git a/drivers/memory/fsl_ifc.c b/drivers/memory/fsl_ifc.c > > index d062c2f8250f..251d713cd50b 100644 > > --- a/drivers/memory/fsl_ifc.c > > +++ b/drivers/memory/fsl_ifc.c > > @@ -88,6 +88,7 @@ static int fsl_ifc_ctrl_remove(struct platform_device *dev) > > { > > struct fsl_ifc_ctrl *ctrl = dev_get_drvdata(&dev->dev); > > > > + of_platform_depopulate(&dev->dev); > > free_irq(ctrl->nand_irq, ctrl); > > free_irq(ctrl->irq, ctrl); > > > > @@ -285,6 +286,14 @@ static int fsl_ifc_ctrl_probe(struct platform_device *dev) > > } > > } > > > > + /* legacy dts may still use "simple-bus" compatible */ > > + if (!of_device_is_compatible(dev->dev.of_node, "simple-bus")) { > > + ret = of_platform_populate(dev->dev.of_node, NULL, NULL, > > + &dev->dev); > > There's no need to make this conditional. of_platform_populate() is safe > to call multiple times. If that doesn't work, it's a bug. I think that it is probably an optimization to avoid re-populate the bus for legacy device trees. But it might be cleaner to just re-populate anyway? Regards, Leo From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F5E0C433F5 for ; Sat, 9 Oct 2021 03:26:10 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 55D3960FC3 for ; Sat, 9 Oct 2021 03:26:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 55D3960FC3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=xiNeT6ZpzApjyxvQYlips9chQYl774A+BYaSvKiqROc=; b=zpQD3kLTnFlh2g snJSr/bbsDjkVuWUyb3ZSAZ9BrbzR8J1CHuulF25aB0nAyijx9WhpUyCa81+35gTAWCo3L0szudlR NFvbUX+1Sc/827B194D95ERdNG0Pz7BcdK8zMHicGuXo2Xkhu3ZkdhX61YqK85eRz85jR+Lt5SbPV 9w8BEmAL1MzO4rbT01GdUVq8eQzM9Qf3nJCMBR+2/pyOkpLvQ2zo02yJIw14kZxfGYyntZV81sX+z jrO5bi/wCQu17IXj3z4ymksEZwemKx3gtiaZu+wk5jpJcFk65jHKM5Vgu6JqdTaeGZ9Tm6Dkcw7P0 glHVVtTNUS68CNWgwK+g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mZ2yJ-004xIq-6p; Sat, 09 Oct 2021 03:24:27 +0000 Received: from mail-qv1-f44.google.com ([209.85.219.44]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mZ2mh-004riE-QH for linux-arm-kernel@lists.infradead.org; Sat, 09 Oct 2021 03:12:29 +0000 Received: by mail-qv1-f44.google.com with SMTP id cv2so7625338qvb.5 for ; Fri, 08 Oct 2021 20:12:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RZSR3JWmSBMwGLbANGREyXBTPWcaZYMU43ykvJz+HmI=; b=SknWXAwLSJrLHrnYmUK10RormLuSK31oo1pUcnR8hf5MxCNNCaDPJfoKyfmHTQR43G k+GklIc4DgUGGLcKDTHzlYytVDezz/P2gS34AcfnY/3pmZrorebfxWzqAmQPBhARD+47 15idiF5tbUG+I8A84UqYSBEwDgOriBFQCrBNePKEZUQXM5Q6CE2afVRHRaeYdykCxtla VZfG7ZY0EBNzTniwBe3/X5hrAKvD2wwvldnyxyraksMfCVsFtQG7YOWzLKrILP5eAJYP N7gP7dOqex7MpR0TnLHROpFDPutpDdWEwurLLajwUYkcPzmwR/GItVYJgkFiAcBtVgse Kueg== X-Gm-Message-State: AOAM532MjF1Na8varmPTcbr3wLFRMMBXH5tbTn1Z9UQr+kSSXR130azh 9kGrwextnMyAbroiJxviVGQC2Omqnf0= X-Google-Smtp-Source: ABdhPJzPjjIvZya0zNaaf4OhFwcaJZQ5AHA0lNvPt43bm1qw3tROQo1VHQTshrllLMF5V3lHiQz4ug== X-Received: by 2002:a0c:9043:: with SMTP id o61mr13486142qvo.54.1633749145922; Fri, 08 Oct 2021 20:12:25 -0700 (PDT) Received: from mail-qk1-f174.google.com (mail-qk1-f174.google.com. [209.85.222.174]) by smtp.gmail.com with ESMTPSA id d129sm864585qkf.136.2021.10.08.20.12.25 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 Oct 2021 20:12:25 -0700 (PDT) Received: by mail-qk1-f174.google.com with SMTP id 77so10233005qkh.6 for ; Fri, 08 Oct 2021 20:12:25 -0700 (PDT) X-Received: by 2002:a37:b842:: with SMTP id i63mr5942720qkf.262.1633749145064; Fri, 08 Oct 2021 20:12:25 -0700 (PDT) MIME-Version: 1.0 References: <20211001000924.15421-1-leoyang.li@nxp.com> <20211001000924.15421-3-leoyang.li@nxp.com> In-Reply-To: From: Li Yang Date: Fri, 8 Oct 2021 22:12:13 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/5] memory: fsl_ifc: populate child devices without relying on simple-bus To: Rob Herring Cc: "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Shawn Guo , lkml , Krzysztof Kozlowski , linuxppc-dev , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211008_201227_893099_48485B19 X-CRM114-Status: GOOD ( 22.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Oct 4, 2021 at 12:14 PM Rob Herring wrote: > > On Thu, Sep 30, 2021 at 07:09:21PM -0500, Li Yang wrote: > > After we update the binding to not use simple-bus compatible for the > > controller, we need the driver to populate the child devices explicitly. > > > > Signed-off-by: Li Yang > > --- > > drivers/memory/fsl_ifc.c | 9 +++++++++ > > 1 file changed, 9 insertions(+) > > > > diff --git a/drivers/memory/fsl_ifc.c b/drivers/memory/fsl_ifc.c > > index d062c2f8250f..251d713cd50b 100644 > > --- a/drivers/memory/fsl_ifc.c > > +++ b/drivers/memory/fsl_ifc.c > > @@ -88,6 +88,7 @@ static int fsl_ifc_ctrl_remove(struct platform_device *dev) > > { > > struct fsl_ifc_ctrl *ctrl = dev_get_drvdata(&dev->dev); > > > > + of_platform_depopulate(&dev->dev); > > free_irq(ctrl->nand_irq, ctrl); > > free_irq(ctrl->irq, ctrl); > > > > @@ -285,6 +286,14 @@ static int fsl_ifc_ctrl_probe(struct platform_device *dev) > > } > > } > > > > + /* legacy dts may still use "simple-bus" compatible */ > > + if (!of_device_is_compatible(dev->dev.of_node, "simple-bus")) { > > + ret = of_platform_populate(dev->dev.of_node, NULL, NULL, > > + &dev->dev); > > There's no need to make this conditional. of_platform_populate() is safe > to call multiple times. If that doesn't work, it's a bug. I think that it is probably an optimization to avoid re-populate the bus for legacy device trees. But it might be cleaner to just re-populate anyway? Regards, Leo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel