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]
Date:   Sun, 25 Apr 2021 13:40:32 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Ferry Toth <ftoth@...londelft.nl>
Cc:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        MyungJoo Ham <myungjoo.ham@...sung.com>,
        Chanwoo Choi <cw00.choi@...sung.com>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Subject: Re: [PATCH v1 1/1] extcon-intel-mrfld: initialize mrfld_extcon status

On Sat, Apr 24, 2021 at 8:58 PM Ferry Toth <ftoth@...londelft.nl> wrote:
>
> extcon driver for Basin Cove PMIC shadows the switch status used for dwc3
> DRD to detect a change in the switch position. This change initializes the
> status at probe time.

Thanks for catching and fixing this issue!

Reviewed-by: Andy Shevchenko <andy.shevchenko@...il.com>

> Signed-off-by: Ferry Toth <ftoth@...londelft.nl>
> Fixes: 492929c54791 ("extcon: mrfld: Introduce extcon driver for Basin Cove PMIC")
> ---
>  drivers/extcon/extcon-intel-mrfld.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/drivers/extcon/extcon-intel-mrfld.c b/drivers/extcon/extcon-intel-mrfld.c
> index f47016fb28a8..cd1a5f230077 100644
> --- a/drivers/extcon/extcon-intel-mrfld.c
> +++ b/drivers/extcon/extcon-intel-mrfld.c
> @@ -197,6 +197,7 @@ static int mrfld_extcon_probe(struct platform_device *pdev)
>         struct intel_soc_pmic *pmic = dev_get_drvdata(dev->parent);
>         struct regmap *regmap = pmic->regmap;
>         struct mrfld_extcon_data *data;
> +       unsigned int status;
>         unsigned int id;
>         int irq, ret;
>
> @@ -244,6 +245,14 @@ static int mrfld_extcon_probe(struct platform_device *pdev)
>         /* Get initial state */
>         mrfld_extcon_role_detect(data);
>
> +       /*
> +        * Cached status value is used for cable detection, see comments
> +        * in mrfld_extcon_cable_detect(), we need to sync cached value
> +        * with a real state of the hardware.
> +        */
> +       regmap_read(regmap, BCOVE_SCHGRIRQ1, &status);
> +       data->status = status;
> +
>         mrfld_extcon_clear(data, BCOVE_MIRQLVL1, BCOVE_LVL1_CHGR);
>         mrfld_extcon_clear(data, BCOVE_MCHGRIRQ1, BCOVE_CHGRIRQ_ALL);
>
> --
> 2.27.0
>


-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ