Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp4870297pjb; Mon, 27 Jul 2020 07:15:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQeDuSmtBrCYlI/3jDjfYr+KFmlPNyvDQzjeK0wn9pLQ7zVbb3mvSXCmgV/Zw6CghhR92X X-Received: by 2002:a50:fe18:: with SMTP id f24mr21537862edt.14.1595859338932; Mon, 27 Jul 2020 07:15:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595859338; cv=none; d=google.com; s=arc-20160816; b=lQGklxGuhdgqbrE3D4FdIu3GWFZnmE00m+jKZdIKvnxL4QkuGdqtmBa77vSHNHqRXh m5NkSnCtJ5wuklBhcKPVVvjieFSQuGf+NcNwuPC3CUEPFCkbvSE45JpxntX0aHxeqXr7 mr6II5Y460yyvp8OVaWD4bGA8MNlODwYL4Dpq0YQ9QT2SzWfwblhdaDq/VH6V8jX/wgr +3jzuOcct2pHpQwRxACZyXuDV5q+Y+sq0RI0WSWaASGphvg6xgw+gQpECyw4uh+Bu2EV SUOWvYm+8iN7ZBhvKJIUDOGQ4y8SFTESD47nI13pQ/TF42OoH4bvj6nHg3+gpUFFRFZH pa7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+SQMywYnUUQgRXLTBngerkcpq63TgI4kVPNEdvuTIOc=; b=EiITaax755QkjhDWRm2TX9v/Mi4RQnQj/8omKebkZ2803oAdMVFjZNHRgi0GaLjtoO /PxHw+GQRRJoswKyPaLDoWGlszJnEoJ4LxjwIzup3zpKfiSaxhUGyjU7wWNN1mofriAm bRxhHcehZZVzdussDFosieK/2HmxEcqf2UCByITXQEyqHtsuqLKCXCVwmj6BQpLK9r5a 51NIKUBq8nyfHdmD4Isx/kJzQFhVd+mqtwtYIj8hhL2HmsjsoW+svXo69JUgZrPM3KZ1 gBOA6YKuUtsE17u2qVvN6olnI6CFbh+bvUQybs46uMdtFqp1tA/RVJxe2j2AO1v/gTHT QWZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dmDvFDV9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bo4si5527478ejb.279.2020.07.27.07.15.15; Mon, 27 Jul 2020 07:15:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dmDvFDV9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729535AbgG0OL5 (ORCPT + 99 others); Mon, 27 Jul 2020 10:11:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:35714 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730066AbgG0OLv (ORCPT ); Mon, 27 Jul 2020 10:11:51 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 28975208E4; Mon, 27 Jul 2020 14:11:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595859110; bh=ARPaB4wAHglbbqJ4LINQxaTkNFe3SorSemUE1XOUsgI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dmDvFDV9DSEunlpX9XuogmyTlRqeak5KLKnJ0nRiz+AnhsL3Lrh3P5Zq8qqw0f1Fj EuFHt91OU6+ZevsqWze73K6PHJRd4ZDUbSOHYaIc+ISX27dhx7+OmiSkRT1NUdQHwL J0hmYrdYxX9gByHBi+eXqeLFg05YsD9UbAcTZ2FI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sergey Organov , Richard Cochran , Jakub Kicinski , Sasha Levin Subject: [PATCH 4.19 29/86] net: dp83640: fix SIOCSHWTSTAMP to update the struct with actual configuration Date: Mon, 27 Jul 2020 16:04:03 +0200 Message-Id: <20200727134915.910636778@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200727134914.312934924@linuxfoundation.org> References: <20200727134914.312934924@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sergey Organov [ Upstream commit 473309fb8372365ad211f425bca760af800e10a7 ] >From Documentation/networking/timestamping.txt: A driver which supports hardware time stamping shall update the struct with the actual, possibly more permissive configuration. Do update the struct passed when we upscale the requested time stamping mode. Fixes: cb646e2b02b2 ("ptp: Added a clock driver for the National Semiconductor PHYTER.") Signed-off-by: Sergey Organov Acked-by: Richard Cochran Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/phy/dp83640.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/phy/dp83640.c b/drivers/net/phy/dp83640.c index 4fed778331573..dd0a658c843d6 100644 --- a/drivers/net/phy/dp83640.c +++ b/drivers/net/phy/dp83640.c @@ -1343,6 +1343,7 @@ static int dp83640_hwtstamp(struct phy_device *phydev, struct ifreq *ifr) dp83640->hwts_rx_en = 1; dp83640->layer = PTP_CLASS_L4; dp83640->version = PTP_CLASS_V1; + cfg.rx_filter = HWTSTAMP_FILTER_PTP_V1_L4_EVENT; break; case HWTSTAMP_FILTER_PTP_V2_L4_EVENT: case HWTSTAMP_FILTER_PTP_V2_L4_SYNC: @@ -1350,6 +1351,7 @@ static int dp83640_hwtstamp(struct phy_device *phydev, struct ifreq *ifr) dp83640->hwts_rx_en = 1; dp83640->layer = PTP_CLASS_L4; dp83640->version = PTP_CLASS_V2; + cfg.rx_filter = HWTSTAMP_FILTER_PTP_V2_L4_EVENT; break; case HWTSTAMP_FILTER_PTP_V2_L2_EVENT: case HWTSTAMP_FILTER_PTP_V2_L2_SYNC: @@ -1357,6 +1359,7 @@ static int dp83640_hwtstamp(struct phy_device *phydev, struct ifreq *ifr) dp83640->hwts_rx_en = 1; dp83640->layer = PTP_CLASS_L2; dp83640->version = PTP_CLASS_V2; + cfg.rx_filter = HWTSTAMP_FILTER_PTP_V2_L2_EVENT; break; case HWTSTAMP_FILTER_PTP_V2_EVENT: case HWTSTAMP_FILTER_PTP_V2_SYNC: @@ -1364,6 +1367,7 @@ static int dp83640_hwtstamp(struct phy_device *phydev, struct ifreq *ifr) dp83640->hwts_rx_en = 1; dp83640->layer = PTP_CLASS_L4 | PTP_CLASS_L2; dp83640->version = PTP_CLASS_V2; + cfg.rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT; break; default: return -ERANGE; -- 2.25.1