When a piston cylinder system that evolves isothermally and quasistatically is irreversible?
If it is done quasi statically with friction involved and, if the system is in contact with a constant temperature bath at the initial system temperature T, then, for the same volume change, the change in entropy of the system will be the same.  That means that all the entropy generated as a result of frictional irreversibility will be transferred to the surroundings (the constant temperature bath).  This will be equal to the frictional work divided by the temperature T.  So the entropy of the universe will increase by this amount.