Is Solo 401k Contribution Specific to company it was started with, one company is profitable the other isn't, net SE income is negative?

I have two companies, one I file a schedule C for and is profitable. This is the company with which my solo 401k is attached. I have a second company that is an LLC, limited partnership, and it lost more money than the schedule C company, resulting in a negative net Self-employment income.

Can the contributions I made to my solo 401k, still be deducted since the contributions were made in a plan associated with my profitable business, or, does the fact that my overall net Self-Employment income is less than $18,000 mean that the contributions cannot be deducted?