From patchwork Thu Mar 4 12:31:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Westerberg X-Patchwork-Id: 394140 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30EE3C43142 for ; Thu, 4 Mar 2021 12:34:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0B33864F3E for ; Thu, 4 Mar 2021 12:34:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240832AbhCDMdY (ORCPT ); Thu, 4 Mar 2021 07:33:24 -0500 Received: from mga12.intel.com ([192.55.52.136]:64927 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240808AbhCDMdS (ORCPT ); Thu, 4 Mar 2021 07:33:18 -0500 IronPort-SDR: Tj9kfYEfnWIZm6+7CBpaBMRwz71MZuzU11XnKrDgUXva/FFuYEKgLdW8gqAhnUQBuFIJPDLyFC PaBFVmx25gsQ== X-IronPort-AV: E=McAfee;i="6000,8403,9912"; a="166662653" X-IronPort-AV: E=Sophos;i="5.81,222,1610438400"; d="scan'208";a="166662653" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Mar 2021 04:31:33 -0800 IronPort-SDR: ly8Jdcv0Hl/ZhnrKFx+Y22W2mFysooOQBuqy8GrXrdZWmsK2wzcFZHy0BPzow5HmsrInS6MrBE +HnedhSBd/Vw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,222,1610438400"; d="scan'208";a="518641969" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga004.jf.intel.com with ESMTP; 04 Mar 2021 04:31:30 -0800 Received: by black.fi.intel.com (Postfix, from userid 1001) id BCE6650E; Thu, 4 Mar 2021 14:31:26 +0200 (EET) From: Mika Westerberg To: linux-usb@vger.kernel.org Cc: Michael Jamet , Yehezkel Bernat , Andreas Noever , Isaac Hazan , Mika Westerberg , Lukas Wunner , "David S . Miller" , Jakub Kicinski , netdev@vger.kernel.org Subject: [PATCH 14/18] net: thunderbolt: Align the driver to the USB4 networking spec Date: Thu, 4 Mar 2021 15:31:21 +0300 Message-Id: <20210304123125.43630-15-mika.westerberg@linux.intel.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210304123125.43630-1-mika.westerberg@linux.intel.com> References: <20210304123125.43630-1-mika.westerberg@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The USB4 networking spec (USB4NET) recommends different timeouts, and also suggest that the driver sets the 64k frame support flag in the properties block. Make the networking driver to honor this. Signed-off-by: Mika Westerberg --- drivers/net/thunderbolt.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/thunderbolt.c b/drivers/net/thunderbolt.c index 5c9ec91b6e78..9a6a8353e192 100644 --- a/drivers/net/thunderbolt.c +++ b/drivers/net/thunderbolt.c @@ -25,12 +25,13 @@ /* Protocol timeouts in ms */ #define TBNET_LOGIN_DELAY 4500 #define TBNET_LOGIN_TIMEOUT 500 -#define TBNET_LOGOUT_TIMEOUT 100 +#define TBNET_LOGOUT_TIMEOUT 1000 #define TBNET_RING_SIZE 256 #define TBNET_LOGIN_RETRIES 60 -#define TBNET_LOGOUT_RETRIES 5 +#define TBNET_LOGOUT_RETRIES 10 #define TBNET_MATCH_FRAGS_ID BIT(1) +#define TBNET_64K_FRAMES BIT(2) #define TBNET_MAX_MTU SZ_64K #define TBNET_FRAME_SIZE SZ_4K #define TBNET_MAX_PAYLOAD_SIZE \ @@ -1367,7 +1368,7 @@ static int __init tbnet_init(void) * the moment. */ tb_property_add_immediate(tbnet_dir, "prtcstns", - TBNET_MATCH_FRAGS_ID); + TBNET_MATCH_FRAGS_ID | TBNET_64K_FRAMES); ret = tb_register_property_dir("network", tbnet_dir); if (ret) {