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: <f12d2c516d2a038bcc27677d9b982c52d19d5027.camel@gmail.com>
Date:   Thu, 10 Dec 2020 19:03:05 +0100
From:   Bean Huo <huobean@...il.com>
To:     Can Guo <cang@...eaurora.org>, asutoshd@...eaurora.org,
        nguyenb@...eaurora.org, hongwus@...eaurora.org,
        rnayak@...eaurora.org, linux-scsi@...r.kernel.org,
        kernel-team@...roid.com, saravanak@...gle.com, salyzyn@...gle.com
Cc:     Alim Akhtar <alim.akhtar@...sung.com>,
        Avri Altman <avri.altman@....com>,
        "James E.J. Bottomley" <jejb@...ux.ibm.com>,
        "Martin K. Petersen" <martin.petersen@...cle.com>,
        Stanley Chu <stanley.chu@...iatek.com>,
        Bean Huo <beanhuo@...ron.com>,
        Bart Van Assche <bvanassche@....org>,
        Satya Tangirala <satyat@...gle.com>,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] scsi: ufs: Clean up ufshcd_exit_clk_scaling/gating()

On Wed, 2020-12-09 at 05:35 -0800, Can Guo wrote:
> ufshcd_hba_exit() is always called after ufshcd_exit_clk_scaling()
> and
> ufshcd_exit_clk_gating(), so move ufshcd_exit_clk_scaling/gating() to
> ufshcd_hba_exit().
> 
> Signed-off-by: Can Guo <cang@...eaurora.org>
> 
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index 12266bd..41a12d6 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -1846,11 +1846,14 @@ static void ufshcd_init_clk_scaling(struct
> ufs_hba *hba)
>         snprintf(wq_name, sizeof(wq_name), "ufs_clkscaling_%d",
>                  hba->host->host_no);
>         hba->clk_scaling.workq =
> create_singlethread_workqueue(wq_name);
> +
> +       hba->clk_scaling.is_initialized = true;
>  }
>  
>  static void ufshcd_exit_clk_scaling(struct ufs_hba *hba)
>  {
> -       if (!ufshcd_is_clkscaling_supported(hba))
> +       if (!ufshcd_is_clkscaling_supported(hba) ||
> +           !hba->clk_scaling.is_initialized)
>                 return;
>  
>         if (hba->devfreq)
> @@ -1894,12 +1897,16 @@ static void ufshcd_init_clk_gating(struct
> ufs_hba *hba)
>         hba->clk_gating.enable_attr.attr.mode = 0644;
>         if (device_create_file(hba->dev, &hba-
> >clk_gating.enable_attr))
>                 dev_err(hba->dev, "Failed to create sysfs for
> clkgate_enable\n");
> +
> +       hba->clk_gating.is_initialized = true;
>  }

you don't need these two is_initialized at all. they are only be false
when scaling/gating is not supported??

Bean


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ