From: Tom Rini Date: Tue, 31 Mar 2020 15:10:02 -0400 Subject: [PATCH resend 3/5] mpc8xxx_spi: put max_cs to use In-Reply-To: <20200211151947.26091-4-rasmus.villemoes@prevas.dk> References: <20200211151947.26091-1-rasmus.villemoes@prevas.dk> <20200211151947.26091-4-rasmus.villemoes@prevas.dk> Message-ID: <20200331191002.GF27133@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, Feb 11, 2020 at 03:20:24PM +0000, Rasmus Villemoes wrote: > Currently, max_cs is write-only; it's just set in > mpc8xxx_spi_ofdata_to_platdata and not otherwise used. > > My mpc8309 was always resetting during an "sf probe 0". It turns out > dm_gpio_set_dir_flags() was being called with garbage, since nothing > had initialized priv->gpios[0] - our device tree used "cs-gpios" > rather than "gpios", so gpio_request_list_by_name() had returned 0. > > That would have been a lot easier to figure out if the chip select > index was sanity checked, so rename max_cs to cs_count, and reject a > xfer with a too large cs index. > > Signed-off-by: Rasmus Villemoes Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: