lkml.org 
[lkml]   [2022]   [Sep]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 1/9] trinity: Add base driver
    On Mon, Jul 25, 2022 at 03:53:00PM +0900, Jiho Chu wrote:

    > + drv->opened = drv->opened - 1;
    > + if (drv->opened == 0) {
    > + /* wait already submitted requests */
    > + if (drv->desc->drain_reqs)
    > + drv->desc->drain_reqs(drv);

    > + drv->desc->set_state(drv, TRINITY_STATE_PAUSE);

    > + mutex_lock(&drv->lock);
    > + /** remove PAUSE set on the CP of the NPU */
    > + if (drv->opened == 0) {
    > + ret = trinity_wait_ready(drv);
    > + if (ret != 0)
    > + goto out;
    > + }
    > + drv->opened = drv->opened + 1;

    Would it perhaps be cleaner to hold a runtime PM reference on the
    device for each file and deal with the power up/down of the hardware in
    the runtime PM callbacks?
    [unhandled content-type:application/pgp-signature]
    \
     
     \ /
      Last update: 2022-09-01 20:38    [W:5.267 / U:0.532 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site