Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp831064ybj; Tue, 5 May 2020 08:12:20 -0700 (PDT) X-Google-Smtp-Source: APiQypIaX7Vaj29XLTvkpW5GiIyQSjvpK/2IBZx8gFNUkkU7XBJqxRTpuxZikIwdxHoCqInd0CKG X-Received: by 2002:a05:6402:356:: with SMTP id r22mr3298599edw.3.1588691539837; Tue, 05 May 2020 08:12:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588691539; cv=none; d=google.com; s=arc-20160816; b=J7weFBw99CvgAi+naxnvysO7HBewENqd3qfI6AXix5Ib2+pVNvH59Q9GKhOvdwA5NW TzgnQuvRueMzLQrZqc2L9QDOzpTGQVII0mcvEvlt8R9/aTExOxY5FnWiUqMH21X48/Ta Z62/uMFlW2Mp5TpUZXVsBw/fPGSzLpn7D6DKohmrmRh1D6cHwENJA9okZzUpLst1PwKD ERYrhz9sOmh9Ua02Jx++Az6QP0rN/QD6K9ZqgeG54yyEKUQCiTG7Y3hAhVEy+A2YbrGj mZq4dxwhIPC8Va0CRq8OqyR8yFFFGlTYDtWi2eJ9Z+8IgHK2fmAtSdijrCPAAtyv33AO ZqTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=xKfeDZSPk00OHx6HiVWWe8vwsxfyKmjQDROnekOCkGY=; b=jY4r15sQe/7qLx5VaTC5678VIFpygTo0Amuk7JIOJDaZq0rNfCRbrnrfg9oiVchLdX agRF6tncDV1eN/VeoKwVyBQXSj4UQgYDo+MXhfxM2NECa+aGhD2iV6N8HiaPQhJhZ5/Z dq4Em36/c0MwlBjK7V5Ru/teIceVeJLN5tbk6ec+2LOmoZ9KT3HeprgT2jEjjRas3Nk3 OYmJUFJn9OtCDji2Mbo9LCL2Qv5Vf3A78jehcstvEOT0ZJfzd7geaW35iBeAjTv0DVNf i7DrcnwisSsx9O1mBH10Bu+Uxeqk77NkbGRMr3SiIbXWS4w1rm3cKmkAkBXNF9T5j++6 DTvA== ARC-Authentication-Results: i=1; mx.google.com; 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 i7si1270435eja.355.2020.05.05.08.11.47; Tue, 05 May 2020 08:12:19 -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; 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 S1730165AbgEEPJl (ORCPT + 99 others); Tue, 5 May 2020 11:09:41 -0400 Received: from smtp06.smtpout.orange.fr ([80.12.242.128]:19877 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729712AbgEEPJk (ORCPT ); Tue, 5 May 2020 11:09:40 -0400 Received: from [192.168.42.210] ([93.23.13.215]) by mwinf5d12 with ME id b39d220044ePWwV0339dV3; Tue, 05 May 2020 17:09:39 +0200 X-ME-Helo: [192.168.42.210] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 05 May 2020 17:09:39 +0200 X-ME-IP: 93.23.13.215 Subject: Re: [PATCH 2/4 v2] firmware: stratix10-svc: Unmap some previously memremap'ed memory To: Greg KH Cc: richard.gong@linux.intel.com, atull@kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org References: <43505dc3a4b405d1c7d4a0fa74c67eda3e8bdb75.1588142343.git.christophe.jaillet@wanadoo.fr> <20200505144355.GC838641@kroah.com> From: Christophe JAILLET Message-ID: <5bae5684-6b3e-e94c-7745-046bd24c4f4b@wanadoo.fr> Date: Tue, 5 May 2020 17:09:38 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200505144355.GC838641@kroah.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 05/05/2020 à 16:43, Greg KH a écrit : > 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? I don't think so, there is no memunmap call in 'stratix10-svc.c' CJ > thanks, > > greg k-h >