netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: i40e: fix shifting error in i40e_led_get
@ 2013-12-19 21:57 Daniel Borkmann
  2013-12-19 22:04 ` Jeff Kirsher
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Borkmann @ 2013-12-19 21:57 UTC (permalink / raw)
  To: davem; +Cc: netdev, jeffrey.t.kirsher

In function i40e_led_get(), we fetch the LED mode from the GPIO
registers and extract it from gpio_val. However, regardless of
the outcome of the fetched value in gpio_val, the calculation
to extract the mode will always be 0, as we do the following:

  (gpio_val & (61440U /* 0xf << 12 */)) >> 17

Instead of I40E_GLGEN_GPIO_CTL_INT_MODE_SHIFT, we need to use
I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT to fix this.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
---
 Seems like this is still unfixed, so sending to netdev.

 drivers/net/ethernet/intel/i40e/i40e_common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index 1e4ea13..a170761 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -365,8 +365,8 @@ u32 i40e_led_get(struct i40e_hw *hw)
 		if (port != hw->port)
 			continue;
 
-		mode = (gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK)
-				>> I40E_GLGEN_GPIO_CTL_INT_MODE_SHIFT;
+		mode = (gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) >>
+		       I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT;
 		break;
 	}
 
-- 
1.8.3.1

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

* Re: [PATCH net] net: i40e: fix shifting error in i40e_led_get
  2013-12-19 21:57 [PATCH net] net: i40e: fix shifting error in i40e_led_get Daniel Borkmann
@ 2013-12-19 22:04 ` Jeff Kirsher
  2013-12-19 22:41   ` Daniel Borkmann
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Kirsher @ 2013-12-19 22:04 UTC (permalink / raw)
  To: Daniel Borkmann; +Cc: davem, netdev

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

On Thu, 2013-12-19 at 22:57 +0100, Daniel Borkmann wrote:
> In function i40e_led_get(), we fetch the LED mode from the GPIO
> registers and extract it from gpio_val. However, regardless of
> the outcome of the fetched value in gpio_val, the calculation
> to extract the mode will always be 0, as we do the following:
> 
>   (gpio_val & (61440U /* 0xf << 12 */)) >> 17
> 
> Instead of I40E_GLGEN_GPIO_CTL_INT_MODE_SHIFT, we need to use
> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT to fix this.
> 
> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
> ---
>  Seems like this is still unfixed, so sending to netdev.
> 
>  drivers/net/ethernet/intel/i40e/i40e_common.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Thanks Daniel, I may already have a patch in my queue that fixes this,
but if not, I will add this to my queue.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH net] net: i40e: fix shifting error in i40e_led_get
  2013-12-19 22:04 ` Jeff Kirsher
@ 2013-12-19 22:41   ` Daniel Borkmann
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Borkmann @ 2013-12-19 22:41 UTC (permalink / raw)
  To: Jeff Kirsher; +Cc: davem, netdev

On 12/19/2013 11:04 PM, Jeff Kirsher wrote:
> On Thu, 2013-12-19 at 22:57 +0100, Daniel Borkmann wrote:
>> In function i40e_led_get(), we fetch the LED mode from the GPIO
>> registers and extract it from gpio_val. However, regardless of
>> the outcome of the fetched value in gpio_val, the calculation
>> to extract the mode will always be 0, as we do the following:
>>
>>    (gpio_val & (61440U /* 0xf << 12 */)) >> 17
>>
>> Instead of I40E_GLGEN_GPIO_CTL_INT_MODE_SHIFT, we need to use
>> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT to fix this.
>>
>> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
>> ---
>>   Seems like this is still unfixed, so sending to netdev.
>>
>>   drivers/net/ethernet/intel/i40e/i40e_common.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> Thanks Daniel, I may already have a patch in my queue that fixes this,
> but if not, I will add this to my queue.

I reported that plus fix > 1 months ago, so I guess it seems not
yet in the queue. ;-)

Anyways, thanks Jeff!

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

end of thread, other threads:[~2013-12-19 22:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-19 21:57 [PATCH net] net: i40e: fix shifting error in i40e_led_get Daniel Borkmann
2013-12-19 22:04 ` Jeff Kirsher
2013-12-19 22:41   ` Daniel Borkmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).