From: Atsushi Nemoto <anemo@mba.ocn.ne.jp> To: iivanov@mm-sol.com Cc: broonie@kernel.org, gsi@denx.de, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] spi: core: Validate length of the transfers in message Date: Tue, 25 Feb 2014 22:55:28 +0900 (JST) [thread overview] Message-ID: <20140225.225528.453119424.anemo@mba.ocn.ne.jp> (raw) In-Reply-To: <1392890528-7417-1-git-send-email-iivanov@mm-sol.com> On Thu, 20 Feb 2014 12:02:08 +0200, "Ivan T. Ivanov" <iivanov@mm-sol.com> wrote: > SPI transfer length should be multiple of SPI word size, > where SPI word size should be power-of-two multiple ... > + n_words = xfer->len / w_size; > + /* No partial transfers accepted */ > + if (!n_words || xfer->len % w_size) > + return -EINVAL; Is xfer->len == 0 invalid? Long time ago I have fixed atmel spi driver to support zero length transfer (commit 06719814 atmel_spi: support zero length transfer). According to Documentation/spi/spi-summary, zeto length transfer seems valid. + optionally defining short delays after transfers ... using the spi_transfer.delay_usecs setting (this delay can be the only protocol effect, if the buffer length is zero); --- Atsushi Nemoto
WARNING: multiple messages have this Message-ID (diff)
From: Atsushi Nemoto <anemo-7JcRY8pycbNHfZP73Gtkiw@public.gmane.org> To: iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org Cc: broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, gsi-ynQEQJNshbs@public.gmane.org, linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Subject: Re: [PATCH v3] spi: core: Validate length of the transfers in message Date: Tue, 25 Feb 2014 22:55:28 +0900 (JST) [thread overview] Message-ID: <20140225.225528.453119424.anemo@mba.ocn.ne.jp> (raw) In-Reply-To: <1392890528-7417-1-git-send-email-iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org> On Thu, 20 Feb 2014 12:02:08 +0200, "Ivan T. Ivanov" <iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org> wrote: > SPI transfer length should be multiple of SPI word size, > where SPI word size should be power-of-two multiple ... > + n_words = xfer->len / w_size; > + /* No partial transfers accepted */ > + if (!n_words || xfer->len % w_size) > + return -EINVAL; Is xfer->len == 0 invalid? Long time ago I have fixed atmel spi driver to support zero length transfer (commit 06719814 atmel_spi: support zero length transfer). According to Documentation/spi/spi-summary, zeto length transfer seems valid. + optionally defining short delays after transfers ... using the spi_transfer.delay_usecs setting (this delay can be the only protocol effect, if the buffer length is zero); --- Atsushi Nemoto -- 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
next prev parent reply other threads:[~2014-02-25 14:16 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-02-20 10:02 [PATCH v3] spi: core: Validate length of the transfers in message Ivan T. Ivanov 2014-02-20 10:02 ` Ivan T. Ivanov 2014-02-22 3:01 ` Mark Brown 2014-02-22 3:01 ` Mark Brown 2014-02-25 13:55 ` Atsushi Nemoto [this message] 2014-02-25 13:55 ` Atsushi Nemoto 2014-02-26 0:14 ` Mark Brown 2014-02-27 13:38 ` Atsushi Nemoto 2014-02-28 6:19 ` Mark Brown 2014-02-28 6:19 ` Mark Brown 2014-02-28 13:55 ` Atsushi Nemoto 2014-02-28 13:55 ` Atsushi Nemoto
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=20140225.225528.453119424.anemo@mba.ocn.ne.jp \ --to=anemo@mba.ocn.ne.jp \ --cc=broonie@kernel.org \ --cc=gsi@denx.de \ --cc=iivanov@mm-sol.com \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-spi@vger.kernel.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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.