From patchwork Sat Oct 22 07:27:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7600 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1106477wrr; Sat, 22 Oct 2022 01:38:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5BpyLNhLLgIvNneJ5Uo5rRHgSQhgdO/awQNvtbJJIWzmoAE22B9LOck2IDeM4Km3H5xWuq X-Received: by 2002:a17:90b:3505:b0:20d:2c35:9834 with SMTP id ls5-20020a17090b350500b0020d2c359834mr26580093pjb.122.1666427880266; Sat, 22 Oct 2022 01:38:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666427880; cv=none; d=google.com; s=arc-20160816; b=oJvoSRpTz8WEIOKoB2t+Fr14jaUx6+x3+xOBFWmFhYYoaZB1mPHX21hIJMR2JKfdt8 GcpP3nVolollETnxU7gzZ5n1PaZCRdxvD80x8oJBLrLqWeWFkxKpe6QMwMtbNh4+Xuhj 0NTL++ZKyFTbvlx65zEgsfrxWxiE+Vt+jo+2PHtHxuFNcEthu9fCRfiRTOUb7KrCdmKv WV4pKKNNEN4/RNJeSR21YThY04oa3wBYsK1W0t7b1pcyUMYZl4iBKxXowTOPp2WWWW0h tgDtbRNeS2hnDyPDD7OSDXwt3ZI3MS3C2HiMx7X8T/TZYrlpib1Zhg7jTy/6QAH3Tj+h lBFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=u95MpHAAfzf6FFlDZJUXEyDup8IeV4MZHMz1A7Ogets=; b=RMDuggx/kDfzvGLZlSH0K15DgXjYDrRB/sNi2OLX3CLw7euxVaF5SggCnyDG3Y1fJS tE9QKMMvr9SbQwFIuJ+GaSTgpSdPcOqfyeVVIyc7tAbRLqG4xm9MjT6KYTjFBlx9Kw9p fhYIc5Or/BS2NCkYgSDi8imGq18b0Oxm68i52FBTcDTeXFrIVxwT8f6zKT7oI8++nwmg H3JeFDs2dTpgjECuFMPa+x9ki6uokOtrMdQRR6icIH6DTazIjhHVqbl2bsNwttu3yuoW TIHJQ/ETYv5os11QBbzVYZzUUV/jeFoRIb0zPROQMDdQM0v3XzyxQFFmQFyY0NFoV8M7 VldA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="l5SH/0mm"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d8-20020a056a0024c800b005257035371bsi30145346pfv.108.2022.10.22.01.37.43; Sat, 22 Oct 2022 01:38:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="l5SH/0mm"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234145AbiJVIeI (ORCPT + 99 others); Sat, 22 Oct 2022 04:34:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234333AbiJVIa3 (ORCPT ); Sat, 22 Oct 2022 04:30:29 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D373225E8AF; Sat, 22 Oct 2022 01:02:29 -0700 (PDT) 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 ams.source.kernel.org (Postfix) with ESMTPS id F3325B82DF9; Sat, 22 Oct 2022 08:01:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16CD1C433C1; Sat, 22 Oct 2022 08:01:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666425689; bh=YHvVHIJX2HPHSLT4eGLhe20mkccL+miqWFxNvBZc7ac=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l5SH/0mmTH/Dpn543hWJ81AadoByAYOrBjbJBJWe1wSqiW1fDSRZOOlp4yvdk1Blt WG9+g0GJx+Y4v8KIigdB/vM2pYyxiO1Tavy4/FOgyCwVxikJSn6lkxm2JI2zsiTQpr trO16pYN9bPXioU/LDexY8c4KAx3f8NDED+x4M/A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Richard Cochran , Vadim Fedorenko , Michael Chan , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.19 583/717] bnxt_en: replace reset with config timestamps Date: Sat, 22 Oct 2022 09:27:42 +0200 Message-Id: <20221022072524.213297711@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747376280633129941?= X-GMAIL-MSGID: =?utf-8?q?1747376280633129941?= From: Vadim Fedorenko [ Upstream commit 8db3d514e96715c897fe793c4d5fc0fd86aca517 ] Any change to the hardware timestamps configuration triggers nic restart, which breaks transmition and reception of network packets for a while. But there is no need to fully restart the device because while configuring hardware timestamps. The code for changing configuration runs after all of the initialisation, when the NIC is actually up and running. This patch changes the code that ioctl will only update configuration registers and will not trigger carrier status change, but in case of timestamps for all rx packetes it fallbacks to close()/open() sequnce because of synchronization issues in the hardware. Tested on BCM57504. Cc: Richard Cochran Signed-off-by: Vadim Fedorenko Reviewed-by: Michael Chan Link: https://lore.kernel.org/r/20220922191038.29921-1-vfedorenko@novek.ru Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c index 8e316367f6ce..2132ce63193c 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c @@ -505,9 +505,13 @@ static int bnxt_hwrm_ptp_cfg(struct bnxt *bp) ptp->tstamp_filters = flags; if (netif_running(bp->dev)) { - rc = bnxt_close_nic(bp, false, false); - if (!rc) - rc = bnxt_open_nic(bp, false, false); + if (ptp->rx_filter == HWTSTAMP_FILTER_ALL) { + rc = bnxt_close_nic(bp, false, false); + if (!rc) + rc = bnxt_open_nic(bp, false, false); + } else { + bnxt_ptp_cfg_tstamp_filters(bp); + } if (!rc && !ptp->tstamp_filters) rc = -EIO; }