From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dl1-f51.google.com (mail-dl1-f51.google.com [74.125.82.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9D476314A65 for ; Tue, 19 May 2026 16:19:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779207550; cv=none; b=k8tQUIOrULYia9D/g95yVwDlepyQGImJZFDZjbNDoxyAaADnJTns89cV5Y0qJgdYwrWMnAB6Wqs0H1ec99UeRCPz7YTgbftIIB067gomlK8EyI7eN0m0B8TqZKT2xAE8YopDsCYhSi5lPfFRSwn3D/MSwdgvjPYglLFiRzoX6yg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779207550; c=relaxed/simple; bh=V2cyGsvcEK1A9SLy9blLw02kY04LB0hI5Dbx6JNWWqE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Py2Grneq5NG5hnm+Z+7u/sQyRj7t+L3yXrc/NsCQAAng9DD5GQUOMI358oTtk8mduWh3MW47hJwDnuo7YqxjlBZEl/cLcPKZzlXRrmwiYnA7lYfrCVuF6m/f9nLEap/ATvR0tMk0XLjhp2mdqSmPiwVv+mp8qQnxBeTEaAZ5v4M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wbinvd.org; spf=pass smtp.mailfrom=wbinvd.org; dkim=pass (2048-bit key) header.d=wbinvd.org header.i=@wbinvd.org header.b=FEO8UiPp; arc=none smtp.client-ip=74.125.82.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wbinvd.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wbinvd.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wbinvd.org header.i=@wbinvd.org header.b="FEO8UiPp" Received: by mail-dl1-f51.google.com with SMTP id a92af1059eb24-12db2e415a7so1843104c88.1 for ; Tue, 19 May 2026 09:19:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wbinvd.org; s=wbinvd; t=1779207547; x=1779812347; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=khVqO4Z4rE2qwk5253J5JQWCckznW2vJhR2BBG4hqrU=; b=FEO8UiPpVqgun7PW9wMXbBtzIHkMgX+n8MdnBejqNXw4geIigtt1XydF2MLv9dSvqB A4ylLh6xucP0oiq3akYD6St2s92WZnGtv6kgvm76M3o4GCT0MUMAw87BIh03NUgvAnl4 7VjY6SA47Y/mCuQ/Hvd/289pWc8GV3tDwqrESsrvYE/i35dKezbLpwCjCh4aUbW5GSGA PFKafQY0r5+6KPfm2qTb5lelBMU4FjZAQgVEhKtkS6PngU/rK3bnTyEM8J4rsGWXrCj1 syxGNbRphulZdGbMfJ93ie4HaO53stnlOu1GCmTzCBbmhfa6vFtW9lLl4HHnH3g0AYt2 DrVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779207547; x=1779812347; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=khVqO4Z4rE2qwk5253J5JQWCckznW2vJhR2BBG4hqrU=; b=BOBRHjT/sCWQRtRUL3scFQ4ePr5UA85Hn6CV5w58q5EoKO5WyEPrluA3THh/mNbvQB wkDk9NbaPAgRTbcLc81UL2r/EqNYTxe1B/f8NRw3zLSgqawZNfqqZYJolutYohoOxRW3 EtvaaKM6pcWm6dpT/qj6uM4l80GIieCQTZet5gn7jEwrRef1zV8T++M8C/JM/CaQURLd xEGaJYt7DKnqljDqHNWZ5v2cxpQ4TobwbIEdDglM/VcTslz+MYTUFtR6qaxebQhfAOUG Kt5IaSSCrimszQBn+9tZd17c9w8laZN1YPXav2F3yvGhFKfT6m1x69F99hyduO86S02C uEjg== X-Forwarded-Encrypted: i=1; AFNElJ/BcrHHfXKGl8VueShqe4IAwS5xlpdv5caU+HpzAPgdKFzXiUnKHDucwDvRczkj1lozyJqWYo5eJAmy9zU=@vger.kernel.org X-Gm-Message-State: AOJu0YytfPFH2iHJ25CXZxzwKDTSOWASXQGKcO68ezrCYfFyZ7rqyuk5 /ym8dMBfABBIQ3Lu4vyuNzKRGC/Q8F0O7W9hndcY/kzWS4bWFvmLxuP3y18+SsFLih2REaEOD9G VAkIL X-Gm-Gg: Acq92OHqHH5oFd/8iVsr6BSMkcz6JX6Y7In1L9gfkyZk5VucNdKA6BbmJY0rbxIUuK0 G2+LeoEDS7V6BsZtfnDzMnQ2noSIuC2X6a04evSIZPf/K3kqI0u+tzHocLhEMXxUWWOxA3UN0JQ ES/vVrw94uKB11QC7oZsOdvaJKGMryYX8iMiyomZN1UvufpAjjO6yLsrLkvzDhqPcw1NBkliNE/ SASM2yG1Aq2m9dRoeEcaaS8lX1V0UPZjPOl0/AeNv+J7jCzRd0oYFXzzSAXVjc9rOYm05zMLz2A 1dkXt6uaQeCtbA6J+pjdWhHkJg/qSiAIryyO/ccTEiAIwosGFmWl45ZLDik/PIhK5YruF4lHAnn OXNHuS6pGyQ+yU4JJWHFttsl1oO14Ez5aODxJrg5Lqp/URdjI+VFDamM6+NDghi4HWXz/4fWKJB 198HbeCFQyYMjRzDwta8zhbKH7cg== X-Received: by 2002:a05:7022:60b:b0:134:feba:3b7 with SMTP id a92af1059eb24-13504945c88mr9493469c88.31.1779207546533; Tue, 19 May 2026 09:19:06 -0700 (PDT) Received: from mozart.vkv.me ([2001:5a8:468b:d015:607b:660e:b0bc:f251]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-30293e2e69esm21132953eec.1.2026.05.19.09.19.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2026 09:19:06 -0700 (PDT) Date: Tue, 19 May 2026 09:19:03 -0700 From: Calvin Owens To: Michael Byczkowski Cc: Rodolfo Giometti , Andrew Morton , linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org, bigeasy@linutronix.de Subject: Re: [PATCH v5 0/3] pps: improve PREEMPT_RT performance Message-ID: References: <719A31CE-CA58-45C3-A013-1BFE81F724C5@by-online.de> <5FDC46CF-4F8F-4E85-9E59-B796C5BF1194@by-online.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <5FDC46CF-4F8F-4E85-9E59-B796C5BF1194@by-online.de> On Saturday 05/16 at 13:32 +0200, Michael Byczkowski wrote: > > On 25. Apr 2026, at 19:18, Michael Byczkowski wrote: > > > > I found three issues in the PPS subsystem that cause unnecessary jitter > > under PREEMPT_RT, while being fully backward-compatible with non-RT > > kernels: > > > > 1. pps-gpio: The IRQ handler is force-threaded on PREEMPT_RT, so the > > PPS timestamp is captured after scheduling delay rather than at > > interrupt entry. Fix: split into a hardirq primary handler (captures > > timestamp only) and a threaded handler (processes the event). > > > > 2. pps_device.lock: spinlock_t becomes a sleeping mutex on PREEMPT_RT, > > allowing pps_event() to be preempted mid-update. Fix: convert to > > raw_spinlock_t and move sleeping calls out of the critical section. > > > > 3. pps_kc_hardpps_lock: Same issue as (2), in the kernel consumer path > > that calls hardpps(). Fix: convert to DEFINE_RAW_SPINLOCK. > > > > All three patches are tested on a Raspberry Pi 5 running a 7.0.0-rc6 > > PREEMPT_RT kernel. On non-RT kernels there is zero behavioral change. > > > > Signed-off-by: Michael Byczkowski > > Acked-by: Rodolfo Giometti > > Tested-by: Michael Byczkowski > > > > by (3): > > pps: pps-gpio: split IRQ handler into hardirq and threaded parts > > pps: convert pps_device lock to raw_spinlock for PREEMPT_RT > > pps: convert pps_kc_hardpps_lock to raw_spinlock for PREEMPT_RT > > > > drivers/pps/clients/pps-gpio.c | 37 +++++++++++++++++++++++----------- > > drivers/pps/kapi.c | 18 ++++++++++------- > > drivers/pps/kc.c | 22 ++++++++++---------- > > drivers/pps/pps.c | 16 +++++++-------- > > include/linux/pps_kernel.h | 2 +- > > 5 files changed, 56 insertions(+), 39 deletions(-) > > > > -- > > 2.47.3 > > Gentle ping on this series. v4 patches 1/3 and 3/3 carried Rodolfo's > Acked-by; v5 addressed the remaining feedback on 2/3. Happy to rework > anything or split the series if that helps it move forward. Unfortunately apple mail is corrupting your patches :/ Greg KH usually applies patches for drivers/pps/, but I didn't add him here yet because the patches don't apply. If you can point me at a git branch for v5, I'd be happy to re-send the patches myself with your authorship. This is all useful for me and I'd like to help :) If you do it yourself, just make sure to add Greg to the Cc: list. Cheers, Calvin > Adding linux-rt-users@ and Sebastian on Cc in case there's interest from the > PREEMPT_RT side.