public inbox for linux-gpio@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gpio: amd-fch: Return 0-1 range for get operation
@ 2026-01-29 22:21 Rory Little
  2026-01-30  5:07 ` kernel test robot
  2026-01-30  6:03 ` kernel test robot
  0 siblings, 2 replies; 3+ messages in thread
From: Rory Little @ 2026-01-29 22:21 UTC (permalink / raw)
  To: Enrico Weigelt; +Cc: linux-gpio

Now that gpiochip_get sanitizes the output of these calls, this old
non-1 behavior was causing -EBADE to be returned when voltage high was
read.

Signed-off-by: Rory Little <rory@candelatech.com>
---
 drivers/gpio/gpio-amd-fch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-amd-fch.c b/drivers/gpio/gpio-amd-fch.c
index e6c6c3ec7656..37bf1842481d 100644
--- a/drivers/gpio/gpio-amd-fch.c
+++ b/drivers/gpio/gpio-amd-fch.c
@@ -125,7 +125,7 @@ static int amd_fch_gpio_get(struct gpio_chip *gc,
 	void __iomem *ptr = amd_fch_gpio_addr(priv, offset);
 
 	spin_lock_irqsave(&priv->lock, flags);
-	ret = (readl_relaxed(ptr) & AMD_FCH_GPIO_FLAG_READ);
+	ret = FIELD_GET(AMD_FCH_GPIO_FLAG_READ, readl_relaxed(ptr));
 	spin_unlock_irqrestore(&priv->lock, flags);
 
 	return ret;
-- 
2.52.0


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

* Re: [PATCH] gpio: amd-fch: Return 0-1 range for get operation
  2026-01-29 22:21 [PATCH] gpio: amd-fch: Return 0-1 range for get operation Rory Little
@ 2026-01-30  5:07 ` kernel test robot
  2026-01-30  6:03 ` kernel test robot
  1 sibling, 0 replies; 3+ messages in thread
From: kernel test robot @ 2026-01-30  5:07 UTC (permalink / raw)
  To: Rory Little, Enrico Weigelt; +Cc: oe-kbuild-all, linux-gpio

Hi Rory,

kernel test robot noticed the following build errors:

[auto build test ERROR on brgl/gpio/for-next]
[also build test ERROR on linus/master v6.19-rc7 next-20260129]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Rory-Little/gpio-amd-fch-Return-0-1-range-for-get-operation/20260130-063318
base:   https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git gpio/for-next
patch link:    https://lore.kernel.org/r/20260129222150.486419-1-rory%40candelatech.com
patch subject: [PATCH] gpio: amd-fch: Return 0-1 range for get operation
config: sparc-randconfig-002-20260130 (https://download.01.org/0day-ci/archive/20260130/202601301318.t7FyBGAS-lkp@intel.com/config)
compiler: sparc-linux-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260130/202601301318.t7FyBGAS-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202601301318.t7FyBGAS-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/gpio/gpio-amd-fch.c: In function 'amd_fch_gpio_get':
>> drivers/gpio/gpio-amd-fch.c:128:8: error: implicit declaration of function 'FIELD_GET' [-Werror=implicit-function-declaration]
     ret = FIELD_GET(AMD_FCH_GPIO_FLAG_READ, readl_relaxed(ptr));
           ^~~~~~~~~
   cc1: some warnings being treated as errors


vim +/FIELD_GET +128 drivers/gpio/gpio-amd-fch.c

   118	
   119	static int amd_fch_gpio_get(struct gpio_chip *gc,
   120				    unsigned int offset)
   121	{
   122		unsigned long flags;
   123		int ret;
   124		struct amd_fch_gpio_priv *priv = gpiochip_get_data(gc);
   125		void __iomem *ptr = amd_fch_gpio_addr(priv, offset);
   126	
   127		spin_lock_irqsave(&priv->lock, flags);
 > 128		ret = FIELD_GET(AMD_FCH_GPIO_FLAG_READ, readl_relaxed(ptr));
   129		spin_unlock_irqrestore(&priv->lock, flags);
   130	
   131		return ret;
   132	}
   133	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

* Re: [PATCH] gpio: amd-fch: Return 0-1 range for get operation
  2026-01-29 22:21 [PATCH] gpio: amd-fch: Return 0-1 range for get operation Rory Little
  2026-01-30  5:07 ` kernel test robot
@ 2026-01-30  6:03 ` kernel test robot
  1 sibling, 0 replies; 3+ messages in thread
From: kernel test robot @ 2026-01-30  6:03 UTC (permalink / raw)
  To: Rory Little, Enrico Weigelt; +Cc: llvm, oe-kbuild-all, linux-gpio

Hi Rory,

kernel test robot noticed the following build errors:

[auto build test ERROR on brgl/gpio/for-next]
[also build test ERROR on linus/master v6.19-rc7 next-20260129]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Rory-Little/gpio-amd-fch-Return-0-1-range-for-get-operation/20260130-063318
base:   https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git gpio/for-next
patch link:    https://lore.kernel.org/r/20260129222150.486419-1-rory%40candelatech.com
patch subject: [PATCH] gpio: amd-fch: Return 0-1 range for get operation
config: s390-randconfig-002-20260130 (https://download.01.org/0day-ci/archive/20260130/202601301319.Zm4jGCnY-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 9b8addffa70cee5b2acc5454712d9cf78ce45710)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260130/202601301319.Zm4jGCnY-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202601301319.Zm4jGCnY-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/gpio/gpio-amd-fch.c:128:8: error: call to undeclared function 'FIELD_GET'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     128 |         ret = FIELD_GET(AMD_FCH_GPIO_FLAG_READ, readl_relaxed(ptr));
         |               ^
   1 error generated.


vim +/FIELD_GET +128 drivers/gpio/gpio-amd-fch.c

   118	
   119	static int amd_fch_gpio_get(struct gpio_chip *gc,
   120				    unsigned int offset)
   121	{
   122		unsigned long flags;
   123		int ret;
   124		struct amd_fch_gpio_priv *priv = gpiochip_get_data(gc);
   125		void __iomem *ptr = amd_fch_gpio_addr(priv, offset);
   126	
   127		spin_lock_irqsave(&priv->lock, flags);
 > 128		ret = FIELD_GET(AMD_FCH_GPIO_FLAG_READ, readl_relaxed(ptr));
   129		spin_unlock_irqrestore(&priv->lock, flags);
   130	
   131		return ret;
   132	}
   133	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

end of thread, other threads:[~2026-01-30  6:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-29 22:21 [PATCH] gpio: amd-fch: Return 0-1 range for get operation Rory Little
2026-01-30  5:07 ` kernel test robot
2026-01-30  6:03 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox