Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4538128rwd; Sun, 4 Jun 2023 07:24:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6yQGH8a74sYjwwF/Rl+hMARnMaJa/odPmY2LDAlNZ4BkpAgeh0OjiluVDOcDytFweu9I1p X-Received: by 2002:a05:6a00:1144:b0:64d:4412:9923 with SMTP id b4-20020a056a00114400b0064d44129923mr19554991pfm.3.1685888643213; Sun, 04 Jun 2023 07:24:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1685888643; cv=pass; d=google.com; s=arc-20160816; b=C/bW8/z4TY6J0CFuxX3OwKdc8SIv3XtSErl25wfhATZa7qpRFhIZwteC8ewLXD8hip UU7Fk2n0FGclIEG9Ok/4AMnD+mgkiSV0VIVaWNGpwIZVKjVIRuqf7RITv4nozAkAtren QzfpN/+2TJivb3Zm1YX9zlQBCXxFms/xi8S4jGMmqaoTI3535fhAOvIxjiZkHCjkM445 6y0wncYV2rX6BvMQM8paNX2dZJuYasgmAF4CyZ6+UBfLMzaGKifoPzyMnTAAbNORpvwn DQKye6eheA9izfRDKEI/cfS3fZLr95zgHl7CPnKR6vS0ljuu0VHOBX5jJ7RGXSVrtUOw wXJw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=BzcElPlulU+8xjoOMrgsQgOCoANsPHLfjay0Dt8SHEY=; b=h6IGc7yPSo776ZjYyQr2kp90jZizr8ScTsb5hiUF+RklK6NutsmzL733NHbXquGTmr kM2FHVDgpXfgg/APOQDqTsC1TFYs4/8Ze07gpXfTgjlU+czD8XgBGVUaRRh/cgSsX3lI xEr/JD+7+2Z+nNS/EmHil0SMCN7sjgQzpc6COHRX2/zjHS6qHdv3mlOwedkvL+vm0zT6 mWL2s36aoiMyJzrMr7psMtVTZQnyildXgNtgnnz9bIG4uiCVYYx/cqIxbAV49IL6Cg2/ 8k88/57NVtEkx4hW7cVxD+F8ZnHUo5MublXL2Z4Dpl8T7gPEN/08SAYeQj3/jaKXvntm 1W+g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@arinc9.com header.s=zmail header.b=fndRkYd6; arc=pass (i=1 spf=pass spfdomain=arinc9.com dkim=pass dkdomain=arinc9.com dmarc=pass fromdomain=arinc9.com>); 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 k24-20020a63f018000000b005439273f2a4si1520336pgh.139.2023.06.04.07.23.43; Sun, 04 Jun 2023 07:24:03 -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=@arinc9.com header.s=zmail header.b=fndRkYd6; arc=pass (i=1 spf=pass spfdomain=arinc9.com dkim=pass dkdomain=arinc9.com dmarc=pass fromdomain=arinc9.com>); 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 S229932AbjFDNeK (ORCPT + 99 others); Sun, 4 Jun 2023 09:34:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229578AbjFDNeI (ORCPT ); Sun, 4 Jun 2023 09:34:08 -0400 Received: from sender3-op-o18.zoho.com (sender3-op-o18.zoho.com [136.143.184.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9100ADA; Sun, 4 Jun 2023 06:34:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685885608; cv=none; d=zohomail.com; s=zohoarc; b=DPnm3klMFsV5I+wpRudckd2hAgFIn6ljkvX/NMTxREfdp5cxEvlcc28W8zn3rqInhGaONTvdWZI+7CIVnsyn80IlY5WFjxzEh3vgwIQtQGguGyggQU4dYfAQ6HAQs+yPV2oXw6auRPNe0E0sK6/weNzbadAjwOGvdPGyawby8/w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685885608; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=BzcElPlulU+8xjoOMrgsQgOCoANsPHLfjay0Dt8SHEY=; b=NKGrUXTER60OMO2P6gB4dCh5pQFottY0WzoXZwJPNbvD9nE9LpQMqtq9PSTKoOLtJhkuZB9ZxZPc3284YIAcCxrKep8YMJtZsTk4MQruLz+Xpc1ec94i/W3kyK9Dr8R1RqN164rj/mBR8DoI9DRp1jBvEfhv+VykkLmIW6h2zto= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=arinc9.com; spf=pass smtp.mailfrom=arinc.unal@arinc9.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1685885608; s=zmail; d=arinc9.com; i=arinc.unal@arinc9.com; h=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:Cc:Cc:References:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=BzcElPlulU+8xjoOMrgsQgOCoANsPHLfjay0Dt8SHEY=; b=fndRkYd6lUAGZrs3zb0Cco21VEpzO/i+OsXd3S2j6P+YDuEBxRJ2zHnt5sMGQsVK CwSC66PgCJ/1vExUMGWTL6wq+Jf7TkApctmM0ObIoLgO43bmXX27udCLcfpiwjPdci6 QUMuEPLlf7ssYtCX6X24XzpPpLGHe+74VPq5m8VQ= Received: from [192.168.99.249] (178-147-169-233.haap.dm.cosmote.net [178.147.169.233]) by mx.zohomail.com with SMTPS id 1685885607262824.205537190085; Sun, 4 Jun 2023 06:33:27 -0700 (PDT) Message-ID: <9ce13208-a20d-44ef-8b47-456801c075a1@arinc9.com> Date: Sun, 4 Jun 2023 16:33:17 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH net-next 25/30] net: dsa: mt7530: properly set MT7531_CPU_PMAP Content-Language: en-US To: Vladimir Oltean Cc: Sean Wang , Landen Chao , DENG Qingfang , Daniel Golle , Andrew Lunn , Florian Fainelli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Russell King , Richard van Schagen , Richard van Schagen , Frank Wunderlich , Bartel Eerdekens , erkin.bozoglu@xeront.com, mithat.guner@xeront.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org References: <20230522121532.86610-1-arinc.unal@arinc9.com> <20230522121532.86610-1-arinc.unal@arinc9.com> <20230522121532.86610-26-arinc.unal@arinc9.com> <20230522121532.86610-26-arinc.unal@arinc9.com> <20230526155124.sps74wayui6bydao@skbuf> <9423a818-f9c0-d867-7f7d-27f05e1536b9@arinc9.com> <20230604130808.3lxuz5ezsouhku57@skbuf> From: =?UTF-8?B?QXLEsW7DpyDDnE5BTA==?= In-Reply-To: <20230604130808.3lxuz5ezsouhku57@skbuf> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ZohoMailClient: External X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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 On 4.06.2023 16:08, Vladimir Oltean wrote: > On Sun, Jun 04, 2023 at 11:21:48AM +0300, Arınç ÜNAL wrote: >>> Stylistically, the existence of an indirect call to priv->info->cpu_port_config() >>> per switch family is a bit dissonant with an explicit check for device id later >>> in the same function. >> >> mt753x_cpu_port_enable() is not being called from priv->info->cpu_port_config() >> though. > > Quite the other way around. I'm saying that mt753x_cpu_port_enable(), > the function whose logic you're changing, already has a mechanism to > execute code specific to one switch family. Ah, makes sense. > >> I'm not sure how I would do this without the device ID check here. > > Hmm, by defining a new mt7530_cpu_port_config() procedure for ID_MT7621 > and ID_MT7530? > > Although in a different thread we are perhaps challenging the idea that > what is currently in priv->info->cpu_port_config() is useful - at least > half of it are manual invocations of phylink methods which are possibly > not needed. If after the removal of those, it no longer makes sense to > have priv->info->cpu_port_config() at all, then I'm not saying that the > explicit check for device id here doesn't make sense. Just that it's not > in harmony with what currently exists 3 lines above. Regardless of the outcome of that conversation, I would like to avoid structural changes like this since this patch will go to net. > >>>> -#define MT7531_CPU_PMAP_MASK GENMASK(7, 0) >>>> +#define MT7531_CPU_PMAP(x) ((x) & 0xff) >>> >>> You can leave this as ((x) & GENMASK(7, 0)) >> >> Now that I've read Russell's comment on the previous patch, the below would >> be even better? >> >> MT7531_CPU_PMAP(x) FIELD_PREP(MT7531_CPU_PMAP_MASK, x) >> >>> >>>> +#define MT7531_CPU_PMAP_MASK MT7531_CPU_PMAP(~0) >>> >>> There's no other user of MT7531_CPU_PMAP_MASK, you can remove this. >> >> Should I do above or remove this? > > No specific preference. If you want to make this driver start using > FIELD_PREP() then go ahead. Will do. Arınç