linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] rtlwifi: Fix some errors in recent patches
@ 2019-09-03  1:18 Larry Finger
  2019-09-03  1:18 ` [PATCH 1/3] rtlwifi: rtl8821ae: Fix incorrect returned values Larry Finger
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Larry Finger @ 2019-09-03  1:18 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless, pkshih, Larry Finger

When formuating the patches that converted the GET_XXX macros that read
RX and TX descriptor values, I made all of them return "int" values,
Unfortunately, the resulting inline routines must return unsigned values
when all 32-bits are returned as these entities are frequently addresses.

Although I have submitted fixes for several drivers, only 3 are affected
as the problem caused failures that led me to the problem.

Fortunately, none of these faulty changes will reach mainline until 5.4,
thus most users will not be affected until 5.4-rc1.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>

Larry Finger (3):
  rtlwifi: rtl8821ae: Fix incorrect returned values
  rtlwifi: rtl8188ee: Fix incorrect returned values
  rtlwifi: rtl8192ce: Fix incorrect returned values

 drivers/net/wireless/realtek/rtlwifi/rtl8188ee/trx.h | 14 +++++++-------
 drivers/net/wireless/realtek/rtlwifi/rtl8192ce/trx.h |  6 +++---
 drivers/net/wireless/realtek/rtlwifi/rtl8821ae/trx.h | 10 +++++-----
 3 files changed, 15 insertions(+), 15 deletions(-)

-- 
2.16.4


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

* [PATCH 1/3] rtlwifi: rtl8821ae: Fix incorrect returned values
  2019-09-03  1:18 [PATCH 0/3] rtlwifi: Fix some errors in recent patches Larry Finger
@ 2019-09-03  1:18 ` Larry Finger
  2019-09-03 13:34   ` Kalle Valo
  2019-09-03  1:18 ` [PATCH 2/3] rtlwifi: rtl8188ee: " Larry Finger
  2019-09-03  1:18 ` [PATCH 3/3] rtlwifi: rtl8192ce: " Larry Finger
  2 siblings, 1 reply; 5+ messages in thread
From: Larry Finger @ 2019-09-03  1:18 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless, pkshih, Larry Finger

In commit bd421dab7515 ("rtlwifi: rtl8821ae: Convert macros that set
descriptor"), all the routines that get fields from a descriptor
were changed to return signed integer values. This is incorrect for the
routines that get the entire 32-bit word. In this case, an unsigned
quantity is required.

Fixes: bd421dab7515 ("rtlwifi: rtl8821ae: Convert macros that set descriptor")
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
 drivers/net/wireless/realtek/rtlwifi/rtl8821ae/trx.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/trx.h b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/trx.h
index 81951f0c80b6..a9ed6fd41089 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/trx.h
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/trx.h
@@ -214,7 +214,7 @@ static inline void set_tx_desc_tx_buffer_address(__le32 *__pdesc, u32 __val)
 	*(__pdesc + 10) = cpu_to_le32(__val);
 }
 
-static inline int get_tx_desc_tx_buffer_address(__le32 *__pdesc)
+static inline u32 get_tx_desc_tx_buffer_address(__le32 *__pdesc)
 {
 	return le32_to_cpu(*(__pdesc + 10));
 }
@@ -324,12 +324,12 @@ static inline int get_rx_desc_bw(__le32 *__pdesc)
 	return le32_get_bits(*(__pdesc + 4), GENMASK(5, 4));
 }
 
-static inline int get_rx_desc_tsfl(__le32 *__pdesc)
+static inline u32 get_rx_desc_tsfl(__le32 *__pdesc)
 {
 	return le32_to_cpu(*(__pdesc + 5));
 }
 
-static inline int get_rx_desc_buff_addr(__le32 *__pdesc)
+static inline u32 get_rx_desc_buff_addr(__le32 *__pdesc)
 {
 	return le32_to_cpu(*(__pdesc + 6));
 }
@@ -341,12 +341,12 @@ static inline void set_rx_desc_buff_addr(__le32 *__pdesc, u32 __val)
 
 /* TX report 2 format in Rx desc*/
 
-static inline int get_rx_rpt2_desc_macid_valid_1(__le32 *__status)
+static inline u32 get_rx_rpt2_desc_macid_valid_1(__le32 *__status)
 {
 	return le32_to_cpu(*(__status + 4));
 }
 
-static inline int get_rx_rpt2_desc_macid_valid_2(__le32 *__status)
+static inline u32 get_rx_rpt2_desc_macid_valid_2(__le32 *__status)
 {
 	return le32_to_cpu(*(__status + 5));
 }
-- 
2.16.4


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

* [PATCH 2/3] rtlwifi: rtl8188ee: Fix incorrect returned values
  2019-09-03  1:18 [PATCH 0/3] rtlwifi: Fix some errors in recent patches Larry Finger
  2019-09-03  1:18 ` [PATCH 1/3] rtlwifi: rtl8821ae: Fix incorrect returned values Larry Finger
@ 2019-09-03  1:18 ` Larry Finger
  2019-09-03  1:18 ` [PATCH 3/3] rtlwifi: rtl8192ce: " Larry Finger
  2 siblings, 0 replies; 5+ messages in thread
From: Larry Finger @ 2019-09-03  1:18 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless, pkshih, Larry Finger

In commit 36eda7568f2e ("rtlwifi: rtl8188ee: Convert macros that set
descriptor"), all the routines that get fields from a descriptor were
changed to return signed integer values. This is incorrect for the
routines that get the entire 32-bit word. In this case, an unsigned
quantity is required.

Fixes: 36eda7568f2e ("rtlwifi: rtl8188ee: Convert macros that set descriptor")
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
 drivers/net/wireless/realtek/rtlwifi/rtl8188ee/trx.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/trx.h b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/trx.h
index bd862732d6ae..917729807514 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/trx.h
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/trx.h
@@ -244,7 +244,7 @@ static inline void set_tx_desc_tx_buffer_address(__le32 *__pdesc, u32 __val)
 	*(__pdesc + 8) = cpu_to_le32(__val);
 }
 
-static inline int get_tx_desc_tx_buffer_address(__le32 *__pdesc)
+static inline u32 get_tx_desc_tx_buffer_address(__le32 *__pdesc)
 {
 	return le32_to_cpu(*(__pdesc + 8));
 }
@@ -464,22 +464,22 @@ static inline int get_rx_status_desc_magic_match(__le32 *__pdesc)
 	return le32_get_bits(*(__pdesc + 3), BIT(31));
 }
 
-static inline int get_rx_desc_iv1(__le32 *__pdesc)
+static inline u32 get_rx_desc_iv1(__le32 *__pdesc)
 {
 	return le32_to_cpu(*(__pdesc + 4));
 }
 
-static inline int get_rx_desc_tsfl(__le32 *__pdesc)
+static inline u32 get_rx_desc_tsfl(__le32 *__pdesc)
 {
 	return le32_to_cpu(*(__pdesc + 5));
 }
 
-static inline int get_rx_desc_buff_addr(__le32 *__pdesc)
+static inline u32 get_rx_desc_buff_addr(__le32 *__pdesc)
 {
 	return le32_to_cpu(*(__pdesc + 6));
 }
 
-static inline int get_rx_desc_buff_addr64(__le32 *__pdesc)
+static inline u32 get_rx_desc_buff_addr64(__le32 *__pdesc)
 {
 	return le32_to_cpu(*(__pdesc + 7));
 }
@@ -501,12 +501,12 @@ static inline int get_rx_rpt2_desc_pkt_len(__le32 *__status)
 	return le32_get_bits(*(__status), GENMASK(8, 0));
 }
 
-static inline int get_rx_rpt2_desc_macid_valid_1(__le32 *__status)
+static inline u32 get_rx_rpt2_desc_macid_valid_1(__le32 *__status)
 {
 	return le32_to_cpu(*(__status + 4));
 }
 
-static inline int get_rx_rpt2_desc_macid_valid_2(__le32 *__status)
+static inline u32 get_rx_rpt2_desc_macid_valid_2(__le32 *__status)
 {
 	return le32_to_cpu(*(__status + 5));
 }
-- 
2.16.4


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

* [PATCH 3/3] rtlwifi: rtl8192ce: Fix incorrect returned values
  2019-09-03  1:18 [PATCH 0/3] rtlwifi: Fix some errors in recent patches Larry Finger
  2019-09-03  1:18 ` [PATCH 1/3] rtlwifi: rtl8821ae: Fix incorrect returned values Larry Finger
  2019-09-03  1:18 ` [PATCH 2/3] rtlwifi: rtl8188ee: " Larry Finger
@ 2019-09-03  1:18 ` Larry Finger
  2 siblings, 0 replies; 5+ messages in thread
From: Larry Finger @ 2019-09-03  1:18 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless, pkshih, Larry Finger

In commit 98fd8db59a00 ("rtlwifi: rtl8192ce: Convert macros that set
descriptor"), all the routines that get fields from a descriptor
were changed to return signed integer values. This is incorrect for the
routines that get the entire 32-bit word. In this case, an unsigned
quantity is required.

Fixes: 98fd8db59a00 ("rtlwifi: rtl8192ce: Convert macros that set descriptor")
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
 drivers/net/wireless/realtek/rtlwifi/rtl8192ce/trx.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/trx.h b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/trx.h
index 709dcac9d84b..b45b05a6a523 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/trx.h
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/trx.h
@@ -216,7 +216,7 @@ static inline void set_tx_desc_tx_buffer_address(__le32 *__pdesc, u32  __val)
 	*(__pdesc + 8) = cpu_to_le32(__val);
 }
 
-static inline int get_tx_desc_tx_buffer_address(__le32 *__pdesc)
+static inline u32 get_tx_desc_tx_buffer_address(__le32 *__pdesc)
 {
 	return le32_to_cpu(*((__pdesc + 8)));
 }
@@ -311,12 +311,12 @@ static inline int get_rx_desc_bw(__le32 *__pdesc)
 	return le32_get_bits(*((__pdesc + 3)), BIT(9));
 }
 
-static inline int get_rx_desc_tsfl(__le32 *__pdesc)
+static inline u32 get_rx_desc_tsfl(__le32 *__pdesc)
 {
 	return le32_to_cpu(*((__pdesc + 5)));
 }
 
-static inline int get_rx_desc_buff_addr(__le32 *__pdesc)
+static inline u32 get_rx_desc_buff_addr(__le32 *__pdesc)
 {
 	return le32_to_cpu(*((__pdesc + 6)));
 }
-- 
2.16.4


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

* Re: [PATCH 1/3] rtlwifi: rtl8821ae: Fix incorrect returned values
  2019-09-03  1:18 ` [PATCH 1/3] rtlwifi: rtl8821ae: Fix incorrect returned values Larry Finger
@ 2019-09-03 13:34   ` Kalle Valo
  0 siblings, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2019-09-03 13:34 UTC (permalink / raw)
  To: Larry Finger; +Cc: linux-wireless, pkshih, Larry Finger

Larry Finger <Larry.Finger@lwfinger.net> wrote:

> In commit bd421dab7515 ("rtlwifi: rtl8821ae: Convert macros that set
> descriptor"), all the routines that get fields from a descriptor
> were changed to return signed integer values. This is incorrect for the
> routines that get the entire 32-bit word. In this case, an unsigned
> quantity is required.
> 
> Fixes: bd421dab7515 ("rtlwifi: rtl8821ae: Convert macros that set descriptor")
> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>

3 patches applied to wireless-drivers-next.git, thanks.

3bf404b470f9 rtlwifi: rtl8821ae: Fix incorrect returned values
38fcdcbd3def rtlwifi: rtl8188ee: Fix incorrect returned values
fe025ef7d066 rtlwifi: rtl8192ce: Fix incorrect returned values

-- 
https://patchwork.kernel.org/patch/11127097/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


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

end of thread, other threads:[~2019-09-03 13:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-03  1:18 [PATCH 0/3] rtlwifi: Fix some errors in recent patches Larry Finger
2019-09-03  1:18 ` [PATCH 1/3] rtlwifi: rtl8821ae: Fix incorrect returned values Larry Finger
2019-09-03 13:34   ` Kalle Valo
2019-09-03  1:18 ` [PATCH 2/3] rtlwifi: rtl8188ee: " Larry Finger
2019-09-03  1:18 ` [PATCH 3/3] rtlwifi: rtl8192ce: " Larry Finger

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).