From patchwork Fri Apr 5 23:55:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13619593 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-oa1-f42.google.com (mail-oa1-f42.google.com [209.85.160.42]) (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 B6247376F5 for ; Fri, 5 Apr 2024 23:55:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712361335; cv=none; b=MXj9MRGQZB4jJrvfMBJ73sVIE9KvPFOQVSqecX6IhMGcI04Q2Hf4V4Oi0XNS5EdkbOb6ppjTDNullIkXl40hu4NOP8WO8QEq4envW2fgEyhR89YRmw3cTO3wIK1gm4OFcArqv13kHeRVBQOrV2FNIvvHi/XStM92rUydcxHmd8c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712361335; c=relaxed/simple; bh=tMLDuYtychh33OOhY9BHQHX16boKULM8p0yu6v8K5O8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=WbD5ZpRfXFw2OJXLe80Fo1cyA6PiUKhbthPoMH2+rew6amLOCkxWRFElfBB0uGNaO7RwtaFzEje7fveSbq9CsjLI1iZAUWDgS6cVg5hqA3X4CSAebezUeOXVx3ulkHG0vWq9jZgRXzQmM/AQZfxOM2bFp4T5VOTMUE1rINE1r1w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=LbLdVrAh; arc=none smtp.client-ip=209.85.160.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="LbLdVrAh" Received: by mail-oa1-f42.google.com with SMTP id 586e51a60fabf-22ea24c9215so1487541fac.0 for ; Fri, 05 Apr 2024 16:55:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1712361333; x=1712966133; darn=vger.kernel.org; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=+PN+auHSkOKZUcIL1blqDd2MqE91KF9mTXcFFEvChwQ=; b=LbLdVrAh2wLrk4vbD7XXHS8HbXGEg7LJ58dOpskudj6Z/jzKEbAQPgfxQDRmQLRdRo 2hek1nUGHXXAAsHHWYEMzn79UsdZ0sY9S+FxbbSfw+PVe22nEMJnqFpGyln+dtko2+u8 BzntSJJOa1Oy1rHRsM2Or1J21h629FjNto14s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712361333; x=1712966133; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+PN+auHSkOKZUcIL1blqDd2MqE91KF9mTXcFFEvChwQ=; b=vRxpFFnwV0aTGNtHGgUFFjSDsOleJfhU89VaZfag6yk0W0+w3i2t7kUeQ+wJj0lR0p b6DxarswLCLaGQ5djuPkmlfYS4OLzaM6E2yxrisU1VqPOKrPs0TfwhpJ/KsvHz7okk2o 4tPmkVbaeL3a9R3z3rOBhzunwr7lJdiUQlwyRzHMrmv9qW+bErxSOX6AS78DVa8MlPoa qbobL3qWMoTrfmK4xSD+iyQe8qj3l8z+3rqcx16+6FR4rgQgEissg6PhgFYoXx3awUGD VdhQiXtbWdQY5BkkWU40bn4ByXg2o/3+cL2cVikd5iBoZIYWmHhNu9YQ6hLMjayoxdZq XVjg== X-Gm-Message-State: AOJu0YxkWR8u/r5bGLQLau/v8cxO8cr46SvIeCVS/d7Od8q3pcGmSma6 bAyKQ8smcZPzXxPfsxOIhg5IIWGwxAybILidrUG0HF0+TMaGig4C/ky5/tuYix0OwwK6Gs5tsTA = X-Google-Smtp-Source: AGHT+IHdUxKMn7mPnUdiH3boaEybH8WKkE9+sccxXuoISHV3/0qB41+/DNHuQVihiLYuytYKU+x89w== X-Received: by 2002:a05:6870:1609:b0:22e:9aec:e8fe with SMTP id b9-20020a056870160900b0022e9aece8femr2951964oae.47.1712361332617; Fri, 05 Apr 2024 16:55:32 -0700 (PDT) Received: from lvnvda5233.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id it24-20020a056a00459800b006ea81423c65sm2162078pfb.148.2024.04.05.16.55.31 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Apr 2024 16:55:32 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, pavan.chebbi@broadcom.com, andrew.gospodarek@broadcom.com, Kalesh AP Subject: [PATCH net 3/3] bnxt_en: Reset PTP tx_avail after possible firmware reset Date: Fri, 5 Apr 2024 16:55:13 -0700 Message-Id: <20240405235513.64668-4-michael.chan@broadcom.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20240405235513.64668-1-michael.chan@broadcom.com> References: <20240405235513.64668-1-michael.chan@broadcom.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Pavan Chebbi It is possible that during error recovery and firmware reset, there is a pending TX PTP packet waiting for the timestamp. We need to reset this condition so that after recovery, the tx_avail count for PTP is reset back to the initial value. Otherwise, we may not accept any PTP TX timestamps after recovery. Fixes: 118612d519d8 ("bnxt_en: Add PTP clock APIs, ioctls, and ethtool methods") Reviewed-by: Kalesh AP Signed-off-by: Pavan Chebbi Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 493b724848c8..57e61f963167 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -11758,6 +11758,8 @@ static int __bnxt_open_nic(struct bnxt *bp, bool irq_re_init, bool link_re_init) /* VF-reps may need to be re-opened after the PF is re-opened */ if (BNXT_PF(bp)) bnxt_vf_reps_open(bp); + if (bp->ptp_cfg) + atomic_set(&bp->ptp_cfg->tx_avail, BNXT_MAX_TX_TS); bnxt_ptp_init_rtc(bp, true); bnxt_ptp_cfg_tstamp_filters(bp); bnxt_cfg_usr_fltrs(bp);