All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
To: Martin Sperl <kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
Cc: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	lee-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-rpi-kernel
	<linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>
Subject: Re: [PATCH 4/6] spi: bcm2835: warn about native-chip-selects being used
Date: Mon, 30 Mar 2015 21:23:01 -0600	[thread overview]
Message-ID: <551A1315.8010600@wwwdotorg.org> (raw)
In-Reply-To: <0330B85B-A297-482B-80A9-E01F236D33D2-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>

On 03/29/2015 08:03 AM, Martin Sperl wrote:
> Signed-off-by: Martin Sperl <kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
> Tested-by: Martin Sperl <kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>

It would be useful to have a commit description saying why such a
warning was useful.

> diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c

> @@ -82,6 +82,7 @@ struct bcm2835_spi {
>  	u8 *rx_buf;
>  	int tx_len;
>  	int rx_len;
> +	bool native_cs_use_warning_done;
>  };
...
> @@ -294,6 +298,14 @@ static int bcm2835_spi_setup(struct spi_device *spi)
...
> +	/* we are in the native chipselect case now,
> +	 * so warn about the fact that some things may not work as well

What things and why? (I'm asking mainly because that should be in the
commit description and perhaps this comment).

> +	 */
> +	if (!bs->native_cs_use_warning_done) {
> +		dev_warn(&spi->dev,
> +			 "setup: native chipselect is used - some driver functions/optimizations are not applied\n");
> +		bs->native_cs_use_warning_done = 1;
> +	}

Isn't there a warn_once() that would remove the need to check/set
native_cs_use_warning_done?
--
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

      parent reply	other threads:[~2015-03-31  3:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-29 14:03 [PATCH 4/6] spi: bcm2835: warn about native-chip-selects being used Martin Sperl
     [not found] ` <0330B85B-A297-482B-80A9-E01F236D33D2-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-03-30  4:22   ` Mark Brown
     [not found]     ` <20150330042205.GB1568-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-03-30 19:20       ` Martin Sperl
     [not found]         ` <4790EEB6-C62D-4FE0-98AE-26ADE3024B04-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-03-31  3:21           ` Stephen Warren
2015-03-31  3:23   ` Stephen Warren [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=551A1315.8010600@wwwdotorg.org \
    --to=swarren-3lzwwm7+weoh9zmkesr00q@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org \
    --cc=lee-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@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 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.