From: Bean Huo <huobean@gmail.com>
To: Avri Altman <avri.altman@wdc.com>,
"James E . J . Bottomley" <jejb@linux.vnet.ibm.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>
Cc: Bart Van Assche <bvanassche@acm.org>,
Bean Huo <beanhuo@micron.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 4/4] scsi: ufs: Re-use compose_devman_upiu
Date: Thu, 07 Mar 2024 14:06:33 +0100 [thread overview]
Message-ID: <6826cdb060609f81c970fc21b2050535f7c5a810.camel@gmail.com> (raw)
In-Reply-To: <20240305210051.10847-5-avri.altman@wdc.com>
On Tue, 2024-03-05 at 23:00 +0200, Avri Altman wrote:
> diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
> index c9c2b7f99758..a39a2b34ee2b 100644
> --- a/drivers/ufs/core/ufshcd.c
> +++ b/drivers/ufs/core/ufshcd.c
> @@ -2710,18 +2710,27 @@ static void ufshcd_disable_intr(struct
> ufs_hba *hba, u32 intrs)
> /**
> * ufshcd_prepare_req_desc_hdr - Fill UTP Transfer request
> descriptor header according to request
> * descriptor according to request
> + * @hba: per adapter instance
> * @lrbp: pointer to local reference block
> * @upiu_flags: flags required in the header
> * @cmd_dir: requests data direction
> * @ehs_length: Total EHS Length (in 32‐bytes units of all Extra
> Header Segments)
> + * @scsi: scsi or device management`
^ '`'
> */
> -static void ufshcd_prepare_req_desc_hdr(struct ufshcd_lrb *lrbp, u8
> *upiu_flags,
> - enum dma_data_direction
> cmd_dir, int ehs_length)
> +static void
> +ufshcd_prepare_req_desc_hdr(struct ufs_hba *hba, struct ufshcd_lrb
> *lrbp,
> + u8 *upiu_flags, enum dma_data_direction
> cmd_dir,
> + int ehs_length, bool scsi)
Why not directly pass UTP_CMD_TYPE_SCSI or UTP_CMD_TYPE_DEV_MANAGE
instead of using below ?: logic?
> {
> struct utp_transfer_req_desc *req_desc = lrbp-
> >utr_descriptor_ptr;
> struct request_desc_header *h = &req_desc->header;
> enum utp_data_direction data_direction;
>
> + if (hba->ufs_version <= ufshci_version(1, 1))
> + lrbp->command_type = scsi ? UTP_CMD_TYPE_SCSI :
> UTP_CMD_TYPE_DEV_MANAGE;
next prev parent reply other threads:[~2024-03-07 13:06 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-05 21:00 [PATCH v2 0/4] Re-use device management code fragments Avri Altman
2024-03-05 21:00 ` [PATCH v2 1/4] scsi: ufs: Re-use device management locking code Avri Altman
2024-03-06 21:21 ` Bean Huo
2024-03-05 21:00 ` [PATCH v2 2/4] scsi: ufs: Re-use exec_dev_cmd Avri Altman
2024-03-06 22:05 ` Bean Huo
2024-03-07 19:28 ` Avri Altman
2024-03-08 19:29 ` Bean Huo
2024-03-08 19:42 ` Avri Altman
2024-03-05 21:00 ` [PATCH v2 3/4] scsi: ufs: Re-use compose_dev_cmd Avri Altman
2024-03-07 12:50 ` Bean Huo
2024-03-07 18:12 ` Bart Van Assche
2024-03-05 21:00 ` [PATCH v2 4/4] scsi: ufs: Re-use compose_devman_upiu Avri Altman
2024-03-07 13:06 ` Bean Huo [this message]
2024-03-07 19:26 ` Avri Altman
2024-03-08 22:32 ` Bart Van Assche
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=6826cdb060609f81c970fc21b2050535f7c5a810.camel@gmail.com \
--to=huobean@gmail.com \
--cc=avri.altman@wdc.com \
--cc=beanhuo@micron.com \
--cc=bvanassche@acm.org \
--cc=jejb@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.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