Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1709641rdh; Tue, 26 Sep 2023 00:38:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEhRILuLjUlYkAhIhbu0PTKtio75URsyReXfsQAHUBkZdwV2806x1qttIpM7TS7iIs1BUxX X-Received: by 2002:a05:6a20:96d4:b0:15d:8857:79fb with SMTP id hq20-20020a056a2096d400b0015d885779fbmr8698832pzc.32.1695713894051; Tue, 26 Sep 2023 00:38:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695713894; cv=none; d=google.com; s=arc-20160816; b=W00KHqjDev8oD5rH8RRvYIwCIiPr4v5wVLsTs+EMuDmHtYXG/9PNzybzdKKiRkMSP6 sBvfgo8IgQ5X5u63Z0d4hMwprNfTMWnv1KU/35ZfYLsLh/4Jy8gNTyGOnnCguPVsD+HR HPr+3pTMsltcYrl6oJCRaKF57PHO9BGU2VqlgU0+5B3uJXo84ttEBr4+HewbXzIATtmm 11W4Z2Ku+8n6VEVRn3Y1Ezlrxy1Hjg2Dii7QEyo+7mCgsxkIOdIb/LVS3FYh0mtygN4G E+EqwFVN0/KamBiFO7bZw5ynd+jreso+z+vOfikgjmpZ/TuuRpgWCHhiUFEtIhqYy9on gvLQ== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=udBsh/RmJuLj6FPk0vjuikS3GmU9zkQcuKhb5mUD2C8=; fh=E3Crwe/jk3pXiAkF1DIrn0rx95xFblNFqHkxbuMFbrs=; b=d01nSo1hbaxRrPFiZ5jUK37heuVrnutkwgYsT+tt7jW5Ximk03yRo3iPRjnEVB/X2u upk0NwvKt4pUK0IQUfgijLjm27RVWJIl3+4j05lv77ok0nI2fX0iVLq/ZBc7P6/1rGf5 0d8ZPRNt3WYCA2+twuIQtyfK0VEWUc58jeys86QxOHrdhH23d8O03tfhuYWOgyaTua7S JEDZXRUPTtPhDP5Cb9VWNknPI+DpQbmn1WOBrPBSalP196PjzLc+WGALMIIkRwX3+1tf bMMiq9vnBfZKip+1+N7PLgYieaFlDD8MMJaoTE0/Pml4Y351zCMs6cssYaL5AFI/1VCC uMFg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id l4-20020a17090aaa8400b002777ca0d151si1013364pjq.165.2023.09.26.00.38.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 00:38:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 4A282826FB47; Tue, 26 Sep 2023 00:38:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233537AbjIZHhz (ORCPT + 99 others); Tue, 26 Sep 2023 03:37:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229617AbjIZHhx (ORCPT ); Tue, 26 Sep 2023 03:37:53 -0400 Received: from muru.com (muru.com [72.249.23.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DDDC8DC; Tue, 26 Sep 2023 00:37:46 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 2D61380A3; Tue, 26 Sep 2023 07:37:46 +0000 (UTC) Date: Tue, 26 Sep 2023 10:37:44 +0300 From: Tony Lindgren To: Sean Young Cc: Ivaylo Dimitrov , linux-media@vger.kernel.org, Russell King , Mauro Carvalho Chehab , Thierry Reding , Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= , Timo Kokkonen , Pali =?utf-8?B?Um9ow6Fy?= , "Sicelo A . Mhlongo" , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pwm@vger.kernel.org Subject: Re: [PATCH v5 2/2] media: rc: remove ir-rx51 in favour of generic pwm-ir-tx Message-ID: <20230926073744.GA5285@atomide.com> References: <99f0042f-538c-bcaf-96fd-bac24a87f88e@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Tue, 26 Sep 2023 00:38:01 -0700 (PDT) * Sean Young [230926 07:16]: > On Mon, Sep 25, 2023 at 07:06:44PM +0300, Ivaylo Dimitrov wrote: > > On 1.09.23 г. 17:18 ч., Sean Young wrote: > > > The ir-rx51 is a pwm-based TX driver specific to the N900. This can be > > > handled entirely by the generic pwm-ir-tx driver, and in fact the > > > pwm-ir-tx driver has been compatible with ir-rx51 from the start. > > > > > > > Unfortunately, pwm-ir-tx does not work on n900. My investigation shows that > > for some reason usleep_range() sleeps for at least 300-400 us more than what > > interval it is requested to sleep. I played with cyclictest from rt-tests > > package and it gives similar results - increasing the priority helps, but I > > was not able to make it sleep for less that 300 us in average. I tried > > cpu_latency_qos_add_request() in pwm-ir-tx, but it made no difference. > > > > I get similar results on motorola droid4 (OMAP4), albeit there average sleep > > is in 200-300 us range, which makes me believe that either OMAPs have issues > > with hrtimers or the config we use has some issue which leads to scheduler > > latency. Or, something else... > > The pwm-ir-tx driver does suffer from this problem, but I was under the > impression that the ir-rx51 has the same problem. > > > In either case help is appreciated to dig further trying to find the reason > > for such a big delay. > > pwm-ir-tx uses usleep_range() and ir-rx51 uses hrtimers. I thought that > usleep_range() uses hrtimers; however if you're not seeing the same delay > on ir-rx51 then maybe it's time to switch pwm-ir-tx to hrtimers. Maybe using fsleep() fixes this issue? See commit c6af13d33475 ("timer: add fsleep for flexible sleeping"), and Documentation/timers/timers-howto.rst. The long wake-up time for an idle state could explain the values. I think Ivaylo already tested with most cpuidle states disabled via sysfs though. > I don't have a n900 to test on, unfortunately. If you want one for development, the maemo folks cc:ed here likely have some available devices. Regards, Tony