linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] iio: Refactor __iio_update_buffers()
@ 2015-05-18 11:34 Lars-Peter Clausen
  2015-05-18 11:34 ` [PATCH v2 1/3] iio: __iio_update_buffers: Verify configuration before starting to apply it Lars-Peter Clausen
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Lars-Peter Clausen @ 2015-05-18 11:34 UTC (permalink / raw)
  To: Jonathan Cameron, Hartmut Knaack, Peter Meerwald
  Cc: linux-iio, Lars-Peter Clausen

Changes since v1:
	* Dropped 'iio: __iio_update_buffers: Update mode before
	  preenable/after postdisable' for now

- Lars

Original cover letter below:

__iio_update_buffers() is quite the beast, it does quite a few different
things and has a couple of separate error paths due to this. This series
refactors the function starting with moving the configuration verification
out of the configuration path itself. This means we can verify that the
configuration will be accepted before we make any changes to the device and
don't have to implement rollback functionality. The function is also broken
down into a couple of smaller helper function each which only a single
error path. This should hopefully make it easier to comprehend what is
going on. The last step of the refactoring process is to make sure that we
always leave the device in a sane and consistent state even if we encounter
a fatal error. This allows to potentially recover from the fatal error and
will also make sure that we don't trigger unexpected behavior in drivers.

The main motivation for this series to get __iio_update_buffers() ready for
future extension like the ones that are needed to support DMA buffer
support as well as better support for hardware buffer support.

The last patch in this series is not meant to be applied, but it implements
some simple random error injecting into the various error paths of
__iio_update_buffers(). This was used to test the patch series for
regressions and to make sure that we can indeed recover from fatal errors
now.

Lars-Peter Clausen (3):
  iio: __iio_update_buffers: Verify configuration before starting to
    apply it
  iio: __iio_update_buffers: Split enable and disable path into helper
    functions
  iio: __iio_update_buffers: Leave device in sane state on error

 drivers/iio/industrialio-buffer.c | 287 +++++++++++++++++++++++---------------
 1 file changed, 175 insertions(+), 112 deletions(-)

-- 
1.8.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-05-23 11:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-18 11:34 [PATCH v2 0/3] iio: Refactor __iio_update_buffers() Lars-Peter Clausen
2015-05-18 11:34 ` [PATCH v2 1/3] iio: __iio_update_buffers: Verify configuration before starting to apply it Lars-Peter Clausen
2015-05-23 11:45   ` Jonathan Cameron
2015-05-18 11:34 ` [PATCH v2 2/3] iio: __iio_update_buffers: Split enable and disable path into helper functions Lars-Peter Clausen
2015-05-23 11:45   ` Jonathan Cameron
2015-05-18 11:34 ` [PATCH v2 3/3] iio: __iio_update_buffers: Leave device in sane state on error Lars-Peter Clausen
2015-05-23 11:48   ` Jonathan Cameron

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).