Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3511826pxp; Tue, 8 Mar 2022 16:18:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJwyLcPc9jSzIgz40r1ZpCZ3aDcWksj1Jzu4PLiL/usmlsEQvKmCG2ohsgGcLROQk2yKtYK+ X-Received: by 2002:a17:902:e844:b0:151:f805:30ee with SMTP id t4-20020a170902e84400b00151f80530eemr8767328plg.33.1646785095404; Tue, 08 Mar 2022 16:18:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646785095; cv=none; d=google.com; s=arc-20160816; b=PGpblhKqAhtUhaIjbIo2sCpchB58L63dOmIaaEcICbrvWOiR9aiT0bFd55apHi0nw5 +ITMOBxtUzYUUcBboW1hSLsx/ayzY7jwyIJBbMh1iYw89jlbN9LDKX+yeVMSqXxZOvrk /eOU3WGHW2dWcGiaEsXPLMWtofQM+SoUHK7ALjdqb9Yl/6xXfH8tepTEk2hFBuvXKbMz FWnX73p+m5BCRfYC23KM55355ULzK9rcimLMZ4F7+OsJZTXhCDYwjEoalQuQdwStU/Pt D9pA44FpZP/8pQ6V7Gn6TFjeO+Qhuwz3FtHzxiZJFfhejKBO2EXerQ80HXWXdRkStI2j kbxQ== 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=FG9d9AQa90VpHPK3gi3B5dADoCRzSxnWl2+SRq8tFKs=; b=webivW27+upk+8FWGqCzFbWXvzb0pyrehlcMsYSahc0+tAy4hXq7DynEN8MrYROrZW tzx76KfimVzM+4XkNndJwrElv3YjO6Y+sVCriahsZ0F3En4qzpXsoms3qtxZKd5B8Wqv e1D62HuElWBIAX3/dy9CIbWZQBXxxCjx7GbxVWdaOJHmbTZ42ysQawMmeVUH90ae0bn4 6imLQsc2iEK67rS+b7Tl9qpFK1trGPvUs/cR2Kt/wtfTuok7rf0fsMhoOb2jxpCp1rrn 58THrCjoDNJ0s2JmhpVUD0uChjIvT9+SSBKamsmwG18vfK2ESFOWiD2002F15d2BKy4G fbPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b="KW0/9ZGY"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id e2-20020a636902000000b003802788ce55si294583pgc.835.2022.03.08.16.18.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 16:18:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b="KW0/9ZGY"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C3DADBAB92; Tue, 8 Mar 2022 15:44:00 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350407AbiCHVhM (ORCPT + 99 others); Tue, 8 Mar 2022 16:37:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232088AbiCHVhK (ORCPT ); Tue, 8 Mar 2022 16:37:10 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [185.16.172.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A18B054FAA; Tue, 8 Mar 2022 13:36:12 -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=FG9d9AQa90VpHPK3gi3B5dADoCRzSxnWl2+SRq8tFKs=; b=KW0/9ZGYCkYMYLQcraP8+6oofj eVm+h2/8WEuO0wGr5ofaK/fdf4Hf+aJNR4AxNrITORYe9SySewXnwvyiZWVMAEDRcKCQfe+wVfVpG 0ZKaINWGldkk8f2OzHvIBBSHPGTPgi/LePFH8yWuaJQzPMsSqr6jizWPTcf2CAY6Y7K8=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1nRhV3-009rWv-RP; Tue, 08 Mar 2022 22:36:09 +0100 Date: Tue, 8 Mar 2022 22:36:09 +0100 From: Andrew Lunn To: Horatiu Vultur Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, UNGLinuxDriver@microchip.com, davem@davemloft.net, kuba@kernel.org Subject: Re: [PATCH net-next] net: lan966x: Improve the CPU TX bitrate. Message-ID: References: <20220308165727.4088656-1-horatiu.vultur@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220308165727.4088656-1-horatiu.vultur@microchip.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 > static int lan966x_port_inj_ready(struct lan966x *lan966x, u8 grp) > { > - u32 val; > + unsigned long time = jiffies + usecs_to_jiffies(READL_TIMEOUT_US); > + int ret = 0; > > - return readx_poll_timeout_atomic(lan966x_port_inj_status, lan966x, val, > - QS_INJ_STATUS_FIFO_RDY_GET(val) & BIT(grp), > - READL_SLEEP_US, READL_TIMEOUT_US); > + while (!(lan_rd(lan966x, QS_INJ_STATUS) & > + QS_INJ_STATUS_FIFO_RDY_SET(BIT(grp)))) { > + if (time_after(jiffies, time)) { > + ret = -ETIMEDOUT; > + break; > + } Did you try setting READL_SLEEP_US to 0? readx_poll_timeout_atomic() explicitly supports that. Andrew