[PATCH 2/2] UBUNTU: SAUCE: alx: add disable_wol paramenter

AceLan Kao acelan.kao at canonical.com
Thu May 24 05:43:05 UTC 2018


Hi Stefan,

I just submit v2 patches and change the option to "enable_wol"

Best regards,
AceLan Kao.

2018-05-23 20:11 GMT+08:00 Stefan Bader <stefan.bader at canonical.com>:
> On 23.05.2018 03:56, AceLan Kao wrote:
>> BugLink: BugLink: https://launchpad.net/bugs/1772610
>>
>> The WoL feature was reported broken and will lead to the system resumes
>> immediately after suspended. This symptom is not happening on every
>> system, and we don't have any machines can reproduce this issue.
>> To avoid regression, adding disable_wol option and disable
>> WoL feature by default to prevent the issue from happening.
>
> I am thinking about this and somehow for me an option named disable_foo which is
> set by default feels counter intuitive. Would not "enable_wol" with a default to
> 0 be better?
>
> -Stefan
>
>>
>> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=61651
>> Signed-off-by: AceLan Kao <acelan.kao at canonical.com>
>> ---
>>  drivers/net/ethernet/atheros/alx/ethtool.c | 7 ++++++-
>>  drivers/net/ethernet/atheros/alx/main.c    | 5 +++++
>>  2 files changed, 11 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/atheros/alx/ethtool.c b/drivers/net/ethernet/atheros/alx/ethtool.c
>> index 859e27236ce4..e50129d3fea6 100644
>> --- a/drivers/net/ethernet/atheros/alx/ethtool.c
>> +++ b/drivers/net/ethernet/atheros/alx/ethtool.c
>> @@ -46,6 +46,8 @@
>>  #include "reg.h"
>>  #include "hw.h"
>>
>> +extern const bool disable_wol;
>> +
>>  /* The order of these strings must match the order of the fields in
>>   * struct alx_hw_stats
>>   * See hw.h
>> @@ -315,6 +317,9 @@ static void alx_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
>>       struct alx_priv *alx = netdev_priv(netdev);
>>       struct alx_hw *hw = &alx->hw;
>>
>> +     if (disable_wol)
>> +             return;
>> +
>>       wol->supported = WAKE_MAGIC | WAKE_PHY;
>>       wol->wolopts = 0;
>>
>> @@ -329,7 +334,7 @@ static int alx_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
>>       struct alx_priv *alx = netdev_priv(netdev);
>>       struct alx_hw *hw = &alx->hw;
>>
>> -     if (wol->wolopts & ~(WAKE_MAGIC | WAKE_PHY))
>> +     if (disable_wol || (wol->wolopts & ~(WAKE_MAGIC | WAKE_PHY)))
>>               return -EOPNOTSUPP;
>>
>>       hw->sleep_ctrl = 0;
>> diff --git a/drivers/net/ethernet/atheros/alx/main.c b/drivers/net/ethernet/atheros/alx/main.c
>> index c0e2bb22ce24..c27fdf737732 100644
>> --- a/drivers/net/ethernet/atheros/alx/main.c
>> +++ b/drivers/net/ethernet/atheros/alx/main.c
>> @@ -51,6 +51,11 @@
>>
>>  const char alx_drv_name[] = "alx";
>>
>> +/* disable WoL by default */
>> +bool disable_wol = 1;
>> +module_param(disable_wol, bool, 0);
>> +MODULE_PARM_DESC(disable_wol, "Disable Wake on Lan feature");
>> +
>>  static void alx_free_txbuf(struct alx_tx_queue *txq, int entry)
>>  {
>>       struct alx_buffer *txb = &txq->bufs[entry];
>>
>
>
>
> --
> kernel-team mailing list
> kernel-team at lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
>




More information about the kernel-team mailing list