public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Can Guo <cang@codeaurora.org>
To: daejun7.park@samsung.com
Cc: Greg KH <gregkh@linuxfoundation.org>,
	avri.altman@wdc.com, jejb@linux.ibm.com,
	martin.petersen@oracle.com, asutoshd@codeaurora.org,
	stanley.chu@mediatek.com, bvanassche@acm.org, huobean@gmail.com,
	ALIM AKHTAR <alim.akhtar@samsung.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	JinHwan Park <jh.i.park@samsung.com>,
	Javier Gonzalez <javier.gonz@samsung.com>,
	SEUNGUK SHIN <seunguk.shin@samsung.com>,
	Sung-Jun Park <sungjun07.park@samsung.com>,
	Jinyoung CHOI <j-young.choi@samsung.com>,
	BoRam Shin <boram.shin@samsung.com>
Subject: Re: [PATCH v29 4/4] scsi: ufs: Add HPB 2.0 support
Date: Mon, 15 Mar 2021 14:36:55 +0800	[thread overview]
Message-ID: <9eb5f8385f830bdec25828f17527c73f@codeaurora.org> (raw)
In-Reply-To: <20210315013137epcms2p861f06e66be9faff32b6648401778434a@epcms2p8>

On 2021-03-15 09:31, Daejun Park wrote:
> This patch supports the HPB 2.0.
> 
> The HPB 2.0 supports read of varying sizes from 4KB to 512KB.
> In the case of Read (<= 32KB) is supported as single HPB read.
> In the case of Read (36KB ~ 512KB) is supported by as a combination of
> write buffer command and HPB read command to deliver more PPN.
> The write buffer commands may not be issued immediately due to busy 
> tags.
> To use HPB read more aggressively, the driver can requeue the write 
> buffer
> command. The requeue threshold is implemented as timeout and can be
> modified with requeue_timeout_ms entry in sysfs.
> 
> Signed-off-by: Daejun Park <daejun7.park@samsung.com>
> ---
> +static int ufshpb_issue_pre_req(struct ufshpb_lu *hpb, struct 
> scsi_cmnd *cmd,
> +				int *read_id)
> +{
> +	struct ufshpb_req *pre_req;
> +	struct request *req = NULL;
> +	struct bio *bio = NULL;
> +	unsigned long flags;
> +	int _read_id;
> +	int ret = 0;
> +
> +	req = blk_get_request(cmd->device->request_queue,

To keep symmetry with ufshpb_get_req(), can we use 
hpb->sdev_ufs_lu->request_queue?

Thanks,
Can Guo.

> +			      REQ_OP_SCSI_OUT | REQ_SYNC, BLK_MQ_REQ_NOWAIT);
> +	if (IS_ERR(req))
> +		return -EAGAIN;
> +
> +	bio = bio_alloc(GFP_ATOMIC, 1);
> +	if (!bio) {
> +		blk_put_request(req);
> +		return -EAGAIN;
> +	}
> +
> +	spin_lock_irqsave(&hpb->rgn_state_lock, flags);
> +	pre_req = ufshpb_get_pre_req(hpb);
> +	if (!pre_req) {
> +		ret = -EAGAIN;
> +		goto unlock_out;
> +	}
> +	_read_id = ufshpb_get_read_id(hpb);
> +	spin_unlock_irqrestore(&hpb->rgn_state_lock, flags);
> +
> +	pre_req->req = req;
> +	pre_req->bio = bio;
> +
> +	ret = ufshpb_execute_pre_req(hpb, cmd, pre_req, _read_id);
> +	if (ret)
> +		goto free_pre_req;
> +
> +	*read_id = _read_id;
> +
> +	return ret;
> +free_pre_req:
> +	spin_lock_irqsave(&hpb->rgn_state_lock, flags);
> +	ufshpb_put_pre_req(hpb, pre_req);
> +unlock_out:
> +	spin_unlock_irqrestore(&hpb->rgn_state_lock, flags);
> +	bio_put(bio);
> +	blk_put_request(req);
> +	return ret;
> +}
> +

  parent reply	other threads:[~2021-03-15  6:37 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20210315012850epcms2p361447b689e925561c48aa9ca54434eb5@epcms2p3>
2021-03-15  1:28 ` [PATCH v29 0/4] scsi: ufs: Add Host Performance Booster Support Daejun Park
2021-03-15  1:29   ` [PATCH v29 1/4] scsi: ufs: Introduce HPB feature Daejun Park
2021-03-15  1:30   ` [PATCH v29 2/4] scsi: ufs: L2P map management for HPB read Daejun Park
2021-03-15  1:30   ` [PATCH v29 3/4] scsi: ufs: Prepare HPB read for cached sub-region Daejun Park
2021-03-15  1:31   ` [PATCH v29 4/4] scsi: ufs: Add HPB 2.0 support Daejun Park
2021-03-15  5:05     ` Can Guo
2021-03-15  7:07       ` Daejun Park
2021-03-15  7:23         ` Can Guo
2021-03-15  7:47           ` Can Guo
2021-03-17  1:42             ` Daejun Park
2021-03-17  2:45               ` Can Guo
2021-03-18  2:02                 ` Daejun Park
2021-03-18  2:25                   ` Can Guo
2021-03-18  2:29                     ` Daejun Park
2021-03-18  4:49                   ` Can Guo
2021-03-18  7:13                     ` Daejun Park
2021-03-15  6:36     ` Can Guo [this message]
2021-03-21 10:05     ` Avri Altman
2021-03-22  0:50       ` 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=9eb5f8385f830bdec25828f17527c73f@codeaurora.org \
    --to=cang@codeaurora.org \
    --cc=alim.akhtar@samsung.com \
    --cc=asutoshd@codeaurora.org \
    --cc=avri.altman@wdc.com \
    --cc=boram.shin@samsung.com \
    --cc=bvanassche@acm.org \
    --cc=daejun7.park@samsung.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=huobean@gmail.com \
    --cc=j-young.choi@samsung.com \
    --cc=javier.gonz@samsung.com \
    --cc=jejb@linux.ibm.com \
    --cc=jh.i.park@samsung.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 \
    /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