From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 525A03A1CE2; Wed, 3 Dec 2025 16:58:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764781095; cv=none; b=FwOPnE+3DbALm+d4pK6UaeldZC+h2ViXOXY36nu29f/Fc8KIeupCSRVjqCo1DTBxj3qu8yQEUMYRGSy6GZ829PqFNZGBWxOpPB/TAeUnpqpVXiqN0QzYDy4/N3LTw+W2PGpQCqcof1D4BA7pZZ8p7EOyBULWXkl03a8HL8dJT0k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764781095; c=relaxed/simple; bh=QnadCWP0xw/9iILmHkE6eYbIRn4DL7/4ExjtyrqtLSI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZPHF8wS02FL/ER43z1rNJdzjuXyzRS74rVLp7A6mljZAcYck4ZVZCkeWS0ry+zdUKS/enAudsYFaydPv2M9avU5R/NvqrwEmcfVg5Bq4ilznHSSganUB3MdQ3qo+biaYQlfxLfyUDsp7ER1w2P6rCpVYxMN8wg2MJyKR/Pgj7U8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Kgo0eBZk; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Kgo0eBZk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B49D7C4CEF5; Wed, 3 Dec 2025 16:58:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1764781095; bh=QnadCWP0xw/9iILmHkE6eYbIRn4DL7/4ExjtyrqtLSI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Kgo0eBZkwSDJmaIWAG4/pRIPNtoWMsJyUgYhoV3UVc/Oyt1PqAo4Gi5sTdHl+Wljt n4HkRwy1xvWLz8QZnS860QYbBlFw9uTmRCr4bdMwcPv76OVv03UZQzw63inZks0se1 YkSRvWWaBdARf+OiDRPiVAwWdji0pjmtVA1utVNw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Wei Fang , Paolo Abeni , Sasha Levin Subject: [PATCH 6.6 20/93] net: fec: do not register PPS event for PEROUT Date: Wed, 3 Dec 2025 16:29:13 +0100 Message-ID: <20251203152337.258927319@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251203152336.494201426@linuxfoundation.org> References: <20251203152336.494201426@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Wei Fang [ Upstream commit 9a060d0fac9e75524f72864adec6d8cdb70a5bca ] There are currently two situations that can trigger the PTP interrupt, one is the PPS event, the other is the PEROUT event. However, the irq handler fec_pps_interrupt() does not check the irq event type and directly registers a PPS event into the system, but the event may be a PEROUT event. This is incorrect because PEROUT is an output signal, while PPS is the input of the kernel PPS system. Therefore, add a check for the event type, if pps_enable is true, it means that the current event is a PPS event, and then the PPS event is registered. Fixes: 350749b909bf ("net: fec: Add support for periodic output signal of PPS") Signed-off-by: Wei Fang Link: https://patch.msgid.link/20251125085210.1094306-5-wei.fang@nxp.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- drivers/net/ethernet/freescale/fec_ptp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/freescale/fec_ptp.c b/drivers/net/ethernet/freescale/fec_ptp.c index beb1d98fa741a..4bb894b5afcb9 100644 --- a/drivers/net/ethernet/freescale/fec_ptp.c +++ b/drivers/net/ethernet/freescale/fec_ptp.c @@ -719,8 +719,11 @@ static irqreturn_t fec_pps_interrupt(int irq, void *dev_id) fep->next_counter = (fep->next_counter + fep->reload_period) & fep->cc.mask; - event.type = PTP_CLOCK_PPS; - ptp_clock_event(fep->ptp_clock, &event); + if (fep->pps_enable) { + event.type = PTP_CLOCK_PPS; + ptp_clock_event(fep->ptp_clock, &event); + } + return IRQ_HANDLED; } -- 2.51.0