Consider some movement along a path segment $s$ with constant acceleration/deceleration (see figure below). The initial speed is $v_0$ and the final speed is $v_1$. The constant acceleration is $a$ and the constant deceleration is $-a$.

So, to clarify, we know the values for $v_0$, $v_1$, $a$, and segment length $s_{t}$. We do not know the values for $v_x$, $t_x$, or $t_s$.
So for $t:[0,t_x]$ we have $v(t) = at + v_0$, and then at $t_x$ the acceleration switches to deceleration so we get $v_1$ at $t_s$ (the end of the path segment).
The ultimate goal is to find $t_s$, i.e., the time it takes to move along the entire segment.
One approach would be to find an expression for $v_x$ that lets me calculate
$$t_x = \frac{v_x - v_0}{a}$$
and
$$t_s = t_x + \frac{v_1 - v_x}{-a}.$$
But I am having trouble finding any expression that tells me the speed $v_x$ where the switch from acceleration to deceleration occurs.
I have tried solving the equation system
(1) $v(t) = at + v_0$
(2) $v(t) = -at + m$
with $m = -at_s + v_1$, which gives me
$$t_x = \frac{t_s}{2} + \frac{(v_1 - v_0)}{2a},$$
which substituted into (1) gives me
$$v_x = \frac{at_s + v_1 + v_0}{2}$$
but is dependent on $t_s$ which is the unknown I want to find.
I seem to be at a loss here and would appreciate any help whatsoever.
EDIT: Clarified what values are known.
UPDATE: I have realized that $v_x$ can be calculated from the fact that the segment length $s_t$ is known.
The equation
$$s(t) = \frac{a}{2}t^2 + v_0t$$
can be used in combination with the system of equations (1) and (2) above. If we start with (1) we get
$$t = \frac{v - v_0}{a},$$
which at $t_x$ becomes
$$t_x = \frac{v_x - v_0}{a}.$$
Substituting this into the equation for $s(t)$ we get the distance covered from $t=0$ to $t_x$ (referred to as $s_1$)
$$s_1 = \frac{a}{2}\left(\frac{v_x - v_0}{a}\right)^2 + v_0\left(\frac{v_x - v_0}{a}\right).$$
If we then look at (2) and consider $t_x=0$ we can write it as
$$v(t) = -at + v_x.$$
If we extract t from this equation we get
$$t = \frac{v_x - v}{a}.$$
This means that the time it takes to decelerate from $v_x$ to $v_1$ (referred to as $t_2$) is thus
$$t_2 = \frac{v_x - v_1}{a}.$$
Substituting this into the general equation for distance we get an expression for the deceleration distance, i.e., the distance covered from $t_x$ to $t_s$ (referred to as $s_2$)
$$s_2 = \frac{a}{2}\left(\frac{v_x - v_1}{a}\right)^2 + v_0\left(\frac{v_x - v_1}{a}\right).$$
Since the total segment length $s_t$ is known and it is the sum of the two parts
$$s_t = s_1 + s_2,$$
and $s_1$ and $s_2$ both only depend on $v_x$ we get an equation that has only one unknown, $v_x$, and can therefore be solved.
I have not tried solving it yet but unless I have done some fatal error, it should be straight forward.
UPDATE: The solution mentioned in the first update seems ok. If we set
$$s_t = s_1 + s_2$$
and solve for $v_x$ we get
$$v_x = \sqrt{as_t + \frac{v_0^2}{2} + \frac{v_1^2}{2}},$$
(which is the same expression as @narasimham mentioned in a comment to his answer).
This can be used in the approach mentioned at the top to get an analytic expression for $t_s$.
$$t_s = \frac{v_x - v_0}{a} + \frac{v_1 - v_x}{-a}$$ $$ = \frac{2v_x - v_0 - v_1}{a}$$ $$ = \frac{2\sqrt{as_t + \frac{v_0^2}{2} + \frac{v_1^2}{2}} - v_0 - v_1}{a}.$$
There is not enough information to solve the problem. The expression you have gives the difference in the length of the intervals $[t_0,t_x]$ and $[t_x,t_s]$, but we have no constraint on the sum. You could have $t_x=t_0$, so the particle starts decelerating immediately and decelerates until it reaches $v_1$. You can have $t_x$ any higher value, then the period of deceleration will increase by $t_x$ and you will arrive at the same final $v_1$