All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] platform/x86/intel-uncore-freq: Return error on write frequency
@ 2023-04-18 15:32 Srinivas Pandruvada
  2023-04-19 13:35 ` Ilpo Järvinen
  2023-04-25 16:22 ` Hans de Goede
  0 siblings, 2 replies; 4+ messages in thread
From: Srinivas Pandruvada @ 2023-04-18 15:32 UTC (permalink / raw)
  To: hdegoede, markgross
  Cc: platform-driver-x86, linux-kernel, Srinivas Pandruvada, Zhang Rui,
	Wendy Wang

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 <srinivas.pandruvada@linux.intel.com>
Reviewed-by: Zhang Rui <rui.zhang@intel.com>
Tested-by: Wendy Wang <wendy.wang@intel.com>
---
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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] platform/x86/intel-uncore-freq: Return error on write frequency
  2023-04-18 15:32 [PATCH] platform/x86/intel-uncore-freq: Return error on write frequency Srinivas Pandruvada
@ 2023-04-19 13:35 ` Ilpo Järvinen
  2023-04-19 15:00   ` srinivas pandruvada
  2023-04-25 16:22 ` Hans de Goede
  1 sibling, 1 reply; 4+ messages in thread
From: Ilpo Järvinen @ 2023-04-19 13:35 UTC (permalink / raw)
  To: Srinivas Pandruvada
  Cc: hdegoede, markgross, platform-driver-x86, LKML, Zhang Rui,
	Wendy Wang

[-- Attachment #1: Type: text/plain, Size: 1459 bytes --]

On Tue, 18 Apr 2023, Srinivas Pandruvada wrote:

> 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 <srinivas.pandruvada@linux.intel.com>
> Reviewed-by: Zhang Rui <rui.zhang@intel.com>
> Tested-by: Wendy Wang <wendy.wang@intel.com>
> ---
> 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;
>  }

Shouldn't this have Fixes tag?

Other than that,

Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>


-- 
 i.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] platform/x86/intel-uncore-freq: Return error on write frequency
  2023-04-19 13:35 ` Ilpo Järvinen
@ 2023-04-19 15:00   ` srinivas pandruvada
  0 siblings, 0 replies; 4+ messages in thread
From: srinivas pandruvada @ 2023-04-19 15:00 UTC (permalink / raw)
  To: Ilpo Järvinen
  Cc: hdegoede, markgross, platform-driver-x86, LKML, Zhang Rui,
	Wendy Wang

On Wed, 2023-04-19 at 16:35 +0300, Ilpo Järvinen wrote:
> On Tue, 18 Apr 2023, Srinivas Pandruvada wrote:
> 
> > 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
> > <srinivas.pandruvada@linux.intel.com>
> > Reviewed-by: Zhang Rui <rui.zhang@intel.com>
> > Tested-by: Wendy Wang <wendy.wang@intel.com>
> > ---
> > 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;
> >  }
> 
> Shouldn't this have Fixes tag?
With the reorg of the directories, the blame commit is not what which
will be shown by "git blame". The original one is:

Fixes: 49a474c7ba51 ("platform/x86: Add support for Uncore frequency
control")

Didn't mark to stable that the current MSR write can't fail on
production systems.

> 
> Other than that,
> 
> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
> 
> 
Thanks,
Srinivas

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] platform/x86/intel-uncore-freq: Return error on write frequency
  2023-04-18 15:32 [PATCH] platform/x86/intel-uncore-freq: Return error on write frequency Srinivas Pandruvada
  2023-04-19 13:35 ` Ilpo Järvinen
@ 2023-04-25 16:22 ` Hans de Goede
  1 sibling, 0 replies; 4+ messages in thread
From: Hans de Goede @ 2023-04-25 16:22 UTC (permalink / raw)
  To: Srinivas Pandruvada, markgross
  Cc: platform-driver-x86, linux-kernel, Zhang Rui, Wendy Wang

Hi,

On 4/18/23 17:32, Srinivas Pandruvada wrote:
> 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 <srinivas.pandruvada@linux.intel.com>
> Reviewed-by: Zhang Rui <rui.zhang@intel.com>
> Tested-by: Wendy Wang <wendy.wang@intel.com>

Thank you for your patch, I've applied this patch to my review-hans 
branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans

Note it will show up in my review-hans branch once I've pushed my
local branch there, which might take a while.

Patches which are added to review-hans now are intended for
the next rc1. This branch will get rebased to the next rc1 when
it is out and after the rebasing the contents of review-hans
will be pushed to the platform-drivers-x86/for-next branch.

Regards,

Hans



> ---
> 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;
>  }
>  


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-04-25 16:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-18 15:32 [PATCH] platform/x86/intel-uncore-freq: Return error on write frequency Srinivas Pandruvada
2023-04-19 13:35 ` Ilpo Järvinen
2023-04-19 15:00   ` srinivas pandruvada
2023-04-25 16:22 ` Hans de Goede

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.