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: <X93XuJ4lsQbBgnU+@kroah.com>
Date:   Sat, 19 Dec 2020 11:36:40 +0100
From:   Greg KH <gregkh@...uxfoundation.org>
To:     Daejun Park <daejun7.park@...sung.com>
Cc:     "avri.altman@....com" <avri.altman@....com>,
        "jejb@...ux.ibm.com" <jejb@...ux.ibm.com>,
        "martin.petersen@...cle.com" <martin.petersen@...cle.com>,
        "asutoshd@...eaurora.org" <asutoshd@...eaurora.org>,
        "stanley.chu@...iatek.com" <stanley.chu@...iatek.com>,
        "cang@...eaurora.org" <cang@...eaurora.org>,
        "huobean@...il.com" <huobean@...il.com>,
        "bvanassche@....org" <bvanassche@....org>,
        ALIM AKHTAR <alim.akhtar@...sung.com>,
        "linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Sung-Jun Park <sungjun07.park@...sung.com>,
        yongmyung lee <ymhungry.lee@...sung.com>,
        Jinyoung CHOI <j-young.choi@...sung.com>,
        Adel Choi <adel.choi@...sung.com>,
        BoRam Shin <boram.shin@...sung.com>,
        SEUNGUK SHIN <seunguk.shin@...sung.com>
Subject: Re: [PATCH v16 1/3] scsi: ufs: Introduce HPB feature

On Sat, Dec 19, 2020 at 06:18:47PM +0900, Daejun Park wrote:
> +static int ufshpb_get_state(struct ufshpb_lu *hpb)
> +{
> +	return atomic_read(&hpb->hpb_state);
> +}
> +
> +static void ufshpb_set_state(struct ufshpb_lu *hpb, int state)
> +{
> +	atomic_set(&hpb->hpb_state, state);
> +}

You have a lock for the state, and yet the state is an atomic variable
and you do not use the lock here at all.  You don't use the lock at all
infact...

So either the lock needs to be dropped, or you need to use the lock and
make the state a normal variable please.

> +static void ufshpb_hpb_lu_prepared(struct ufs_hba *hba)
> +{
> +	struct ufshpb_lu *hpb;
> +	struct scsi_device *sdev;
> +	bool init_success;
> +
> +	init_success = !ufshpb_check_hpb_reset_query(hba);
> +
> +	shost_for_each_device(sdev, hba->host) {
> +		hpb = sdev->hostdata;
> +		if (!hpb)
> +			continue;
> +
> +		if (init_success) {
> +			dev_info(hba->dev, "set state to present\n");

Why be noisy?  Why does userspace need to see this all the time,
shouldn't only errors be printing something?

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ