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: <20210430175904.0000508c@Huawei.com>
Date:   Fri, 30 Apr 2021 17:59:04 +0100
From:   Jonathan Cameron <Jonathan.Cameron@...wei.com>
To:     Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
CC:     <linuxarm@...wei.com>, <mauro.chehab@...wei.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Sakari Ailus <sakari.ailus@...ux.intel.com>,
        <devel@...verdev.osuosl.org>, <linux-kernel@...r.kernel.org>,
        <linux-media@...r.kernel.org>
Subject: Re: [PATCH v4 21/79] staging: media: atomisp: use
 pm_runtime_resume_and_get()

On Wed, 28 Apr 2021 16:51:42 +0200
Mauro Carvalho Chehab <mchehab+huawei@...nel.org> wrote:

> Commit dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter")
> added pm_runtime_resume_and_get() in order to automatically handle
> dev->power.usage_count decrement on errors.
> 
> Use the new API, in order to cleanup the error check logic.

I'd mention that the origin error handling order was wrong and you've
also fixed that by moving hm_pool_unregister() later.

> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
> ---
>  drivers/staging/media/atomisp/pci/atomisp_fops.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/media/atomisp/pci/atomisp_fops.c b/drivers/staging/media/atomisp/pci/atomisp_fops.c
> index f1e6b2597853..26d05474a035 100644
> --- a/drivers/staging/media/atomisp/pci/atomisp_fops.c
> +++ b/drivers/staging/media/atomisp/pci/atomisp_fops.c
> @@ -837,7 +837,7 @@ static int atomisp_open(struct file *file)
>  	}
>  
>  	/* runtime power management, turn on ISP */
> -	ret = pm_runtime_get_sync(vdev->v4l2_dev->dev);
> +	ret = pm_runtime_resume_and_get(vdev->v4l2_dev->dev);
>  	if (ret < 0) {
>  		dev_err(isp->dev, "Failed to power on device\n");
>  		goto error;
> @@ -881,9 +881,9 @@ static int atomisp_open(struct file *file)
>  

>  css_error:
>  	atomisp_css_uninit(isp);
> -error:
> -	hmm_pool_unregister(HMM_POOL_TYPE_DYNAMIC);
>  	pm_runtime_put(vdev->v4l2_dev->dev);
> +error:
> +	hmm_pool_unregister(HMM_POOL_TYPE_DYNAMIC);
>  	rt_mutex_unlock(&isp->mutex);
>  	return ret;
>  }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ