On Tue, Nov 6, 2018 at 2:50 PM Zhi, Yong <[email protected]> wrote: > > Hi, Sakari, > > Thanks for the feedback. > > > -----Original Message----- > > From: Sakari Ailus [mailto:[email protected]] > > Sent: Monday, November 5, 2018 3:55 AM > > To: Zhi, Yong <[email protected]> > > Cc: [email protected]; [email protected]; > > [email protected]; [email protected]; > > [email protected]; Mani, Rajmohan > > <[email protected]>; Zheng, Jian Xu <[email protected]>; Hu, > > Jerry W <[email protected]>; Toivonen, Tuukka > > <[email protected]>; Qiu, Tian Shu <[email protected]>; Cao, > > Bingbu <[email protected]> > > Subject: Re: [PATCH v7 06/16] intel-ipu3: mmu: Implement driver > > > > Hi Yong, > > > > On Mon, Oct 29, 2018 at 03:23:00PM -0700, Yong Zhi wrote: > > > From: Tomasz Figa <[email protected]> > > > > > > This driver translates IO virtual address to physical address based on > > > two levels page tables. > > > > > > Signed-off-by: Tomasz Figa <[email protected]> > > > Signed-off-by: Yong Zhi <[email protected]> > > > --- > > > > ... > > > > > +static void call_if_ipu3_is_powered(struct ipu3_mmu *mmu, > > > + void (*func)(struct ipu3_mmu *mmu)) { > > > + pm_runtime_get_noresume(mmu->dev); > > > + if (pm_runtime_active(mmu->dev)) > > > + func(mmu); > > > + pm_runtime_put(mmu->dev); > > > > How about: > > > > if (!pm_runtime_get_if_in_use(mmu->dev)) > > return; > > > > func(mmu); > > pm_runtime_put(mmu->dev); > > > > Ack, unless Tomasz has different opinion.
It's actually the proper way of doing it. Thanks for the suggestion. Best regards, Tomasz
