Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp804605ybj; Tue, 5 May 2020 07:48:35 -0700 (PDT) X-Google-Smtp-Source: APiQypIQwDRo67ooQQKyUaG1jYM08OYy9wqoaBnUI719zT3e0E+S7tx9SrtW0M/IKrY9w1aHs5DD X-Received: by 2002:a17:906:1443:: with SMTP id q3mr3014727ejc.325.1588690114947; Tue, 05 May 2020 07:48:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588690114; cv=none; d=google.com; s=arc-20160816; b=Vjnz6FAqEFf6LoPOHYsDuEZ1i1xP2GjPj+zcKNHCnHmoK/P34MdeJdeudnOeEf9L6W gjhLxsttxx+upc9imCPv2SSzAsITyvlCEdEdj5oiJ4CBG4y4me1QlRIkBO3lKplSbAeZ fs6NCgl8mpzwo+jFHlPgeSjTeiql8hIwkSRTcKc0RU0xS6c6weDGiETh2uk5cIWeCXdC c02XpDHZnOZcs550KUuI6l+OQxC3h4RsfoRCNJejIKCMUG5UsdEl63T76i7Bw48HCOar Jr9jXTS8VTNkMAcav4pUJdUaXdyct9Gc7ze1OrFagm0vG47rOMCtykV+uWjDsgmeYcGr pttA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=dvfOXxRg7QymDKBet1uJhQO7du7n6A+MIrSKvNXXx9E=; b=AnAgumHYcm37La537I5tdVsDb8ODKTURqc5Qe8N3+zq88ckpE0HYwVLDm4pxj326zf pYEb0qA25CNVMHYSN3D9CiQY0BBCuo2sPwfHoh0cZQtGNr4Xlw/lKc09wN1WZeX9AA9u /VptoaPebl37SXd25L/1D7kKpUIcDb6MpSramynI7Y/hYsIPB7HeHGSpIj8fzUNqLAnY PqZVJ3r/o8tkyU3UOXPZNU8INNY+RNVY3ahIvNVNc4zqmypTQAAgGxYhYSBll0CFy9mZ NNTJi2/sQi458E82PCAzneQ1E4zzBOGsCi503a6vTVJoG5b3RutS1V1ACqguzutbR80c yHlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Xa5SqWSL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r3si1379136edc.405.2020.05.05.07.48.11; Tue, 05 May 2020 07:48:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Xa5SqWSL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729320AbgEEOn6 (ORCPT + 99 others); Tue, 5 May 2020 10:43:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:44658 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729183AbgEEOn6 (ORCPT ); Tue, 5 May 2020 10:43:58 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8D01D20663; Tue, 5 May 2020 14:43:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588689838; bh=aVUty+xGKseAmsxbQ7di/4P2HYVjqVdFBr76G8ddcO0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Xa5SqWSLZ2cdsz6sIL9vQqLBdEnwAmoTTVSKmpig+QWaggaLG7hyCZt8I0Ztm98Rz o3WG6kHjnvpYmqu9485kp9KKMj+2w7BoPn2ZBJm/yQeq7hT90QuUBCkVt9cG9YtH60 tgNmVR6UPLpMkWzGmTHbbKdU9f5pjgAFMD2LoRpU= Date: Tue, 5 May 2020 16:43:55 +0200 From: Greg KH To: Christophe JAILLET Cc: richard.gong@linux.intel.com, atull@kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH 2/4 v2] firmware: stratix10-svc: Unmap some previously memremap'ed memory Message-ID: <20200505144355.GC838641@kroah.com> References: <43505dc3a4b405d1c7d4a0fa74c67eda3e8bdb75.1588142343.git.christophe.jaillet@wanadoo.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <43505dc3a4b405d1c7d4a0fa74c67eda3e8bdb75.1588142343.git.christophe.jaillet@wanadoo.fr> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 29, 2020 at 08:52:43AM +0200, Christophe JAILLET wrote: > In 'svc_create_memory_pool()' we memremap some memory. This has to be > undone in case of error and if the driver is removed. > > The easiest way to do it is to use 'devm_memremap()'. > > Fixes: 7ca5ce896524 ("firmware: add Intel Stratix10 service layer driver") > Signed-off-by: Christophe JAILLET > --- > drivers/firmware/stratix10-svc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/firmware/stratix10-svc.c b/drivers/firmware/stratix10-svc.c > index 3a176e62754a..de5870f76c5e 100644 > --- a/drivers/firmware/stratix10-svc.c > +++ b/drivers/firmware/stratix10-svc.c > @@ -631,7 +631,7 @@ svc_create_memory_pool(struct platform_device *pdev, > end = rounddown(sh_memory->addr + sh_memory->size, PAGE_SIZE); > paddr = begin; > size = end - begin; > - va = memremap(paddr, size, MEMREMAP_WC); > + va = devm_memremap(dev, paddr, size, MEMREMAP_WC); > if (!va) { > dev_err(dev, "fail to remap shared memory\n"); > return ERR_PTR(-EINVAL); And there was no previous unmap happening when the pool was torn down that now needs to be removed? thanks, greg k-h