Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2754322rwb; Mon, 19 Sep 2022 09:26:44 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6tPXYJbd052t8ZPpXqk31aBcC4t9A20Vd3jLA7074eil43lrzj2I5qd6S4lHaqXPW5xlQr X-Received: by 2002:a17:907:3205:b0:770:8554:c4ee with SMTP id xg5-20020a170907320500b007708554c4eemr13314306ejb.39.1663604804544; Mon, 19 Sep 2022 09:26:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663604804; cv=none; d=google.com; s=arc-20160816; b=BUsiZKfxPrpY3h3Xr7I23fsToNEWDYdnQUJs6J2UAjqUyLlS1ghWPOPEZxlBK7j5no dkFPStWF9lPvvzIaECcocOn2JmjTWnmpKB4AwAtkPQagF8ywooZ6GoaF8s81FRgjDQ3t dbFukH00LC6QNHbSXHrfTyIG0Sioj5tmfB2Q6lii9leamfcV95O3Ogba5LBjClJfnmJz A5uy2Gg0Mereki3jXhQnxznrTEpNeG0RxRfPQctoFjzl5Gj6roFd0gCPmyClCfv+PgLM W2pwrWlwRyoCwgVptaVs3BgaiE+YIN9QFf0XCzs0VISs9JipxcCfSiAIINNulwAhJUz6 AUig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=4w2H0/aVozaHmubnqFnPjiPTuYGSRzmbJ5Wwl6IDQwM=; b=EmlkvQOy8OV8gMcFvgeLB7kI08Drev/uYnU5b+Tuki2Oyp29XjJf8AaPkF9cF0VSpk N2gaDPFevy/95ls31swM0j+5qkd1rRk6fYEaXwOkFy0RYXOXjvyc4V2yyPNMmgSkz3oW Fejy4epNglUbVuzxRCSnKkk9xLhQcBNXwqrNrU0KCiePP2+kpOoc5CLkpA44ddN6G39c 75pSA0KAvIn7wm7zwM0+oUa36+dGXlYGe34TuFjK6Ry9fPqv0NLEqwuYhkBSiW2nj0Ut 5miZu/rWy2VwH/RbDthkQ+7lKRSaeCISadloJEKWvN00RUESG9whs/6RQji1v9q3lLSQ mbRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Lcv42Ss9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h8-20020a056402280800b004520b2492a1si12625584ede.528.2022.09.19.09.26.19; Mon, 19 Sep 2022 09:26:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Lcv42Ss9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230198AbiISQCf (ORCPT + 99 others); Mon, 19 Sep 2022 12:02:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229991AbiISQCP (ORCPT ); Mon, 19 Sep 2022 12:02:15 -0400 Received: from relay10.mail.gandi.net (relay10.mail.gandi.net [IPv6:2001:4b98:dc4:8::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E7903AE52 for ; Mon, 19 Sep 2022 09:00:29 -0700 (PDT) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id EB70A24000E; Mon, 19 Sep 2022 16:00:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1663603227; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4w2H0/aVozaHmubnqFnPjiPTuYGSRzmbJ5Wwl6IDQwM=; b=Lcv42Ss9HGpIaCPVGZlsqSX3b4RETBixGo4uKB9QrhoufMMLiAxBu08X17z+G4slmrlwN9 Z6WowHP6ZO5LMXhxmBydcyUHnj54Jq2E3Mj4uVzL1yZstEYPbO4zJNE5J4XnvQ0h7POLr8 oSAVOOn21UXyjWZKkBGyiyp3sXrL7L8tfC7N5kWrIg/0GuF+sF8/rL/SPppLiv8tquBLre c5kwjH+1qwDO5GwgW93QEETcLp6ugYlLjWklnhej2XFyve0vxTaS2mL0BsR7l+LoEuJzLp 76RsJ5bA3HANiTyTGPiCUSrFbvWdg3bkXLJdQgX7i4ZgC5a+FUR6nlXpiNXjqw== Date: Mon, 19 Sep 2022 18:00:22 +0200 From: Miquel Raynal To: Jack Wang Cc: linux-mtd@lists.infradead.org, Richard Weinberger , Vignesh Raghavendra , Maxime Coquelin , Alexandre Torgue , Philipp Zabel , Christophe Kerello , Cai Huoqing , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] mtd: rawnand: stm32_fmc2: Fix dma_map_sg error check Message-ID: <20220919180022.2c80e2b7@xps-13> In-Reply-To: <20220825075338.35338-2-jinpu.wang@ionos.com> References: <20220825075338.35338-1-jinpu.wang@ionos.com> <20220825075338.35338-2-jinpu.wang@ionos.com> Organization: Bootlin X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jack, jinpu.wang@ionos.com wrote on Thu, 25 Aug 2022 09:53:37 +0200: > dma_map_sg return 0 on error, in case of error return -EIO. >=20 > Cc: Miquel Raynal > Cc: Richard Weinberger > Cc: Vignesh Raghavendra > Cc: Maxime Coquelin > Cc: Alexandre Torgue > Cc: Philipp Zabel > Cc: Christophe Kerello > Cc: Cai Huoqing > Cc: linux-mtd@lists.infradead.org > Cc: linux-stm32@st-md-mailman.stormreply.com > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-kernel@vger.kernel.org > Fixes: 2cd457f328c1 ("mtd: rawnand: stm32_fmc2: add STM32 FMC2 NAND flash= controller driver") > Signed-off-by: Jack Wang I'll apply this series so I need to re-add Christophe's tag sent on the patch alone (which is identical as far as I see): Reviewed-by: Christophe Kerello > --- > drivers/mtd/nand/raw/stm32_fmc2_nand.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/mtd/nand/raw/stm32_fmc2_nand.c b/drivers/mtd/nand/ra= w/stm32_fmc2_nand.c > index 87c1c7dd97eb..a0c825af19fa 100644 > --- a/drivers/mtd/nand/raw/stm32_fmc2_nand.c > +++ b/drivers/mtd/nand/raw/stm32_fmc2_nand.c > @@ -862,8 +862,8 @@ static int stm32_fmc2_nfc_xfer(struct nand_chip *chip= , const u8 *buf, > =20 > ret =3D dma_map_sg(nfc->dev, nfc->dma_data_sg.sgl, > eccsteps, dma_data_dir); > - if (ret < 0) > - return ret; > + if (!ret) > + return -EIO; > =20 > desc_data =3D dmaengine_prep_slave_sg(dma_ch, nfc->dma_data_sg.sgl, > eccsteps, dma_transfer_dir, > @@ -893,8 +893,10 @@ static int stm32_fmc2_nfc_xfer(struct nand_chip *chi= p, const u8 *buf, > =20 > ret =3D dma_map_sg(nfc->dev, nfc->dma_ecc_sg.sgl, > eccsteps, dma_data_dir); > - if (ret < 0) > + if (!ret) { > + ret =3D -EIO; > goto err_unmap_data; > + } > =20 > desc_ecc =3D dmaengine_prep_slave_sg(nfc->dma_ecc_ch, > nfc->dma_ecc_sg.sgl, Thanks, Miqu=C3=A8l