Received: by 2002:a05:7412:e79e:b0:f3:1519:9f41 with SMTP id o30csp13643rdd; Wed, 22 Nov 2023 08:12:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IEb4MBTiLRGhkGaEA7g947Gxhw2IcG6YSJxow0I7QIyOfsMjFQn9AwMG8juU5dGdlGNf5Xk X-Received: by 2002:a17:902:e78c:b0:1cf:5746:7ad0 with SMTP id cp12-20020a170902e78c00b001cf57467ad0mr8001479plb.14.1700669567605; Wed, 22 Nov 2023 08:12:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700669567; cv=none; d=google.com; s=arc-20160816; b=k+kgwG6MarcNPYnAEP5603bpa64iaBLiBjDU+F4+43F2Kn0YIlz3Por4DlRHNlqi1g T3tcMehbmXdCDYnmV9P/oerPdf0er+BdG70VAH4Muw3EuDnZ91bc3STQQuRLBBmrHo// T2rtWFWrARnAcLjnm/avQiFkouEkPmD+yDDAM8vW8N/NdxUugnuEx7iywA97yZl1pxvP glUVC4zstCB9Yrfa6Ew72WSeaRg5i4onTZYZNXDQoV3fEHES26IdkQe2dT1CG07XYMJm Kyo9p/g1Lls+PjjiCKMppynXb9gyvKgnTliCMLXd90+HYv31Z/ZhTAcGLU0B2qi4FEkt JVoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=QKOV/Z/369p+Ig5Wi5vZTAl5YNXFdkGpmq3M44EHZwA=; fh=pm6lM3UqDIPs/aAq/43PUxPgrPpH+VJpTzRQZpNfirI=; b=lyDE+T5fY5x3ThcJPsklGAQ/p82x8EPqC06aU/zIZAnimyF2XmdBkLL14L+eM/I1OV m3XdKOQCJsUl1IMEQ7Se9x+jpNRkxW9oxNyeJ5XWa3seR/6nEl7h+S/pJrPmrrgeS+BS +MO8RPibCIPINHgqydauWoaNxk0/r5LHanD0oBJSnUGtXhWhRrP6gL9L0/B3KxbRnOSd Unzh655j9pScAaHQa73HzHLLvHoIC7zhG0ZGzstiEFXoJ22dd28N4ya5N9+4FjUbzy+1 JuLaKAscfGo0uea1gwQj3Gk0duAAIIyh/Q4ckQly/pBZxIkwwwUAEsAO6zoksKEiHcZ0 w2AA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="QyYObT/q"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id f9-20020a170902ce8900b001cf652d73fdsi6175286plg.284.2023.11.22.08.12.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 08:12:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="QyYObT/q"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 4D18580942DA; Wed, 22 Nov 2023 08:11:30 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231576AbjKVQLW (ORCPT + 99 others); Wed, 22 Nov 2023 11:11:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230377AbjKVQLV (ORCPT ); Wed, 22 Nov 2023 11:11:21 -0500 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::224]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC1F7A1; Wed, 22 Nov 2023 08:11:16 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 9B70DE0007; Wed, 22 Nov 2023 16:11:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700669475; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QKOV/Z/369p+Ig5Wi5vZTAl5YNXFdkGpmq3M44EHZwA=; b=QyYObT/qeq6FL+xnl+X+3ZYqxKx/6fswUDTCYEAXqwCu+5zig5Aps5cUGkdtWViVXH5SGW ExhYuOBKORylGz2SoHQrfPZrDpWM6hABUjGZmF7OjN02Cu+CVk2XDQeiikJSAR7WNAGLPd /fzB4ZzcFEqyGHEKmI6clLg/1s5mPMOZGx5YOrnrJh4bVwZUGhhSx8Mv9DBgnhMugfDjnc YuCEu60HF8YbAnG1MTH0u+moLMwpw8aq1r4FDue3BqpP2SFM1XbOTj95JGL3L33mcMelJv WhQWj5TzN6/ThTU9bCiCTPK5fBpjm5YnbnKR++1Iqj1oRAwtG2Gh+NSokbneZg== Date: Wed, 22 Nov 2023 17:11:12 +0100 From: =?UTF-8?B?S8O2cnk=?= Maincent To: Andrew Lunn Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan Corbet , Luis Chamberlain , Russ Weight , Greg Kroah-Hartman , "Rafael J. Wysocki" , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Thomas Petazzoni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH net-next 9/9] net: pse-pd: Add PD692x0 PSE controller driver Message-ID: <20231122171112.59370d21@kmaincent-XPS-13-7390> In-Reply-To: <2ff8bea5-5972-4d1a-a692-34ad27b05446@lunn.ch> References: <20231116-feature_poe-v1-0-be48044bf249@bootlin.com> <20231116-feature_poe-v1-9-be48044bf249@bootlin.com> <2ff8bea5-5972-4d1a-a692-34ad27b05446@lunn.ch> Organization: bootlin X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Spam-Score: 400 X-GND-Status: SPAM X-GND-Sasl: kory.maincent@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 22 Nov 2023 08:11:30 -0800 (PST) Thanks for your reviews! On Thu, 16 Nov 2023 23:54:02 +0100 Andrew Lunn wrote: > I'm reading this patch first, so this might be a dumb question... >=20 > > +static int pd692x0_recv_msg(struct pd692x0_priv *priv, > > + struct pd692x0_msg *msg, > > + struct pd692x0_msg_content *buf) > > +{ =20 >=20 > ... >=20 > > + i2c_master_recv(client, (u8 *)buf, sizeof(*buf)); > > + if (buf->key) > > + goto out; > > + > > + msleep(10000); =20 >=20 > That is 10 seconds, right? Yes, it is in the communication loss procedure. >=20 > > +static int pd692x0_sendrecv_msg(struct pd692x0_priv *priv, > > + struct pd692x0_msg *msg, > > + struct pd692x0_msg_content *buf) > > +{ > > + struct device *dev =3D &priv->client->dev; > > + int ret; > > + > > + ret =3D pd692x0_send_msg(priv, msg); > > + if (ret) > > + return ret; > > + > > + ret =3D pd692x0_recv_msg(priv, msg, buf); =20 >=20 > So this function takes at least 10 seconds? No, on normal communication it takes a bit more than 30ms. It could be more if there are communication loss, even reset the controller. See the communication loss procedure in "PD692x0 BT Serial Communication Protocol User Guide" for details. > > +static int pd692x0_ethtool_set_config(struct pse_controller_dev *pcdev, > > + unsigned long id, > > + struct netlink_ext_ack *extack, > > + const struct pse_control_config > > *config) +{ =20 >=20 > .... >=20 > > + switch (config->admin_control) { > > + case ETHTOOL_PSE_ADMIN_STATE_ENABLED: > > + msg.content.data[0] =3D 0x1; > > + break; > > + case ETHTOOL_PSE_ADMIN_STATE_DISABLED: > > + msg.content.data[0] =3D 0x0; > > + break; > > + default: > > + return -EOPNOTSUPP; > > + } > > + > > + msg.content.sub[2] =3D id; > > + ret =3D pd692x0_sendrecv_msg(priv, &msg, &buf); =20 >=20 > So this is also 10 seconds?=20 >=20 > Given its name, it looks like this is called via ethtool? Is the > ethtool core holding RTNL? It is generally considered bad to hold RTNL for > that long. Yes it is holding RTNL lock. Should I consider another behavior in case of communication loss to not holding RTNL lock so long? Regards, --=20 K=C3=B6ry Maincent, Bootlin Embedded Linux and kernel engineering https://bootlin.com