linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pelle Nilsson <per.nilsson-5TWeZ6kPplYAvxtiuMwx3w@public.gmane.org>
To: linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: spi-altera in mainline
Date: Tue, 31 Mar 2015 09:43:09 +0200	[thread overview]
Message-ID: <551A500D.6030701@xelmo.com> (raw)

(Resending this bug report to linux-spi as requested, first reported to
nios2-dev-g9ZBwUv/Ih/yUk5EbOjzudqWx8ZoriO+@public.gmane.org)


Hello

Using spi-altera from (and with) mainline kernel 4.0rc3 gives a kernel
panic on first attempted SPI transfer. After debugging, it seems to be
caused by commit 24778be2 which removed the empty implementation of
altera_spi_setupxfer() (the function was temporarily added back in
commit 103ccee4 because of a perceived problem, and then removed again
in commit 30af9b55). This causes two problems:

1) Since spi-altera doesn't zero-initialize the spi_bitbang struct,
bitbang->setup_transfer points to a random memory location, obviously
giving a kernel panic when it's called.

2) Even if I zero-initialize it, spi-bitbang reacts to this by calling
its built-in setup function spi_bitbang_setup_transfer(), and this
function tries to write to fields in the struct pointed out by
spi->controller_state. However, spi->controller_state is NULL (at least
for me), so this again gives a kernel panic due to NULL pointer dereference.

So the easiest way I could find to get the driver working is by
reverting the change mentioned above, adding back an empty
implementation of altera_spi_setupxfer().

Best regards, Pelle
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

                 reply	other threads:[~2015-03-31  7:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=551A500D.6030701@xelmo.com \
    --to=per.nilsson-5twez6kpplyavxtiumwx3w@public.gmane.org \
    --cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.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).