[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 2/4] m25p80: Improve command handling for Jedec commands
From: |
Cédric Le Goater |
Subject: |
Re: [PATCH v2 2/4] m25p80: Improve command handling for Jedec commands |
Date: |
Fri, 7 Feb 2020 08:22:17 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 |
On 2/6/20 7:32 PM, Guenter Roeck wrote:
> When requesting JEDEC data using the JEDEC_READ command, the Linux kernel
> always requests 6 bytes. The current implementation only returns three
> bytes, and interprets the remaining three bytes as new commands.
> While this does not matter most of the time, it is at the very least
> confusing. To avoid the problem, always report up to 6 bytes of JEDEC
> data. Fill remaining data with 0.
>
> Signed-off-by: Guenter Roeck <address@hidden>
Reviewed-by: Cédric Le Goater <address@hidden>
> ---
> v2: Split patch into two parts; improved decription
>
> hw/block/m25p80.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c
> index 5ff8d270c4..53bf63856f 100644
> --- a/hw/block/m25p80.c
> +++ b/hw/block/m25p80.c
> @@ -1040,8 +1040,11 @@ static void decode_new_cmd(Flash *s, uint32_t value)
> for (i = 0; i < s->pi->id_len; i++) {
> s->data[i] = s->pi->id[i];
> }
> + for (; i < SPI_NOR_MAX_ID_LEN; i++) {
> + s->data[i] = 0;
> + }
>
> - s->len = s->pi->id_len;
> + s->len = SPI_NOR_MAX_ID_LEN;
> s->pos = 0;
> s->state = STATE_READING_DATA;
> break;
>
- [PATCH v2 1/4] m25p80: Convert to support tracing, Guenter Roeck, 2020/02/06
- [PATCH v2 2/4] m25p80: Improve command handling for Jedec commands, Guenter Roeck, 2020/02/06
- [PATCH v2 3/4] m25p80: Improve command handling for unsupported commands, Guenter Roeck, 2020/02/06
- [PATCH v2 4/4] aspeed/smc: Fix number of dummy cycles for FAST_READ_4 command, Guenter Roeck, 2020/02/06
- Re: [PATCH v2 1/4] m25p80: Convert to support tracing, Philippe Mathieu-Daudé, 2020/02/06
- Re: [PATCH v2 1/4] m25p80: Convert to support tracing, Alistair Francis, 2020/02/06
- Re: [PATCH v2 1/4] m25p80: Convert to support tracing, Cédric Le Goater, 2020/02/07
- Re: [PATCH v2 1/4] m25p80: Convert to support tracing, Cédric Le Goater, 2020/02/17