Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1745904pxv; Sat, 10 Jul 2021 13:54:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/7yYSWv8XZQ4PBvGnF34EC1zLc7t45jVAseKV72noMySNnxZgt5AUAsE79i4wAtbJAQbo X-Received: by 2002:a05:6402:2814:: with SMTP id h20mr50938872ede.29.1625950475686; Sat, 10 Jul 2021 13:54:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625950475; cv=none; d=google.com; s=arc-20160816; b=yTqJiJKmqxHrRxfaUTYYPBKD6ZUaNb1oqM70tkpewF4TTsnjWpjN9xfFJOhcAqulSP mIrX2YD78Iw7v5wXZE2jUhDXojM+Gw13M26tXy2IWa3UIPYfph49g/V5J1O2TRa1WQ9o LzoZgJUkoYYf3yjIV7yHukXX+AUBnr/9mPNT004o7IjDxtqMChKvTmu+fwkKk/ppCugm eVehfwrMZbV6derJ4NUGZLg3zmJdD95Q/e+BHQ2WKZBAnGjNZ77UDm1YIQsAtRvHR8/l MyvruDEOYZKz2KG3eurLTKlYRDOd6CDJL56blfQnH/dOQ+OnBgZh5oz69d7gPmNav9wg pMvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=79nDPPhzMUdqY/HoQvtNoGx5K1d4gf+exWkNwx3ridI=; b=GZ/153lM4kfhbaiRPcvIi0RcKvYSOdXozRRPVLWwdjn88nUJCJZ6cE4jyHn9weP8CY xhitSxGAfGGBiFtvuY4DMER7aP/tgCcSuUwJhb9tRVTkH/u/UmBMf7wuS+uJBNH6E4d8 n0dE953W/5lfV9UOrROIrQfi9OG1xmrz3F58L6HrM7AX9GfgUXIm+pqY45348BDtB96F gEThP3d3/2RcsD7N0mtQfEymiizvz5OmZNPcf12EhFdIQQbr2cfBxcOjYaeAdxiNkD1+ F6Mlnyf9jQ40EaWVyZIfUGKamgF22PnjohkiRVwmjXePNQW+WYkbi9y9f7Hyggps5Avt ypjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ebGmXZhK; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h24si13651613ejt.504.2021.07.10.13.54.13; Sat, 10 Jul 2021 13:54:35 -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=@gmail.com header.s=20161025 header.b=ebGmXZhK; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229783AbhGJUyy (ORCPT + 99 others); Sat, 10 Jul 2021 16:54:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229515AbhGJUyy (ORCPT ); Sat, 10 Jul 2021 16:54:54 -0400 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59E12C0613DD; Sat, 10 Jul 2021 13:52:08 -0700 (PDT) Received: by mail-ej1-x632.google.com with SMTP id o5so24035859ejy.7; Sat, 10 Jul 2021 13:52:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=79nDPPhzMUdqY/HoQvtNoGx5K1d4gf+exWkNwx3ridI=; b=ebGmXZhKg5B3ySOC3CMoPRdgy5KbrSu5oP9GL9eo8B8OoveTFjEeMLxGaImy/ym+h4 8D/O2YrirP1MXOb/ajnNn8lChcx8Ny5KERXXNWRmN62vhoP7OdsAT8cuC7tIKtoYCzzG 0kFXouvkCFaLXw3lgDF9ziL8ECYgjtJS1hvUClpjTrjbazX5QyN3oeAmPpzK70EqgPcD kdi5ehNxkNR3wYmiKwy8iU/jrP1zldPeffHxIczH5qqtQLXn/+bZKfz2au0ixQplBNd9 WwopNOwJiSUF7Z1vuxBnzhx1v75xT8Okq7sGXuz3YFOg23HnE6glbn9b8HPuzkROxuBO LwNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=79nDPPhzMUdqY/HoQvtNoGx5K1d4gf+exWkNwx3ridI=; b=R0witO7j6wbOSneqiggVJTDL++s/f/bwZ4RoKPogaPIDpfr5E0reOd9mqTKU/LoOkg +kTbXKfC+p9NM6CXFBMudFjVzrBKb0XDpg98wMDPquzARAZ8yv3Dw2dZYVFUAPY1OnJf FF8+J2SyVNfWERN8O/AieYAHTKlQvxTQ8SEoGgpkCq7UAy8kF33u4XRUlZdKSS4V79CX IOfgvqa7vV50QWsa5synxzH8GV+2k9TL3WQnXITn14Ur5umFiYj7PQS2jy41el1TNc1F kPub/C64oGC2GIKIuzu/mOV+vGswl1GN74RME7eogSypzGLco38pY/o3taeLc+d7SrfT 3Ahg== X-Gm-Message-State: AOAM531UUAUDJL6GWcl7phQg6FLBniMBi126R/j6+hJ+npuT2/c1yD6N y1iyO7JsUrAqQzinDBGG4DY= X-Received: by 2002:a17:907:990d:: with SMTP id ka13mr45551211ejc.392.1625950326866; Sat, 10 Jul 2021 13:52:06 -0700 (PDT) Received: from skbuf ([82.76.66.29]) by smtp.gmail.com with ESMTPSA id ce21sm1724473ejc.25.2021.07.10.13.52.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 13:52:06 -0700 (PDT) Date: Sat, 10 Jul 2021 23:52:05 +0300 From: Vladimir Oltean To: Colin Foster Cc: andrew@lunn.ch, vivien.didelot@gmail.com, f.fainelli@gmail.com, davem@davemloft.net, kuba@kernel.org, robh+dt@kernel.org, claudiu.manoil@nxp.com, alexandre.belloni@bootlin.com, UNGLinuxDriver@microchip.com, linux@armlinux.org.uk, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH v2 net-next 7/8] net: dsa: ocelot: felix: add support for VSC75XX control over SPI Message-ID: <20210710205205.blitrpvdwmf4au7z@skbuf> References: <20210710192602.2186370-1-colin.foster@in-advantage.com> <20210710192602.2186370-8-colin.foster@in-advantage.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210710192602.2186370-8-colin.foster@in-advantage.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jul 10, 2021 at 12:26:01PM -0700, Colin Foster wrote: > +static const struct felix_info ocelot_spi_info = { > + .target_io_res = vsc7512_target_io_res, > + .port_io_res = vsc7512_port_io_res, > + .regfields = vsc7512_regfields, > + .map = vsc7512_regmap, > + .ops = &vsc7512_ops, > + .stats_layout = vsc7512_stats_layout, > + .num_stats = ARRAY_SIZE(vsc7512_stats_layout), > + .vcap = vsc7512_vcap_props, > + .num_mact_rows = 1024, > + > + /* The 7512 and 7514 both have support for up to 10 ports. The 7511 and > + * 7513 have support for 4. Due to lack of hardware to test and > + * validate external phys, this is currently limited to 4 ports. > + * Expanding this to 10 for the 7512 and 7514 and defining the > + * appropriate phy-handle values in the device tree should be possible. > + */ > + .num_ports = 4, Ouch, this was probably not a good move. felix_setup() -> felix_init_structs sets ocelot->num_phys_ports based on this value. If you search for ocelot->num_phys_ports in ocelot and in felix, it is widely used to denote "the index of the CPU port module within the analyzer block", since the CPU port module's number is equal to the number of the last physical port + 1. If VSC7512 has 10 ports, then the CPU port module is port 10, and if you set num_ports to 4 you will cause the driver to misbehave. > + .num_tx_queues = OCELOT_NUM_TC, > + .mdio_bus_alloc = felix_mdio_bus_alloc, > + .mdio_bus_free = felix_mdio_bus_free, > + .phylink_validate = vsc7512_phylink_validate, > + .prevalidate_phy_mode = vsc7512_prevalidate_phy_mode, > + .port_setup_tc = vsc7512_port_setup_tc, > + .init_regmap = vsc7512_regmap_init, > +}; > + /* Not sure about this */ > + ocelot->num_flooding_pgids = 1; Why are you not sure? It's the same as ocelot.