From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by dpdk.org (Postfix) with ESMTP id 7845C2C18 for ; Wed, 18 Oct 2017 15:57:13 +0200 (CEST) Received: by mail-wm0-f68.google.com with SMTP id l68so10412995wmd.5 for ; Wed, 18 Oct 2017 06:57:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=RcnqJxnzcL6t4rNF63820nA78jQ13kujKfHna6x98lk=; b=DpJcAviSGY9Wz9yRYnUX4y2N5mVM9SGwSAklV/SOvkqanuFh5SIREghbbyX6DpO8qS yKs2vf3keQa7+UrbpwZqowAIaD+iajZ7Za/fP6olyljALYeOEIKXdzQYUVG+KDKGRV4+ QrJTfXKUtc3MTbHHrvJmtJznbqltFibpJxq8U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=RcnqJxnzcL6t4rNF63820nA78jQ13kujKfHna6x98lk=; b=ffEGHo96rVer19pk7KZqwmsclBwZ8wZco6x8D+JdTR1nyw0YSc6iBUYu7gjranGVFt IzXyd6F0AwIDbs8UhiY7gu8w9Ow6Fu8t9QN39qf7gkM8Q8i8nuPrddFzEodYg9ewW47F VlnZTWvHuVkV0ckPqoJeefxkbrDRC4OH8DdIe+DUF/HtzZMhLVoDaH6K183bAs0dg+Sx GngkHZv7LJwAU73XG0S888Vy2lCdSQf4YHt7ZqUduXx1/ELK28VEG+Hl80sqSzfzmvrR sUU6FUwXN0Q3MJIZ92TYRXrWrNAFDy8Imy2G9+z1fM1hsfZyaBbNR2zBIjI/p8XZnDc8 qhOg== X-Gm-Message-State: AMCzsaWhkPo8YnAq+Wln1fu28hfGafu/CjxsFP92il2L1PefFqhxzHdm KkUKp89qSbJdJksLCQA6vnc1p6ZxNlc43WfxjF+Itg== X-Google-Smtp-Source: ABhQp+SQmV45oIaS0oO5jzhf8Up23okpbK5cZbavxvIxRojl9f7gB4HZSFGns84UB0PLvhowp7zlJYZx8y5gGL9XCAU= X-Received: by 10.28.30.139 with SMTP id e133mr5997690wme.8.1508335033097; Wed, 18 Oct 2017 06:57:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.144.134 with HTTP; Wed, 18 Oct 2017 06:56:52 -0700 (PDT) In-Reply-To: <9041e0ef-2ec7-a448-0676-71c4b59b67c0@intel.com> References: <1508161628-4265-1-git-send-email-radoslaw.biernacki@linaro.org> <9041e0ef-2ec7-a448-0676-71c4b59b67c0@intel.com> From: Radoslaw Biernacki Date: Wed, 18 Oct 2017 15:56:52 +0200 Message-ID: To: "Hunt, David" Cc: dev@dpdk.org, stable@dpdk.org, alan.carew@intel.com, pablo.de.lara.guarch@intel.com Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-stable] [PATCH 1/2] power: switching to unbuffered stdio for /sys file access X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Oct 2017 13:57:13 -0000 Hi David, Thank you for comments. On 18 October 2017 at 12:33, Hunt, David wrote: > 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). > I apologise for missing checkpatch, seems that problems with my environment settings cause the silent output. Will never happen again. ---snip--- For the option of using open/write: yes, as you agreed with that, let me prepare V2 of those fixes.