The time to reach point P in upward journey is $x$. The total time to reach maximum height is $\frac{v}{g}$. The ball takes equal time to come down from maximum height to point P. Hence, total time after point P is twice the time from $x$ to $\frac{v}{g}$. So, time taken to pass through point P again is: \[ 2\left(\frac{v}{g} - x\right) \]