Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2975835rdb; Tue, 12 Sep 2023 19:44:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE13PUU+wHaYlvP/z1KssMP3uwUkgujUuCP95kxpALPbf8QKNC7FYJwmUmpD9ewvL2Cyb2q X-Received: by 2002:a05:6870:b6a4:b0:1d0:f5bd:6c8 with SMTP id cy36-20020a056870b6a400b001d0f5bd06c8mr1593937oab.5.1694573087684; Tue, 12 Sep 2023 19:44:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694573087; cv=none; d=google.com; s=arc-20160816; b=hvHxdSS7ArKsSuc4v/A67XROCZiJwxvPKTbkNGKK53SF3ph3fsxLtNfLGz5Suf43C+ ZRF16J1Q2ZnFXCeiLu1zI7uifcM0XMlrJJJd8E2EGof+HDILr3lVR6goAQA7EKl4lr+B sLDLsfGSMeSbqzKIdEyluM36zGq2uoJ6s50jg/WEBnk/Lgj8CuisU2Nu0vR11ofyYBJp QmTbMLC8xO9lb1IzSbmoXVTjqnFmnokE5LZ9R8gTzT1JBpE7lj0zzEn8tsycC+302NI3 t/VbSojCd1noGCjFlxs/xIIIqCGbpdHJ8IFraJ6S1xkr2dzgj768dUsmz/lgDgZT381U AWZw== 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=/O8MVT56+zUGcQzRzvIk5l2qYL/0RI/d40KXm58VTfc=; fh=s0phb9UowzLhVIuqTgH7wUZpwV9jjWJzZJKQQLoK85w=; b=q8G2CWRIFOvJ1OMoBJPv3G2vaw2PHHN3BxNHRsOmy/JVup5XFU1r5R0y/1xbCU4qz5 tPtDFDXYYKQCBIXbFf9JByNyjsxhIVHjpFHZoQR0IAuFUVvS/yE9XzjTL/n0XN+yW10i /sJQUJwq+Drs+VUfsnPKR37DWYoIrHBgS8UXfHip0OoBOCFwdaT7sf31yj82Fx7qMYz5 MSjydjbTeTCyeZUS30IFIpLHxv/5M7608fLxHV8ZQ18fLc4stceovLcZsvTHiLBUyCzt mEtmybzsF0vqVQesze6Y8IK2GctCRuyr0tIAgAqzu+Tfe84CCxQhJAplq8ZlKnfqZmzF WTGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=YV8nZp2b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id m9-20020a654389000000b0055be9543340si8810473pgp.872.2023.09.12.19.44.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 19:44:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=YV8nZp2b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id CEC37802390B; Tue, 12 Sep 2023 03:27:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233257AbjILK1H (ORCPT + 99 others); Tue, 12 Sep 2023 06:27:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234318AbjILK0u (ORCPT ); Tue, 12 Sep 2023 06:26:50 -0400 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 638F710DC; Tue, 12 Sep 2023 03:26:44 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 2C19660007; Tue, 12 Sep 2023 10:26:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1694514403; 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=/O8MVT56+zUGcQzRzvIk5l2qYL/0RI/d40KXm58VTfc=; b=YV8nZp2bkWgjApjHU/fxeam8UdOwPYtwPQrOHDC/CjeTqVk80qjBb2xjc+vZ9ZTxZHo2PP WEB5g8JZo7LAl81+K5cKMhRLArv5hTzIhVsW/qQDmqNLK1Qvm3WTJyqjZgQfPMw/9ngVQh MJj2EXbIGnEoZzrQ6d83OMQXpYB/C3YmjOKtrBtKFTEHg6X93KlZoV3L1qW15PhAp7kuW5 eQNYSdEzM/oHXuZlKf2gTYvP9eNF8CDYsPZi1DsUSnCGMe9NC3xS+S2x6COewIhm7tf1iW iX9pya5BNojLoteQuPfZyF6YS9dsfbboT5xUmtIFERNKkgYyB3+qRnQbw91Weg== Date: Tue, 12 Sep 2023 12:26:40 +0200 From: Miquel Raynal To: Bibek Kumar Patro Cc: , , , , , , , , , Subject: Re: [PATCH v3] mtd: rawnand: qcom: unmap dma address during probe failure Message-ID: <20230912122640.1ed25673@xps-13> In-Reply-To: <20230912101814.7748-1-quic_bibekkum@quicinc.com> References: <20230912101814.7748-1-quic_bibekkum@quicinc.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-GND-Sasl: miquel.raynal@bootlin.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 12 Sep 2023 03:27:11 -0700 (PDT) Hi Bibek, quic_bibekkum@quicinc.com wrote on Tue, 12 Sep 2023 15:48:14 +0530: Title: s/during/upon/? > Fix address argument of nand controller currently being > passed to dma_unmap_resource() in probe error path. What about: Unmap the right resource upon probe failure: we currently provide the physical address of the DMA region rather than the output of dma_map_resource() which is obviously wrong. > This address argument should be the dma address returned by > dma_map_resource() instead of the physical address of nand controller. > >=20 > Fixes: 7330fc505af4 ("mtd: rawnand: qcom: stop using phys_to_dma()") > Signed-off-by: Bibek Kumar Patro > --- > v3: Incorporated comments from Miquel > - Modified the commit message and title as per suggestions. >=20 > v2: Incorporated comments from Pavan/Mani. > https://lore.kernel.org/all/20230911133026.29868-1-quic_bibekkum@quic= inc.com/ >=20 > v1: https://lore.kernel.org/all/20230907092854.11408-1-quic_bibekkum@quic= inc.com/ >=20 > drivers/mtd/nand/raw/qcom_nandc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qco= m_nandc.c > index 64499c1b3603..b079605c84d3 100644 > --- a/drivers/mtd/nand/raw/qcom_nandc.c > +++ b/drivers/mtd/nand/raw/qcom_nandc.c > @@ -3444,7 +3444,7 @@ static int qcom_nandc_probe(struct platform_device = *pdev) > err_aon_clk: > clk_disable_unprepare(nandc->core_clk); > err_core_clk: > - dma_unmap_resource(dev, res->start, resource_size(res), > + dma_unmap_resource(dev, nandc->base_dma, resource_size(res), > DMA_BIDIRECTIONAL, 0); > return ret; > } > -- > 2.17.1 >=20 Thanks, Miqu=C3=A8l