Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp7166877imm; Tue, 28 Aug 2018 07:27:55 -0700 (PDT) X-Google-Smtp-Source: ANB0VdawJn8wx8+iTrDAEsjh+AekC5Y26JO9zikwUqwtzb7YfvV+3y+QkAAxhSnFsObkn/bRCf24 X-Received: by 2002:a17:902:934a:: with SMTP id g10-v6mr1808112plp.121.1535466475414; Tue, 28 Aug 2018 07:27:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535466475; cv=none; d=google.com; s=arc-20160816; b=amvNcLcweUQrHGvSpH5KxvhgeC/eaj5WPN4A7uz+L3fv03LHtgHQAkR8bfv8TKvfwT toIwTmkp+PpXJdo92rGOA5zxO8VK9nA7SlPuBcvK/fQYdEFZ9EMwPSHQ1J+3dh9lykBP eWN4UUZ6sIyagTqM7FqwN7+V4SrPsWEFShzejqjg87Gc7lcAYB2HDCx9G1b5A76cUz+N PaTHAGX7Y03zS+kJ/pHNMovpVPwF9WR2OZO4ZAbb9wZPZ8JFSw9RI7PNhNg26CLDYgvW ipBq5Nt8zG8qxXFQ2tu2/yD3ebZtPmGinBL0IyBaXAeQ/nfbmCXKNGA9Ib+ro0ztAZZ3 2BrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=9KxEnm+UOwsgYttFwfth7+Rr8VCzxsEU2cgQXPYCinY=; b=cx4XvyfFAXWQ+K3q6HdSnGjd+FzD/CoVC5/n4OZnGl3F3l9unEnxydf2789/ou/uJO DILN1jQGxnaKwqzBId17KEjLlhFr0ZfL+XpkU7exFxjY1CZ9jnPZ1ENwb89y4MSsRN8y jqjRWUVJfMfzxvppMGVdWOH05uuhlmG1uQekazS7GtL+QSri+AkEB1ZA0ovconpYihAy Ls+IzKaS/hrYfDo+rUn/VTbHFlc60LzJ8s4i0RVNARsvZOmfVE/cxf3dd5n9LcSvzJbp 9D4QfGTx73gPZj5+jfBaME/AWuOE1p43lQHHvOiC6I4DJ9xWDhSzZ37TKjQs3K2Poa3R EIDQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 62-v6si1108920ply.520.2018.08.28.07.27.39; Tue, 28 Aug 2018 07:27:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728242AbeH1SST (ORCPT + 99 others); Tue, 28 Aug 2018 14:18:19 -0400 Received: from mail.bootlin.com ([62.4.15.54]:49052 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726439AbeH1SST (ORCPT ); Tue, 28 Aug 2018 14:18:19 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 6A9C0206F6; Tue, 28 Aug 2018 16:26:23 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from bbrezillon (AAubervilliers-681-1-53-19.w90-88.abo.wanadoo.fr [90.88.170.19]) by mail.bootlin.com (Postfix) with ESMTPSA id 28CFA20618; Tue, 28 Aug 2018 16:26:13 +0200 (CEST) Date: Tue, 28 Aug 2018 16:26:11 +0200 From: Boris Brezillon To: Ricardo Ribalda Delgado Cc: David Woodhouse , Brian Norris , Marek Vasut , Richard Weinberger , Zhouyang Jia , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/8] mtd: maps: gpio-addr-flash: Fix ioremapped size Message-ID: <20180828162611.2f45e5c9@bbrezillon> In-Reply-To: <20180821143152.32293-3-ricardo.ribalda@gmail.com> References: <20180821143152.32293-1-ricardo.ribalda@gmail.com> <20180821143152.32293-3-ricardo.ribalda@gmail.com> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 21 Aug 2018 16:31:46 +0200 Ricardo Ribalda Delgado wrote: > We should only iomap the area of the chip that is memory mapped. > Otherwise we could be mapping devices beyond the memory space or that > belong to other devices. > Can you add Fixes: ebd71e3a4861 ("mtd: maps: gpio-addr-flash: fix warnings and make more portable") and in case you want to backport the fix: Cc: > Signed-off-by: Ricardo Ribalda Delgado > --- > drivers/mtd/maps/gpio-addr-flash.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/mtd/maps/gpio-addr-flash.c b/drivers/mtd/maps/gpio-addr-flash.c > index 17be47f72973..6de16e81994c 100644 > --- a/drivers/mtd/maps/gpio-addr-flash.c > +++ b/drivers/mtd/maps/gpio-addr-flash.c > @@ -234,7 +234,7 @@ static int gpio_flash_probe(struct platform_device *pdev) > state->map.copy_to = gf_copy_to; > state->map.bankwidth = pdata->width; > state->map.size = state->win_size * (1 << state->gpio_count); > - state->map.virt = ioremap_nocache(memory->start, state->map.size); > + state->map.virt = ioremap_nocache(memory->start, state->win_size); > if (!state->map.virt) > return -ENOMEM; >