Companies should not be allowed to hold patents
Intellectual property is created by people, not by companies. People may need the funding of companies to create, but they are the ones creating.
This whole patent mess is directly the cause of letting patents obey the law of the market. Remove patents from the market, and the mess goes away by itself.
So patents should be the sole right of the individuals that put their name on the patent. Only those individuals can decide who has the right to exploit the patent they have. Rights to the patent cannot be sold. Rights to exploit the patent cannot be sold without the express consent of the individuals who own the patent. When said individuals die, the patent lapses into the public domain.
Of course, that leaves the possibility of companies killing the individuals that hold a patent in order for it to fall into the public domain, but I think we already have enough laws to deal with that consequence.