Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp6960719ybn; Mon, 30 Sep 2019 06:35:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqzBan6sASm7MntGBchgu9ua48GMX4HcIvwQ3rdK3efjyEHKaBtnsMdG3ai+8Ahb+CjYPBhI X-Received: by 2002:aa7:dc55:: with SMTP id g21mr19476895edu.210.1569850526363; Mon, 30 Sep 2019 06:35:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569850526; cv=none; d=google.com; s=arc-20160816; b=ikPQIigmjfctu9S7addiU7WqhGZnRk8WzDzVyhn2ithqm7YjxuDwlD/fPWq2Icwbec RbQj2mAT2oBbQp4zfgo6HebXEi7X9cADeAJ5+5qrrg9q2Aub2sjUewMfJPdmn5fbDIiX 6uo8ypSK+1W6PYdgug0dM2Jv/Bf3FBhrgw/7dkmPIJ4+rYnZy+QO62NwDntXJz64O1ny wIB3GAdBNhUMW7z2v6GLB9EM0hLScdFFWJVqmbAKs0ouPx0/4cGSgylgv3AbYXrDyOQm VXnTe89La01a3hP/yu4r1lQN5UD1yZgrS5iF/gw50U5oF5As2Dd05qRwqRZrlHoE5qTL 8kNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=DkZhXLf/liSBVKh0ARKHhgcCiN6tBxU8m1QCK+EHagE=; b=NPNsQQNVzVz5HwzjA7xMA8AMj4Ttz4y0HQde6za5gc8PS6yj6zMi29oNKtTrUFIziu KUbiX7ItK4WHIUPa7o/P7IB6gUiks4ZY8zPFCGhsjBR98vgehm+M4H67Dj3Nxhxww6uZ TVtmmwdnjKqW6/jvortcYv7p18xkNvWB2kMLPLydmEKfbHHZtyMNbkLc8p7ppODf1rMg vgFDqien75G+bK5kWEoxjIg8OOjqVCxZtDt2UdnufjxtZon4IUw2XjcMMpggs+SOSTSd /lavRI16I41jYZNdlwwoZ6vGXvZKQigzm3RElViPN3Octf+16wPO71BHcp4xYcB3J9qP Gpew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ysoft.com header.s=20160406-ysoft-com header.b=KmLhQ08Y; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ysoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id jz12si6759249ejb.193.2019.09.30.06.35.01; Mon, 30 Sep 2019 06:35:26 -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 (test mode) header.i=@ysoft.com header.s=20160406-ysoft-com header.b=KmLhQ08Y; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ysoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731313AbfI3Nee (ORCPT + 99 others); Mon, 30 Sep 2019 09:34:34 -0400 Received: from uho.ysoft.cz ([81.19.3.130]:36312 "EHLO uho.ysoft.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730583AbfI3Nee (ORCPT ); Mon, 30 Sep 2019 09:34:34 -0400 Received: from [10.1.8.111] (unknown [10.1.8.111]) by uho.ysoft.cz (Postfix) with ESMTP id 5035FA48B3; Mon, 30 Sep 2019 15:34:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ysoft.com; s=20160406-ysoft-com; t=1569850471; bh=DkZhXLf/liSBVKh0ARKHhgcCiN6tBxU8m1QCK+EHagE=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=KmLhQ08Y2U16kKNbPRryKZWifG7u+VBmXUzd2Di93Q+vOSkJ5hnIRgqYW9RR+VZzL E5RToMy9puNOGm9AHWqo93JPxDuw84gDBj/Yy33PPWsq67I8RMosGnkUAPsmPH0sol xXE4tYJ9a94/BgbX3LhZS0qr4ZmIEx08QKuw3/bk= Subject: Re: [PATCH net] net: dsa: qca8k: Use up to 7 ports for all operations To: Andrew Lunn , "David S. Miller" , netdev@vger.kernel.org Cc: Vivien Didelot , linux-kernel@vger.kernel.org, Florian Fainelli , Heiner Kallweit References: <1569488357-31415-1-git-send-email-michal.vokac@ysoft.com> From: =?UTF-8?B?TWljaGFsIFZva8OhxI0=?= Message-ID: <07dda3c6-696c-928f-b007-8cda9744b624@ysoft.com> Date: Mon, 30 Sep 2019 15:34:31 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <1569488357-31415-1-git-send-email-michal.vokac@ysoft.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 26. 09. 19 10:59, Michal Vokáč wrote: > The QCA8K family supports up to 7 ports. So use the existing > QCA8K_NUM_PORTS define to allocate the switch structure and limit all > operations with the switch ports. > > This was not an issue until commit 0394a63acfe2 ("net: dsa: enable and > disable all ports") disabled all unused ports. Since the unused ports 7-11 > are outside of the correct register range on this switch some registers > were rewritten with invalid content. > > Fixes: 6b93fb46480a ("net-next: dsa: add new driver for qca8xxx family") > Fixes: a0c02161ecfc ("net: dsa: variable number of ports") > Fixes: 0394a63acfe2 ("net: dsa: enable and disable all ports") > Signed-off-by: Michal Vokáč More recent patches on the list are getting attention. Is this one falling through the cracks? > --- > I am not sure which of the fixes tags should be used but this definetelly > fixes something.. > > IMHO the 0394a63acfe2 ("net: dsa: enable and disable all ports") did not > cause the issue but made it visible. > > drivers/net/dsa/qca8k.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c > index 16f15c93a102..bbeeb8618c80 100644 > --- a/drivers/net/dsa/qca8k.c > +++ b/drivers/net/dsa/qca8k.c > @@ -705,7 +705,7 @@ qca8k_setup(struct dsa_switch *ds) > BIT(0) << QCA8K_GLOBAL_FW_CTRL1_UC_DP_S); > > /* Setup connection between CPU port & user ports */ > - for (i = 0; i < DSA_MAX_PORTS; i++) { > + for (i = 0; i < QCA8K_NUM_PORTS; i++) { > /* CPU port gets connected to all user ports of the switch */ > if (dsa_is_cpu_port(ds, i)) { > qca8k_rmw(priv, QCA8K_PORT_LOOKUP_CTRL(QCA8K_CPU_PORT), > @@ -1074,7 +1074,7 @@ qca8k_sw_probe(struct mdio_device *mdiodev) > if (id != QCA8K_ID_QCA8337) > return -ENODEV; > > - priv->ds = dsa_switch_alloc(&mdiodev->dev, DSA_MAX_PORTS); > + priv->ds = dsa_switch_alloc(&mdiodev->dev, QCA8K_NUM_PORTS); > if (!priv->ds) > return -ENOMEM; > >