Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2182528rwd; Fri, 19 May 2023 02:05:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6DExchqza/tlHVoNdnL8Efq6b36PylJLvR/FbQFY2x6Hs80Umm4ArrVBWI0VAzbTdaF+gF X-Received: by 2002:a17:902:ecc8:b0:1ab:1260:19de with SMTP id a8-20020a170902ecc800b001ab126019demr2388748plh.11.1684487101268; Fri, 19 May 2023 02:05:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1684487101; cv=pass; d=google.com; s=arc-20160816; b=Ykm9vFF4LcH94dNAlfW74Pg3ydisF0Mxbf4r96Y+q5I32htzBBWccafhkXabvh1EXY 31ciCQezLHHvXlfhuAp048EUrzL5RgHrPQo1T5OYQrYTrK/w5spEmxM/9aLBFXmUQjgv wHbdN+bntufYFKsTLVI/QysyB/RsPChOaKgBKohI6juXz5I02k8FC9UpxaUn82jb0eZ/ 8LZpQYipJKRoEafLiXwKGXzGfDK2YZermszVhI3qa5JRAt6Df9KlLpcB62NnpjzFMqaN qBJe8l4eUngIU7e9ao+40oi+/5Ejo2gpD0dBGSrG9cT/Kvm0ZEHsv3tDz4jwJEjFyL36 SN4w== 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=9cTXMQjxCbsf8OJ4PdCQtrzXacOYRxjN+ow4tfwd9MI=; b=Tmu7AFtJC/YpcPbSiAMaIq9YrCq/vDEl6AEgmu17Cv7tCtUpfZ2+zrcAOg/qPg+wH4 DtJEUATXCS3nZobo32Hhb7ZZhqp+/p36DYVMbUfjuIb6wnnAIw/7X8QeeqBibXrvnh7Q dgBWRE1A3Uq9RI9xS64bofe+5ginG6qaTaeFKOegKU7H97AILem9FgqfFx0DeqZvYyP5 Qbno3VWymoXXa5sCXA22uAW+Bn9NfIvE+uBO8pqzSoCZf7YP2gZhx0/10Y0dVh7PCKNn ljhqffnPaJ7UHzYHEM0lJypQ+8t7RAfJ7AW4SfY2y9AaRlJIKsHFpcY3y0FXryCXGMjr VAJg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@corigine.onmicrosoft.com header.s=selector2-corigine-onmicrosoft-com header.b="vCHT3Ub/"; arc=pass (i=1 spf=pass spfdomain=corigine.com dkim=pass dkdomain=corigine.com dmarc=pass fromdomain=corigine.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=corigine.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p13-20020a170902a40d00b001ac7aa1c7b9si3127577plq.388.2023.05.19.02.04.45; Fri, 19 May 2023 02:05:01 -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=@corigine.onmicrosoft.com header.s=selector2-corigine-onmicrosoft-com header.b="vCHT3Ub/"; arc=pass (i=1 spf=pass spfdomain=corigine.com dkim=pass dkdomain=corigine.com dmarc=pass fromdomain=corigine.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=corigine.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230072AbjESJBW (ORCPT + 99 others); Fri, 19 May 2023 05:01:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229599AbjESJBU (ORCPT ); Fri, 19 May 2023 05:01:20 -0400 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2103.outbound.protection.outlook.com [40.107.100.103]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E667E56; Fri, 19 May 2023 02:01:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eaq5QfgqRYmgrt3VJke18xJLg8fDQYyT4Z4mB4n3hSNowdSluKaP3xBshWGXLQK4ESrK93Bw9MQSvg4XGLjzcMbsjzCkgtw/LV+LvYFz7mH7J9xPBlDn2JOeOdnmwv6DmxprLxafx6tPUC29fKaOHT5+vH1zW7xf50evEwgRt8FMujOmbwpmzeV9j1fNK7FjBrSbyGn9XreO4FeGEMRMNQOabnmYqNtu5dD8OHsJSJOi/jKhxpevkl3HKuyLhDo+TjSV8zdSaGKThoWAddfitwztIcWELQtWH/tMY92hiuEV0F4cYzydirk29f1lsEqSD2+vLh/RX+9M8V1jnoE+Tw== 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=9cTXMQjxCbsf8OJ4PdCQtrzXacOYRxjN+ow4tfwd9MI=; b=eZ4quRo3fSjSZSGTZ/VJuUEn2HiZGmUGs4Kg0Pox+hwPDM1wYNxvptq9vou4J+e7Il2/yRf5JkD3od8PG5K+wnaKJdSPev5EzJCRxucrb9wydry0ZmHDddGz+xA0jkb1xbI2d6i+gx6z+1yUMK9l1Lzp4N0HeTySkrKZON+ESxXbMb91Ame8Z5Vi7OZU1tJ79KQMD85zNmME8kn576NptyOTo9jergJD0jfz+bGilD0CemteAa/Y9gYplXokML0NWKv5fy4e6Ehcl7rup98Qcp0VPByxSAzBdxVteLNQ8YjRl+fsUnzqKwn37uAP6BQqCiI3mFZqZLN8wDo+CG8kVA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9cTXMQjxCbsf8OJ4PdCQtrzXacOYRxjN+ow4tfwd9MI=; b=vCHT3Ub/kgzMluAv65m+O4K2kn68neWwahXqusrAosw7PtL89ZsrAJbXTDl7M/H7i+ebVpiH6tFWmQPKvBf71RsoA+JkcEAU02kemyJNicxD7uo0PTjSeFYrKjTEjCTkGahwgOQd81Px0IO5DjPkxLoKsXj8hmHx3pJSB8/7LE8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) by CH0PR13MB5169.namprd13.prod.outlook.com (2603:10b6:610:ea::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.21; Fri, 19 May 2023 09:01:15 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::f416:544d:18b7:bb34]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::f416:544d:18b7:bb34%5]) with mapi id 15.20.6411.021; Fri, 19 May 2023 09:01:15 +0000 Date: Fri, 19 May 2023 11:01:07 +0200 From: Simon Horman To: Oleksij Rempel Cc: "David S. Miller" , Andrew Lunn , Eric Dumazet , Florian Fainelli , Jakub Kicinski , Paolo Abeni , Vladimir Oltean , Woojung Huh , Arun Ramadoss , "Russell King (Oracle)" , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, UNGLinuxDriver@microchip.com Subject: Re: [PATCH net-next v3 1/2] net: dsa: microchip: ksz8: Make flow control, speed, and duplex on CPU port configurable Message-ID: References: <20230518092913.977705-1-o.rempel@pengutronix.de> <20230518092913.977705-2-o.rempel@pengutronix.de> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230518092913.977705-2-o.rempel@pengutronix.de> X-ClientProxiedBy: AS4P191CA0015.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:5d5::12) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR13MB4842:EE_|CH0PR13MB5169:EE_ X-MS-Office365-Filtering-Correlation-Id: 3aa84249-89f7-43e6-b71a-08db5847993a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6+pR6K7mfH3uEtLU3/zamEy0gjIReyQO/sEoObKS7rqxJQeogKVsGSiOqao/JsyZP+88LRvkhuXWakGg+KjduHhF4wEWJyI0r8SlBqJNDQdBsM7rI+fsUdPwfMre3tEV+AgqtZ9AkwBjm/BlrkYbM5iERaemPKW27jFn9XVZi30rjAXlOeMVikmsHjtzOABmI7Iayv56VnvZhgaIu09Bsgu2ccOYPCfuAzdd0wAxE2ffFWmJ3qUN7oPovUOHVdrFsWdG+U/jLrwEOh6MrU7LEwy+Ci/ZY1UmNFv6eJ7wxIK91tkp2StemuoOtdG3ERWea4rMhNMeJHwa8eLq4QfqX7FTC2VA+/8whvExqvsvfRGoBTY9hYPYh2VAThssWLhbSWhlYk0ZhTJ+Ft3q6rDBvg4nTJ38X0UpF0+vKvy/RXkmMQ5xTBxjaeE0SD0QLCAlB5musDHJRCAurKzaJmjMQwkH1xZ7fbMJARZc/WsaC6BdZVItw9e3iJVdFBJXJuo/n+g7bryfxRfbWOjI6x/QMVmF0c4CvifWmAKwiLzvcsj853Orer6GOmxdY7pmual8 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(136003)(366004)(39840400004)(396003)(376002)(451199021)(4326008)(6916009)(66946007)(66556008)(66476007)(478600001)(54906003)(316002)(86362001)(36756003)(83380400001)(6512007)(6506007)(2616005)(186003)(41300700001)(5660300002)(8936002)(8676002)(7416002)(44832011)(6486002)(2906002)(6666004)(38100700002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?bnaslNdFfxDprebzc/Qc7cy6tcT600XZP4Qqm2k8p9m1Hub05wK55/Dlb3Rn?= =?us-ascii?Q?IywLGlHSOrvoJZYasq9S6SrzK/ZZTcc1hUdztte1boY/+jdlF/Ghq8FaJ4+Q?= =?us-ascii?Q?j4JDbBT3AqriqDF/fynCR7PHYXmpdPT5C93brbfQnV7DMxDg8RI61r0OQx+7?= =?us-ascii?Q?DIYfe0hYer/bcWmKZCtIGsA+RNLn57Zsia7EBCyCAtfnJ6s7JaELUrjzYE2b?= =?us-ascii?Q?UsZaRMSo5TQ2dK88whtXq+E8uufCY2iBPxdRRTmAv5OhlOMWu9G6ZmEoRWeQ?= =?us-ascii?Q?M0tBwEYBgK0PEJT3wJPfFiAe9KfVlSPlmmhKwJjA2LVxD0WaEX0JhueJLf7l?= =?us-ascii?Q?cGdyISCYRBDFgOzxVEpoQ+9ZXh6rHIMx54FJKo9HUG0C2/7MYQEevNy4BoAF?= =?us-ascii?Q?8O4UUHbpVVFsss6YYOmk37cA497xbI0MJretKJHfF6V63Hv+eEnnXpXB98Pb?= =?us-ascii?Q?6kfcLFmbM7FxApPvQpcKUxmeFurB0tDHZFBeQ8/u+vmolbJp2oUVx5LVPwHK?= =?us-ascii?Q?bFkx8Shc6Eaw7NLhv7dsOBuhfqWOiTREnXNrO0e12JGl30sQ8UcVxLdoFiEe?=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YniQGhCkNsKURWZpbA8OqKCavocjB5?= =?us-ascii?Q?zvKRsRzoZkjeeOeKGjSKVIHCKXagLfesr2Fxmz/M4Kv97pC09jvTreuRUGKg?= =?us-ascii?Q?/fmpJNADWJFr3vnSo1H3E2Ut6KwV08byT1jrlS4GPlTzOvZ7Zpl4x7u/VH+a?= =?us-ascii?Q?H+BKVr9R+61PY9zVWv1TuhZfDhsyJpbE7o/vfEdjxNKNmB9RAUMbQAaHbEJb?= =?us-ascii?Q?30rTcg=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3aa84249-89f7-43e6-b71a-08db5847993a X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2023 09:01:15.1876 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: IFbRGvRcZbsMMeWN4F0vm5t0mEkCflhH7zkz90TZemPNLKxd4K8KAC4/1EeYpJ/aDIN+JUuyOb6RudvY2S4Kw/7juJJ8wtvDowYQe4co40U= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR13MB5169 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, 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 Thu, May 18, 2023 at 11:29:12AM +0200, Oleksij Rempel wrote: > Allow flow control, speed, and duplex settings on the CPU port to be > configurable. Previously, the speed and duplex relied on default switch > values, which limited flexibility. Additionally, flow control was > hardcoded and only functional in duplex mode. This update enhances the > configurability of these parameters. > > Signed-off-by: Oleksij Rempel Reviewed-by: Simon Horman ... > diff --git a/drivers/net/dsa/microchip/ksz8795.c b/drivers/net/dsa/microchip/ksz8795.c > index f56fca1b1a22..9cfe343d2214 100644 > --- a/drivers/net/dsa/microchip/ksz8795.c > +++ b/drivers/net/dsa/microchip/ksz8795.c > @@ -1371,6 +1371,55 @@ void ksz8_config_cpu_port(struct dsa_switch *ds) > } > } > > +/** > + * ksz8_upstream_link_up - Configures the CPU/upstream port of the switch. > + * @dev: The KSZ device instance. > + * @port: The port number to configure. > + * @speed: The desired link speed. > + * @duplex: The desired duplex mode. > + * @tx_pause: If true, enables transmit pause. > + * @rx_pause: If true, enables receive pause. > + * > + * Description: > + * The function configures flow control and speed settings for the CPU/upstream > + * port of the switch based on the desired settings, current duplex mode, and > + * speed. > + */ > +static void ksz8_upstream_link_up(struct ksz_device *dev, int port, int speed, + int duplex, bool tx_pause, bool rx_pause) nit: there seems to be an off-by-one error in the indentation of the line above. ...