public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Detlev Zundel <dzu@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] soft_spi.c crash while saveenv
Date: Thu, 18 Mar 2010 10:37:10 +0100	[thread overview]
Message-ID: <m24okex96h.fsf@ohwell.denx.de> (raw)
In-Reply-To: <003001cac61d$93ec2b40$c801a8c0@xeon> (Horst Gall's message of "Wed, 17 Mar 2010 23:02:41 +0100")

Hello Horst,

> I used the soft_spi - driver for saving the u-boot-environment.
>
> When I started "saveenv" u-boot hang - no output.
> I located the problem in soft_spi.c in function "spi_xfer()".
> This function writes every byte received from the spi-device to the
> pointer "dout".
> In case of writing to the spi-device the returned bytes are also
> written to the dout-pointer.
>
> The function "spi_flash_cmd()" in "drivers/mtd/spi/spi_flash.c" calls
> now this function with
> a NULL-pointer.

Ok, I see that the mtd does a call with NULL pointers, so your fix
actually works for your combination.

On the other hand, this check of parameters is not consistent in the
other drivers.  drivers/spi/mpc8xxx_spi.c does no checks, while
drivers/spi/bfin_spi.c does - I did not bother to check others.

As I'm a friend of passive programming, I would go down your route but
eventually fix all other drivers too.

So can you please cook up a proper patch with a signed-off-by line as
stated in the docs[1]?

Thanks
  Detlev

[1] http://www.denx.de/wiki/U-Boot/Patches

-- 
Die eine Haelfte der Welt lacht ueber die andere, und Narren sind alle.
                                    --- Baltasar Gracian
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de

      reply	other threads:[~2010-03-18  9:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-17 22:02 [U-Boot] soft_spi.c crash while saveenv Horst Gall
2010-03-18  9:37 ` Detlev Zundel [this message]

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=m24okex96h.fsf@ohwell.denx.de \
    --to=dzu@denx.de \
    --cc=u-boot@lists.denx.de \
    /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