From: "mar.krzeminski" <mar.krzeminski@gmail.com>
To: Jean-Christophe DUBOIS <jcd@tribudubois.net>,
qemu-devel@nongnu.org, peter.maydell@linaro.org
Subject: Re: [Qemu-devel] [PATCH] [M25P80] Make sure not to overrun the internal data buffer.
Date: Fri, 30 Dec 2016 19:09:27 +0100 [thread overview]
Message-ID: <a25f717f-28b6-959a-92c3-a7233dcf7fe2@gmail.com> (raw)
In-Reply-To: <684d34f1-9107-1ed0-1115-f3034bd899f4@tribudubois.net>
W dniu 30.12.2016 o 18:14, Jean-Christophe DUBOIS pisze:
> Le 30/12/2016 à 16:39, mar.krzeminski a écrit :
>> I got some time, and reproduced the problem. Here are some logs with
>> m25p80 debugs:
>> : decode_new_cmd: decoded new command:9f
>> : decode_new_cmd: populated jedec code
>> : decode_new_cmd: decoded new command:0
>> : decode_new_cmd: decoded new command:0 //Getting flash Id in above 4
>> lines -> OK (but missing CS)
>> Found sst25vf016b compatible flash device
>> : decode_new_cmd: decoded new command:6 //Write enable, command
>> without payload, so it is ok
>> : decode_new_cmd: decoded new command:1 //Write to status register,
>> guest sends data
>> INFO: spi0.0: sst25vf016b (2048 Kbytes)
>> INFO: spi0.0: mtd
>> .name = spi0.0,
>> .size = 0x200000 (2MiB)
>> .erasesize = 0x00001000 (4KiB)
>> .numeraseregions = 0
>> Segmentation fault (core dumped) //Here probably guest try to send
>> some data
>>
>> The root cause why m25p80 enter strange state is that CS line is not
>> selected/deselected at all- there is missing debug from m25p80_cs.
>> In spi transfer CS line (here qemu_irq) should be 0 before begin of
>> every message, and set after end of transmission.
>> In case of simple WREN command you should see something like this:
>> : m25p80_cs: deselect
>> : decode_new_cmd: decoded new command:6
>> : m25p80_cs: select
>>
>> Can you check spi controller model code?
>
> I'll double check.
>
> But why is the SPI memory/device even responding if CS is not set ?
Looking at ssi code it should not.
Flash (so the m25p80) is responding when CS line is low and it seem that
this is default.
Thanks,
Marcin
>
>>
>> Thanks,
>> Marcin
>>
>>
>
>
next prev parent reply other threads:[~2016-12-30 18:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-24 15:11 [Qemu-devel] [PATCH] [M25P80] Make sure not to overrun the internal data buffer Jean-Christophe Dubois
2016-12-24 17:18 ` mar.krzeminski
2016-12-24 17:41 ` Jean-Christophe DUBOIS
2016-12-24 18:04 ` mar.krzeminski
2016-12-24 18:12 ` Jean-Christophe DUBOIS
2016-12-27 17:08 ` Jean-Christophe DUBOIS
2016-12-30 15:39 ` mar.krzeminski
2016-12-30 17:14 ` Jean-Christophe DUBOIS
2016-12-30 18:09 ` mar.krzeminski [this message]
2017-01-02 21:24 ` Jean-Christophe DUBOIS
2017-01-03 17:08 ` mar.krzeminski
2017-01-03 20:34 ` Jean-Christophe DUBOIS
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=a25f717f-28b6-959a-92c3-a7233dcf7fe2@gmail.com \
--to=mar.krzeminski@gmail.com \
--cc=jcd@tribudubois.net \
--cc=peter.maydell@linaro.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).