All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lei Wen <adrian.wenl@gmail.com>
To: Daniel Mack <zonque@gmail.com>, Igor Grinberg <grinberg@compulab.co.il>
Cc: Eric Miao <eric.y.miao@gmail.com>,
	David Woodhouse <David.Woodhouse@intel.com>,
	Artem Bityutskiy <dedekind1@gmail.com>,
	Lei Wen <leiwen@marvell.com>,
	Haojian Zhuang <haojian.zhuang@gmail.com>,
	linux-mtd@lists.infradead.org,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 3/4] MTD: pxa3xx_nand: enable multiple chip select support
Date: Tue, 12 Jul 2011 17:40:33 +0800	[thread overview]
Message-ID: <CALZhoSRPYtMtsDqY5rPKfx4ux72iCDPQm=3wmTMMt2_P3zWtKA@mail.gmail.com> (raw)
In-Reply-To: <4E1B4E21.1090507@compulab.co.il>

On Tue, Jul 12, 2011 at 3:25 AM, Igor Grinberg <grinberg@compulab.co.il> wrote:
>
>
> On 07/11/11 21:53, Daniel Mack wrote:
>
>> On Mon, Jul 11, 2011 at 8:19 PM, Igor Grinberg <grinberg@compulab.co.il> wrote:
>>> On 07/11/11 17:49, Daniel Mack wrote:
>>>> Lei, any ideas, can you reproduce this? To avoid further regressions
>>>> of this driver, you really should have a system on which you can test
>>>> suspend and resume after each commit.
>>> I think the problem is that on PXA3xx resume from S2/S3 involves bootloader.
>>> If I remember correctly, the BootROM reads the bootloader from the boot device
>>> regardless of the reset cause (S2/S3 resume is kind a reset for PXA3xx).
>> At least not in our case. The first level bootloader is entered on
>> resume just as it is on a POR event, with the exception that the D3S
>> bit in the ASCR register is set in this case.
>
> You say "first level boot loader is entered"... who is loading it and where from?
> Indeed, it should happen as in POR case, but again, it resides on some non-volatile
> storage, isn't it? What storage does it reside on?
>
>> We unconditionally
>> initialize the static and dynamic memory controllers and then either
>> jump to the routine that initializes the NAND controller, read the 2nd
>> level loader and pass control to it. Or (in the resume case) we just
>> jump to the address stored at the RAM address 0x80000000 (which has
>> been set to cpu_resume previously) and thus enter the kernel again. No
>> NAND operations in the game in this case, and this has always worked
>> fine.
>
> Except those to read the first stage boot loader... (if it resides on NAND).
> Well, our case is working similarly and both the first stage bootloader (OBM)
> and the second stage bootloader (U-Boot) reside on the NAND flash,
> therefore BootROM has to reconfigure the NAND flash, so it can boot (resume).
>
>
>>> Then the bootloader must decide what should be done according to the reset cause.
>>> This means, that the BootROM already configures the NAND flash
>>> (if it is the boot device) and pxa3xx_nand driver should just get on with it
>>> and don't try to reconfigure?
>> I think the problem is just the opposite. The driver expects the setup
>> registers to retain their state over suspend, and doesn't write them
>> again, and this causes operations to fail after resume.
>
> Well, according to Lei, the driver writes back the configuration that is stored prior
> to suspend and that's why I agreed that it should work...
>
> http://www.spinics.net/lists/arm-kernel/msg131942.html
>
>
Daniel,

I retest with suspend&resume on my board, each time that board would
reset the timing in the
begining of pxa3xx_cmdfunc as expected. So this should be ok as it is
the same behavior
with original code.

However, it certainly has some potential risk in the suspend&resume process.
That is in pxa3xx_nand_suspend and pxa3xx_nand_resume, it should call
mtd->suspend and mtd->resume
respectively.

This implement has already existed in our code release for years, but
have get into the mainline yet.
So I tend to merged into the third patch, and you could have test
again whether could fix your issue.

Thanks,
Lei

WARNING: multiple messages have this Message-ID (diff)
From: adrian.wenl@gmail.com (Lei Wen)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/4] MTD: pxa3xx_nand: enable multiple chip select support
Date: Tue, 12 Jul 2011 17:40:33 +0800	[thread overview]
Message-ID: <CALZhoSRPYtMtsDqY5rPKfx4ux72iCDPQm=3wmTMMt2_P3zWtKA@mail.gmail.com> (raw)
In-Reply-To: <4E1B4E21.1090507@compulab.co.il>

On Tue, Jul 12, 2011 at 3:25 AM, Igor Grinberg <grinberg@compulab.co.il> wrote:
>
>
> On 07/11/11 21:53, Daniel Mack wrote:
>
>> On Mon, Jul 11, 2011 at 8:19 PM, Igor Grinberg <grinberg@compulab.co.il> wrote:
>>> On 07/11/11 17:49, Daniel Mack wrote:
>>>> Lei, any ideas, can you reproduce this? To avoid further regressions
>>>> of this driver, you really should have a system on which you can test
>>>> suspend and resume after each commit.
>>> I think the problem is that on PXA3xx resume from S2/S3 involves bootloader.
>>> If I remember correctly, the BootROM reads the bootloader from the boot device
>>> regardless of the reset cause (S2/S3 resume is kind a reset for PXA3xx).
>> At least not in our case. The first level bootloader is entered on
>> resume just as it is on a POR event, with the exception that the D3S
>> bit in the ASCR register is set in this case.
>
> You say "first level boot loader is entered"... who is loading it and where from?
> Indeed, it should happen as in POR case, but again, it resides on some non-volatile
> storage, isn't it? What storage does it reside on?
>
>> We unconditionally
>> initialize the static and dynamic memory controllers and then either
>> jump to the routine that initializes the NAND controller, read the 2nd
>> level loader and pass control to it. Or (in the resume case) we just
>> jump to the address stored at the RAM address 0x80000000 (which has
>> been set to cpu_resume previously) and thus enter the kernel again. No
>> NAND operations in the game in this case, and this has always worked
>> fine.
>
> Except those to read the first stage boot loader... (if it resides on NAND).
> Well, our case is working similarly and both the first stage bootloader (OBM)
> and the second stage bootloader (U-Boot) reside on the NAND flash,
> therefore BootROM has to reconfigure the NAND flash, so it can boot (resume).
>
>
>>> Then the bootloader must decide what should be done according to the reset cause.
>>> This means, that the BootROM already configures the NAND flash
>>> (if it is the boot device) and pxa3xx_nand driver should just get on with it
>>> and don't try to reconfigure?
>> I think the problem is just the opposite. The driver expects the setup
>> registers to retain their state over suspend, and doesn't write them
>> again, and this causes operations to fail after resume.
>
> Well, according to Lei, the driver writes back the configuration that is stored prior
> to suspend and that's why I agreed that it should work...
>
> http://www.spinics.net/lists/arm-kernel/msg131942.html
>
>
Daniel,

I retest with suspend&resume on my board, each time that board would
reset the timing in the
begining of pxa3xx_cmdfunc as expected. So this should be ok as it is
the same behavior
with original code.

However, it certainly has some potential risk in the suspend&resume process.
That is in pxa3xx_nand_suspend and pxa3xx_nand_resume, it should call
mtd->suspend and mtd->resume
respectively.

This implement has already existed in our code release for years, but
have get into the mainline yet.
So I tend to merged into the third patch, and you could have test
again whether could fix your issue.

Thanks,
Lei

  reply	other threads:[~2011-07-12  9:40 UTC|newest]

Thread overview: 162+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-22  3:17 [PATCH] MTD: pxa3xx_nand: enable multiple chip select support Lei Wen
2011-07-08 16:00 ` Lei Wen
2011-06-22 11:39 ` Daniel Mack
2011-06-22 11:39   ` Daniel Mack
2011-06-22 12:21   ` Lei Wen
2011-07-08 17:38     ` Lei Wen
2011-06-22 13:06     ` Daniel Mack
2011-06-22 13:06       ` Daniel Mack
2011-06-23  6:22       ` Lei Wen
2011-06-23  6:22         ` Lei Wen
2011-06-22 13:45 ` Igor Grinberg
2011-07-08 16:09   ` Igor Grinberg
2011-06-23  6:35   ` Lei Wen
2011-07-08 15:26     ` Lei Wen
2011-06-23 10:44     ` Igor Grinberg
2011-06-23 10:44       ` Igor Grinberg
2011-06-25 11:17       ` Lei Wen
2011-06-25 11:17         ` Lei Wen
2011-06-25 12:32         ` Daniel Mack
2011-06-25 12:32           ` Daniel Mack
2011-06-25 12:51           ` Lei Wen
2011-06-25 12:51             ` Lei Wen
2011-06-27 13:22         ` Igor Grinberg
2011-06-27 13:22           ` Igor Grinberg
2011-06-28  7:32         ` Artem Bityutskiy
2011-06-28  7:32           ` Artem Bityutskiy
2011-06-28 15:12           ` Lei Wen
2011-06-28 15:12             ` Lei Wen
2011-06-29  3:51           ` [PATCH V3 0/9] pxa3xx_nand: add two " Lei Wen
2011-06-29  3:51             ` Lei Wen
2011-06-29  9:00             ` Igor Grinberg
2011-06-29  9:00               ` Igor Grinberg
2011-06-29 10:20               ` Artem Bityutskiy
2011-06-29 10:20                 ` Artem Bityutskiy
2011-07-04  9:27                 ` Lei Wen
2011-07-04  9:27                   ` Lei Wen
2011-07-04  9:25             ` [PATCH V4 0/4] " Lei Wen
2011-07-04  9:25               ` Lei Wen
2011-07-08  3:34               ` [PATCH V5 0/3] " Lei Wen
2011-07-08  3:34                 ` Lei Wen
2011-07-12 10:28                 ` [PATCH V6 0/4] " Lei Wen
2011-07-12 10:28                   ` Lei Wen
2011-07-12 14:35                   ` [PATCH V7 " Lei Wen
2011-07-12 14:35                     ` Lei Wen
2011-07-15  3:44                     ` [PATCH V8 " Lei Wen
2011-07-15  3:44                       ` Lei Wen
2011-07-20  4:51                       ` Artem Bityutskiy
2011-07-20  4:51                         ` Artem Bityutskiy
2011-07-15  3:44                     ` [PATCH V8 1/4] MTD: pxa3xx_nand: enhance suspend and resume routine Lei Wen
2011-07-15  3:44                       ` Lei Wen
2011-07-15  3:44                     ` [PATCH V8 2/4] MTD: pxa3xx_nand: convert all printk into dev_* Lei Wen
2011-07-15  3:44                       ` Lei Wen
2011-07-15  3:44                     ` [PATCH V8 3/4] MTD: pxa3xx_nand: sperate each chip individual info Lei Wen
2011-07-15  3:44                       ` Lei Wen
2011-07-15  3:44                     ` [PATCH V8 4/4] MTD: pxa3xx_nand: enable multiple chip select support Lei Wen
2011-07-15  3:44                       ` Lei Wen
2011-07-12 14:35                   ` [PATCH V7 1/4] MTD: pxa3xx_nand: enhance suspend and resume routine Lei Wen
2011-07-12 14:35                     ` Lei Wen
2011-07-13 10:53                     ` Sergei Shtylyov
2011-07-13 10:53                       ` Sergei Shtylyov
2011-07-12 14:35                   ` [PATCH V7 2/4] MTD: pxa3xx_nand: convert all printk into dev_* Lei Wen
2011-07-12 14:35                     ` Lei Wen
2011-07-13 10:57                     ` Sergei Shtylyov
2011-07-13 10:57                       ` Sergei Shtylyov
2011-07-13 12:41                       ` Lei Wen
2011-07-13 12:41                         ` Lei Wen
2011-07-13 14:35                         ` Sergei Shtylyov
2011-07-13 14:35                           ` Sergei Shtylyov
2011-07-12 14:35                   ` [PATCH V7 3/4] MTD: pxa3xx_nand: sperate each chip individual info Lei Wen
2011-07-12 14:35                     ` Lei Wen
2011-07-12 14:35                   ` [PATCH V7 4/4] MTD: pxa3xx_nand: enable multiple chip select support Lei Wen
2011-07-12 14:35                     ` Lei Wen
2011-07-12 10:28                 ` [PATCH V6 1/4] MTD: pxa3xx_nand: convert all printk into dev_* Lei Wen
2011-07-12 10:28                   ` Lei Wen
2011-07-12 10:28                 ` [PATCH V6 2/4] MTD: pxa3xx_nand: sperate each chip individual info Lei Wen
2011-07-12 10:28                   ` Lei Wen
2011-07-12 10:28                 ` [PATCH V6 3/4] MTD: pxa3xx_nand: enable multiple chip select support Lei Wen
2011-07-12 10:28                   ` Lei Wen
2011-07-12 10:28                 ` [PATCH V6 4/4] MTD: pxa3xx_nand: enhance suspend and resume routine Lei Wen
2011-07-12 10:28                   ` Lei Wen
2011-07-12 11:39                   ` Daniel Mack
2011-07-12 11:39                     ` Daniel Mack
2011-07-12 12:02                     ` Daniel Mack
2011-07-12 12:02                       ` Daniel Mack
2011-07-12 15:56                       ` Igor Grinberg
2011-07-12 15:56                         ` Igor Grinberg
2011-07-12 17:35                         ` Daniel Mack
2011-07-12 17:35                           ` Daniel Mack
2011-07-08  3:34               ` [PATCH 1/3] MTD: pxa3xx_nand: convert all printk into dev_* Lei Wen
2011-07-08  3:34                 ` Lei Wen
2011-07-08  3:34               ` [PATCH 2/3] MTD: pxa3xx_nand: sperate each chip individual info Lei Wen
2011-07-08  3:34                 ` Lei Wen
2011-07-08  3:34               ` [PATCH 3/3] MTD: pxa3xx_nand: enable multiple chip select support Lei Wen
2011-07-08  3:34                 ` Lei Wen
2011-07-04  9:25             ` [PATCH 1/4] MTD: pxa3xx_nand: convert all printk into dev_* Lei Wen
2011-07-04  9:25               ` Lei Wen
2011-07-04  9:25             ` [PATCH 2/4] MTD: pxa3xx_nand: sperate each chip individual info Lei Wen
2011-07-04  9:25               ` Lei Wen
2011-07-06  7:29               ` Igor Grinberg
2011-07-06  7:29                 ` Igor Grinberg
2011-07-04  9:25             ` [PATCH 3/4] MTD: pxa3xx_nand: enable multiple chip select support Lei Wen
2011-07-04  9:25               ` Lei Wen
2011-07-06  6:53               ` Artem Bityutskiy
2011-07-06  6:53                 ` Artem Bityutskiy
2011-07-06  6:54                 ` Lei Wen
2011-07-06  6:54                   ` Lei Wen
2011-07-06  7:07                   ` Artem Bityutskiy
2011-07-06  7:07                     ` Artem Bityutskiy
2011-07-06  7:41               ` Igor Grinberg
2011-07-06  7:41                 ` Igor Grinberg
2011-07-07  6:26                 ` Lei Wen
2011-07-07  6:26                   ` Lei Wen
2011-07-07  8:59                   ` Igor Grinberg
2011-07-07  8:59                     ` Igor Grinberg
2011-07-07  9:06                     ` Lei Wen
2011-07-07  9:06                       ` Lei Wen
2011-07-07 11:23                       ` Igor Grinberg
2011-07-07 11:23                         ` Igor Grinberg
2011-07-11 14:49                 ` Daniel Mack
2011-07-11 14:49                   ` Daniel Mack
2011-07-11 18:19                   ` Igor Grinberg
2011-07-11 18:19                     ` Igor Grinberg
2011-07-11 18:53                     ` Daniel Mack
2011-07-11 18:53                       ` Daniel Mack
2011-07-11 19:25                       ` Igor Grinberg
2011-07-11 19:25                         ` Igor Grinberg
2011-07-12  9:40                         ` Lei Wen [this message]
2011-07-12  9:40                           ` Lei Wen
2011-07-12  9:57                           ` Daniel Mack
2011-07-12  9:57                             ` Daniel Mack
2011-07-12 10:29                             ` Lei Wen
2011-07-12 10:29                               ` Lei Wen
2011-07-12 12:05                               ` Daniel Mack
2011-07-12 12:05                                 ` Daniel Mack
2011-07-12 12:48                         ` Daniel Mack
2011-07-12 12:48                           ` Daniel Mack
2011-07-12 15:49                           ` Igor Grinberg
2011-07-12 15:49                             ` Igor Grinberg
2011-07-04  9:25             ` [PATCH 4/4] ARM: mmp/pxa: fix nand platform data Lei Wen
2011-07-04  9:25               ` Lei Wen
2011-06-29  3:51           ` [PATCH 1/9] MTD: pxa3xx_nand: convert all printk into dev_* Lei Wen
2011-06-29  3:51             ` Lei Wen
2011-06-29  3:51           ` [PATCH 2/9] MTD: pxa3xx_nand: enable multiple chip select support Lei Wen
2011-06-29  3:51             ` Lei Wen
2011-06-29  7:11             ` Artem Bityutskiy
2011-06-29  7:11               ` Artem Bityutskiy
2011-06-29  7:16               ` Lei Wen
2011-06-29  7:16                 ` Lei Wen
2011-06-29  3:51           ` [PATCH 3/9] ARM: aspenite: fix nand platform data Lei Wen
2011-06-29  3:51             ` Lei Wen
2011-06-29  3:51           ` [PATCH 4/9] ARM: cm-x300: " Lei Wen
2011-06-29  3:51             ` Lei Wen
2011-06-29  3:51           ` [PATCH 5/9] ARM: colibri-pxa3xx: " Lei Wen
2011-06-29  3:51             ` Lei Wen
2011-06-29  3:51           ` [PATCH 6/9] ARM: littleton: " Lei Wen
2011-06-29  3:51             ` Lei Wen
2011-06-29  3:51           ` [PATCH 7/9] ARM: mxm8x10: " Lei Wen
2011-06-29  3:51             ` Lei Wen
2011-06-29  3:51           ` [PATCH 8/9] ARM: raumfeld: " Lei Wen
2011-06-29  3:51             ` Lei Wen
2011-06-29  3:51           ` [PATCH 9/9] ARM: zylonite: " Lei Wen
2011-06-29  3:51             ` Lei Wen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALZhoSRPYtMtsDqY5rPKfx4ux72iCDPQm=3wmTMMt2_P3zWtKA@mail.gmail.com' \
    --to=adrian.wenl@gmail.com \
    --cc=David.Woodhouse@intel.com \
    --cc=dedekind1@gmail.com \
    --cc=eric.y.miao@gmail.com \
    --cc=grinberg@compulab.co.il \
    --cc=haojian.zhuang@gmail.com \
    --cc=leiwen@marvell.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=zonque@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.