I have a Solo 401k, IRA and HSA - Can my contributions to all three combined exceed my earned income?

As mentioned in the subject, I am self-employed, have a solo 401k, I also have an HSA and IRA.

 

Turbotax allows me to contribute to the solo 401k and IRA up to my earned income (as it should). If I also add a contribution to my HSA it allows the deduction for this, however if I were to add up my 401k, IRA and HSA deductions they would exceed my total earned income (but not total income).


My question is: Is this correct and can I take a deduction for contributions to all three even if the total exceeds earned (self-employment) income?