The gemara has a principal that one does not receive lashes for a la'av that can be fixed up through the performance of an aseh. Tosafos understands the mishna to be saying that one would receive malkus for taking a mill as a mashkon, since the mill contains 2 components, which are considered separate and independent parts regarding the violation. Tosafos asks, Why should one receive malkus at all since the rationale behind the prohibition is that these are ochel nefesh type items (meaning they are needed for his livelihood), so can potentially be fixed by returning them so that there should not be malkus associated with this violation at all? The proof that Tosafos cites for this being a לאו שניתק לעשה that one doesn't receive malkus for is the story quoted on 116a where a person took a shechita knife as collateral and Abaye commanded him to return it. Tosafos at first understands that the only rationale for returning the item would be that it is a לאו שניתק לעשה. Ultimately Tosafos concludes that it is not a לאו שניתק לעשה and the only reason that Abaye demanded that it be returned is that the lender didn't realize when he took it that it was assur, so that he was never ko'neh it as a mashkon, and therefore it had to be returned.
Regarding taking ochel nefesh type items as a mashkon, there is a machlokes rishonim. Tosafos 113 d.h. v'es, holds that any item that is needed for livelihood, may not be taken at all as collateral. However, the Maharsha quotes many rishonim who disagree with Tosafos and hold that it may be taken as collateral but must be returned when the borrower needs them to use for his livelihood. See also Hagahos HaGra on tosafos who quotes that the Ramban and Rashba hold that it may be taken but must be returned when needed, whereas the Ramabm agrees with Tosafos that it may not be taken at all. Now, the entire assumption of Tosafos that the reason abaye must have insisted on returning the ochel nefesh collateral was because it is a לאו שניתק לעשה, it lishatasam. Had Tosafos held like the Ramban and Rashba there would be no proof at all from the story of Abaye because abaye was merely telling the person that the standard rules of this type of mashkon is that it must be returned when the borrower needs it.
Tosafos also assumes that if we would say כל מילתא דעביד רחמנא אי עביד לא מהני then it would make sense that Abaye would demand returning the mashkon, since he wasn't allowed to take it, the taking was ineffective. There is a big discussion in achronim (chavos da'as and R' akiva eiger in hilchos shechita) whether אי עביד לא מהני applies when the issur won't be fixed. Meaning that אי עביד לא מהני may only apply when we say that by not taking effect the issur will not have been violated. Based on that principal, it is a big chiddush for tosafos to assume that אי עביד לא מהני would apply here. Even if the kinyan doesn't take effect, there is certainly some issur violated by taking an item of the borrower that should not be taken - if not for the issur of לא תחבול there would be an issur לא תגזול. Yet, Tosafos assumes that since אי עביד לא מהני would help avoid לא תחבול, even though it will cause לא תגזול, we can still apply this principal to prevent the lender form acquiring the collateral.