All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gargi Sharma <gs051095@gmail.com>
To: Alison Schofield <amsfield22@gmail.com>
Cc: Arushi Singhal <arushisinghal19971997@gmail.com>,
	 simran singhal <singhalsimran0@gmail.com>,
	sayli karnik <karniksayli1995@gmail.com>,
	 outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] iio meter patches - same!
Date: Wed, 22 Mar 2017 04:21:48 +0530	[thread overview]
Message-ID: <CAOCi2DF3AK_7iZyYaOAojOPEf3AEZiEfK-ZtmJO7VqaW8m0SCQ@mail.gmail.com> (raw)
In-Reply-To: <20170321203110.GB12475@d830.WORKGROUP>

On Wed, Mar 22, 2017 at 2:01 AM, Alison Schofield <amsfield22@gmail.com> wrote:
>
> Simran, Gargi, Sayli, Arushi,
>
> With respect to these...
>
> meter/ade7753.c: simran singhal
> meter/ade7754.c: Gargi Sharma
> meter/ade7758_core.c: Sayli Karnik
> meter/ade7759.c: ArushiSinghal
>
> They are all near identical and therefore should have near identical
> solutions.  You could work together, or follow one another, but, in
> the end we don't want to see 4 different flavors of the solution.
> That makes it harder to maintain.
>
> Also - if 'we' can get one reviewed/ACK'd/applied, then we make the
> reviewers and maintainers life easier when we follow it with 3
> similar patches.
>
> Here's where I think you all dancing around...
> You have Lars' feedback from ade7753:
> > It might make sense to reuse the existing lock which currently
> > protects the
> > read/write functions. You can do this by introducing a variant of
> > ade7753_spi_{read,write}_reg_16() that does not take a lock and use
> > these to
> > implement the read-modify-write cycle in a protected section.
>
> I'll add to that:
> They were all using mlock to try to protect the spi read followed by
> write operation.
I have a question here: why do we want to protect the spi read?, I mean
usually we want to protect writes since there might be a race condition.
Or is it because if two threads are running the same function
concurrently we want to give access of the function to the thread
number 2 only once thread number 1 has written to the register?

>I don't think the lock was actually doing that.
> I don't see a guarantee that another spi write could not intervene,
> So perhaps there was no real protection.
Again, if we have two threads 1 and 2, won't the structure indio_dev
be same for the both of them? And only one thread can hold the lock at
a time.
>
> I'm thinking one function that locks the existing transaction lock, does
> the read, does the write, unlocks.
Simran wrote a function write_then_read in this patch
http://marc.info/?l=linux-driver-devel&m=149001635402891&w=2. Do we
want to do something similar?

>
> Can you all coordinate that please.  This way the next patch we see on
> this is agreed upon by all four.  Once that is applauded ;), the others
> can follow easily!
>
Yeah that makes sense and is the most productive use of all of our ability! :)

Thanks!
Gargi

> thanks,
> alison
>
>
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20170321203110.GB12475%40d830.WORKGROUP.
> For more options, visit https://groups.google.com/d/optout.


  parent reply	other threads:[~2017-03-21 22:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-21 20:31 iio meter patches - same! Alison Schofield
2017-03-21 21:43 ` sayli karnik
2017-03-21 22:51 ` Gargi Sharma [this message]
2017-03-22  3:48   ` [Outreachy kernel] " Alison Schofield
2017-03-22 17:41 [Outreachy kernel] iio meter patches - same!] Alison Schofield
2017-03-23  8:11 ` Daniel Baluta
2017-03-23 17:32   ` Alison Schofield
2017-03-23 18:27     ` Alison Schofield

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=CAOCi2DF3AK_7iZyYaOAojOPEf3AEZiEfK-ZtmJO7VqaW8m0SCQ@mail.gmail.com \
    --to=gs051095@gmail.com \
    --cc=amsfield22@gmail.com \
    --cc=arushisinghal19971997@gmail.com \
    --cc=karniksayli1995@gmail.com \
    --cc=outreachy-kernel@googlegroups.com \
    --cc=singhalsimran0@gmail.com \
    /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.