public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] mmc: cqhci: Fix for check CQHCI_HALT state.
       [not found] <CGME20240829061834epcas1p127b6ec517e904efbf1eba945fbfd4bb0@epcas1p1.samsung.com>
@ 2024-08-29  6:18 ` Seunghwan Baek
  2024-08-29  6:18   ` [PATCH v2 1/2] mmc: cqhci: Fix checking of " Seunghwan Baek
  2024-08-29  6:18   ` [PATCH v2 2/2] cqhci-core: Make use cqhci_halted() routine Seunghwan Baek
  0 siblings, 2 replies; 9+ messages in thread
From: Seunghwan Baek @ 2024-08-29  6:18 UTC (permalink / raw)
  To: linux-kernel, linux-mmc, ulf.hansson, ritesh.list, quic_asutoshd,
	adrian.hunter
  Cc: grant.jung, jt77.jang, junwoo80.lee, dh0421.hwang, jangsub.yi,
	sh043.lee, cw9316.lee, sh8267.baek, wkon.kim

Code fix for check cqe halt state.

---
Changes in v2:
 - Modify and delete "Fixes" tag.
 - Change the subject of each commit.

---

Seunghwan Baek (2):
  mmc: cqhci: Fix checking of CQHCI_HALT state
  cqhci-core: Make use cqhci_halted() routine

 drivers/mmc/host/cqhci-core.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2 1/2] mmc: cqhci: Fix checking of CQHCI_HALT state
  2024-08-29  6:18 ` [PATCH v2 0/2] mmc: cqhci: Fix for check CQHCI_HALT state Seunghwan Baek
@ 2024-08-29  6:18   ` Seunghwan Baek
  2024-08-29  6:46     ` Ritesh Harjani
                       ` (2 more replies)
  2024-08-29  6:18   ` [PATCH v2 2/2] cqhci-core: Make use cqhci_halted() routine Seunghwan Baek
  1 sibling, 3 replies; 9+ messages in thread
From: Seunghwan Baek @ 2024-08-29  6:18 UTC (permalink / raw)
  To: linux-kernel, linux-mmc, ulf.hansson, ritesh.list, quic_asutoshd,
	adrian.hunter
  Cc: grant.jung, jt77.jang, junwoo80.lee, dh0421.hwang, jangsub.yi,
	sh043.lee, cw9316.lee, sh8267.baek, wkon.kim, stable

To check if mmc cqe is in halt state, need to check set/clear of CQHCI_HALT
bit. At this time, we need to check with &, not &&.

Fixes: a4080225f51d ("mmc: cqhci: support for command queue enabled host")
Cc: stable@vger.kernel.org
Signed-off-by: Seunghwan Baek <sh8267.baek@samsung.com>
---
 drivers/mmc/host/cqhci-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/cqhci-core.c b/drivers/mmc/host/cqhci-core.c
index c14d7251d0bb..a02da26a1efd 100644
--- a/drivers/mmc/host/cqhci-core.c
+++ b/drivers/mmc/host/cqhci-core.c
@@ -617,7 +617,7 @@ static int cqhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
 		cqhci_writel(cq_host, 0, CQHCI_CTL);
 		mmc->cqe_on = true;
 		pr_debug("%s: cqhci: CQE on\n", mmc_hostname(mmc));
-		if (cqhci_readl(cq_host, CQHCI_CTL) && CQHCI_HALT) {
+		if (cqhci_readl(cq_host, CQHCI_CTL) & CQHCI_HALT) {
 			pr_err("%s: cqhci: CQE failed to exit halt state\n",
 			       mmc_hostname(mmc));
 		}
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 2/2] cqhci-core: Make use cqhci_halted() routine
  2024-08-29  6:18 ` [PATCH v2 0/2] mmc: cqhci: Fix for check CQHCI_HALT state Seunghwan Baek
  2024-08-29  6:18   ` [PATCH v2 1/2] mmc: cqhci: Fix checking of " Seunghwan Baek
@ 2024-08-29  6:18   ` Seunghwan Baek
  2024-08-29  6:48     ` Ritesh Harjani
                       ` (2 more replies)
  1 sibling, 3 replies; 9+ messages in thread
From: Seunghwan Baek @ 2024-08-29  6:18 UTC (permalink / raw)
  To: linux-kernel, linux-mmc, ulf.hansson, ritesh.list, quic_asutoshd,
	adrian.hunter
  Cc: grant.jung, jt77.jang, junwoo80.lee, dh0421.hwang, jangsub.yi,
	sh043.lee, cw9316.lee, sh8267.baek, wkon.kim

Code to check whether cqe is in halt state is modified to cqhci_halted,
which has already been implemented.

Signed-off-by: Seunghwan Baek <sh8267.baek@samsung.com>
---
 drivers/mmc/host/cqhci-core.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/mmc/host/cqhci-core.c b/drivers/mmc/host/cqhci-core.c
index a02da26a1efd..178277d90c31 100644
--- a/drivers/mmc/host/cqhci-core.c
+++ b/drivers/mmc/host/cqhci-core.c
@@ -33,6 +33,11 @@ struct cqhci_slot {
 #define CQHCI_HOST_OTHER	BIT(4)
 };
 
+static bool cqhci_halted(struct cqhci_host *cq_host)
+{
+	return cqhci_readl(cq_host, CQHCI_CTL) & CQHCI_HALT;
+}
+
 static inline u8 *get_desc(struct cqhci_host *cq_host, u8 tag)
 {
 	return cq_host->desc_base + (tag * cq_host->slot_sz);
@@ -282,7 +287,7 @@ static void __cqhci_enable(struct cqhci_host *cq_host)
 
 	cqhci_writel(cq_host, cqcfg, CQHCI_CFG);
 
-	if (cqhci_readl(cq_host, CQHCI_CTL) & CQHCI_HALT)
+	if (cqhci_halted(cq_host))
 		cqhci_writel(cq_host, 0, CQHCI_CTL);
 
 	mmc->cqe_on = true;
@@ -617,7 +622,7 @@ static int cqhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
 		cqhci_writel(cq_host, 0, CQHCI_CTL);
 		mmc->cqe_on = true;
 		pr_debug("%s: cqhci: CQE on\n", mmc_hostname(mmc));
-		if (cqhci_readl(cq_host, CQHCI_CTL) & CQHCI_HALT) {
+		if (cqhci_halted(cq_host)) {
 			pr_err("%s: cqhci: CQE failed to exit halt state\n",
 			       mmc_hostname(mmc));
 		}
@@ -953,11 +958,6 @@ static bool cqhci_clear_all_tasks(struct mmc_host *mmc, unsigned int timeout)
 	return ret;
 }
 
-static bool cqhci_halted(struct cqhci_host *cq_host)
-{
-	return cqhci_readl(cq_host, CQHCI_CTL) & CQHCI_HALT;
-}
-
 static bool cqhci_halt(struct mmc_host *mmc, unsigned int timeout)
 {
 	struct cqhci_host *cq_host = mmc->cqe_private;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 1/2] mmc: cqhci: Fix checking of CQHCI_HALT state
  2024-08-29  6:18   ` [PATCH v2 1/2] mmc: cqhci: Fix checking of " Seunghwan Baek
@ 2024-08-29  6:46     ` Ritesh Harjani
  2024-09-02 10:27     ` Adrian Hunter
  2024-09-03 12:37     ` Ulf Hansson
  2 siblings, 0 replies; 9+ messages in thread
From: Ritesh Harjani @ 2024-08-29  6:46 UTC (permalink / raw)
  To: Seunghwan Baek, linux-kernel, linux-mmc, ulf.hansson,
	quic_asutoshd, adrian.hunter
  Cc: grant.jung, jt77.jang, junwoo80.lee, dh0421.hwang, jangsub.yi,
	sh043.lee, cw9316.lee, sh8267.baek, wkon.kim, stable

Seunghwan Baek <sh8267.baek@samsung.com> writes:

> To check if mmc cqe is in halt state, need to check set/clear of CQHCI_HALT
> bit. At this time, we need to check with &, not &&.
>
> Fixes: a4080225f51d ("mmc: cqhci: support for command queue enabled host")
> Cc: stable@vger.kernel.org
> Signed-off-by: Seunghwan Baek <sh8267.baek@samsung.com>

Thanks for fixing it. Please feel free to add - 
Reviewed-by: Ritesh Harjani <ritesh.list@gmail.com>

> ---
>  drivers/mmc/host/cqhci-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/cqhci-core.c b/drivers/mmc/host/cqhci-core.c
> index c14d7251d0bb..a02da26a1efd 100644
> --- a/drivers/mmc/host/cqhci-core.c
> +++ b/drivers/mmc/host/cqhci-core.c
> @@ -617,7 +617,7 @@ static int cqhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
>  		cqhci_writel(cq_host, 0, CQHCI_CTL);
>  		mmc->cqe_on = true;
>  		pr_debug("%s: cqhci: CQE on\n", mmc_hostname(mmc));
> -		if (cqhci_readl(cq_host, CQHCI_CTL) && CQHCI_HALT) {
> +		if (cqhci_readl(cq_host, CQHCI_CTL) & CQHCI_HALT) {
>  			pr_err("%s: cqhci: CQE failed to exit halt state\n",
>  			       mmc_hostname(mmc));
>  		}
> -- 
> 2.17.1

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 2/2] cqhci-core: Make use cqhci_halted() routine
  2024-08-29  6:18   ` [PATCH v2 2/2] cqhci-core: Make use cqhci_halted() routine Seunghwan Baek
@ 2024-08-29  6:48     ` Ritesh Harjani
  2024-09-02 10:34     ` Adrian Hunter
  2024-09-03 12:37     ` Ulf Hansson
  2 siblings, 0 replies; 9+ messages in thread
From: Ritesh Harjani @ 2024-08-29  6:48 UTC (permalink / raw)
  To: Seunghwan Baek, linux-kernel, linux-mmc, ulf.hansson,
	quic_asutoshd, adrian.hunter
  Cc: grant.jung, jt77.jang, junwoo80.lee, dh0421.hwang, jangsub.yi,
	sh043.lee, cw9316.lee, sh8267.baek, wkon.kim

Seunghwan Baek <sh8267.baek@samsung.com> writes:

> Code to check whether cqe is in halt state is modified to cqhci_halted,
> which has already been implemented.
>
> Signed-off-by: Seunghwan Baek <sh8267.baek@samsung.com>

LGTM. Please feel free to add - 

Reviewed-by: Ritesh Harjani <ritesh.list@gmail.com> 


> ---
>  drivers/mmc/host/cqhci-core.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/mmc/host/cqhci-core.c b/drivers/mmc/host/cqhci-core.c
> index a02da26a1efd..178277d90c31 100644
> --- a/drivers/mmc/host/cqhci-core.c
> +++ b/drivers/mmc/host/cqhci-core.c
> @@ -33,6 +33,11 @@ struct cqhci_slot {
>  #define CQHCI_HOST_OTHER	BIT(4)
>  };
>  
> +static bool cqhci_halted(struct cqhci_host *cq_host)
> +{
> +	return cqhci_readl(cq_host, CQHCI_CTL) & CQHCI_HALT;
> +}
> +
>  static inline u8 *get_desc(struct cqhci_host *cq_host, u8 tag)
>  {
>  	return cq_host->desc_base + (tag * cq_host->slot_sz);
> @@ -282,7 +287,7 @@ static void __cqhci_enable(struct cqhci_host *cq_host)
>  
>  	cqhci_writel(cq_host, cqcfg, CQHCI_CFG);
>  
> -	if (cqhci_readl(cq_host, CQHCI_CTL) & CQHCI_HALT)
> +	if (cqhci_halted(cq_host))
>  		cqhci_writel(cq_host, 0, CQHCI_CTL);
>  
>  	mmc->cqe_on = true;
> @@ -617,7 +622,7 @@ static int cqhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
>  		cqhci_writel(cq_host, 0, CQHCI_CTL);
>  		mmc->cqe_on = true;
>  		pr_debug("%s: cqhci: CQE on\n", mmc_hostname(mmc));
> -		if (cqhci_readl(cq_host, CQHCI_CTL) & CQHCI_HALT) {
> +		if (cqhci_halted(cq_host)) {
>  			pr_err("%s: cqhci: CQE failed to exit halt state\n",
>  			       mmc_hostname(mmc));
>  		}
> @@ -953,11 +958,6 @@ static bool cqhci_clear_all_tasks(struct mmc_host *mmc, unsigned int timeout)
>  	return ret;
>  }
>  
> -static bool cqhci_halted(struct cqhci_host *cq_host)
> -{
> -	return cqhci_readl(cq_host, CQHCI_CTL) & CQHCI_HALT;
> -}
> -
>  static bool cqhci_halt(struct mmc_host *mmc, unsigned int timeout)
>  {
>  	struct cqhci_host *cq_host = mmc->cqe_private;
> -- 
> 2.17.1

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 1/2] mmc: cqhci: Fix checking of CQHCI_HALT state
  2024-08-29  6:18   ` [PATCH v2 1/2] mmc: cqhci: Fix checking of " Seunghwan Baek
  2024-08-29  6:46     ` Ritesh Harjani
@ 2024-09-02 10:27     ` Adrian Hunter
  2024-09-03 12:37     ` Ulf Hansson
  2 siblings, 0 replies; 9+ messages in thread
From: Adrian Hunter @ 2024-09-02 10:27 UTC (permalink / raw)
  To: Seunghwan Baek, linux-kernel, linux-mmc, ulf.hansson, ritesh.list,
	quic_asutoshd
  Cc: grant.jung, jt77.jang, junwoo80.lee, dh0421.hwang, jangsub.yi,
	sh043.lee, cw9316.lee, wkon.kim, stable

On 29/08/24 09:18, Seunghwan Baek wrote:
> To check if mmc cqe is in halt state, need to check set/clear of CQHCI_HALT
> bit. At this time, we need to check with &, not &&.
> 
> Fixes: a4080225f51d ("mmc: cqhci: support for command queue enabled host")
> Cc: stable@vger.kernel.org
> Signed-off-by: Seunghwan Baek <sh8267.baek@samsung.com>

Acked-by: Adrian Hunter <adrian.hunter@intel.com>

> ---
>  drivers/mmc/host/cqhci-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/cqhci-core.c b/drivers/mmc/host/cqhci-core.c
> index c14d7251d0bb..a02da26a1efd 100644
> --- a/drivers/mmc/host/cqhci-core.c
> +++ b/drivers/mmc/host/cqhci-core.c
> @@ -617,7 +617,7 @@ static int cqhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
>  		cqhci_writel(cq_host, 0, CQHCI_CTL);
>  		mmc->cqe_on = true;
>  		pr_debug("%s: cqhci: CQE on\n", mmc_hostname(mmc));
> -		if (cqhci_readl(cq_host, CQHCI_CTL) && CQHCI_HALT) {
> +		if (cqhci_readl(cq_host, CQHCI_CTL) & CQHCI_HALT) {
>  			pr_err("%s: cqhci: CQE failed to exit halt state\n",
>  			       mmc_hostname(mmc));
>  		}


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 2/2] cqhci-core: Make use cqhci_halted() routine
  2024-08-29  6:18   ` [PATCH v2 2/2] cqhci-core: Make use cqhci_halted() routine Seunghwan Baek
  2024-08-29  6:48     ` Ritesh Harjani
@ 2024-09-02 10:34     ` Adrian Hunter
  2024-09-03 12:37     ` Ulf Hansson
  2 siblings, 0 replies; 9+ messages in thread
From: Adrian Hunter @ 2024-09-02 10:34 UTC (permalink / raw)
  To: Seunghwan Baek, linux-kernel, linux-mmc, ulf.hansson, ritesh.list,
	quic_asutoshd
  Cc: grant.jung, jt77.jang, junwoo80.lee, dh0421.hwang, jangsub.yi,
	sh043.lee, cw9316.lee, wkon.kim

On 29/08/24 09:18, Seunghwan Baek wrote:
> Code to check whether cqe is in halt state is modified to cqhci_halted,

'to cqhci_halted' -> to use 'cqhci_halted()'

(and re-wrap text to 75 columns)

> which has already been implemented.
> 
> Signed-off-by: Seunghwan Baek <sh8267.baek@samsung.com>

For consistency subject could start "mmc: cqhci:" instead of "cqhci-core:"

Otherwise:

Acked-by: Adrian Hunter <adrian.hunter@intel.com>

> ---
>  drivers/mmc/host/cqhci-core.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/mmc/host/cqhci-core.c b/drivers/mmc/host/cqhci-core.c
> index a02da26a1efd..178277d90c31 100644
> --- a/drivers/mmc/host/cqhci-core.c
> +++ b/drivers/mmc/host/cqhci-core.c
> @@ -33,6 +33,11 @@ struct cqhci_slot {
>  #define CQHCI_HOST_OTHER	BIT(4)
>  };
>  
> +static bool cqhci_halted(struct cqhci_host *cq_host)
> +{
> +	return cqhci_readl(cq_host, CQHCI_CTL) & CQHCI_HALT;
> +}
> +
>  static inline u8 *get_desc(struct cqhci_host *cq_host, u8 tag)
>  {
>  	return cq_host->desc_base + (tag * cq_host->slot_sz);
> @@ -282,7 +287,7 @@ static void __cqhci_enable(struct cqhci_host *cq_host)
>  
>  	cqhci_writel(cq_host, cqcfg, CQHCI_CFG);
>  
> -	if (cqhci_readl(cq_host, CQHCI_CTL) & CQHCI_HALT)
> +	if (cqhci_halted(cq_host))
>  		cqhci_writel(cq_host, 0, CQHCI_CTL);
>  
>  	mmc->cqe_on = true;
> @@ -617,7 +622,7 @@ static int cqhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
>  		cqhci_writel(cq_host, 0, CQHCI_CTL);
>  		mmc->cqe_on = true;
>  		pr_debug("%s: cqhci: CQE on\n", mmc_hostname(mmc));
> -		if (cqhci_readl(cq_host, CQHCI_CTL) & CQHCI_HALT) {
> +		if (cqhci_halted(cq_host)) {
>  			pr_err("%s: cqhci: CQE failed to exit halt state\n",
>  			       mmc_hostname(mmc));
>  		}
> @@ -953,11 +958,6 @@ static bool cqhci_clear_all_tasks(struct mmc_host *mmc, unsigned int timeout)
>  	return ret;
>  }
>  
> -static bool cqhci_halted(struct cqhci_host *cq_host)
> -{
> -	return cqhci_readl(cq_host, CQHCI_CTL) & CQHCI_HALT;
> -}
> -
>  static bool cqhci_halt(struct mmc_host *mmc, unsigned int timeout)
>  {
>  	struct cqhci_host *cq_host = mmc->cqe_private;


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 1/2] mmc: cqhci: Fix checking of CQHCI_HALT state
  2024-08-29  6:18   ` [PATCH v2 1/2] mmc: cqhci: Fix checking of " Seunghwan Baek
  2024-08-29  6:46     ` Ritesh Harjani
  2024-09-02 10:27     ` Adrian Hunter
@ 2024-09-03 12:37     ` Ulf Hansson
  2 siblings, 0 replies; 9+ messages in thread
From: Ulf Hansson @ 2024-09-03 12:37 UTC (permalink / raw)
  To: Seunghwan Baek
  Cc: linux-kernel, linux-mmc, ritesh.list, quic_asutoshd,
	adrian.hunter, grant.jung, jt77.jang, junwoo80.lee, dh0421.hwang,
	jangsub.yi, sh043.lee, cw9316.lee, wkon.kim, stable

On Thu, 29 Aug 2024 at 08:18, Seunghwan Baek <sh8267.baek@samsung.com> wrote:
>
> To check if mmc cqe is in halt state, need to check set/clear of CQHCI_HALT
> bit. At this time, we need to check with &, not &&.
>
> Fixes: a4080225f51d ("mmc: cqhci: support for command queue enabled host")
> Cc: stable@vger.kernel.org
> Signed-off-by: Seunghwan Baek <sh8267.baek@samsung.com>

Applied for fixes, thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/host/cqhci-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/cqhci-core.c b/drivers/mmc/host/cqhci-core.c
> index c14d7251d0bb..a02da26a1efd 100644
> --- a/drivers/mmc/host/cqhci-core.c
> +++ b/drivers/mmc/host/cqhci-core.c
> @@ -617,7 +617,7 @@ static int cqhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
>                 cqhci_writel(cq_host, 0, CQHCI_CTL);
>                 mmc->cqe_on = true;
>                 pr_debug("%s: cqhci: CQE on\n", mmc_hostname(mmc));
> -               if (cqhci_readl(cq_host, CQHCI_CTL) && CQHCI_HALT) {
> +               if (cqhci_readl(cq_host, CQHCI_CTL) & CQHCI_HALT) {
>                         pr_err("%s: cqhci: CQE failed to exit halt state\n",
>                                mmc_hostname(mmc));
>                 }
> --
> 2.17.1
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 2/2] cqhci-core: Make use cqhci_halted() routine
  2024-08-29  6:18   ` [PATCH v2 2/2] cqhci-core: Make use cqhci_halted() routine Seunghwan Baek
  2024-08-29  6:48     ` Ritesh Harjani
  2024-09-02 10:34     ` Adrian Hunter
@ 2024-09-03 12:37     ` Ulf Hansson
  2 siblings, 0 replies; 9+ messages in thread
From: Ulf Hansson @ 2024-09-03 12:37 UTC (permalink / raw)
  To: Seunghwan Baek
  Cc: linux-kernel, linux-mmc, ritesh.list, quic_asutoshd,
	adrian.hunter, grant.jung, jt77.jang, junwoo80.lee, dh0421.hwang,
	jangsub.yi, sh043.lee, cw9316.lee, wkon.kim

On Thu, 29 Aug 2024 at 08:18, Seunghwan Baek <sh8267.baek@samsung.com> wrote:
>
> Code to check whether cqe is in halt state is modified to cqhci_halted,
> which has already been implemented.
>
> Signed-off-by: Seunghwan Baek <sh8267.baek@samsung.com>

Applied for next (and by amending the commit message according to
suggestions from Adrian), thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/host/cqhci-core.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/mmc/host/cqhci-core.c b/drivers/mmc/host/cqhci-core.c
> index a02da26a1efd..178277d90c31 100644
> --- a/drivers/mmc/host/cqhci-core.c
> +++ b/drivers/mmc/host/cqhci-core.c
> @@ -33,6 +33,11 @@ struct cqhci_slot {
>  #define CQHCI_HOST_OTHER       BIT(4)
>  };
>
> +static bool cqhci_halted(struct cqhci_host *cq_host)
> +{
> +       return cqhci_readl(cq_host, CQHCI_CTL) & CQHCI_HALT;
> +}
> +
>  static inline u8 *get_desc(struct cqhci_host *cq_host, u8 tag)
>  {
>         return cq_host->desc_base + (tag * cq_host->slot_sz);
> @@ -282,7 +287,7 @@ static void __cqhci_enable(struct cqhci_host *cq_host)
>
>         cqhci_writel(cq_host, cqcfg, CQHCI_CFG);
>
> -       if (cqhci_readl(cq_host, CQHCI_CTL) & CQHCI_HALT)
> +       if (cqhci_halted(cq_host))
>                 cqhci_writel(cq_host, 0, CQHCI_CTL);
>
>         mmc->cqe_on = true;
> @@ -617,7 +622,7 @@ static int cqhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
>                 cqhci_writel(cq_host, 0, CQHCI_CTL);
>                 mmc->cqe_on = true;
>                 pr_debug("%s: cqhci: CQE on\n", mmc_hostname(mmc));
> -               if (cqhci_readl(cq_host, CQHCI_CTL) & CQHCI_HALT) {
> +               if (cqhci_halted(cq_host)) {
>                         pr_err("%s: cqhci: CQE failed to exit halt state\n",
>                                mmc_hostname(mmc));
>                 }
> @@ -953,11 +958,6 @@ static bool cqhci_clear_all_tasks(struct mmc_host *mmc, unsigned int timeout)
>         return ret;
>  }
>
> -static bool cqhci_halted(struct cqhci_host *cq_host)
> -{
> -       return cqhci_readl(cq_host, CQHCI_CTL) & CQHCI_HALT;
> -}
> -
>  static bool cqhci_halt(struct mmc_host *mmc, unsigned int timeout)
>  {
>         struct cqhci_host *cq_host = mmc->cqe_private;
> --
> 2.17.1
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-09-03 12:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20240829061834epcas1p127b6ec517e904efbf1eba945fbfd4bb0@epcas1p1.samsung.com>
2024-08-29  6:18 ` [PATCH v2 0/2] mmc: cqhci: Fix for check CQHCI_HALT state Seunghwan Baek
2024-08-29  6:18   ` [PATCH v2 1/2] mmc: cqhci: Fix checking of " Seunghwan Baek
2024-08-29  6:46     ` Ritesh Harjani
2024-09-02 10:27     ` Adrian Hunter
2024-09-03 12:37     ` Ulf Hansson
2024-08-29  6:18   ` [PATCH v2 2/2] cqhci-core: Make use cqhci_halted() routine Seunghwan Baek
2024-08-29  6:48     ` Ritesh Harjani
2024-09-02 10:34     ` Adrian Hunter
2024-09-03 12:37     ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox