Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1368580

Issue with ioremap

Path csiph.com!goblin3!goblin1!goblin.stu.neva.ru!news2.arglkargh.de!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From punnaiah choudary kalluri <punnaia@xilinx.com>
Newsgroups linux.kernel
Subject Issue with ioremap
Date Thu, 31 Mar 2016 21:50:02 +0200
Message-ID <riQLo-1p2-19@gated-at.bofh.it> (permalink)
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to; bh=KWTCkVB226yMBYlZITPdBbtLMU47/jzii70s/1v49/w=; b=bBvC7hsCcjGpWllzoOkHkTmu77jfekVUqotOvW622E9A9cLKjoIIJR/EGtlamXSVyI OVgEoghFXclLsGrX41pmuCPGuh0Mhte8ThDpOKVbZAV6IroRxFwERPs1Y2X540hJdcZd ZGAKTmXSvZ8tnOrvEOV3NTluh1T7VHcCnjoYzL1eD36QxNIpCOEiMWPOa3cHqcsugF2+ /5Gi6gqU184yabOxRADjKrFz5N5M1r6jKx6/u/tiU7AfwrP5xTWgzYUz/r5mzxDZJAXX YGXSojoKbNWOFVEx4EIYDuv7nEIlwOa0muGxqAOxXTcdfvIB9UbrhjWMeLx8VJ6iNOhF 1GuA==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:date:message-id:subject:from :to; bh=KWTCkVB226yMBYlZITPdBbtLMU47/jzii70s/1v49/w=; b=f4jJv0LbHAVxaVm6y+hffDSAievguKmKZTHOQ29ttIbGdQxI8OV/kpnGsybmd1Fyry H5/EZxOiv2w+6xJSBGzsdiRk6Py5T3Am2TeKVNwpgRxK6wz4jItwRv5iNvpvunfChDZV hA3bpUzQblLZs8mSlDnDP4MBMxjxTlYo0aoAjq7K/VEC9RLs78hWyambCFiWT4+K0IiX QjyH4hR2Y9njl5e6iF1GM+flXaz0m1PVzswgewZSDkBVJucEeZVqzl27lnoqGDWp31CK PBp+B5NtXzFfwPzXgGSmUtSiH/9M4dTXqCvvXplaMKCyDlezNdgHfcFCiAe+mM1iDHTf VsVA==
X-Gm-Message-State AD7BkJIBwGQBkQWUxFtY65NGTEkcdnPv8hsGAwRjh5P+2jma1c6GcbwXzofw5h0fyEV24hV327nJZWlUeDxqfw==
MIME-Version 1.0
X-Received by 10.13.203.67 with SMTP id n64mr9567552ywd.321.1459453386565; Thu, 31 Mar 2016 12:43:06 -0700 (PDT)
X-Google-Sender-Auth OOFyFpzhAOWgznnUpMJfuC2ighs
Content-Type text/plain; charset=UTF-8
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 51
Organization linux.* mail to news gateway
X-Original-Date Fri, 1 Apr 2016 01:13:06 +0530
X-Original-Message-ID <CAGnW=BYw9iqm8BpuWrxgcvXV3wwvHcvMtynPeHUGHHiZfPmfuA@mail.gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1368580

Show key headers only | View raw


Hi,

We are using the pl353 smc controller for interfacing the nand in our zynq SOC.
The driver for this controller is currently under mainline review.
Recently we are moved to 4.4 kernel and observing issues with the driver.
while debug, found that the issue is with the virtual address returned from
the ioremap is not aligned to the physical address and causing nand
access failures.
the nand controller physical address starts at 0xE1000000 and the size is 16MB.
the ioremap function in 4.3 kernel returns the virtual address that is
aligned to the size
but not the case in 4.4 kernel.

this controller uses the  bits [31:24] as base address and use rest all bits for
configuring adders cycles, chip select information. so it expects the
virtual address also
aligned to 0xFF000000 otherwise the nand commands issued will fail.


with >= 4.4 kernel
0xf0200000-0xf1201000 16781312 devm_ioremap+0x3c/0x70 phys=e1000000 ioremap

with <= 4.3 kernel
0xf1000000-0xf2001000 16781312 devm_ioremap+0x38/0x68 phys=e1000000 ioremap

the below hack fixes the issue. but its not a proper fix and it just pointing
me the clue for this issue. so, any pointers and help to over come this issue ?
is there a way to do static mapping for the above requirement?


diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 8e3c9c5..fda58d6 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -1340,9 +1340,13 @@ static struct vm_struct
*__get_vm_area_node(unsigned long size,
                                        PAGE_SHIFT, IOREMAP_MAX_ORDER);

         size = PAGE_ALIGN(size);
 +       if (size == 0x1000000)
 +               align = 0x1000000;
         if (unlikely(!size))
                 return NULL;

 +       printk(" size %x align %x\n", size, align);
 +
         area = kzalloc_node(sizeof(*area), gfp_mask & GFP_RECLAIM_MASK, node);
         if (unlikely(!area))
                 return NULL;

Thanks,
Punnaiah

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Issue with ioremap punnaiah choudary kalluri <punnaia@xilinx.com> - 2016-03-31 21:50 +0200
  Re: Issue with ioremap Josh Cartwright <joshc@ni.com> - 2016-03-31 22:10 +0200
    Re: Issue with ioremap Laura Abbott <labbott@redhat.com> - 2016-04-01 01:00 +0200
      Re: Issue with ioremap Russell King - ARM Linux <linux@arm.linux.org.uk> - 2016-04-01 01:10 +0200

csiph-web