Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp169655rdg; Thu, 12 Oct 2023 02:03:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFHXfBBb5aD47zIXHzR/HxbMI1jBN2Gt8iooge6c48aXwcTR0JXVzGcJY3r1O1Ie+t/Wf2V X-Received: by 2002:a05:6a00:849:b0:68e:2c2a:5172 with SMTP id q9-20020a056a00084900b0068e2c2a5172mr31157862pfk.6.1697101399138; Thu, 12 Oct 2023 02:03:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697101399; cv=none; d=google.com; s=arc-20160816; b=nCqSqLlMcupIiUdFRaJgvBTEFfwWilNvXowNrlycUk8OO3EdXcSuk3eDgWFFgO0a/3 m4/XZsPzYPU6dr6PNuRhhk7Up43gckELi/c5tWvZF8Z9+JrRVkdxreQog4JAUd5JD7QV pk4V/gM430dSvYa82Kj0dzhIWP8efcthg3jFI+7isHe0agZ05HlJhR0/k38/5UT/bbTb GPj+waOJDVR79UfoP7qzgz4EsFoo8Wie8W/3LAnMFUyVsFF/ZDsfCtoEZiBtGO2XxeQP MzfcdHf7y97l3YuPcoLMhHar+uE4HWjr35oi+R1z0xuPrHj5KeNpy7YrVZ2k3QVUG+lD p8HQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:content-transfer-encoding:mime-version :message-id:date:subject:from; bh=hDAMRfXRW0VyNj4B3KIRhRDLnhUWfVsYsA3AmVSlp1c=; fh=mcO6uPWa+EaE31BIxnnEPPB7Uowy5Tf+alts1RnogN0=; b=X3fOJUMH315d/EcKMh98Lid8XzP8V4fOMzqaYvEfPeJybyuvWLfjeKT5ia0S5dPmsb d7LDIx7RReYCFD3nSghujawXqDHGYF7NY28B3yoP2TqMQrRjgFVGdDjp6jwpCu2vKJp8 yS9Qk9kI9Tyj/WA4Ija66qVygI3uD7r3cAP5oWo7POlxX+MFh6jf2QTaAonzuUnfvwcL LTtemnQftKx9xqKw3c13QJDqC+NKgJ0g1cmTujVx2B48sW+oWHoSrsEcmrf4gJ7rfdJk IT473Kz0/iJ0fkXghA7dd9SB1s+SVB684Eu+S3CW6DduSh4nMY2Iy/moVa3rKBqVxQxQ Xt3g== 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:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id a11-20020a056a000c8b00b006933bf7aedbsi14704205pfv.285.2023.10.12.02.03.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 02:03:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id 33D0F8226AD9; Thu, 12 Oct 2023 02:03:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235457AbjJLJCu (ORCPT + 99 others); Thu, 12 Oct 2023 05:02:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235518AbjJLJCl (ORCPT ); Thu, 12 Oct 2023 05:02:41 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D4F4F3 for ; Thu, 12 Oct 2023 02:02:38 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qqraM-0000CH-Lr; Thu, 12 Oct 2023 11:02:26 +0200 Received: from [2a0a:edc0:0:1101:1d::39] (helo=dude03.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qqraK-0016dI-UL; Thu, 12 Oct 2023 11:02:24 +0200 Received: from localhost ([::1] helo=dude03.red.stw.pengutronix.de) by dude03.red.stw.pengutronix.de with esmtp (Exim 4.96) (envelope-from ) id 1qqral-00FyMl-11; Thu, 12 Oct 2023 11:02:24 +0200 From: Johannes Zink Subject: [PATCH net-next 0/5] net: stmmac: fix PPS input indexing Date: Thu, 12 Oct 2023 11:02:11 +0200 Message-Id: <20231010-stmmac_fix_auxiliary_event_capture-v1-0-3eeca9e844fa@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIABO2J2UC/x3NwQqDMBCE4VeRPTeQ2JN9lVLCmo51IW4liRIR3 72hx38O35yUkQSZHt1JCbtk+WoLd+sozKwfGHm3pt72d2edNbksCwc/SfW8VYnC6fDYocUHXsu WYMBT78BDGCZQg0bOMGNiDXOjdIuxjWtCM/7PT1IUo6iFXtf1A6TFhSSTAAAA To: Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Richard Cochran , Kurt Kanzenbach Cc: patchwork-jzi@pengutronix.de, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, Johannes Zink X-Mailer: b4 0.12.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: j.zink@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org 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 howler.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 (howler.vger.email [0.0.0.0]); Thu, 12 Oct 2023 02:03:12 -0700 (PDT) The stmmac can have 0 to 4 auxiliary snapshot in channels, which can be used for capturing external triggers with respect to the eqos PTP timer. Previously when enabling the auxiliary snapshot, an invalid request was written to the hardware register, except for the Intel variant of this driver, where the only snapshot available was hardcoded. Patch 1 of this series cleans up the debug netdev_dbg message indicating the auxiliary snapshot being {en,dis}abled. No functional changes here Patch 2 of this series fixes the PPS input indexing Patch 3 of this series removes a field member from plat_stmmacnet_data that is no longer needed Patch 4 of this series prepares Patch 5 by protecting the snapshot enabled flag by the aux_ts_lock mutex Patch 5 of this series adds a temporary workaround, since at the moment the driver can handle only one single auxiliary snapshot at a time. Previously the driver silently dropped the previous configuration and enabled the new one. Now, if a snapshot is already enabled and userspace tries to enable another without previously disabling the snapshot currently enabled: issue a netdev_err and return an errorcode indicating the device is busy. Best Regards Johannes To: Alexandre Torgue To: Jose Abreu To: "David S. Miller" To: Eric Dumazet To: Jakub Kicinski To: Paolo Abeni To: Maxime Coquelin To: Richard Cochran To: Kurt Kanzenbach Cc: patchwork-jzi@pengutronix.de Cc: netdev@vger.kernel.org Cc: linux-stm32@st-md-mailman.stormreply.com Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: kernel@pengutronix.de Signed-off-by: Johannes Zink --- Johannes Zink (5): net: stmmac: simplify debug message on stmmac_enable() net: stmmac: fix PPS capture input index net: stmmac: intel: remove unnecessary field struct plat_stmmacenet_data::ext_snapshot_num net: stmmac: ptp: stmmac_enable(): move change of plat->flags into mutex net: stmmac: do not silently change auxiliary snapshot capture channel drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 1 - drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c | 32 ++++++++++++++--------- drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h | 2 +- include/linux/stmmac.h | 1 - 4 files changed, 21 insertions(+), 15 deletions(-) --- base-commit: 21b2e2624d2ec69b831cd2edd202ca30ac6beae1 change-id: 20231010-stmmac_fix_auxiliary_event_capture-eaf21ea9c9fe Best regards, -- Johannes Zink