From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ADC16C43381 for ; Sun, 10 Mar 2019 12:58:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 75868206DF for ; Sun, 10 Mar 2019 12:58:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="CPMKxYfe" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726488AbfCJM6u (ORCPT ); Sun, 10 Mar 2019 08:58:50 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:35340 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725885AbfCJM6u (ORCPT ); Sun, 10 Mar 2019 08:58:50 -0400 Received: from pendragon.ideasonboard.com (dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi [IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 4E1A8255; Sun, 10 Mar 2019 13:58:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1552222727; bh=6uRyZtmm96kGqGcCi7BuwlheDExNjMIXrRa632OUnxk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CPMKxYfe7EmpClZcpFwfjJ1nlNQBIazL8w4VqhXQoEW61iSQ4vFBe68UIN1Co+U8U D/WW0CMUtVIVAU+2YWBxe867heLJXMDfQIUOUoHcTHJ8aJHVXKPKjMetTvUdxR6RLv yD5Iy2YiJvC2Ig2toqMRi/7pzgez7ZSpAsE+XAcM= Date: Sun, 10 Mar 2019 14:58:41 +0200 From: Laurent Pinchart To: Kangjie Lu Cc: pakki001@umn.edu, Ulf Hansson , Linus Walleij , Laurent Pinchart , Jonathan =?utf-8?Q?Neusch=C3=A4fer?= , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mmc_spi: add a status check for spi_sync_locked Message-ID: <20190310125841.GA4814@pendragon.ideasonboard.com> References: <20190310075306.2193-1-kjlu@umn.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190310075306.2193-1-kjlu@umn.edu> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Kangjie, Thank you for the patch. On Sun, Mar 10, 2019 at 01:53:05AM -0600, Kangjie Lu wrote: > In case spi_sync_locked fails, the fix reports the error and > returns the error code upstream. > > Signed-off-by: Kangjie Lu > --- > drivers/mmc/host/mmc_spi.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/mmc/host/mmc_spi.c b/drivers/mmc/host/mmc_spi.c > index 1b1498805972..32fea585262b 100644 > --- a/drivers/mmc/host/mmc_spi.c > +++ b/drivers/mmc/host/mmc_spi.c > @@ -819,6 +819,10 @@ mmc_spi_readblock(struct mmc_spi_host *host, struct spi_transfer *t, > } > > status = spi_sync_locked(spi, &host->m); > + if (status < 0) { > + dev_dbg(&spi->dev, "read error %02x (%d)\n", status, status); I don't think you need to print the status in both hex and in decimal forms. %d should be enough, error codes are usually printed in decimal in the kernel. Apart from that, Reviewed-by: Laurent Pinchart > + return status; > + } > > if (host->dma_dev) { > dma_sync_single_for_cpu(host->dma_dev, -- Regards, Laurent Pinchart