lkml.org 
[lkml]   [2021]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH 6/7] tty: serial: samsung_tty: Support runtime PM
    Date
    On 06/10/2021 16.43, Krzysztof Kozlowski wrote:
    > On 05/10/2021 17:59, Hector Martin wrote:
    >> + pm_runtime_get_noresume(&pdev->dev);
    >> + pm_runtime_set_active(&pdev->dev);
    >> + pm_runtime_enable(&pdev->dev);
    >> +
    >
    > You need to cleanup in error paths (put/disable).

    There are none though, this function always returns success past this point.

    >> if (port) {
    >> + pm_runtime_get_sync(&dev->dev);
    >
    > 1. You need to check return status.
    > 2. Why do you need to resume the device here?

    As Rafael mentioned, this is basically disabling PM so the device is
    enabled when not bound (which seems to be expected behavior). Not sure
    what I'd do if the resume fails... this is the remove path after all,
    it's not like we're doing anything else with the device at this point.

    >> +
    >> s3c24xx_serial_cpufreq_deregister(to_ourport(port));
    >> uart_remove_one_port(&s3c24xx_uart_drv, port);
    >> +
    >> + pm_runtime_disable(&dev->dev);
    >
    > Why disabling it only if port!=NULL? Can remove() be called if
    > platform_set_drvdata() was not?

    Good question, I'm not entirely sure why these code paths have a check
    for NULL there. They were already there, do you happen to know why? To
    me it sounds like remove would only be called if probe succeeds, at
    which point drvdata should always be set.

    --
    Hector Martin (marcan@marcan.st)
    Public Key: https://mrcn.st/pub

    \
     
     \ /
      Last update: 2021-10-11 07:32    [W:3.197 / U:0.264 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site