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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAF6AEGsXhSbKZXX_OoxNgaB7H6SL+wH6CY6sxDx2xSj9Z2-JWg@mail.gmail.com>
Date:   Wed, 28 Jun 2017 21:50:44 -0400
From:   Rob Clark <robdclark@...il.com>
To:     Bjorn Andersson <bjorn.andersson@...aro.org>
Cc:     Stephen Boyd <sboyd@...eaurora.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-arm-msm <linux-arm-msm@...r.kernel.org>
Subject: Re: [PATCH] spmi: Include OF based modalias in device uevent

On Wed, Jun 28, 2017 at 7:44 PM, Bjorn Andersson
<bjorn.andersson@...aro.org> wrote:
> Include the OF-based modalias in the uevent sent when registering SPMI
> devices, so that user space has a chance to autoload the kernel module
> for the device.
>
> Reported-by: Rob Clark <robdclark@...il.com>
> Signed-off-by: Bjorn Andersson <bjorn.andersson@...aro.org>

Tested-by: Rob Clark <robdclark@...il.com>

> ---
>
> Based on the MODULE_ALIAS in the qcom-spmi-pmic it's likely that the original
> author expected that the spmi-pmic-arb would create devices by the identifier
> "pmic" and the spmi code would include a MODALIAS="spmi:pmic" in the uevent.
>
>  drivers/spmi/spmi.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/drivers/spmi/spmi.c b/drivers/spmi/spmi.c
> index 2b9b0941d9eb..6d23226e5f69 100644
> --- a/drivers/spmi/spmi.c
> +++ b/drivers/spmi/spmi.c
> @@ -365,11 +365,23 @@ static int spmi_drv_remove(struct device *dev)
>         return 0;
>  }
>
> +static int spmi_drv_uevent(struct device *dev, struct kobj_uevent_env *env)
> +{
> +       int ret;
> +
> +       ret = of_device_uevent_modalias(dev, env);
> +       if (ret != -ENODEV)
> +               return ret;
> +
> +       return 0;
> +}
> +
>  static struct bus_type spmi_bus_type = {
>         .name           = "spmi",
>         .match          = spmi_device_match,
>         .probe          = spmi_drv_probe,
>         .remove         = spmi_drv_remove,
> +       .uevent         = spmi_drv_uevent,
>  };
>
>  /**
> --
> 2.12.0
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ