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: <CAMuHMdVthAaoyV2FMabjva=oRFxJQ+qW9fzu6X5b8gpCBdXFAw@mail.gmail.com>
Date:   Wed, 12 Jul 2023 13:58:19 +0200
From:   Geert Uytterhoeven <geert@...ux-m68k.org>
To:     Wolfram Sang <wsa+renesas@...g-engineering.com>
Cc:     linux-renesas-soc@...r.kernel.org, Johan Hovold <johan@...nel.org>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/3] gnss: ubx: add support for the reset gpio

Hi Wolfram,

On Wed, Jul 12, 2023 at 1:40 PM Wolfram Sang
<wsa+renesas@...g-engineering.com> wrote:
> Tested with a Renesas KingFisher board. Because my GNSS device is hooked
> up via UART and I2C simultaneously, I could verify functionality by
> opening/closing the GNSS device using UART and see if the corresponding
> I2C device was visible on the bus.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@...g-engineering.com>

Thanks for your patch!

> --- a/drivers/gnss/ubx.c
> +++ b/drivers/gnss/ubx.c
> @@ -29,6 +31,8 @@ static int ubx_set_active(struct gnss_serial *gserial)
>         if (ret)
>                 return ret;
>
> +       gpiod_set_value_cansleep(data->reset_gpio, 0);
> +
>         return 0;
>  }
>
> @@ -41,6 +45,8 @@ static int ubx_set_standby(struct gnss_serial *gserial)
>         if (ret)
>                 return ret;
>
> +       gpiod_set_value_cansleep(data->reset_gpio, 1);

Please assert reset before disabling the regulator, for symmetry
with ubx_set_active().

> +
>         return 0;
>  }
>
> @@ -90,6 +96,13 @@ static int ubx_probe(struct serdev_device *serdev)
>         if (ret < 0 && ret != -ENODEV)
>                 goto err_free_gserial;
>
> +       /* Start with reset asserted (GPIO must be active low!) */

Does it have to be active low?
The description in your DT bindings suggest both active low and active
high are possible.

I think you just wanted to express that GPIOD_OUT_HIGH means asserted,
i.e. low for the common case of an active-low reset?

> +       data->reset_gpio = devm_gpiod_get_optional(&serdev->dev, "reset", GPIOD_OUT_HIGH);
> +       if (IS_ERR(data->reset_gpio)) {
> +               ret = PTR_ERR(data->reset_gpio);
> +               goto err_free_gserial;
> +       }
> +
>         ret = gnss_serial_register(gserial);
>         if (ret)
>                 goto err_free_gserial;

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ