mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Garry <john.g.garry@oracle.com>
To: "Bao D. Nguyen" <quic_nguyenb@quicinc.com>,
	quic_asutoshd@quicinc.com, quic_cang@quicinc.com,
	bvanassche@acm.org, mani@kernel.org, stanley.chu@mediatek.com,
	adrian.hunter@intel.com, beanhuo@micron.com, avri.altman@wdc.com,
	martin.petersen@oracle.com
Cc: linux-scsi@vger.kernel.org, Alim Akhtar <alim.akhtar@samsung.com>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	Arthur Simchaev <Arthur.Simchaev@wdc.com>,
	Eric Biggers <ebiggers@google.com>,
	Kiwoong Kim <kwmad.kim@samsung.com>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH v3 1/5] ufs: mcq: Add supporting functions for mcq abort
Date: Thu, 23 Mar 2023 10:07:23 +0000	[thread overview]
Message-ID: <e251e5c3-152e-3ebe-aa9f-c5cfa36cfc3f@oracle.com> (raw)
In-Reply-To: <90b7b370269674fd7c0f505b59e0993c5b95a316.1679564391.git.quic_nguyenb@quicinc.com>

On 23/03/2023 09:53, Bao D. Nguyen wrote:
> +static int ufshcd_mcq_poll_register(void __iomem *reg, u32 mask,
> +			u32 val, unsigned long timeout_ms)
> +{
> +	unsigned long timeout = jiffies + msecs_to_jiffies(timeout_ms);
> +	int err = 0;
> +
> +	/* ignore bits that we don't intend to wait on */
> +	val = val & mask;
> +
> +	while ((readl(reg) & mask) != val) {
> +		usleep_range(10, 50);
> +		if (time_after(jiffies, timeout)) {
> +			err = -ETIMEDOUT;
> +			break;
> +		}

This looks just like readl_poll_timeout()

> +	}
> +
> +	return err;
> +}


  reply	other threads:[~2023-03-23 10:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1679564391.git.quic_nguyenb@quicinc.com>
2023-03-23  9:53 ` Bao D. Nguyen
2023-03-23 10:07   ` John Garry [this message]
2023-03-23 10:38     ` Bao D. Nguyen
2023-03-23  9:53 ` [RFC PATCH v3 2/5] ufs: mcq: Add support for clean up mcq resources Bao D. Nguyen
2023-03-23  9:53 ` [RFC PATCH v3 3/5] ufs: mcq: Added ufshcd_mcq_abort() Bao D. Nguyen
2023-03-23  9:53 ` [RFC PATCH v3 4/5] ufs: mcq: Use ufshcd_mcq_poll_cqe_lock() in mcq mode Bao D. Nguyen
2023-03-23  9:53 ` [RFC PATCH v3 5/5] ufs: core: Add error handling for MCQ mode Bao D. Nguyen

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=e251e5c3-152e-3ebe-aa9f-c5cfa36cfc3f@oracle.com \
    --to=john.g.garry@oracle.com \
    --cc=Arthur.Simchaev@wdc.com \
    --cc=adrian.hunter@intel.com \
    --cc=alim.akhtar@samsung.com \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=bvanassche@acm.org \
    --cc=ebiggers@google.com \
    --cc=jejb@linux.ibm.com \
    --cc=kwmad.kim@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mani@kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=quic_asutoshd@quicinc.com \
    --cc=quic_cang@quicinc.com \
    --cc=quic_nguyenb@quicinc.com \
    --cc=stanley.chu@mediatek.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

all inboxes | Powered by JetHome®