mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: linux-kernel@vger.kernel.org, kernel@pengutronix.de,
	Gavin Schenk <g.schenk@eckelmann.de>
Subject: Re: [PATCH v1 1/5] siox: new driver framework for eckelmann SIOX
Date: Mon, 18 Dec 2017 16:06:48 +0100	[thread overview]
Message-ID: <20171218150648.GA25024@kroah.com> (raw)
In-Reply-To: <20171207093008.20688-2-u.kleine-koenig@pengutronix.de>

On Thu, Dec 07, 2017 at 10:30:04AM +0100, Uwe Kleine-König wrote:
> SIOX is a bus system invented at Eckelmann AG to control their building
> management and refrigeration systems. Traditionally the bus was
> implemented on custom microcontrollers, today Linux based machines are
> in use, too.
> 
> The topology on a SIOX bus looks as follows:
> 
>       ,------->--DCLK-->---------------+----------------------.
>       ^                                v                      v
>  ,--------.                ,----------------------.       ,------
>  |        |                |   ,--------------.   |       |
>  |        |--->--DOUT-->---|->-|shift register|->-|--->---|
>  |        |                |   `--------------'   |       |
>  | master |                |        device        |       |  device
>  |        |                |   ,--------------.   |       |
>  |        |---<--DIN---<---|-<-|shift register|-<-|---<---|
>  |        |                |   `--------------'   |       |
>  `--------'                `----------------------'       `------
>       v                                ^                      ^
>       `----------DLD-------------------+----------------------'
> 
> There are two control lines (DCLK and DLD) driven from the bus master to
> all devices in parallel and two daisy chained data lines, one for input
> and one for output. DCLK is the clock to shift both chains by a single
> bit. On an edge of DLD the devices latch both their input and output
> shift registers.
> 
> This patch adds a framework for this bus type.

Looks very nice, great job!

Only one minor comment, and you can just send a follow-up patch for it:

> +	/* prepare data pushed out to devices in buf[0..setbuf_len) */
> +	list_for_each_entry(sdevice, &smaster->devices, node) {
> +		struct siox_driver *sdriver =
> +			to_siox_driver(sdevice->dev.driver);
> +		sdevice->status_written = smaster->status;
> +
> +		i -= sdevice->inbytes;
> +
> +		/*
> +		 * If the device or a previous one is unsynced, don't pet the
> +		 * watchdog. This is done to ensure that the device is kept in
> +		 * reset when something is wrong.
> +		 */
> +		if (!siox_device_synced(sdevice))
> +			unsync_error = 1;
> +
> +		if (sdriver && !unsync_error)
> +			sdriver->set_data(sdevice, sdevice->status_written,
> +					  &smaster->buf[i + 1]);
> +		else
> +			/*
> +			 * Don't trigger watchdog if there is no driver or a
> +			 * sync problem
> +			 */
> +			sdevice->status_written &= ~SIOX_STATUS_WDG;
> +
> +		smaster->buf[i] = sdevice->status_written;
> +	}
> +
> +	WARN_ON(i);

What can someone do if this WARN_ON() triggers?  Seems like it is
left-over debugging code?  If not, make it a "real" error and handle it
properly.  Or provide some sort of context as to what is going on here.

thanks,

greg k-h

  reply	other threads:[~2017-12-18 15:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-07  9:30 [PATCH v1 0/5] siox: add support for new bus type Uwe Kleine-König
2017-12-07  9:30 ` [PATCH v1 1/5] siox: new driver framework for eckelmann SIOX Uwe Kleine-König
2017-12-18 15:06   ` Greg Kroah-Hartman [this message]
2017-12-18 15:08   ` Greg Kroah-Hartman
2017-12-18 15:44     ` Uwe Kleine-König
2017-12-07  9:30 ` [PATCH v1 2/5] siox: add support for tracing Uwe Kleine-König
2017-12-07  9:30 ` [PATCH v1 3/5] siox: add gpio bus driver Uwe Kleine-König
2017-12-07  9:30 ` [PATCH v1 4/5] gpio: new driver to work with a 8x12 siox Uwe Kleine-König
2017-12-18 15:09   ` Greg Kroah-Hartman
2017-12-18 15:40     ` Uwe Kleine-König
2017-12-07  9:30 ` [PATCH v1 5/5] MAINTAINERS: Add entry for SIOX Uwe Kleine-König

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=20171218150648.GA25024@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=g.schenk@eckelmann.de \
    --cc=kernel@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=u.kleine-koenig@pengutronix.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

Powered by JetHome