Article View: linux.kernel.netdev
Article #19939Re: [PATCH net v2 1/4] ptp: ocp: prevent timestamp rearming during detach
From: Vadim Fedorenko
Date: Fri, 20 Nov 2026 19:31
Date: Fri, 20 Nov 2026 19:31
40 lines
10660 bytes
10660 bytes
On 19/11/2026 23:46, Ahmad Byagowi wrote: > On Thu, 19 Nov 2026 at 22:23 UTC, Vadim Fedorenko wrote: >> enable() callback has to set PTP_PF_EXTTS function > > Thanks. I tested the cleanup path. Recording an assignment makes the core > disable that channel, but ptp_ocp exposes six timestamp channels and only > four SMA descriptors. TS0 is the internal GNSS source and TS5 is the PHC > source. All six can be enabled without pin assignments. Four descriptors > cannot record that state without rejecting requests or changing the pin > interface. extts_enable sysfs also reaches enable() without an assignment. Fair point. Pins are pins, time stampers are time stampers. We have to disable things which may trigger interrupts, the time stampers. > Would you and Richard prefer disabling all n_ext_ts channels in > ptp_disable_all_events(), followed by the existing PPS disable? That keeps > cleanup after posix_clock_unregister(), without inventing pin assignments. > I have prepared and tested that alternative locally, not posted it yet. Yes, it's better to make correct core PTP cleanup function. > > I also removed ptp_ocp's preliminary disable loop. Otherwise it can clear > pps_req_map while an in-flight enable subsequently rearms the hardware. > An overlapping sysfs/ioctl request can likewise leave an empty map with > the source enabled, so the final disable now always masks and drains an > empty PPS map. The shortcut remains while another subscription is active. > >> why do we need it now? > > The v2 teardown exception covered a disable that had cleared the map and > dropped the spinlock but had not yet completed synchronize_irq(). The > previous mutex version held its lock through the IRQ drain. This local > revision removes the stopping flag and its special-case condition: core > cleanup runs after active requests finish, and an empty map is disabled > and drained regardless of its prior value. Could you please keep more context while quoting? It's really hard to follow the conversation otherwise
Technical Details
Message-ID:
<75abd6c6-f0ee-4665-9451-05e0e1a7a3d7@linux.dev>Path:
mbox-mo1.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368104-linux-kernel-netdev=dewy.ruReferences:
<20261119-timecard-common-v2-078fe69f33-0-ahmadexp@gmail.com> <20261119-timecard-common-v2-078fe69f33-1-ahmadexp@gmail.com> <4e42134b-b017-4836-9772-9c1915b16e77@linux.dev> <20261119-timecard-common-v3-discussion-743fce65f675-ahmadexp@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368104-linux-kernel-netdev=dewy.ru From: vadim.fedorenko@linux.dev (Vadim Fedorenko) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net v2 1/4] ptp: ocp: prevent timestamp rearming during detach Date: Fri, 20 Nov 2026 19:31:39 +0000 Organization: Usenet Network Message-ID: <75abd6c6-f0ee-4665-9451-05e0e1a7a3d7@linux.dev> References: <20261119-timecard-common-v2-078fe69f33-0-ahmadexp@gmail.com> <20261119-timecard-common-v2-078fe69f33-1-ahmadexp@gmail.com> <4e42134b-b017-4836-9772-9c1915b16e77@linux.dev> <20261119-timecard-common-v3-discussion-743fce65f675-ahmadexp@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="3244815"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:WNN4UlMI1FtFP3JnluYgy/hQr+c= sha256:UJpCnrI+CyWPOYwm0pZfbpyt8SyMjy+2nVtuswTX8TU= sha1:95ggJH/k08yiP4bJ99NjyY9BCJ4= sha256:1XSDzBZSLd6Qc/Dfbges7Xflp3fdCT9/XoPfNPvGWWs= Content-Language: en-US List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id BBCB0115A5D; Fri, 20 Nov 2026 22:31:59 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.15 X-Spam-Status: No, score=-3.15 tagged_above=-9999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key) header.d=linux.dev X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TlPXnMX4M-GR; Fri, 20 Nov 2026 22:31:56 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-368104-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.dev X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id 5E06C115A43; Fri, 20 Nov 2026 22:31:47 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sto.lore.kernel.org (Postfix) with ESMTP id 551B460A81A; Fri, 20 Nov 2026 19:31:47 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795203105; b=zbleVyjUWiyxFPoMiANFz+MtQzk7AfXpfX20Dmkf3qXxSDyPz/zSxaFx32yl88q1cUqZ hmPxtYIFSJYaMUfvuU2mwQYqO+HJUBMSMpNB9PbU5ajww77TmxfMg75Gz2xdJWpsDJ1II fysYltLsyXlQSVO2Hq1sl1Dq6SZatRUrrU4Q7gIcq+oKIla7/zf3YclPfNFtVntYDtoYg jB1lJJbanjpfQ1GVxrbTuKn4tC0hbzb8yxg9c8yHJGgqppkLGb8Cl9e80LhukXZ+BpIbB PhFb7cQoUPETlaQ5Jw73PY5o+MNlqMyMlsY592k1BO9PUUj1qwpqCS0njw9eOT41T2A== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795203105; h=X-Original-To:Received:DMARC-Filter:X-Envelope-To:DKIM-Signature: X-Envelope-To:Received:X-Mizu-Trace-ID:X-Migadu-Flow:Message-ID:Date: X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version:User-Agent: Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=6RbebtAHkTMdks6JM7wkHkadnEvODndEkvce6tfdZEY=; b=QZ4qCtvN32JgXVtdfwyCXXTu0atEB1jculxjdhbH+mDdQALcOThhElOhqngbJjJ2pIx3 BTu5qyoDrFNRYXvMC0QqZRwLXDlAG2zvkTmsGDu9VC5WPFO2JF0UmpwJVFXGv5+fy1hq6 CDyf9+lFaWscXzVOBoZrvGU+LQDkRjZZCw8o+yUiO0y60AnJjWOEWcrS4SP1C6lG8D1qc NuihnUrWy6UtOCJbQyjOhLRtZJUrNbI5Pe8Ca0zil9gNfcMJcl+AS97IBftkncR6HuVcq WsapHDoyYgTeIe9/EZK8W5v6UrmORaF0MuJHdo4kTUxrsgIFhRgXGjh1Wvnkq67banA== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=htnx6rj+; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A2C96606A339; Fri, 20 Nov 2026 19:31:45 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=htnx6rj+ X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.107 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795203104; b=hT0+V74ao9+tFoI9ACvNXyy0iDOGSIsVpgfyIx4u+FQrSE+du0m+F5SeKBluYjsS6nSV j5/XuZ3TEPZh1VgNiO0GCHcOvyZz1/Fgix0+LQQYjvondshGOJmRirvcmAsEwBijfhEHy X3LyL9wZCNf6/UAigrTSmBBbFlic1qtWzgrVsuxnIFC7Dyf1yCiTeWhEgd2x7gfimglpk rlZrgtCLJMEahWgp5+/F8E/ZzWoZyDtAnQMkd7pUV5l+pSQA8orUDzxlfMSNsgc+WXjxG BBitQhCHZFr1JZVzj/WbvBFtVc5qL1POtGJ1XWymaleLPFk2zHAdZ/AEqF0h3MhpcZA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795203104; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:Message-ID:Date:MIME-Version:User-Agent: Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=6RbebtAHkTMdks6JM7wkHkadnEvODndEkvce6tfdZEY=; b=u8ydVqT6BlZNXO5M5EyW+wEZruILZgJRf0cH6hVaJSwB/w5gBGWmf0/+H4QsZ1HJKQsf UyjSj8O39EZPFe/LyqmBZyzkqes4pO/7Ds5e79k/iqsIyOUa1qetvKgvwkuchrykxThjU fiRCqnHxodr8o/tHPn/Nn8wOlHxMCoWPR9LwUurYFa1YZ5J2gDrZBWtOL1RqRubZD5ImI CbR35MpBI/zpHvB8MnYhIlwbqIzA7WtNFwpjkWQC+u69taxsmX8myPAfr8QiMxk8Yfjf9 AzRvdUkUnbDdW5WRApSDZM2iQo3ZQnCY9a+/gbdlweZKSVTuxXIAF362ngMduJcD2zQ== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=htnx6rj+; arc=none smtp.remote-ip=95.215.58.107 X-Received: from mta1.migadu.com (out-107.mta1.migadu.com [95.215.58.107]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7FB3E606A6FB for <netdev@vger.kernel.org>; Fri, 20 Nov 2026 19:31:42 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 7FB3E606A6FB X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Envelope-To: netdev@vger.kernel.org X-DKIM-Signature: a=rsa-sha256; bh=izg7P6nX8r6l2L2/vMBeLH7bUoHOPu29cSNO4TbXPZA=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1795203100; v=1; x=1795807900; b=htnx6rj++Rr7MErW+/1LYqfkFtO/SqmKnZ5qf9U7OR7hJsG7KXMU3dYXRZoSgpIhh4EQV73y /uk64wbp0asip9lUA+GMOKPHTzdqM/joOMhfoXzF55g8BxZu3xlJwuYltrO7uYh3L6t5llLytVy 3rWwC1NbKdYzP8I2LaJDx9Ww= X-Envelope-To: netdev@vger.kernel.org X-Received: by smtp.migadu.com with ESMTPS id 06043f85e0daad53; Fri, 20 Nov 2026 19:31:40 +0000 X-Mizu-Trace-ID: 06043f85e0daad53 X-Migadu-Flow: FLOW_OUT X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-User-Agent: Mozilla Thunderbird X-Cc: netdev@vger.kernel.org, Richard Cochran <richardcochran@gmail.com>, Andrew Lunn <andrew+netdev@lunn.ch>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com> X-In-Reply-To: <20261119-timecard-common-v3-discussion-743fce65f675-ahmadexp@gmail.com>