Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3325903iog; Mon, 20 Jun 2022 17:18:29 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tqfSeiV8knZhCp+Nnrxfyye5vN+SbU+1HRw4ekF3uymQecqdsaCFiilKeW319lLZkGH9bF X-Received: by 2002:a17:903:286:b0:16a:1590:bffd with SMTP id j6-20020a170903028600b0016a1590bffdmr12862723plr.47.1655770709371; Mon, 20 Jun 2022 17:18:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655770709; cv=none; d=google.com; s=arc-20160816; b=YBV464zEacpbK+bORy7ImYfrMwJRBwP2ixne7Fl45kuN7G8IYpYQX2K4ag0aOLkgZU TVIYNDkQcxwoHWp4kXccGOXCfRnNeo1iFjAvoavqLhDd4w0VIwTBMu5sN6zMnid2R/6y 6P+T92TWgtTBN8aj3VR/4S2NoLGIWV0ZhmxkA+ZocAW2EnrarFN9qkoNOdCPm898wIow LGWxF6TVus4rLV8/nNEBPYBxA4Rn4grfJ+gwHwwlHhRdckwiEQe2TwJr29nSD/YLwXIw dwHhp5P9P0VCqsPG/toTEVplnF1gTPwk50MQDB/dZQW/iHlgxGvxpTb0Zd/jQVUcOLYE cWnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=1CFkBJOtdGheyOUeX2yPaN3vtsNkY5WbEiLu1iujMTs=; b=e0nJAHda2lKTDkARRFs0WknfH+Kpcaw78yIPkARPHmYt2UsjOM4We56N78nKQfw9YM s0+y2zerGzfi855jD+Wtnn2+DNDS4SisQrvneWgDeddT+8iMgt5nL5rwrfr/5JvFk3xH qh6a1sDWcyUi5UXXQv4HlbaS5pFG6lSkrFWmyjHRW6T1CJLd7K4Nj4cDopENxZjYMPuJ RDsnJNcLmZ0+FcbToJdPFIl6ASi2zTTrkL9DJTQ7ZijaqSu2RBOLizPFm1jRZ1gBc4wy pBrYKsezlxCXZbCg0pSZH9BeP6zhfQXsZsTw3obSIYfwPQKxNqvutOtWdERpnWok8JY2 CAEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@semihalf.com header.s=google header.b=c4HGipQe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f26-20020a63101a000000b004087c2017fdsi16812051pgl.413.2022.06.20.17.18.16; Mon, 20 Jun 2022 17:18:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@semihalf.com header.s=google header.b=c4HGipQe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244974AbiFTXbh (ORCPT + 99 others); Mon, 20 Jun 2022 19:31:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244221AbiFTXbb (ORCPT ); Mon, 20 Jun 2022 19:31:31 -0400 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 511E51274C for ; Mon, 20 Jun 2022 16:31:29 -0700 (PDT) Received: by mail-lj1-x22b.google.com with SMTP id a11so4756154ljb.5 for ; Mon, 20 Jun 2022 16:31:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=1CFkBJOtdGheyOUeX2yPaN3vtsNkY5WbEiLu1iujMTs=; b=c4HGipQeXgKwPcs43aMkdi5K3w74ldx4cPKh57/kJpEQTehk3R/ApwGMNcAHO0Tdv1 KZcLI3O9sYzcsqENTulejrJsKyKbECVvxjRTj8MwTSKDp1iU1F7fJ2jwGzYLCZFmtPp4 lFpffbNNQ5kIHynvctCZjyLfHRPhdPZUxsbvm5i7v/Zvk2CJq/t7YLnFaTCwfsHe0C1u onkG1TkN4yM9IuLPlUwYVfnTQ+SgsNSxQG59fnew9BzNwu2V8ik0qxv07FfJ9pMmGQCZ MOhJ+CKSFEtbEffaaaZ+krJRh1TGny3Kr9jJAXaWLOUE2a6Ym3yzB1vBdIepC5L74Xwb 6g6Q== 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:content-transfer-encoding; bh=1CFkBJOtdGheyOUeX2yPaN3vtsNkY5WbEiLu1iujMTs=; b=0Yxa7dayVLMn9EyNJXD7GNo7i6draVMIhao3yYCJCwSbQTPlTZfxORExeBU9kJlNyq OSL8Vu4Vcse0gSejPBwCHbU76MpLPHN1Ygftzi0h3MDOqqUMQpCg4/6/O3VoaDULLWJa 0j5p7irRuFwBYVSe00qk8o7oQjypiJDbPXoI/0vpMgVi173uSZ9RX6bMu08D5J6BNYN7 mbdVYSTDC4yITafxlwGik+0v8QHXFuQQGKspNhCp92eZe4MUK5EzEKSMqczaD80XLjCG qJxmtpviKB0Lng0KvndCnsjmClJ1mHMEGG/OkDNBhovaCYbojrneAFO4K77xC9rTWKOW VxBA== X-Gm-Message-State: AJIora/+W3JsGDshYfcZt8h60yo+wl7pIpHE8FZ96k77girUoq/KOhiR bgj8idTXJiFW31YbO0C30nOsA5cLz8BLql54t6IuiA== X-Received: by 2002:a2e:a58d:0:b0:25a:6348:9595 with SMTP id m13-20020a2ea58d000000b0025a63489595mr6680735ljp.72.1655767887614; Mon, 20 Jun 2022 16:31:27 -0700 (PDT) MIME-Version: 1.0 References: <20220620150225.1307946-1-mw@semihalf.com> <20220620150225.1307946-11-mw@semihalf.com> In-Reply-To: From: Marcin Wojtas Date: Tue, 21 Jun 2022 01:31:17 +0200 Message-ID: Subject: Re: [net-next: PATCH 10/12] net: dsa: add ACPI support To: Andrew Lunn Cc: Linux Kernel Mailing List , ACPI Devel Maling List , netdev , "Rafael J. Wysocki" , Andy Shevchenko , Len Brown , vivien.didelot@gmail.com, Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , pabeni@redhat.com, Russell King - ARM Linux , Heiner Kallweit , Grzegorz Bernacki , Grzegorz Jaszczyk , Tomasz Nowicki , Samer El-Haj-Mahmoud , upstream@semihalf.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pon., 20 cze 2022 o 20:32 Andrew Lunn napisa=C5=82(a): > > > static int dsa_port_parse_dsa(struct dsa_port *dp) > > { > > + /* Cascade switch connection is not supported in ACPI world. */ > > + if (is_acpi_node(dp->fwnode)) { > > + dev_warn(dp->ds->dev, > > + "DSA type is not supported with ACPI, disable po= rt #%d\n", > > + dp->index); > > + dp->type =3D DSA_PORT_TYPE_UNUSED; > > + return 0; > > + } > > + > > Did you try this? I'm not sure it will work correctly. When a switch > registers with the DSA core, the core will poke around in DT and fill > in various bits of information, including the DSA links. Once that has > completed, the core will look at all the switches registered so far > and try to determine if it has a complete set, i.e, it has both ends > of all DSA links. If it does have a complete set, it then calls the > setup methods on each switch, and gets them configured. If it finds it > does not have a complete setup, it does nothing, waiting for the next > switch to register. > > So if somebody passed an ACPI description with multiple switches, it > is likely to call the setup methods as soon as the first switch is > registered. And it might call those same setup methods a second time, > when the second switch registers, on both switches. And when the third > switch registers, it will probably call the setup methods yet again on > all the switches.... > > You will have a much safer system if you return -EINVAL if you find a > DSA link in ACPI. That should abort the switch probe. > I only set a single port to "dsa" label to check if this condition is entered. I see 2 devices in the arm64 tree (fsl-lx2160a-bluebox3.dts and armada-3720-turris-mox.dts) that support cascade switches via "link" property. I don't have access to real life setup (and those seem to not support ACPI anyway...). In case this temporarily would remain as unsupported feature, I agree -EINVAL is a safer solution. Thanks, Marcin