Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp4878516pjb; Mon, 27 Jul 2020 07:26:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVZWSp6TSqtM356MdlmNKRoulAsXLBKYCGsTDHr5FHop6QHo+kLW5sZ+2vOn2nF/oSTdzp X-Received: by 2002:a17:907:7202:: with SMTP id dr2mr14180833ejc.36.1595859970936; Mon, 27 Jul 2020 07:26:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595859970; cv=none; d=google.com; s=arc-20160816; b=0Ne5r5KmLrM+/W/v8M3T2Cldk0shUoqFejeUCGznSR2v+mI8sFiBdWcApx7880sDp/ buiUylnddSe1arz0oicT81MhAC3uIV0Xs7geNgIviUXz9DTfo9S8mHzmPIVW0v87Q9D6 yGGnWTIUOIDpR3w/qRhpPUrcq3KgIxvShz9RpE/mNr3XCCVoGvY4bnJvYPoV5rXD2zOC 4oFFCFNjUO/d3S4dEl/h/ampyfaRVpdMxYtFN+24Nn8beU5lotwlxENw/GAsN2ja5uU6 2SGsPsCUvWjkZz7sW4ltbYcIxwC3uCRr4zMF6SpM/+uXYmam3OA3oGhE3TzmvNBVmi/V AUdA== 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=1VbBq6lh2CRbfXZEFmq7qDGvsd3518r19Ypv0oZPfY0=; b=rP5cmtgtkyF4ox9m6lxdw9Axn9bDYiqiCHD848YJR3r/6jNWmsRSodxmBgjleilSvh gKqAsrEO3Wklw8Aw+lsSIxGY8lEnxfq3hladLVlqLaBsweyW8OBtuZVBBqRhoy1FbvjQ pNhIA8V/PYni9K2unceCam+5HUZsDwWT/qiOI2GGgZiWwq3wtyiWHT2R+mhx3/fdD+s6 zq+GEsMcvnmdlPT1iQEWKN70jggycX3Zn14YjaQxNTqDjHq2Yhj9r4j0yI+ymMIlEcSs pWv26CQcETSTJHxTSpx+Bx8UGe2GPLLLHyNn3zliTHkUp2ICcK4Es5ykHYDv1FldmFUQ 2GeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Srqe6jTM; 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 u24si2801076ejx.88.2020.07.27.07.25.48; Mon, 27 Jul 2020 07:26:10 -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=Srqe6jTM; 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 S1731898AbgG0OW3 (ORCPT + 99 others); Mon, 27 Jul 2020 10:22:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:51364 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731879AbgG0OWZ (ORCPT ); Mon, 27 Jul 2020 10:22:25 -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 C7B3B2173E; Mon, 27 Jul 2020 14:22:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595859745; bh=XJuEidlReUIBMXF0vMRweVd7zH9eejVPBgUWArVlU2U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Srqe6jTM2AQA3BvcN4nSlpeX10H2Pn2dGuD88LaOANSB/bTIskzUsi6ETAF0tP3/5 rh8lWh/E1NzILNLs0Tg4JX3cFNcja9Yz5CNM6eNl5W+s/8TJrDBkP81CKufCJc0/bx CakUNdJqV8Xcp/thPkAAK7aaqkVsj2kyx3UKsVUc= 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 5.7 058/179] net: dp83640: fix SIOCSHWTSTAMP to update the struct with actual configuration Date: Mon, 27 Jul 2020 16:03:53 +0200 Message-Id: <20200727134935.497840503@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200727134932.659499757@linuxfoundation.org> References: <20200727134932.659499757@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 ecbd5e0d685cf..acb0aae607558 100644 --- a/drivers/net/phy/dp83640.c +++ b/drivers/net/phy/dp83640.c @@ -1260,6 +1260,7 @@ static int dp83640_hwtstamp(struct mii_timestamper *mii_ts, 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: @@ -1267,6 +1268,7 @@ static int dp83640_hwtstamp(struct mii_timestamper *mii_ts, 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: @@ -1274,6 +1276,7 @@ static int dp83640_hwtstamp(struct mii_timestamper *mii_ts, 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: @@ -1281,6 +1284,7 @@ static int dp83640_hwtstamp(struct mii_timestamper *mii_ts, 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