From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id D6F711B624; Wed, 18 Oct 2017 12:33:59 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Oct 2017 03:33:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,396,1503385200"; d="scan'208";a="1207108717" Received: from dhunt5-mobl1.ger.corp.intel.com (HELO [10.237.220.44]) ([10.237.220.44]) by fmsmga001.fm.intel.com with ESMTP; 18 Oct 2017 03:33:56 -0700 To: Radoslaw Biernacki , dev@dpdk.org Cc: stable@dpdk.org, alan.carew@intel.com, pablo.de.lara.guarch@intel.com References: <1508161628-4265-1-git-send-email-radoslaw.biernacki@linaro.org> From: "Hunt, David" Message-ID: <9041e0ef-2ec7-a448-0676-71c4b59b67c0@intel.com> Date: Wed, 18 Oct 2017 11:33:56 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <1508161628-4265-1-git-send-email-radoslaw.biernacki@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Subject: Re: [dpdk-dev] [PATCH 1/2] power: switching to unbuffered stdio for /sys file access X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Oct 2017 10:34:00 -0000 Hi Radoslaw, On 16/10/2017 2:47 PM, Radoslaw Biernacki wrote: > This patch fixes the bug caused by improper use of buffered > stdio file access for switching the CPU frequency and > governor. Each write operation when using buffered stdio > must be flushed out and the return code from fflush() must > be verified. In buffered mode, write() syscall return value > is is not returned by fwrite()/fputs()/fprintf(). > Since with buffered approatch, fflush() need to be done > every time it is better to use unbuffered mode or not use > stdio at all (instead use plain open/write functions). To > minimize amount of changes this fix use first approach. > > Signed-off-by: Radoslaw Biernacki > --- > lib/librte_power/rte_power_acpi_cpufreq.c | 18 +++++++++++++++++- > 1 file changed, 17 insertions(+), 1 deletion(-) > > diff --git a/lib/librte_power/rte_power_acpi_cpufreq.c b/lib/librte_power/rte_power_acpi_cpufreq.c > index 01ac5ac..8bf5685 100644 > --- a/lib/librte_power/rte_power_acpi_cpufreq.c > +++ b/lib/librte_power/rte_power_acpi_cpufreq.c > @@ -143,12 +143,13 @@ set_freq_internal(struct rte_power_info *pi, uint32_t idx) > "for setting frequency for lcore %u\n", pi->lcore_id); > return -1; > } > + /* we use unbuffered mode so following will fail if kernel will refuse > + * freq setting */ Also, there's an issue with checkpatch on the comment here. Please make sure to run your patches through checkpatch. Typically a recent version of checkpatch should be used (4.1x). Rgds, Dave. ---snip---