Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp5579635rwe; Tue, 18 Apr 2023 08:36:57 -0700 (PDT) X-Google-Smtp-Source: AKy350YSlyKmSuYP6l2e+xHTS8ziHqfr1DR2mh7HdU10iWamHMGg4HeePQ3pdNlIkpbp0fC3NzH9 X-Received: by 2002:a05:6a00:2352:b0:63d:3c39:ecc2 with SMTP id j18-20020a056a00235200b0063d3c39ecc2mr106357pfj.12.1681832216791; Tue, 18 Apr 2023 08:36:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681832216; cv=none; d=google.com; s=arc-20160816; b=e0xwWVPBeW6eyUYwbQUFSMc5FJZL8T0xZO2Dqui8AFm8LIsv6910nkcvn0H8FiPOWZ ODs1iVHUtg1uwgDivjaLPOfWgJBUzwCePsoKdlSUFpyDb3NDI2RcQNCoVOba7f+fbpM+ Cu3LS+IfVC3TFg5IWvyGUGy6oJFnnbUxZzDvBsabXtoFPuGN+U0WdAvRl9/TmSW7ppuR GdfUZjeVcKVQGpNrGrQEhlnC3XPikmzE10dOvkm+gn7OIeb6teOrNfvEtcrzbEqY0e6W VthmSOCui0c3vTCL/uQEglzXA16r1gEpeLa1wFS+AwjrQeUaKt+H8RT4DLRXpTCa3Vyu aTlQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=1DbsGxr9RrcbN+5/tSJdwQCZFxEx0W6+H9ip0PuRrxk=; b=xBrDZNOXBztdgdIG7f8Scb9TNASRjRlwFO5yNjcZrhjQCPqgIrtfOA3ax/OHkRhzgu 4GDTlrKG+ksd4/5oxGMBZV1Eq+bBryi20WB98H6XADwM7XWz9tcZvWXAHGYPkSPsmH5/ kwQGBUGIHe142cC83rqvSjVEsJ9T85pI60tAC75o/smOmEPXIi9Bj/8lfOTXKF1+tk3U 1TKX0cF6nnxTabE7LNFY0OcB/UBoEmmRqIflRNTnSvfQuES4CszJvX6R6U+HiPcQGnx+ Y1FJX8wqNcrweHmt9USsFrkBkVqk7s9SbrYF0Way1Bi7k55Oyua+taz/KLDmk6aARGMU i53w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=G2op57fs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 4-20020a630704000000b0051410c79705si1633242pgh.867.2023.04.18.08.36.43; Tue, 18 Apr 2023 08:36:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=G2op57fs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231338AbjDRPgI (ORCPT + 99 others); Tue, 18 Apr 2023 11:36:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231144AbjDRPgF (ORCPT ); Tue, 18 Apr 2023 11:36:05 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1082B13F8E; Tue, 18 Apr 2023 08:35:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681832132; x=1713368132; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=KfZPAkII450y6QsFRR+Dzs+dcuCUvr+EmFqzc6LmyAs=; b=G2op57fsXGyCIaYiFsNDSI9CJ+rH29bpeP3Ey5F3UM4+Z0qn/kC2baHz 2PTdndY5+humSIFYHGXvp2XhsC8YBpm2E17aN9ThvGCjoliHFfEyKxwHE bmnn+DzGitCqRO0zGal8Pd9QWXSAq4n/mt15Sz7mas32WDPXb96g97CSe 8ur2gCD4XiJUtvwf+nMYO/Vy0akAS0NmHqS4FLGwN3gwp+jyBa9cc/Y/r jcfryV5uNTOflhyhLLp0aCPeTPAb/sDfKOZKc5EyIQObF7gwrA2xQ9hLt ojbgttJ2hQBFnWlHmMf4Y3xSikuFoTHyCl7wcs1crcaSD6vTuVa8QhtZn g==; X-IronPort-AV: E=McAfee;i="6600,9927,10684"; a="324824948" X-IronPort-AV: E=Sophos;i="5.99,207,1677571200"; d="scan'208";a="324824948" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Apr 2023 08:32:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10684"; a="691151956" X-IronPort-AV: E=Sophos;i="5.99,207,1677571200"; d="scan'208";a="691151956" Received: from spandruv-desk.jf.intel.com ([10.54.75.8]) by orsmga002.jf.intel.com with ESMTP; 18 Apr 2023 08:32:32 -0700 From: Srinivas Pandruvada To: hdegoede@redhat.com, markgross@kernel.org Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Srinivas Pandruvada , Zhang Rui , Wendy Wang Subject: [PATCH] platform/x86/intel-uncore-freq: Return error on write frequency Date: Tue, 18 Apr 2023 08:32:30 -0700 Message-Id: <20230418153230.679094-1-srinivas.pandruvada@linux.intel.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently when the uncore_write() returns error, it is silently ignored. Return error to user space when uncore_write() fails. Signed-off-by: Srinivas Pandruvada Reviewed-by: Zhang Rui Tested-by: Wendy Wang --- This patch has no dependency on TPMI patches for uncore support. .../x86/intel/uncore-frequency/uncore-frequency-common.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c b/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c index cb24de9e97dc..fa8f14c925ec 100644 --- a/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c +++ b/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c @@ -44,14 +44,18 @@ static ssize_t store_min_max_freq_khz(struct uncore_data *data, int min_max) { unsigned int input; + int ret; if (kstrtouint(buf, 10, &input)) return -EINVAL; mutex_lock(&uncore_lock); - uncore_write(data, input, min_max); + ret = uncore_write(data, input, min_max); mutex_unlock(&uncore_lock); + if (ret) + return ret; + return count; } -- 2.38.1