From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AFE76C6FA99 for ; Sat, 11 Mar 2023 00:38:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229645AbjCKAic (ORCPT ); Fri, 10 Mar 2023 19:38:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229706AbjCKAi3 (ORCPT ); Fri, 10 Mar 2023 19:38:29 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BC16F9EEF; Fri, 10 Mar 2023 16:38:27 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BBBCF61D5B; Sat, 11 Mar 2023 00:38:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BACB0C433EF; Sat, 11 Mar 2023 00:38:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678495106; bh=d9ekWnm/uAZDtQ6nx3R4q1sbibkqvgFUKQWut/P1z78=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=fyOqXarPUn6EGSSH6geMM5QnN0G4CVvd5Zhfr7stRqk+V/FoZNobW80/4fdfmQ64U tOR/+gMGOmRIMLAyVTZXN0lSp8KhO8SQK6KsLoUHhLPvL9yMxkFD387MzM35LUIWjF dYiEbtKGfm56MIGen5upwS+6Bpz6h7xJA2xGH5vSjP12pqIa2RX63KviLP/QexNRB6 a7FWkRWUXvMtQeGqH26vi3oVbeVwiTtwoZMWheDAvGDAxsiZHNTrvWJCizesK8xQSG rAap2H9d7oPrt/GDx1PLW+jtQ43WGoHJMMygE87AjD49wTNFDB4zyt5dTeaU4JhLXg HMJqQfPfe6OkQ== Date: Fri, 10 Mar 2023 16:38:24 -0800 From: Jakub Kicinski To: Horatiu Vultur Cc: , , , , , , , , Subject: Re: [PATCH net-next v3] net: phy: micrel: Add support for PTP_PF_PEROUT for lan8841 Message-ID: <20230310163824.5f5f653e@kernel.org> In-Reply-To: <20230307214402.793057-1-horatiu.vultur@microchip.com> References: <20230307214402.793057-1-horatiu.vultur@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, 7 Mar 2023 22:44:02 +0100 Horatiu Vultur wrote: > Lan8841 has 10 GPIOs and it has 2 events(EVENT_A and EVENT_B). It is > possible to assigned the 2 events to any of the GPIOs, but a GPIO can > have only 1 event at a time. > These events are used to generate periodic signals. It is possible to > configure the length, the start time and the period of the signal by > configuring the event. > Currently the SW uses only EVENT_A to generate the perout. > > These events are generated by comparing the target time with the PHC > time. In case the PHC time is changed to a value bigger than the target > time + reload time, then it would generate only 1 event and then it > would stop because target time + reload time is small than PHC time. > Therefore it is required to change also the target time every time when > the PHC is changed. The same will apply also when the PHC time is > changed to a smaller value. > > This was tested using: > testptp -L 6,2 > testptp -p 1000000000 -w 200000000 AFAICT enabling a new output will steal the event from the previous one. Is this normal / expected? Should you be checking if any output is active and refuse to enable another GPIO if so? Richard, does the patch look good to you?