From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ilias Apalodimas Subject: Re: [RFC v2, net-next, PATCH 4/4] net/cpsw_switchdev: add switchdev mode of operation on cpsw driver Date: Thu, 14 Jun 2018 14:34:04 +0300 Message-ID: <20180614113404.GB32505@apalos> References: <1528974690-31600-1-git-send-email-ilias.apalodimas@linaro.org> <1528974690-31600-5-git-send-email-ilias.apalodimas@linaro.org> <20180614113028.GB2518@nanopsycho.orion> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev@vger.kernel.org, grygorii.strashko@ti.com, ivan.khoronzhuk@linaro.org, nsekhar@ti.com, ivecera@redhat.com, andrew@lunn.ch, f.fainelli@gmail.com, francois.ozog@linaro.org, yogeshs@ti.com, spatton@ti.com, Jose.Abreu@synopsys.com To: Jiri Pirko Return-path: Received: from mail-wr0-f194.google.com ([209.85.128.194]:46724 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755006AbeFNLeI (ORCPT ); Thu, 14 Jun 2018 07:34:08 -0400 Received: by mail-wr0-f194.google.com with SMTP id v13-v6so6027982wrp.13 for ; Thu, 14 Jun 2018 04:34:08 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20180614113028.GB2518@nanopsycho.orion> Sender: netdev-owner@vger.kernel.org List-ID: On Thu, Jun 14, 2018 at 01:30:28PM +0200, Jiri Pirko wrote: > Thu, Jun 14, 2018 at 01:11:30PM CEST, ilias.apalodimas@linaro.org wrote: > > [...] > > >@@ -2711,6 +2789,10 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data, > > if (of_property_read_bool(node, "dual_emac")) > > data->switch_mode = CPSW_DUAL_EMAC; > > > >+ /* switchdev overrides DTS */ > >+ if (IS_ENABLED(CONFIG_TI_CPSW_SWITCHDEV)) > >+ data->switch_mode = CPSW_SWITCHDEV; > > So you force CPSW_SWITCHDEV mode if the CONFIG_TI_CPSW_SWITCHDEV is > enabled. That does not sound right. I think that user should tell what > mode does he want regardless what the kernel config is. We discussed this during the V1 of the RFC. Yes it doesn't seem good, but the device currently configures the modes using DTS (which is not correct). I choose the .config due to that. I can't think of anything better, but i am open to suggestions