My Mac mini exhibited exactly this problem - but I am posting because it turned out to be completely different, as did resolution.
I was using torrent app Transmission so in other words a large file was being written to my home-brew Fusion drive in a 2012 Mac mini. Transmission hung, and I restarted - and got the Yosemite hang as above. Symptoms were exactly as above (and I have the Samsung 840 SSD). Unfortunately, I could not boot in Safe Mode at all. I could get into Target Disk mode so took all the stuff off it I needed. I could also get to Recovery Mode OK and from that Disk Utility. Disk Utility could not do anything with the home-brew Fusion but I noticed that it was reporting the SSD was fine; it was the Apple HDD that had errors it couldn't fix, and by extension it could not fix the single logical drive. But, I also couldn't erase the drive (or install a fresh copy of Yosemite), and was wondering if I was going to have to take out the SSD (or at least disconnect it) and start again. (Sidebar: my Mac mini is out of warranty but adding the SSD voided it anyway; to get Apple to look at it in the worst-case scenario the SSD would need to be removed.)
But, I found this advice:
http://www.macworld.com/article/2015664/how-to-split-up-a-fusion-drive.html
Caution - this is destructive - i.e. it erases all data! Note also the bit about Target Disk mode and taking all the stuff off it!
Once I had done this (in Terminal, from cmnd-R Recovery Mode - Terminal is invoked from the menu bar) I went to Disk Utility which had flagged the two drives in red, like they were disassociated parts of a Fusion drive, and it offered to fix it, i.e. recombine them. (This erases them again but at this stage they are already erased so it should be academic.)
From that, I could do a Time Machine restore.
So, the upshot is:
If the advice about TRIM isn't working for you, it might be something else altogether.
Splitting up and recombining the logical Fusion drive worked for me. It is however a completely destructive process but my own experience is that Target Disk Mode works so if you do not have a back-up you are comfortable with check that first. A Time Machine restore is also very slow.
I am wondering about TRIM as I would appear to be front-and-center of the people likely to be affected by it, but Yosemite was until this working just fine for me, and it is again.
I hope this is of help to someone pulling their hair out because the advice above wasn't helping.