linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Daejun Park <daejun7.park@samsung.com>
Cc: "avri.altman@wdc.com" <avri.altman@wdc.com>,
	"jejb@linux.ibm.com" <jejb@linux.ibm.com>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
	"asutoshd@codeaurora.org" <asutoshd@codeaurora.org>,
	"stanley.chu@mediatek.com" <stanley.chu@mediatek.com>,
	"cang@codeaurora.org" <cang@codeaurora.org>,
	"huobean@gmail.com" <huobean@gmail.com>,
	"bvanassche@acm.org" <bvanassche@acm.org>,
	ALIM AKHTAR <alim.akhtar@samsung.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Sung-Jun Park <sungjun07.park@samsung.com>,
	yongmyung lee <ymhungry.lee@samsung.com>,
	Jinyoung CHOI <j-young.choi@samsung.com>,
	Adel Choi <adel.choi@samsung.com>,
	BoRam Shin <boram.shin@samsung.com>,
	SEUNGUK SHIN <seunguk.shin@samsung.com>
Subject: Re: [PATCH v16 1/3] scsi: ufs: Introduce HPB feature
Date: Sat, 19 Dec 2020 11:36:40 +0100	[thread overview]
Message-ID: <X93XuJ4lsQbBgnU+@kroah.com> (raw)
In-Reply-To: <20201219091847epcms2p7afeebd03c47eed0b65f89375a881233e@epcms2p7>

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

  reply	other threads:[~2020-12-19 10:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20201219091802epcms2p2c86f7ae2e81aa015702572a8ef180dae@epcms2p2>
2020-12-19  9:18 ` [PATCH v16 0/3] scsi: ufs: Add Host Performance Booster Support Daejun Park
     [not found]   ` <CGME20201219091802epcms2p2c86f7ae2e81aa015702572a8ef180dae@epcms2p7>
2020-12-19  9:18     ` [PATCH v16 1/3] scsi: ufs: Introduce HPB feature Daejun Park
2020-12-19 10:36       ` Greg KH [this message]
2020-12-19 12:48         ` Avri Altman
2020-12-19 12:55           ` Greg KH
     [not found]       ` <CGME20201219091802epcms2p2c86f7ae2e81aa015702572a8ef180dae@epcms2p6>
2020-12-21  2:35         ` Daejun Park
     [not found]   ` <CGME20201219091802epcms2p2c86f7ae2e81aa015702572a8ef180dae@epcms2p1>
2020-12-19  9:19     ` [PATCH v16 2/3] scsi: ufs: L2P map management for HPB read Daejun Park
2020-12-21  2:34     ` Re: [PATCH v16 1/3] scsi: ufs: Introduce HPB feature Daejun Park
2020-12-19  9:20 ` [PATCH v16 3/3] scsi: ufs: Prepare HPB read for cached sub-region Daejun Park

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=X93XuJ4lsQbBgnU+@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=adel.choi@samsung.com \
    --cc=alim.akhtar@samsung.com \
    --cc=asutoshd@codeaurora.org \
    --cc=avri.altman@wdc.com \
    --cc=boram.shin@samsung.com \
    --cc=bvanassche@acm.org \
    --cc=cang@codeaurora.org \
    --cc=daejun7.park@samsung.com \
    --cc=huobean@gmail.com \
    --cc=j-young.choi@samsung.com \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=seunguk.shin@samsung.com \
    --cc=stanley.chu@mediatek.com \
    --cc=sungjun07.park@samsung.com \
    --cc=ymhungry.lee@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).