lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 26 Jun 2020 06:24:13 -0700
From:   Guenter Roeck <groeck@...gle.com>
To:     Dariusz Marcinkiewicz <darekm@...gle.com>
Cc:     linux-media@...r.kernel.org,
        Hans Verkuil <hverkuil-cisco@...all.nl>,
        Gwendal Grignou <gwendal@...omium.org>,
        "# v4 . 10+" <stable@...r.kernel.org>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Benson Leung <bleung@...omium.org>,
        Enric Balletbo i Serra <enric.balletbo@...labora.com>,
        Guenter Roeck <groeck@...omium.org>,
        Jonathan Cameron <Jonathan.Cameron@...wei.com>,
        Sebastian Reichel <sre@...nel.org>,
        Dariusz Marcinkiewicz <darekm@...omium.org>,
        Lee Jones <lee.jones@...aro.org>,
        Neil Armstrong <narmstrong@...libre.com>,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3] media: cros-ec-cec: do not bail on device_init_wakeup failure

On Fri, Jun 26, 2020 at 5:50 AM Dariusz Marcinkiewicz <darekm@...gle.com> wrote:
>
> Do not fail probing when device_init_wakeup fails. Also clear wakeup
> on remove.
>
> device_init_wakeup fails when the device is already enabled as wakeup
> device. Hence, the driver fails to probe the device if:
> - The device has already been enabled for wakeup (via /proc/acpi/wakeup)
> - The driver has been unloaded and is being loaded again.
>
> This goal of the patch is to fix the above cases.
>
> Overwhelming majority of the drivers do not consider device_init_wakeup
> failure as a fatal error and proceed regardless of whether it succeeds
> or not.
>
> Changes since v2:
>  - disabled wakeup in remove
>  - CC'ing stable
>  - description fixed
> Changes since v1:
>  - added Fixes tag
>
> Fixes: cd70de2d356ee ("media: platform: Add ChromeOS EC CEC driver")
> Cc: stable@...r.kernel.org
> Signed-off-by: Dariusz Marcinkiewicz <darekm@...gle.com>

Reviewed-by: Guenter Roeck <groeck@...omium.org>

> ---
>  drivers/media/cec/platform/cros-ec/cros-ec-cec.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/media/cec/platform/cros-ec/cros-ec-cec.c b/drivers/media/cec/platform/cros-ec/cros-ec-cec.c
> index 0e7e2772f08f..3881ed7bc3d9 100644
> --- a/drivers/media/cec/platform/cros-ec/cros-ec-cec.c
> +++ b/drivers/media/cec/platform/cros-ec/cros-ec-cec.c
> @@ -277,12 +277,6 @@ static int cros_ec_cec_probe(struct platform_device *pdev)
>         platform_set_drvdata(pdev, cros_ec_cec);
>         cros_ec_cec->cros_ec = cros_ec;
>
> -       ret = device_init_wakeup(&pdev->dev, 1);
> -       if (ret) {
> -               dev_err(&pdev->dev, "failed to initialize wakeup\n");
> -               return ret;
> -       }
> -
>         cros_ec_cec->adap = cec_allocate_adapter(&cros_ec_cec_ops, cros_ec_cec,
>                                                  DRV_NAME,
>                                                  CEC_CAP_DEFAULTS |
> @@ -310,6 +304,8 @@ static int cros_ec_cec_probe(struct platform_device *pdev)
>         if (ret < 0)
>                 goto out_probe_notify;
>
> +       device_init_wakeup(&pdev->dev, 1);
> +
>         return 0;
>
>  out_probe_notify:
> @@ -339,6 +335,8 @@ static int cros_ec_cec_remove(struct platform_device *pdev)
>                                          cros_ec_cec->adap);
>         cec_unregister_adapter(cros_ec_cec->adap);
>
> +       device_init_wakeup(&pdev->dev, 0);
> +
>         return 0;
>  }
>
> --
> 2.27.0.212.ge8ba1cc988-goog
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ