linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: linux-usb@vger.kernel.org
Cc: Michael Jamet <michael.jamet@intel.com>,
	Yehezkel Bernat <YehezkelShB@gmail.com>,
	Andreas Noever <andreas.noever@gmail.com>,
	Isaac Hazan <isaac.hazan@intel.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Lukas Wunner <lukas@wunner.de>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org
Subject: [PATCH 02/18] thunderbolt: Do not pass timeout for tb_cfg_reset()
Date: Thu,  4 Mar 2021 15:31:09 +0300	[thread overview]
Message-ID: <20210304123125.43630-3-mika.westerberg@linux.intel.com> (raw)
In-Reply-To: <20210304123125.43630-1-mika.westerberg@linux.intel.com>

There is only one user for this function and it passes the default
timeout to it anyway, so remove the parameter completely. This is also
needed in the subsequent patch where we allow connection manager
implementations to use different timeout for non-raw control channel
messages.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 drivers/thunderbolt/ctl.c    | 6 ++----
 drivers/thunderbolt/ctl.h    | 3 +--
 drivers/thunderbolt/switch.c | 2 +-
 3 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/thunderbolt/ctl.c b/drivers/thunderbolt/ctl.c
index 875922133782..b79be1f02d92 100644
--- a/drivers/thunderbolt/ctl.c
+++ b/drivers/thunderbolt/ctl.c
@@ -802,14 +802,12 @@ static bool tb_cfg_copy(struct tb_cfg_request *req, const struct ctl_pkg *pkg)
  * tb_cfg_reset() - send a reset packet and wait for a response
  * @ctl: Control channel pointer
  * @route: Router string for the router to send reset
- * @timeout_msec: Timeout in ms how long to wait for the response
  *
  * If the switch at route is incorrectly configured then we will not receive a
  * reply (even though the switch will reset). The caller should check for
  * -ETIMEDOUT and attempt to reconfigure the switch.
  */
-struct tb_cfg_result tb_cfg_reset(struct tb_ctl *ctl, u64 route,
-				  int timeout_msec)
+struct tb_cfg_result tb_cfg_reset(struct tb_ctl *ctl, u64 route)
 {
 	struct cfg_reset_pkg request = { .header = tb_cfg_make_header(route) };
 	struct tb_cfg_result res = { 0 };
@@ -831,7 +829,7 @@ struct tb_cfg_result tb_cfg_reset(struct tb_ctl *ctl, u64 route,
 	req->response_size = sizeof(reply);
 	req->response_type = TB_CFG_PKG_RESET;
 
-	res = tb_cfg_request_sync(ctl, req, timeout_msec);
+	res = tb_cfg_request_sync(ctl, req, TB_CFG_DEFAULT_TIMEOUT);
 
 	tb_cfg_request_put(req);
 
diff --git a/drivers/thunderbolt/ctl.h b/drivers/thunderbolt/ctl.h
index 97cb03b38953..2eafbfea5dff 100644
--- a/drivers/thunderbolt/ctl.h
+++ b/drivers/thunderbolt/ctl.h
@@ -124,8 +124,7 @@ static inline struct tb_cfg_header tb_cfg_make_header(u64 route)
 }
 
 int tb_cfg_ack_plug(struct tb_ctl *ctl, u64 route, u32 port, bool unplug);
-struct tb_cfg_result tb_cfg_reset(struct tb_ctl *ctl, u64 route,
-				  int timeout_msec);
+struct tb_cfg_result tb_cfg_reset(struct tb_ctl *ctl, u64 route);
 struct tb_cfg_result tb_cfg_read_raw(struct tb_ctl *ctl, void *buffer,
 				     u64 route, u32 port,
 				     enum tb_cfg_space space, u32 offset,
diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index 2a95b4ce06c0..218869c6ee21 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -1331,7 +1331,7 @@ int tb_switch_reset(struct tb_switch *sw)
 			      TB_CFG_SWITCH, 2, 2);
 	if (res.err)
 		return res.err;
-	res = tb_cfg_reset(sw->tb->ctl, tb_route(sw), TB_CFG_DEFAULT_TIMEOUT);
+	res = tb_cfg_reset(sw->tb->ctl, tb_route(sw));
 	if (res.err > 0)
 		return -EIO;
 	return res.err;
-- 
2.30.1


  parent reply	other threads:[~2021-03-04 12:34 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-04 12:31 [PATCH 00/18] thunderbolt: Align with USB4 inter-domain and DROM specs Mika Westerberg
2021-03-04 12:31 ` [PATCH 01/18] thunderbolt: Disable retry logic for intra-domain control packets Mika Westerberg
2021-03-04 12:31 ` Mika Westerberg [this message]
2021-03-04 12:31 ` [PATCH 03/18] thunderbolt: Decrease control channel timeout for software connection manager Mika Westerberg
2021-03-04 12:31 ` [PATCH 04/18] Documentation / thunderbolt: Drop speed/lanes entries for XDomain Mika Westerberg
2021-03-04 12:31 ` [PATCH 05/18] thunderbolt: Add more logging to XDomain connections Mika Westerberg
2021-03-04 12:31 ` [PATCH 06/18] thunderbolt: Do not re-establish XDomain DMA paths automatically Mika Westerberg
2021-03-04 12:31 ` [PATCH 07/18] thunderbolt: Use pseudo-random number as initial property block generation Mika Westerberg
2021-03-04 12:31 ` [PATCH 08/18] thunderbolt: Align XDomain protocol timeouts with the spec Mika Westerberg
2021-03-04 12:31 ` [PATCH 09/18] thunderbolt: Add tb_property_copy_dir() Mika Westerberg
2021-03-04 12:31 ` [PATCH 10/18] thunderbolt: Add support for maxhopid XDomain property Mika Westerberg
2021-03-04 12:31 ` [PATCH 11/18] thunderbolt: Use dedicated flow control for DMA tunnels Mika Westerberg
2021-03-04 12:31 ` [PATCH 12/18] thunderbolt: Drop unused tb_port_set_initial_credits() Mika Westerberg
2021-03-04 12:31 ` [PATCH 13/18] thunderbolt: Allow multiple DMA tunnels over a single XDomain connection Mika Westerberg
2021-03-04 12:31 ` [PATCH 14/18] net: thunderbolt: Align the driver to the USB4 networking spec Mika Westerberg
2021-03-04 12:31 ` [PATCH 15/18] thunderbolt: Add KUnit tests for XDomain properties Mika Westerberg
2021-03-04 12:31 ` [PATCH 16/18] thunderbolt: Add KUnit tests for DMA tunnels Mika Westerberg
2021-03-04 12:31 ` [PATCH 17/18] thunderbolt: Check quirks in tb_switch_add() Mika Westerberg
2021-03-04 12:31 ` [PATCH 18/18] thunderbolt: Add support for USB4 DROM Mika Westerberg
2021-03-18 15:30 ` [PATCH 00/18] thunderbolt: Align with USB4 inter-domain and DROM specs Mika Westerberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210304123125.43630-3-mika.westerberg@linux.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=YehezkelShB@gmail.com \
    --cc=andreas.noever@gmail.com \
    --cc=davem@davemloft.net \
    --cc=isaac.hazan@intel.com \
    --cc=kuba@kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=michael.jamet@intel.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).