[PATCH 0/1][SRU][B][C] MAC address pass through on RTL8153-BND for docking station

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH 0/1][SRU][B][C] MAC address pass through on RTL8153-BND for docking station

AceLan Kao
BugLink: https://bugs.launchpad.net/bugs/1808729

[Impact]
A new chip RTL8153-BND on docks require to be added to the whitelist to support MAC address pass through.

[Fix]
This commit adds check for RTL8153-BND chip which is in v4.20.
9c27369f4a13 r8152: Add support for MAC address pass through on RTL8153-BND

[Regression Potential]
Low. It doesn't change the code flow for the old RTL8153-AD chip, so it won't lead to regression.

Mario Limonciello (1):
  r8152: Add support for MAC address pass through on RTL8153-BND

 drivers/net/usb/r8152.c | 33 ++++++++++++++++++++++-----------
 1 file changed, 22 insertions(+), 11 deletions(-)

--
2.17.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[PATCH 1/1][SRU][B][C] r8152: Add support for MAC address pass through on RTL8153-BND

AceLan Kao
From: Mario Limonciello <[hidden email]>

BugLink: https://bugs.launchpad.net/bugs/1808729

All previous docks and dongles that have supported this feature use
the RTL8153-AD chip.

RTL8153-BND is a new chip that will be used in upcoming Dell type-C docks.
It should be added to the whitelist of devices to activate MAC address
pass through.

Per confirming with Realtek all devices containing RTL8153-BND should
activate MAC pass through and there won't use pass through bit on efuse
like in RTL8153-AD.

Signed-off-by: Mario Limonciello <[hidden email]>
Signed-off-by: David S. Miller <[hidden email]>
(cherry picked from commit 9c27369f4a1393452c17e8708c1b0beb8ac59501)
Signed-off-by: AceLan Kao <[hidden email]>
---
 drivers/net/usb/r8152.c | 33 ++++++++++++++++++++++-----------
 1 file changed, 22 insertions(+), 11 deletions(-)

diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index ca817274b635..38e896bef4f4 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -129,6 +129,7 @@
 #define USB_UPS_CTRL 0xd800
 #define USB_POWER_CUT 0xd80a
 #define USB_MISC_0 0xd81a
+#define USB_MISC_1 0xd81f
 #define USB_AFE_CTRL2 0xd824
 #define USB_UPS_CFG 0xd842
 #define USB_UPS_FLAGS 0xd848
@@ -555,6 +556,7 @@ enum spd_duplex {
 
 /* MAC PASSTHRU */
 #define AD_MASK 0xfee0
+#define BND_MASK 0x0004
 #define EFUSE 0xcfdb
 #define PASS_THRU_MASK 0x1
 
@@ -1150,7 +1152,7 @@ static int rtl8152_set_mac_address(struct net_device *netdev, void *p)
  return ret;
 }
 
-/* Devices containing RTL8153-AD can support a persistent
+/* Devices containing proper chips can support a persistent
  * host system provided MAC address.
  * Examples of this are Dell TB15 and Dell WD15 docks
  */
@@ -1165,13 +1167,23 @@ static int vendor_mac_passthru_addr_read(struct r8152 *tp, struct sockaddr *sa)
 
  /* test for -AD variant of RTL8153 */
  ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_MISC_0);
- if ((ocp_data & AD_MASK) != 0x1000)
- return -ENODEV;
-
- /* test for MAC address pass-through bit */
- ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, EFUSE);
- if ((ocp_data & PASS_THRU_MASK) != 1)
- return -ENODEV;
+ if ((ocp_data & AD_MASK) == 0x1000) {
+ /* test for MAC address pass-through bit */
+ ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, EFUSE);
+ if ((ocp_data & PASS_THRU_MASK) != 1) {
+ netif_dbg(tp, probe, tp->netdev,
+  "No efuse for RTL8153-AD MAC pass through\n");
+ return -ENODEV;
+ }
+ } else {
+ /* test for RTL8153-BND */
+ ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_MISC_1);
+ if ((ocp_data & BND_MASK) == 0) {
+ netif_dbg(tp, probe, tp->netdev,
+  "Invalid variant for MAC pass through\n");
+ return -ENODEV;
+ }
+ }
 
  /* returns _AUXMAC_#AABBCCDDEEFF# */
  status = acpi_evaluate_object(NULL, "\\_SB.AMAC", NULL, &buffer);
@@ -1217,9 +1229,8 @@ static int set_ethernet_addr(struct r8152 *tp)
  if (tp->version == RTL_VER_01) {
  ret = pla_ocp_read(tp, PLA_IDR, 8, sa.sa_data);
  } else {
- /* if this is not an RTL8153-AD, no eFuse mac pass thru set,
- * or system doesn't provide valid _SB.AMAC this will be
- * be expected to non-zero
+ /* if device doesn't support MAC pass through this will
+ * be expected to be non-zero
  */
  ret = vendor_mac_passthru_addr_read(tp, &sa);
  if (ret < 0)
--
2.17.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK: [PATCH 1/1][SRU][B][C] r8152: Add support for MAC address pass through on RTL8153-BND

Colin King
On 26/12/2018 02:35, AceLan Kao wrote:

> From: Mario Limonciello <[hidden email]>
>
> BugLink: https://bugs.launchpad.net/bugs/1808729
>
> All previous docks and dongles that have supported this feature use
> the RTL8153-AD chip.
>
> RTL8153-BND is a new chip that will be used in upcoming Dell type-C docks.
> It should be added to the whitelist of devices to activate MAC address
> pass through.
>
> Per confirming with Realtek all devices containing RTL8153-BND should
> activate MAC pass through and there won't use pass through bit on efuse
> like in RTL8153-AD.
>
> Signed-off-by: Mario Limonciello <[hidden email]>
> Signed-off-by: David S. Miller <[hidden email]>
> (cherry picked from commit 9c27369f4a1393452c17e8708c1b0beb8ac59501)
> Signed-off-by: AceLan Kao <[hidden email]>
> ---
>  drivers/net/usb/r8152.c | 33 ++++++++++++++++++++++-----------
>  1 file changed, 22 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
> index ca817274b635..38e896bef4f4 100644
> --- a/drivers/net/usb/r8152.c
> +++ b/drivers/net/usb/r8152.c
> @@ -129,6 +129,7 @@
>  #define USB_UPS_CTRL 0xd800
>  #define USB_POWER_CUT 0xd80a
>  #define USB_MISC_0 0xd81a
> +#define USB_MISC_1 0xd81f
>  #define USB_AFE_CTRL2 0xd824
>  #define USB_UPS_CFG 0xd842
>  #define USB_UPS_FLAGS 0xd848
> @@ -555,6 +556,7 @@ enum spd_duplex {
>  
>  /* MAC PASSTHRU */
>  #define AD_MASK 0xfee0
> +#define BND_MASK 0x0004
>  #define EFUSE 0xcfdb
>  #define PASS_THRU_MASK 0x1
>  
> @@ -1150,7 +1152,7 @@ static int rtl8152_set_mac_address(struct net_device *netdev, void *p)
>   return ret;
>  }
>  
> -/* Devices containing RTL8153-AD can support a persistent
> +/* Devices containing proper chips can support a persistent
>   * host system provided MAC address.
>   * Examples of this are Dell TB15 and Dell WD15 docks
>   */
> @@ -1165,13 +1167,23 @@ static int vendor_mac_passthru_addr_read(struct r8152 *tp, struct sockaddr *sa)
>  
>   /* test for -AD variant of RTL8153 */
>   ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_MISC_0);
> - if ((ocp_data & AD_MASK) != 0x1000)
> - return -ENODEV;
> -
> - /* test for MAC address pass-through bit */
> - ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, EFUSE);
> - if ((ocp_data & PASS_THRU_MASK) != 1)
> - return -ENODEV;
> + if ((ocp_data & AD_MASK) == 0x1000) {
> + /* test for MAC address pass-through bit */
> + ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, EFUSE);
> + if ((ocp_data & PASS_THRU_MASK) != 1) {
> + netif_dbg(tp, probe, tp->netdev,
> +  "No efuse for RTL8153-AD MAC pass through\n");
> + return -ENODEV;
> + }
> + } else {
> + /* test for RTL8153-BND */
> + ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_MISC_1);
> + if ((ocp_data & BND_MASK) == 0) {
> + netif_dbg(tp, probe, tp->netdev,
> +  "Invalid variant for MAC pass through\n");
> + return -ENODEV;
> + }
> + }
>  
>   /* returns _AUXMAC_#AABBCCDDEEFF# */
>   status = acpi_evaluate_object(NULL, "\\_SB.AMAC", NULL, &buffer);
> @@ -1217,9 +1229,8 @@ static int set_ethernet_addr(struct r8152 *tp)
>   if (tp->version == RTL_VER_01) {
>   ret = pla_ocp_read(tp, PLA_IDR, 8, sa.sa_data);
>   } else {
> - /* if this is not an RTL8153-AD, no eFuse mac pass thru set,
> - * or system doesn't provide valid _SB.AMAC this will be
> - * be expected to non-zero
> + /* if device doesn't support MAC pass through this will
> + * be expected to be non-zero
>   */
>   ret = vendor_mac_passthru_addr_read(tp, &sa);
>   if (ret < 0)
>

Clean upstream cherry pick. Very small regression potential and from
Dell for Dell specific machines.

Acked-by: Colin Ian King <[hidden email]>

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK: [PATCH 0/1][SRU][B][C] MAC address pass through on RTL8153-BND for docking station

Khaled Elmously
In reply to this post by AceLan Kao
On 2018-12-26 10:35:00 , AceLan Kao wrote:

> BugLink: https://bugs.launchpad.net/bugs/1808729
>
> [Impact]
> A new chip RTL8153-BND on docks require to be added to the whitelist to support MAC address pass through.
>
> [Fix]
> This commit adds check for RTL8153-BND chip which is in v4.20.
> 9c27369f4a13 r8152: Add support for MAC address pass through on RTL8153-BND
>
> [Regression Potential]
> Low. It doesn't change the code flow for the old RTL8153-AD chip, so it won't lead to regression.
>
> Mario Limonciello (1):
>   r8152: Add support for MAC address pass through on RTL8153-BND
>
>  drivers/net/usb/r8152.c | 33 ++++++++++++++++++++++-----------
>  1 file changed, 22 insertions(+), 11 deletions(-)
>

Acked-by: Khalid Elmously <[hidden email]>


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

APPLIED: [PATCH 0/1][SRU][B][C] MAC address pass through on RTL8153-BND for docking station

Khaled Elmously
In reply to this post by AceLan Kao
On 2018-12-26 10:35:00 , AceLan Kao wrote:

> BugLink: https://bugs.launchpad.net/bugs/1808729
>
> [Impact]
> A new chip RTL8153-BND on docks require to be added to the whitelist to support MAC address pass through.
>
> [Fix]
> This commit adds check for RTL8153-BND chip which is in v4.20.
> 9c27369f4a13 r8152: Add support for MAC address pass through on RTL8153-BND
>
> [Regression Potential]
> Low. It doesn't change the code flow for the old RTL8153-AD chip, so it won't lead to regression.
>
> Mario Limonciello (1):
>   r8152: Add support for MAC address pass through on RTL8153-BND
>
>  drivers/net/usb/r8152.c | 33 ++++++++++++++++++++++-----------
>  1 file changed, 22 insertions(+), 11 deletions(-)
>
> --
> 2.17.1
>
>
> --
> kernel-team mailing list
> [hidden email]
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

APPLIED[D]: [PATCH 0/1][SRU][B][C] MAC address pass through on RTL8153-BND for docking station

Seth Forshee
In reply to this post by AceLan Kao
On Wed, Dec 26, 2018 at 10:35:00AM +0800, AceLan Kao wrote:

> BugLink: https://bugs.launchpad.net/bugs/1808729
>
> [Impact]
> A new chip RTL8153-BND on docks require to be added to the whitelist to support MAC address pass through.
>
> [Fix]
> This commit adds check for RTL8153-BND chip which is in v4.20.
> 9c27369f4a13 r8152: Add support for MAC address pass through on RTL8153-BND
>
> [Regression Potential]
> Low. It doesn't change the code flow for the old RTL8153-AD chip, so it won't lead to regression.

Please remember to include disco for these sorts of patches. Applied to
disco/master-next, thanks!

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team