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]
Date:   Fri, 2 Sep 2022 17:23:01 +0900
From:   Jiho Chu <jiho.chu@...sung.com>
To:     Mark Brown <broonie@...nel.org>
Cc:     gregkh@...uxfoundation.org, arnd@...db.de,
        linux-kernel@...r.kernel.org, yelini.jeong@...sung.com,
        myungjoo.ham@...sung.com
Subject: Re: [PATCH 1/9] trinity: Add base driver

On Thu, 1 Sep 2022 19:36:01 +0100
Mark Brown <broonie@...nel.org> wrote:

> 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?

Hi, Mark.
This open count will be removed as Greg's review.
Anyway, the PM callback for suspend/resume is defined on device_driver struct.

@@ -1400,6 +1833,7 @@ static struct platform_driver trinity_triv2 = {
                        .name = "triv2",
                        .owner = THIS_MODULE,
                        .of_match_table = of_match_ptr(trinity_match),
+                       .pm = &triv2_dev_pm_ops,
                },
 };

Thanks.
Jiho Chu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ