Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1920460imu; Wed, 12 Dec 2018 06:38:19 -0800 (PST) X-Google-Smtp-Source: AFSGD/VxJabSca4oEuMhI2ZA4P/tumt8Us4xVHdxxo/q6AMJnkItb81vsL4sqrj/AFSyVJnoBPG/ X-Received: by 2002:a17:902:28e9:: with SMTP id f96mr20188661plb.169.1544625498983; Wed, 12 Dec 2018 06:38:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544625498; cv=none; d=google.com; s=arc-20160816; b=x/zLemjEqcGPpL11b+Kt1MUQXZ5XKCG33whnEADe6Wb+Mk07NGFp3tM1CqylzaG0NJ oxmU4MwLcolmBug6eJhCyPRJITYn2ET6jVkKeUGx07LOZPwPiOHhXdOxBztoTqjoVI2K /3EVGV/D5zL0Red6Yg+pDrOjpLpiiZ1wOkqftLCqm6N2HfLOK+HMnyLLOf8WB4TiJY8W D59wE3kaqXLOvBQdU3+aszaKx4TaKFjKozQkEaMj8CsJxLpDCgMofHwf8JvwkfjfrTGw hOtuFwNUL6qOLWeqdSqGaxngutSLkWjlmcrhOYcRack6aRAGEBXs1YYbFR3dZouK9yeI HhHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=aGgcivKRDR7BFRZoRrSe311Wrlk66BItokV0qSMoARA=; b=Q6FYlkmkUaNb+V5QD/dYy3E0wZ0wWRjXtv1Xanto5F3AVVBxZZVlAUivopZ6v8PwV2 VKCBB4TwNgXhD2xdA76IHNktVUNJdH9pF/o7Hd/Z/hWF8BmsvqGv5YVli0ttK7KDuOOk y4HenIjAttDdpHKwhx88jHHOp0yn6TeZ+sA1vBJxIOS1Oi98hYLK7KcqEs1nTzN4XPtT XVOL8VU7eDpB3O51O0rpCybhOqFgLy3JuxJJH9o0e8jjYekKz/J9i3//79f06Q6qlCkz BxGeT84Moy4Aq+Pjh1ZYuqiwHF4EcqCbb83E9wA8xHv4qQfOZigFcqVkOYEMJXVa1G24 Rtqw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m11si15245761pla.436.2018.12.12.06.38.03; Wed, 12 Dec 2018 06:38:18 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727676AbeLLOhC (ORCPT + 99 others); Wed, 12 Dec 2018 09:37:02 -0500 Received: from guitar.tcltek.co.il ([192.115.133.116]:50329 "EHLO mx.tkos.co.il" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726228AbeLLOhB (ORCPT ); Wed, 12 Dec 2018 09:37:01 -0500 Received: from sapphire.tkos.co.il (unknown [10.0.4.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx.tkos.co.il (Postfix) with ESMTPS id 702214400D0; Wed, 12 Dec 2018 16:36:58 +0200 (IST) Date: Wed, 12 Dec 2018 16:36:57 +0200 From: Baruch Siach To: Antoine Tenart Cc: Russell King - ARM Linux , davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, maxime.chevallier@bootlin.com, gregory.clement@bootlin.com, miquel.raynal@bootlin.com, nadavh@marvell.com, stefanc@marvell.com, ymarkman@marvell.com, mw@semihalf.com Subject: Re: [PATCH net] net: mvpp2: 10G modes aren't supported on all ports Message-ID: <20181212143657.irf7tt27mpshfhpz@sapphire.tkos.co.il> References: <20181211163228.26130-1-antoine.tenart@bootlin.com> <20181211163635.GG30658@n2100.armlinux.org.uk> <877egg6jbt.fsf@tkos.co.il> <20181211185156.GH30658@n2100.armlinux.org.uk> <20181212093033.GA3219@kwain> <20181212141451.GC3219@kwain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181212141451.GC3219@kwain> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Antoine, On Wed, Dec 12, 2018 at 03:14:51PM +0100, Antoine Tenart wrote: > On Wed, Dec 12, 2018 at 10:30:33AM +0100, Antoine Tenart wrote: > > On Tue, Dec 11, 2018 at 06:51:56PM +0000, Russell King - ARM Linux wrote: > > > On Tue, Dec 11, 2018 at 07:53:42PM +0200, Baruch Siach wrote: > > > > That is, something like this, right? > > > > > > > > diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c > > > > index 125ea99418df..04cb0241ca2b 100644 > > > > --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c > > > > +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c > > > > @@ -4404,13 +4404,18 @@ static void mvpp2_phylink_validate(struct net_device *dev, > > > > switch (state->interface) { > > > > case PHY_INTERFACE_MODE_10GKR: > > > > case PHY_INTERFACE_MODE_XAUI: > > > > + if (port->gop_id != 0) > > > > + goto empty_set; > > > > + /* Fall-through */ > > > > case PHY_INTERFACE_MODE_NA: > > > > - phylink_set(mask, 10000baseCR_Full); > > > > - phylink_set(mask, 10000baseSR_Full); > > > > - phylink_set(mask, 10000baseLR_Full); > > > > - phylink_set(mask, 10000baseLRM_Full); > > > > - phylink_set(mask, 10000baseER_Full); > > > > - phylink_set(mask, 10000baseKR_Full); > > > > + if (port->gop_id == 0) { > > > > + phylink_set(mask, 10000baseCR_Full); > > > > + phylink_set(mask, 10000baseSR_Full); > > > > + phylink_set(mask, 10000baseLR_Full); > > > > + phylink_set(mask, 10000baseLRM_Full); > > > > + phylink_set(mask, 10000baseER_Full); > > > > + phylink_set(mask, 10000baseKR_Full); > > > > + } > > > > /* Fall-through */ > > > > case PHY_INTERFACE_MODE_RGMII: > > > > case PHY_INTERFACE_MODE_RGMII_ID: > > > > > > > > > > Yep, looks fine to me, thanks. > > > > This looks good, thanks! I'll send a v2. > > Well, I just got back to this, and looking at the beginning of the > validate function invalid modes are already checked. So we do already > have: > > case PHY_INTERFACE_MODE_10GKR: > case PHY_INTERFACE_MODE_XAUI: > if (port->gop_id != 0) > goto empty_set; > break; > > So it turns out the fix can be applied as-is. Right. I should have known that. Thanks for the fix. baruch -- http://baruch.siach.name/blog/ ~. .~ Tk Open Systems =}------------------------------------------------ooO--U--Ooo------------{= - baruch@tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -