From: Santosh Y <santoshsy@gmail.com>
To: Dolev Raviv <draviv@codeaurora.org>
Cc: linux-scsi@vger.kernel.org, linux-arm-msm@vger.kernel.org,
Sujit Reddy Thumma <sthumma@codeaurora.org>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] scsi: ufs: Set fDeviceInit flag to initiate device initialization
Date: Wed, 12 Jun 2013 11:04:43 +0530 [thread overview]
Message-ID: <CALMYJDvXi7M8AgdJNpoL4H2-b3WBNZ3LLc2d8wkUMRJi5OQJQQ@mail.gmail.com> (raw)
In-Reply-To: <1370873118-18468-3-git-send-email-draviv@codeaurora.org>
>
> /**
> + * ufshcd_query_request() - API for issuing query request to the device.
> + * @hba: ufs driver context
> + * @query: params for query request
> + * @descriptor: buffer for sending/receiving descriptor
> + * @retries: number of times to try executing the command
> + *
> + * All necessary fields for issuing a query and receiving its response
> + * are stored in the UFS hba struct. We can use this method since we know
> + * there is only one active query request or any internal command at all
> + * times.
> + */
> +static int ufshcd_send_query_request(struct ufs_hba *hba,
> + struct ufs_query_req *query,
> + u8 *descriptor,
> + struct ufs_query_res *response)
> +{
> + int ret;
> +
> + BUG_ON(!hba);
> + if (!query || !response) {
> + dev_err(hba->dev,
> + "%s: NULL pointer query = %p, response = %p\n",
> + __func__, query, response);
> + return -EINVAL;
> + }
> +
> + mutex_lock(&hba->i_cmd.dev_cmd_lock);
> + hba->i_cmd.query.request = query;
> + hba->i_cmd.query.response = response;
> + hba->i_cmd.query.descriptor = descriptor;
> +
> + ret = ufshcd_exec_internal_cmd(hba, DEV_CMD_TYPE_QUERY,
> + QUERY_REQ_TIMEOUT);
Can this be generic, as external query commands might also use it?
> +
> + hba->i_cmd.query.request = NULL;
> + hba->i_cmd.query.response = NULL;
> + hba->i_cmd.query.descriptor = NULL;
> + mutex_unlock(&hba->i_cmd.dev_cmd_lock);
> +
> + return ret;
> +}
> +
> +/**
--
~Santosh
next prev parent reply other threads:[~2013-06-12 5:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-10 14:05 [PATCH 0/2] Dolev Raviv
2013-06-10 14:05 ` [PATCH 1/2] scsi: ufs: Add support for sending NOP OUT UPIU Dolev Raviv
2013-06-12 5:30 ` Santosh Y
2013-06-13 4:33 ` Sujit Reddy Thumma
2013-06-14 7:40 ` Sujit Reddy Thumma
2013-06-14 13:47 ` Santosh Y
2013-06-10 14:05 ` [PATCH 2/2] scsi: ufs: Set fDeviceInit flag to initiate device initialization Dolev Raviv
2013-06-12 5:34 ` Santosh Y [this message]
2013-06-13 4:36 ` Sujit Reddy Thumma
2013-06-14 13:55 ` Santosh Y
-- strict thread matches above, loose matches on Subject: below --
2013-06-10 14:12 [PATCH 0/2] Add suport for internal request (NOP and Query Request) Dolev Raviv
2013-06-10 14:12 ` [PATCH 2/2] scsi: ufs: Set fDeviceInit flag to initiate device initialization Dolev Raviv
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=CALMYJDvXi7M8AgdJNpoL4H2-b3WBNZ3LLc2d8wkUMRJi5OQJQQ@mail.gmail.com \
--to=santoshsy@gmail.com \
--cc=draviv@codeaurora.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=sthumma@codeaurora.org \
/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).