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: <CAHp75VdFGC5yXSmR_uNOv4=aEseMzWdJ=xNqqo1KKuGkajhb3g@mail.gmail.com>
Date:   Fri, 21 Jan 2022 19:22:57 +0200
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     julian schroeder <julianmarcusschroeder@...il.com>
Cc:     Rob Herring <robh@...nel.org>, bhanumaiya@...gle.com,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Jiri Slaby <jirislaby@...nel.org>,
        "open list:SERIAL DRIVERS" <linux-serial@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] fix serdev bind/unbind

On Fri, Jan 21, 2022 at 8:55 AM julian schroeder
<julianmarcusschroeder@...il.com> wrote:
>
> On some chromebooks, the serdev is used to communicate with

Chromebooks ?

> an embedded controller. When the controller is updated, the
> regular ttyS* is needed. Therefore unbind/bind needs to work
> to be able to switch between the two modes without having to
> reboot. In the case of ACPI enabled platforms, the underlying
> serial device is marked as enumerated but this is not cleared
> upon remove (unbind). In this state it can not be bound as
> serdev.

Seems legit (we do this for i2c and spi serial buses in ACPI case).
After addressing the following nit-pick
Reviewed-by: Andy Shevchenko <andy.shevchenko@...il.com>

...

>  void serdev_device_remove(struct serdev_device *serdev)
>  {
>         struct serdev_controller *ctrl = serdev->ctrl;
> +       struct acpi_device *adev;

> +       adev = ACPI_COMPANION(&serdev->dev);
> +       if (adev)
> +               acpi_device_clear_enumerated(adev);

As I mentioned i2c and SPI cases, I think it would be nice to use same
pattern of this code, i.e.


  if (ACPI_COMPANION(&serdev->dev))
    acpi_device_clear_enumerated(ACPI_COMPANION(&serdev->dev));

drivers/i2c/i2c-core-base.c, line 1007
drivers/spi/spi.c, line 779

>         device_unregister(&serdev->dev);
>         ctrl->serdev = NULL;
>  }


-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ