Received: by 2002:a05:7412:e79e:b0:f3:1519:9f41 with SMTP id o30csp41959rdd; Wed, 22 Nov 2023 08:58:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IHxGbQjCPgMb7xFIFBlc+pXAngeUa1idotWdIYsdnFdaBEDLDVfg4g7r1Paca7gaX6LjcPW X-Received: by 2002:a05:6a00:9395:b0:6c3:74d6:595a with SMTP id ka21-20020a056a00939500b006c374d6595amr3020673pfb.13.1700672303643; Wed, 22 Nov 2023 08:58:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700672303; cv=none; d=google.com; s=arc-20160816; b=wxznEvNNk9lwfK19m+Q6VwOn1URvK6cLSTCxcIumriyFKX2HyzNGyxZLFH3Sm2DNNt DabABJc4uT1GKZ4liddacJ4+IjD0hL44xRKgCQQW4qvqTofzye2NIIgF+7M3wMGQt6HI A+csm+6LZN+yTKmtDwXfTFfTtv0YkIXfOl0YUz6BEOaBHF82HB2EwaOIvDnC526rM80F PGgbyNGQQgGUgf0q6yvyduwgjf1kJM0bD0NQpbpAjgogoJuYMHjGO3dOJjh8dBafA3jx DvMXIwOq3v6p6zp8rRDBXtIFT6wMV4dzjVxE6pjLu+ffSZD4fhlwavE9Y5RcYJRg29Br obZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=llPqWm50yG2G6d8aUjmsaKhLgZNwnadcU3ZGNPGP+lo=; fh=rbWtxkE8kExZFv2KcrtSC0yF0uarX5O6bFbQPIKO3cE=; b=XSAZvydXV6Ui/1aOqRoEAww1vGBuYe/NVN2/xt93UsUOZfSyESBXuhtJcNp12O2129 ZwnxMeoe898l3d4RlJHfAUxtdO01zeNpqDBoffPo8Ne1xgSjl0Atd7cSIXoXPT/BeEw6 zWIiNyvnlfqgwGs15jaXj6uHFrz16ai9dV/AmxJZt9G7mhBIQotovCrB2knB+rTlfSOF TTXfiUwZIOKcGndzLgkv7ZAvBN7JFOeilpKRkIySsT2T8ILcGdevTPwPtdKWauYPyJRW EVY+ejplrLDcVlykFP4vAzHJyVkpiB5fN9biYeu4bV48GWMpE8iGvgA+/eQBfavldDv3 6inQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=T30IeF+h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id c2-20020a056a00008200b006c320b98b74si12726340pfj.369.2023.11.22.08.58.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 08:58:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=T30IeF+h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 882B782E74F0; Wed, 22 Nov 2023 08:56:03 -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 S231948AbjKVQzM (ORCPT + 99 others); Wed, 22 Nov 2023 11:55:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231683AbjKVQzL (ORCPT ); Wed, 22 Nov 2023 11:55:11 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A0A9E7; Wed, 22 Nov 2023 08:55:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=llPqWm50yG2G6d8aUjmsaKhLgZNwnadcU3ZGNPGP+lo=; b=T30IeF+h3xKqGorWcA2viEmJQI cicKm1yi2ucxaziRj0Ucg4xy9HDqA2Keas9XgNJYNDZfYzbsBLGE04r2BSLEIY38Xsr3EbWMbAzZi Y4OyAwvkCrakYn9aASb8tH1ZnqO54/zroCc4004ZgMLtj029Y24Tw/rTlsQfZEuHUils=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1r5qV3-000tR4-Uf; Wed, 22 Nov 2023 17:54:53 +0100 Date: Wed, 22 Nov 2023 17:54:53 +0100 From: Andrew Lunn To: =?iso-8859-1?Q?K=F6ry?= Maincent 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: <04f59e77-134b-45b2-8759-84b8e22c30d5@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> <20231122171112.59370d21@kmaincent-XPS-13-7390> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231122171112.59370d21@kmaincent-XPS-13-7390> 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:56:03 -0800 (PST) > > > +static int pd692x0_sendrecv_msg(struct pd692x0_priv *priv, > > > + struct pd692x0_msg *msg, > > > + struct pd692x0_msg_content *buf) > > > +{ > > > + struct device *dev = &priv->client->dev; > > > + int ret; > > > + > > > + ret = pd692x0_send_msg(priv, msg); > > > + if (ret) > > > + return ret; > > > + > > > + ret = pd692x0_recv_msg(priv, msg, buf); > > > > So this function takes at least 10 seconds? > > No, on normal communication it takes a bit more than 30ms. So i think the first step is to refactor this code to make it clear what the normal path is, and what the exception path is, and the timing of each. > > > + msg.content.sub[2] = id; > > > + ret = pd692x0_sendrecv_msg(priv, &msg, &buf); > > > > So this is also 10 seconds? > > > > 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? How often does it happen? On the scale of its a theoretical possibility, through to it happens every N calls? Also, does it happen on cold boot and reboot? If its never supposed to happen, i would keep holding RTNL, and add a pr_warn() that the PSE has crashed and burned, waiting for it to reboot. If this is likely to happen on the first communication with the device, we might want to do a dummy transfer during probe to get is synchronized before we start using it with the RTNL held. Andrew