Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp1660799pxy; Mon, 2 Aug 2021 07:17:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgxlOVHvg0ZY48QfOndbiVC1yjl4YtrzrP1uRVw4MUlwvbudqv5dg0UttCAm8+boPVuXRa X-Received: by 2002:a92:c547:: with SMTP id a7mr2479963ilj.237.1627913866587; Mon, 02 Aug 2021 07:17:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627913866; cv=none; d=google.com; s=arc-20160816; b=vQYeBvl4idE9ssF8K/GGu/s3nPFCY3pUbzQ+8HyDAYvrL4OpVYD6+uRDeVQXqmwURm Firg30+uMPT1MuGE4W+nxuhrjy8ln6bOPgyQZWhcEqoa2WHAFe55kwJfuQ3W9E8XDnQ4 YWPLq7ZH1vLaIFFtMMX9YFllRDdJhv12Hwgtyp+/3YPUFootw3X5FRX/3nf4BPqLUMDo /IDKrQrn+7kjpoR+fTOogq8KqlElyhX1Yq0MkNeWqApM+0U4Q3mIba5tAXF3P5AkosN1 76b7xMME1ShKOMxxJ8e4q4NrnMUBgtMvDBPVWJsShtC6MT6z8HLsV4Xd7EEI045RWELr wnwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zy5bmMKQ097iBeLL2kyOEJXh63a2hmD7lODydcPvvGc=; b=hbA/3NQ/H50k3Gv87+zdz/2XtVycTbUUtMDcZ9oFgsu+o/QimeZM0T5x/U54JNnrJA IfXk365vwO81wUg/hxpI+OxPoQ3z3CBr9zLqNFArSArFlgKDmH+ETmIXeaqG+ixTWJAG nOxE63hIaPYMOwW4exlnTHtEXbK9s5fhNGEPZeKkUOvjvrDZIshRyGzR7hSb0RQJGarA xd1u2ISZPd5a7e4JCOcK/MIeTg6T9gafF26CaUs7kF9SGjvp7wNXbCPW2tEH9kVW9OYh 0VLbXdSsnLMjA66YJFIC5VaL708LDq04R9s77+CpAXZOce/AnWNEFPnOjbmOtoetXD0U EsOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ytNpvXYt; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p19si12725496iov.90.2021.08.02.07.17.35; Mon, 02 Aug 2021 07:17:46 -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=@linuxfoundation.org header.s=korg header.b=ytNpvXYt; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237468AbhHBOPU (ORCPT + 99 others); Mon, 2 Aug 2021 10:15:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:47228 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236011AbhHBOEE (ORCPT ); Mon, 2 Aug 2021 10:04:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DD9C060FC2; Mon, 2 Aug 2021 13:57:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1627912653; bh=oGIDwrhQA59BqYIi+ujH1CmZIRsuETtH2fTIyuKm8dw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ytNpvXYtLFcism8Oj6pvQyiA3X7EPSL46ds+9QmOsdFfAP4sooOf3Wl+UHcNn9jyo 4mBDmxJwVE2eCccQfeu8LNsfBd5Y1xxnCSTudIRPIDpfSYlOmA0zDnFzq78PvH/g/s CWSlwE35uk7Tc3u5jUecY/cJ6ASdMJ9gqN8hTmro= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shannon Nelson , "David S. Miller" , Sasha Levin Subject: [PATCH 5.13 056/104] ionic: catch no ptp support earlier Date: Mon, 2 Aug 2021 15:44:53 +0200 Message-Id: <20210802134345.852801219@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210802134344.028226640@linuxfoundation.org> References: <20210802134344.028226640@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shannon Nelson [ Upstream commit f79eef711eb57d56874b08ea11db69221de54a6d ] If PTP configuration is attempted on ports that don't support it, such as VF ports, the driver will return an error status -95, or EOPNOSUPP and print an error message enp98s0: hwstamp set failed: -95 Because some daemons can retry every few seconds, this can end up filling the dmesg log and pushing out other more useful messages. We can catch this issue earlier in our handling and return the error without a log message. Fixes: 829600ce5e4e ("ionic: add ts_config replay") Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/pensando/ionic/ionic_lif.h | 7 ++----- drivers/net/ethernet/pensando/ionic/ionic_phc.c | 10 +++++++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.h b/drivers/net/ethernet/pensando/ionic/ionic_lif.h index af291303bd7a..69ab59fedb6c 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.h +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.h @@ -302,7 +302,7 @@ int ionic_lif_identify(struct ionic *ionic, u8 lif_type, int ionic_lif_size(struct ionic *ionic); #if IS_ENABLED(CONFIG_PTP_1588_CLOCK) -int ionic_lif_hwstamp_replay(struct ionic_lif *lif); +void ionic_lif_hwstamp_replay(struct ionic_lif *lif); int ionic_lif_hwstamp_set(struct ionic_lif *lif, struct ifreq *ifr); int ionic_lif_hwstamp_get(struct ionic_lif *lif, struct ifreq *ifr); ktime_t ionic_lif_phc_ktime(struct ionic_lif *lif, u64 counter); @@ -311,10 +311,7 @@ void ionic_lif_unregister_phc(struct ionic_lif *lif); void ionic_lif_alloc_phc(struct ionic_lif *lif); void ionic_lif_free_phc(struct ionic_lif *lif); #else -static inline int ionic_lif_hwstamp_replay(struct ionic_lif *lif) -{ - return -EOPNOTSUPP; -} +static inline void ionic_lif_hwstamp_replay(struct ionic_lif *lif) {} static inline int ionic_lif_hwstamp_set(struct ionic_lif *lif, struct ifreq *ifr) { diff --git a/drivers/net/ethernet/pensando/ionic/ionic_phc.c b/drivers/net/ethernet/pensando/ionic/ionic_phc.c index a87c87e86aef..6e2403c71608 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_phc.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_phc.c @@ -188,6 +188,9 @@ int ionic_lif_hwstamp_set(struct ionic_lif *lif, struct ifreq *ifr) struct hwtstamp_config config; int err; + if (!lif->phc || !lif->phc->ptp) + return -EOPNOTSUPP; + if (copy_from_user(&config, ifr->ifr_data, sizeof(config))) return -EFAULT; @@ -203,15 +206,16 @@ int ionic_lif_hwstamp_set(struct ionic_lif *lif, struct ifreq *ifr) return 0; } -int ionic_lif_hwstamp_replay(struct ionic_lif *lif) +void ionic_lif_hwstamp_replay(struct ionic_lif *lif) { int err; + if (!lif->phc || !lif->phc->ptp) + return; + err = ionic_lif_hwstamp_set_ts_config(lif, NULL); if (err) netdev_info(lif->netdev, "hwstamp replay failed: %d\n", err); - - return err; } int ionic_lif_hwstamp_get(struct ionic_lif *lif, struct ifreq *ifr) -- 2.30.2