From: Andrew Jones <drjones@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: David Engraf <david.engraf@sysgo.com>,
Kevin Wolf <kwolf@redhat.com>,
QEMU Developers <qemu-devel@nongnu.org>,
Qemu-block <qemu-block@nongnu.org>, Max Reitz <mreitz@redhat.com>,
dgilbert@redhat.com
Subject: Re: [Qemu-devel] [PATCH] pflash_cfi01: fix per device sector length in CFI table
Date: Thu, 12 Jan 2017 12:36:19 +0100 [thread overview]
Message-ID: <20170112113619.zuc5tuhmhzvawnmz@hawk.localdomain> (raw)
In-Reply-To: <CAFEAcA8asry6LGTuv+SLVyemNVFk9Q7WhU74Cc2YA_yud8qPMg@mail.gmail.com>
On Thu, Jan 12, 2017 at 10:42:41AM +0000, Peter Maydell wrote:
> On 12 January 2017 at 10:35, David Engraf <david.engraf@sysgo.com> wrote:
> > The CFI entry for sector length must be set to sector length per device.
> > This is important for boards using multiple devices like the ARM Vexpress
> > board (width = 4, device-width = 2).
> >
> > Linux and u-boots calculate the size ratio by dividing both values:
> >
> > size_ratio = info->portwidth / info->chipwidth;
> >
> > After that the sector length will be multiplied by the size_ratio, thus the
> > CFI entry for sector length is doubled. When Linux or u-boot send a sector
> > erase, they expect to erase the doubled sector length, but QEMU only erases
> > the board specified sector length.
> >
> > This patch fixes the sector length in the CFI table to match the length per
> > device, equal to blocks_per_device.
>
> Thanks for the patch. I haven't checked against the pflash spec yet,
> but this looks like it's probably the right thing.
>
> The only two machines which use a setup with multiple devices (ie
> which specify device_width to the pflash_cfi01) are vexpress and virt.
> For all other machines this patch leaves the behaviour unchanged.
>
> Q: do we need to have some kind of nasty hack so that pre-2.9 virt
> still gets the old broken values in the CFI table, for version and
> migration compatibility? Ccing Drew for an opinion...
>
I'm pretty sure we need the nasty hack, but I'm also Ccing David for
his opinion.
Thanks,
drew
next prev parent reply other threads:[~2017-01-12 11:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-12 10:35 [Qemu-devel] [PATCH] pflash_cfi01: fix per device sector length in CFI table David Engraf
2017-01-12 10:42 ` Peter Maydell
2017-01-12 11:36 ` Andrew Jones [this message]
2017-01-12 12:01 ` David Engraf
2017-01-16 10:26 ` Dr. David Alan Gilbert
2017-01-17 16:48 ` [Qemu-devel] [PATCH v2] " David Engraf
2017-01-27 14:31 ` [Qemu-devel] [PATCH] " Peter Maydell
2017-01-27 14:54 ` Peter Maydell
2017-01-27 15:13 ` Andrew Jones
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=20170112113619.zuc5tuhmhzvawnmz@hawk.localdomain \
--to=drjones@redhat.com \
--cc=david.engraf@sysgo.com \
--cc=dgilbert@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).