Re: [PATCH] mmc : fix for check cqe halt.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Seunghwan Baek <sh8267.baek@xxxxxxxxxxx> 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: 0653300224a6 ("mmc: cqhci: rename cqhci.c to cqhci-core.c")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Seunghwan Baek <sh8267.baek@xxxxxxxxxxx>
> ---
>  drivers/mmc/host/cqhci-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Thanks for fixing it!
Small suggestion below. But this still looks good to me, so either ways- 

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


>
> 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) {

There is already a helper cqhci_halted(). Maybe we could use that.

static bool cqhci_halted(struct cqhci_host *cq_host)
{
	return 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

-ritesh




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux