lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 7 Feb 2019 16:28:46 +0200
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Mika Westerberg <mika.westerberg@...ux.intel.com>
Cc:     linux-kernel@...r.kernel.org,
        Michael Jamet <michael.jamet@...el.com>,
        Yehezkel Bernat <YehezkelShB@...il.com>,
        Andreas Noever <andreas.noever@...il.com>,
        Lukas Wunner <lukas@...ner.de>,
        "David S . Miller" <davem@...emloft.net>, netdev@...r.kernel.org
Subject: Re: [PATCH v2 21/28] thunderbolt: Add support for Display Port
 tunnels

On Wed, Feb 06, 2019 at 04:17:31PM +0300, Mika Westerberg wrote:
> Display Port tunnels are somewhat more complex than PCIe tunnels as it
> requires 3 tunnels (AUX Rx/Tx and Video). In addition we are not
> supposed to create the tunnels immediately when a DP OUT is enumerated.
> Instead we need to wait until we get hotplug event to that adapter port
> or check if the port has HPD set before tunnels can be established. This
> adds Display Port tunneling support to the software connection manager.

> +static int tb_tunnel_dp(struct tb *tb, struct tb_port *out)
> +{
> +	struct tb_cm *tcm = tb_priv(tb);
> +	struct tb_switch *sw = out->sw;
> +	struct tb_tunnel *tunnel;
> +	struct tb_port *in;
> +
> +	if (tb_port_is_enabled(out))
> +		return 0;
> +
> +	do {
> +		sw = tb_to_switch(sw->dev.parent);
> +		if (!sw)
> +			return 0;
> +		in = tb_find_unused_port(sw, TB_TYPE_DP_HDMI_IN);
> +	} while (!in);
> +
> +	tunnel = tb_tunnel_alloc_dp(tb, in, out);
> +	if (!tunnel) {
> +		tb_port_dbg(out, "DP tunnel allocation failed\n");

> +		return -EIO;

In the same way how you done for XDomains it makes sense to return here -ENOMEM.

> +	}
> +
> +	if (tb_tunnel_activate(tunnel)) {
> +		tb_port_info(out, "DP tunnel activation failed, aborting\n");
> +		tb_tunnel_free(tunnel);
> +		return -EIO;
> +	}
> +
> +	list_add_tail(&tunnel->list, &tcm->tunnel_list);
> +	return 0;
> +}

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ