Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp4044856rwb; Sun, 9 Oct 2022 16:43:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4l6gqwZ+ElFswj3WUiJ3YPgjszt83iBfLcc/AA6saOH+gTNHJwPkTa7lx2nSr4o3dRUUd9 X-Received: by 2002:a05:6a00:23d3:b0:548:45c:4f9f with SMTP id g19-20020a056a0023d300b00548045c4f9fmr16963877pfc.62.1665358998463; Sun, 09 Oct 2022 16:43:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665358998; cv=none; d=google.com; s=arc-20160816; b=D1Cs1ZkAYNRVHfyBVlySJJ5DwVJQQX3r6nafx8Jv7/NV2HQ458SyWDJsj4rC0qYx3K tF5SmnvwIvx83t4EIp7VKpjQzboTtaA88CaK12syYFJ/gpClK59Es9R+WaPb4teQPAf6 hJyXcpiGhvI/CK1hH7Qxc/tXdaed4YS7duqAgWT6SWde49No4kah9tKvs8bu+1rDPPyw F0vtbMQJBDhkJcvcwcz7+3VZCxwskhfHAKXl6J3I/swrB6NRkHKXXdjRxo6GjW5YsiYu 676+nqYlR+gAAd3ALKwpuxm6p6/8WCxTO0cL2FtB/Cs62NFyWaDiSGU1uMZQ5J1u8s7L BYoQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=u95MpHAAfzf6FFlDZJUXEyDup8IeV4MZHMz1A7Ogets=; b=aqLFDOy4S4sKEhPPKkdl3WfAE2R0rmBG6Vh9UBUwvIbdYUzz8l1uym7yJ/YgkxHIph CCR4nRwk7GamAZyzeF3jPpCoJSxiruTjLxwS6BgC6bV6b9n0FpS9PuBUvsSdga9G0Irm 6XA5uC/d9NQm34gkdDokI1rqRGce00Gr1SrqrRlTQFCic991HWBead79LQvapQi4Jdkh A4XLYBJgvhTHL/vMQ3u+Fn8jVsWzr8ExlyTzjxz+0kM/afCxf5EjPD2NNXCMA+cvt2tX lCcxjsM3tnI00o6ZvWM+ldDuCEuVgde9Vbhv/qvaDuMaLOt1IPVT4ueYRaF0VfOA6Ny+ +rbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=chVjI7fL; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z15-20020a1709027e8f00b00176b3c7d158si8791502pla.99.2022.10.09.16.43.07; Sun, 09 Oct 2022 16:43:18 -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=@kernel.org header.s=k20201202 header.b=chVjI7fL; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231668AbiJIWYM (ORCPT + 99 others); Sun, 9 Oct 2022 18:24:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231704AbiJIWW7 (ORCPT ); Sun, 9 Oct 2022 18:22:59 -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 60761392; Sun, 9 Oct 2022 15:17:45 -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 0B502B80DEA; Sun, 9 Oct 2022 22:12:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9747EC43470; Sun, 9 Oct 2022 22:12:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665353546; bh=YHvVHIJX2HPHSLT4eGLhe20mkccL+miqWFxNvBZc7ac=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=chVjI7fLnK9Wm59MtGVvtZnWqtwQBqUUdnvNc+33OulBXSYk1tlV/TZvdjvcqW194 ejdfiSoKMwK9Pnj2yDLxRkIcQX3cd0gEY3U1niKBcJdHdyWuGmyIE7sFh0YkC7w+ES wx9jYDX7OK8o/l9LkclAUOeD09MUJ2cHQsRpiRCswk8RctWzMeSmPD1BOcY0/RC/e2 ylzbfjLqjE044i4XhglYW2upH967YxMaPUOyjN0uI70BPvuG1zPYu4rg9Bqz+oLq+5 3Y3bI2do8ozUIbrq9UWywTVkMef57W93TvZEUeHRGgT/4FQw5hF4+GyfFkmV4Sw/Qt JBuKkT45Bd4UA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Vadim Fedorenko , Richard Cochran , Michael Chan , Jakub Kicinski , Sasha Levin , davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 6.0 59/77] bnxt_en: replace reset with config timestamps Date: Sun, 9 Oct 2022 18:07:36 -0400 Message-Id: <20221009220754.1214186-59-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221009220754.1214186-1-sashal@kernel.org> References: <20221009220754.1214186-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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 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; } -- 2.35.1