Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp379416pxb; Mon, 25 Oct 2021 10:03:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2cHtm9nIBfw41J7kS3IW6Yo9RI8mvWwc4sv+dSvGgFYiOHNcZ7WHT5bqLZd5a0/eSqCsB X-Received: by 2002:a50:be81:: with SMTP id b1mr28364089edk.59.1635181398685; Mon, 25 Oct 2021 10:03:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635181398; cv=none; d=google.com; s=arc-20160816; b=bun2WKbKMhLrESpPaQ/31q+ra1lBA8mDGdpQCIrO0p1zvXLaUarXhStBgJzC4BSKRm U5Kcx2i9/ylFKH0g+3DEzL0p3i7fyb5TrTEmaPjKnDKO8InvZ9/6f2hERFmOC8f/uZPT vU0Jhd0EWsysEJtKP4uTi+NgNtcDeZxK8jmNBWu8HH1HgeVjye+pk8GBTNaYvDbob52Y fJ5Et88TUg2tOFnQMuvV17G1qGsxe2OFOBtQ2kmTiV5Zl3hGF42wNQ4QQ9+SmK34b9vg tpsAvdk8ZNBAlRrlgeG71jRiFh92pgWNs/tOY4SAjnwkL/pIWIyClnHkAjkb+sze35wv GKnQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/92mnUlD+D+ZhUFxFeArPKmBz5e0oUdu+tdPyGK6Ye0=; b=ZNqAB0xsfiN7DB26QJLkXrZLaljrcfbdX4l2LNKtpEd054iXzNtI3zKVwEdjmvvOKp FMPLSOw5lU6HPVi7irkj+RTHc4U0FGl0u6A276U4qulJfcCL9Z3Qy3Jz4f9iBjXftJYP dRisj4M/XK0oZiIBjHClPft29Bpr/yiZMQse3IEXOFG3qBW8LCsJtnjCO7UQbliq10wW fF0dVCHas/xvqw3mo6x4Ib08Mm39KrFITui5DY3gZ/gdJOxRxkdtau4omo6mvllOY4+q ID2dovofiK7So0xTxgUswLZCNbMYKltUpb4367fa0ZmKL2NiyZchXeetB2P/tXGIdVKF XUbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nanS7ujg; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qk34si16821909ejc.772.2021.10.25.10.02.50; Mon, 25 Oct 2021 10:03:18 -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=k20201202 header.b=nanS7ujg; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234181AbhJYRCU (ORCPT + 99 others); Mon, 25 Oct 2021 13:02:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:54638 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234169AbhJYRCO (ORCPT ); Mon, 25 Oct 2021 13:02:14 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8325060F22; Mon, 25 Oct 2021 16:59:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635181192; bh=7ws+I935y9f8B2ecOxeRyLCo+VOgQQB4j6S/b/0MAOE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nanS7ujgh2Gl2Wm2wIPD9s2fbUp7GvVrNj6dfQDrCNS/i+wIbf8XNFGEufLvW8+MO i1QedOhVr8cKBFJE45/c0MR9tOiYKUU9714olhbNIFpJ8Ro7w9XiWWwa+r2HigT+2G LmxOTcSOAAd93jtJU+j8MSJa0lYi3FrZBQ20aDadyBhc2kKR1vL5xbwWy3j8PnBjV6 uv6uhiBbkIdbgpN6SWXJq7yuZl8xqYEgThNGfpfVyS9ANxZB3dnujWAttFBBfCXrEK l4A7v9JC9fcCaQ52MPddOBwJ8+DK0qCl53JC7Gn9FKHq22P+gKg4o7IqYEKnH5/Hvn LySuoIKPewW+A== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Kele Huang , "David S . Miller" , Sasha Levin , richardcochran@gmail.com, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.14 06/18] ptp: fix error print of ptp_kvm on X86_64 platform Date: Mon, 25 Oct 2021 12:59:19 -0400 Message-Id: <20211025165939.1393655-6-sashal@kernel.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211025165939.1393655-1-sashal@kernel.org> References: <20211025165939.1393655-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kele Huang [ Upstream commit c2402d43d183b11445aed921e7bebcd47ef222f1 ] Commit a86ed2cfa13c5 ("ptp: Don't print an error if ptp_kvm is not supported") fixes the error message print on ARM platform by only concerning about the case that the error returned from kvm_arch_ptp_init() is not -EOPNOTSUPP. Although the ARM platform returns -EOPNOTSUPP if ptp_kvm is not supported while X86_64 platform returns -KVM_EOPNOTSUPP, both error codes share the same value 95. Actually kvm_arch_ptp_init() on X86_64 platform can return three kinds of errors (-KVM_ENOSYS, -KVM_EOPNOTSUPP and -KVM_EFAULT). The problem is that -KVM_EOPNOTSUPP is masked out and -KVM_EFAULT is ignored among them. This patch fixes this by returning them to ptp_kvm_init() respectively. Signed-off-by: Kele Huang Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/ptp/ptp_kvm_x86.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/ptp/ptp_kvm_x86.c b/drivers/ptp/ptp_kvm_x86.c index d0096cd7096a..4991054a2135 100644 --- a/drivers/ptp/ptp_kvm_x86.c +++ b/drivers/ptp/ptp_kvm_x86.c @@ -31,10 +31,10 @@ int kvm_arch_ptp_init(void) ret = kvm_hypercall2(KVM_HC_CLOCK_PAIRING, clock_pair_gpa, KVM_CLOCK_PAIRING_WALLCLOCK); - if (ret == -KVM_ENOSYS || ret == -KVM_EOPNOTSUPP) + if (ret == -KVM_ENOSYS) return -ENODEV; - return 0; + return ret; } int kvm_arch_ptp_get_clock(struct timespec64 *ts) -- 2.33.0