Burq-Gérard-Tzvetkov [10] and Hu [26] established Lp estimates (2≤p≤∞) for the restriction of eigenfunctions to submanifolds. The estimates are sharp, except for the log loss at the endpoint L2 estimates for submanifolds of codimension 2. It has long been believed that the log loss at the endpoint can be removed in general, while the problem is still open. So this paper is devoted to the study of sharp endpoint restriction estimates for eigenfunctions in this case. Chen-Sogge [17] removed the log loss for the geodesics on 3-dimensional manifolds. In this paper, we generalize their result to higher dimensions and prove that the log loss can be removed for totally geodesic submanifolds of codimension 2. Moreover, on 3-dimensional manifolds, we can remove the log loss for curves with nonvanishing geodesic curvatures, and more general finite type curves. The problem in 3D is essentially related to Hilbert transforms along curves in the plane and a class of singular oscillatory integrals studied by Phong-Stein [35], Ricci-Stein [38], Pan [32], Seeger [40], Carbery-Pérez [15].