Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp2447674rwn; Fri, 16 Sep 2022 10:22:27 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5OuvuCup7I6y2c1x/ZT6AtLIdO8cpouNp8NG/PWYeQLpylkYc286K2MtHCyrpJIhNLYWnb X-Received: by 2002:a17:90a:5b0d:b0:1fe:3769:5fb8 with SMTP id o13-20020a17090a5b0d00b001fe37695fb8mr18072143pji.152.1663348947659; Fri, 16 Sep 2022 10:22:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1663348947; cv=pass; d=google.com; s=arc-20160816; b=Mna9UcBhAqTWeVwJ5MGbd6XOxRoCyDX0SdJTDpMY4CX0piuzf4u2qjtSUr3tf1aUSB oaf/o1bcH0sxkU7OT2567S0oaiB3TLI8OeLfs6it+q1Wz5uV9jw2s0w/IsXpoYVlSXKs BHZgvXoGl1IZWol6kbQjdQXMlS9sUtbNNum+PP9lMb1IFfncum0qH/R19puTe/mt4Ipd vOtEIN2LSey8aZdax0FBrlmpVXHsvs/iLyVpC8qOP9mD14VlowiHnw4YbBEPiaqk0TKQ 9TCjGPiOKtX0iA9/ArK+4MPgRKCXVhxfuf5tyaCGdDETGwqcfydT13cdvtnWdutdalXJ 5BxQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=PH71J2d4VUE8i6wE1QJELT6TLfPv5mvfi6mejJsqw0Q=; b=FJIBjW+xy1kf6apkWIu9j+J3XdXRqRllqi2AN9V1qDpY+2dh+R4hhM1YsW5mYlBPLT jG6OBOmexFkKIlL5YydSvXhnXpaTd9sniFZoUK7SzaxuwWfhAJ/mZ3T4KPmgLj6rE6qR Ve5USaHUhcvDpYiIcwSDvhgX8tJ8H9iaCDn3tw71Ulh0ZZP/v57v+rY0Uw9R1PiMYi/B Evxz1KZl2/eOLk8zsOkQhDniZflwtRUjGfxDPNZQ6a0rRufiCDx3lUYcuRrggK63eIZf KOGHD9NgCXaIT9yQAKRUnXlcosb7P+XhFEMqI0EdE0KmKtdDGkqX7BwLWCmpHLIuJisj 8OPA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@inadvantage.onmicrosoft.com header.s=selector2-inadvantage-onmicrosoft-com header.b=eqBAtSEc; arc=pass (i=1 spf=pass spfdomain=in-advantage.com dkim=pass dkdomain=in-advantage.com dmarc=pass fromdomain=in-advantage.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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=in-advantage.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z8-20020a655a48000000b0042b964fd0b6si23319343pgs.333.2022.09.16.10.22.15; Fri, 16 Sep 2022 10:22:27 -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=@inadvantage.onmicrosoft.com header.s=selector2-inadvantage-onmicrosoft-com header.b=eqBAtSEc; arc=pass (i=1 spf=pass spfdomain=in-advantage.com dkim=pass dkdomain=in-advantage.com dmarc=pass fromdomain=in-advantage.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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=in-advantage.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229744AbiIPQ4L (ORCPT + 99 others); Fri, 16 Sep 2022 12:56:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229509AbiIPQ4H (ORCPT ); Fri, 16 Sep 2022 12:56:07 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2097.outbound.protection.outlook.com [40.107.244.97]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD87AAB4FB; Fri, 16 Sep 2022 09:56:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eQC/7kMLdpcLyj0LxKjOvjQQ6dQeDnj+v3KoKUB82T3ARwSd8/3oNPTpjJOEnmnIjDbOy8T1o4+5V5MQ14LsGF2AgMjf8QKz3aT4j/mP2C1asfh4FIpjdez1/CedezYSBpCM3M9eGNp9EC9jSDGXHYkdqJQWPkYT+D8G2IaiRKF32MjyDz0VKRhVCyfG6R2deuJO09Bk1i//8Vdo+RbYloqAOR9WRQwM4gVAz24hf2OtESBtMgjVQ1Vf13rMZghiu/diml71+HejZSOqMEtwGBUnGDuhwh6zTHbSKGf8953vlYlPRXmPHyIHIqMGnOxO5mUKf2/lwaPVe5xInxBIIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=PH71J2d4VUE8i6wE1QJELT6TLfPv5mvfi6mejJsqw0Q=; b=mwBe11Jjm41/EyJoUzVCQlEa4A43yppjzU7thbBwkOWra6bYx+IQljqUtTNM+iAyspiGqnLcBYSrUOjYmiS5nvE3xU7VmSC6iafmPi9VFLR8id4HhBgfIruiPB8DDmV9wey3pp0zwGXxzVTW49aw1JtNVHUb4z4CxwklfomFJHw5inBpVox6lT4ZXqPnYhkj0iyIShDMjr/aLSHNzI0yhllClKGH+5L0fRBcM98mC33d4+9s3glKVyA9LpGfEkxsOJNPvqGo1B8ul2e+glnuocTUHR4550jIRobSYzZco0ZYfx2O2W6r3dpagcIjmgWxO19ZT/kcuZQqZtITiP5d/w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=in-advantage.com; dmarc=pass action=none header.from=in-advantage.com; dkim=pass header.d=in-advantage.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inadvantage.onmicrosoft.com; s=selector2-inadvantage-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PH71J2d4VUE8i6wE1QJELT6TLfPv5mvfi6mejJsqw0Q=; b=eqBAtSEcFo2pGJO/CElJPPDUdJe9DWEOeDbCrdtZrFgrdJ2xtb8pm6gpDqhSEm2eT+0bg/3qZgOxXIFgdFRd+MFPPU9DPc5Uii3sAps4gOqsEL1uLL/fDKrKZFPNTrP2DzC/jSYh/K0tSCcosabetTj/HvGUK9TPPhDHtnyI74k= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=in-advantage.com; Received: from MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) by CH3PR10MB6692.namprd10.prod.outlook.com (2603:10b6:610:148::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.15; Fri, 16 Sep 2022 16:56:00 +0000 Received: from MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::dcf2:ddbd:b18d:bb49]) by MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::dcf2:ddbd:b18d:bb49%3]) with mapi id 15.20.5632.015; Fri, 16 Sep 2022 16:56:00 +0000 Date: Fri, 16 Sep 2022 09:55:55 -0700 From: Colin Foster To: Vladimir Oltean Cc: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Russell King , Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S. Miller" , Florian Fainelli , Vivien Didelot , Andrew Lunn , "UNGLinuxDriver@microchip.com" , Alexandre Belloni , Claudiu Manoil , Lee Jones Subject: Re: [RFC v1 net-next 8/8] net: dsa: ocelot: add external ocelot switch control Message-ID: References: <20220911200244.549029-1-colin.foster@in-advantage.com> <20220911200244.549029-1-colin.foster@in-advantage.com> <20220911200244.549029-9-colin.foster@in-advantage.com> <20220911200244.549029-9-colin.foster@in-advantage.com> <20220912172109.ezilo6su5w6dihrk@skbuf> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220912172109.ezilo6su5w6dihrk@skbuf> X-ClientProxiedBy: SJ0PR03CA0111.namprd03.prod.outlook.com (2603:10b6:a03:333::26) To MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR1001MB2351:EE_|CH3PR10MB6692:EE_ X-MS-Office365-Filtering-Correlation-Id: 049b1b1c-aa43-4d02-6fe4-08da98045500 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rzce5XYviZOtHqTrA3A18Y4KGBqQA9FdhIcUoNdqPPxrgFCHQkfwRlMIP4ilhyFpxS+l7EB9yya7Nor8jXcJnZ/v8ddHnhlbuBBVrnwNNkirAnGSoywx28IukVqPXBylh2DTsw3s7YVnlDJjAB+xHI1lVUFTMT+GpA/fApTiYBq/dKDaxhZ4v2Lk1V2/jUFeoj538f04XE1TgZfstndEAgB8h8/em4c0zN56o6xHPwykqm/hb/yn2t1cpbcDvUoxNChfBu4bvQZhfneQRUFT8x6YwZAxjROUkxX8AIBrrfdjpiOYzI1OY1OXq6Ot0dIYT7YAt/IiC+r9p2PzcEzaCVcEijeuvPAss5k0V9QZ7WZIfsPfMOVAYlxCHFKtmOFqtdACwltP+w+MR0N9iUhlr9fvHgYkzIThnXlCJ1GMo10gk1yH8myI5EXTUtFuwzJp9Dl4Xx1MiyN5XylDa+BTA57SWPWfw/a4jFNomTv8cDXLEt+WadOtsFYvLeEgalOgoTYkDhw8DfANtJPmDTXN4E6s8ik+pFoQBlwDP0kcdpAhWwPs4o0z63CSfcpNGE9ebEsLe35IkFZ/38v5KR4t+q09iSDaLIHQ6wywPEvlNuzc2Qi0cLE7S2Ma7pT1qKu/KKpNvCwBjgNb2HQXwbv00kdFZ0e1rF2FzL+TN5ikjpBl3FtTeF3f47U/ueiCn4u0R9okySBVm/FzOAZBEnXhFA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1001MB2351.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(7916004)(39830400003)(376002)(396003)(136003)(366004)(346002)(451199015)(86362001)(7416002)(44832011)(5660300002)(8676002)(6512007)(26005)(33716001)(66946007)(66476007)(54906003)(2906002)(66556008)(4326008)(8936002)(6916009)(41300700001)(316002)(478600001)(6506007)(6666004)(9686003)(38100700002)(186003)(6486002)(83380400001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?M7MQLM++3Vgg5PwKJVw5369hUH7+8MuCgc7ZDybYkdJ0TqKHmWaRbbUAWHtv?= =?us-ascii?Q?8MhLux4NCZ4rFMj2mPrNGVusINKnibqZC9wTYvMA79VQNwyHMYVlTuiLINmf?= =?us-ascii?Q?xFKZK65g8jF9K0Eu9/J6T8OryOSWmmgUqPAAM0b8ugrOlffRSJohrNkTJMqM?= =?us-ascii?Q?AwXB9cbtt0YD9HC5aNWhhYdWY+y7oCmzq4fDJFOsMfihAhYeZrdcu2F6nktB?= =?us-ascii?Q?WDypsKdITk8tdEsc4Zjg4mqFiQSAjvr+Z+tt4q0s8BYneAs4nDk6iVUoxfOK?= =?us-ascii?Q?3xT7wdEakAGgtoKYjAD0PpGcN6nw+sKMhYgBEMOUvXvDNwN3BJgSEXM6xp33?= =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wkGYq1kJFo1UAn+Yfww?= =?us-ascii?Q?FZzjbLfXh9Kz5EbDA2opwCKqWlKTRNBiOyrFxzTkY1xg2/fHzD53+5Pd0k1N?= =?us-ascii?Q?YsQC+5nyUUXr8oJPP86WDa/FoY/meODNtxm+2hjyRcORzaU+MUXJRyE67syD?= =?us-ascii?Q?K7FIhK/GnfWybMpA3NR0OBJMbZ4rINYp+HYHiR1mN7ED4ewqlWo8rNWhG+p9?= =?us-ascii?Q?i6ImS5j64DOVlNFwzh6ylmW8q5UCFh9c6D28iydBw6XxWrVA3M2NwzhpnZ6Y?= =?us-ascii?Q?+X5YiZAvTA5E4VsCKaEMvStTIueOGklk9CPLPkaCpDYmfTgfXrokfdnK/t4Z?= =?us-ascii?Q?+XatpWCSr2vUtjZw/mHrK9YOGsvbwtfovpeU2e1i/HiaGtQoTleWtwijoRnq?= =?us-ascii?Q?9w=3D=3D?= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: 049b1b1c-aa43-4d02-6fe4-08da98045500 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2351.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2022 16:56:00.2229 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 48e842ca-fbd8-4633-a79d-0c955a7d3aae X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: zNS5AoA3QeMj14bBgn60LhjQ31cptn9DQ94rl11vSF3FnMRTT25phMJjpHVdtwWfXWRh57LF318ZHPdI6U7dUFmTk4a9yi+f/LQ4nm0sPNg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR10MB6692 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS 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 Mon, Sep 12, 2022 at 05:21:10PM +0000, Vladimir Oltean wrote: > On Sun, Sep 11, 2022 at 01:02:44PM -0700, Colin Foster wrote: > > + > > +#define OCELOT_EXT_MEM_INIT_SLEEP_US 1000 > > +#define OCELOT_EXT_MEM_INIT_TIMEOUT_US 100000 > > + > > +#define OCELOT_EXT_PORT_MODE_SERDES (OCELOT_PORT_MODE_SGMII | \ > > + OCELOT_PORT_MODE_QSGMII) > > There are places where OCELOT_EXT doesn't make too much sense, like here. > The capabilities of the SERDES ports do not change depending on whether > the switch is controlled externally or not. Same for the memory init > delays. Maybe OCELOT_MEM_INIT_*, OCELOT_PORT_MODE_SERDES etc? > > There are more places as well below in function names, I'll let you be > the judge if whether ocelot is controlled externally is relevant to what > they do in any way. > > > +static int ocelot_ext_reset(struct ocelot *ocelot) I'm looking into these changes now. I was using "ocelot_ext_" not necessarily as an indication as "this only matters when it is controlled externally" but rather "this is a function within ocelot_ext.c" So there's a weird line between what constitutes "external control" vs "generic" There are only two things that really matter for external control: 1. The regmaps are set up in a specific way by ocelot-mfd 2. The existence of a DSA CPU port Going by 1 only - there's basically nothing in drivers/net/dsa/ocelot/ocelot_ext.c that is inherently "external only". And that's kindof the point. The only thing that can be done externally that isn't done internally would be a whole chip reset. Going by 2 only - the simple fact that it is in drivers/net/dsa/ means that there is a CPU port, and therefore everything in the file requires that it is externally controlled. Unless you're going another way, and you're not actually talking about "function names" but instead "should this actually live in ocelot_lib" While I don't think that's what you were directly suggesting - I like this! ocelot_ext_reset() shouldn't exist - I should move, update, and utilize ocelot_reset() from drivers/net/ethernet/mscc/ocelot_vsc7514.c. The ocelot_ext function list will dwindle down to: *_probe *_remove *_shutdown *_regmap_init *_phylink_validate