All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jishnu Prakash <jprakash@codeaurora.org>
To: Jonathan Cameron <jic23@kernel.org>
Cc: agross@kernel.org, bjorn.andersson@linaro.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	mka@chromium.org, linus.walleij@linaro.org,
	Jonathan.Cameron@huawei.com, andy.shevchenko@gmail.com,
	amit.kucheria@verdurent.com, smohanad@codeaurora.org,
	kgunda@codeaurora.org, aghayal@codeaurora.org,
	Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	linux-arm-msm@vger.kernel.org, linux-iio@vger.kernel.org,
	linux-arm-msm-owner@vger.kernel.org
Subject: Re: [PATCH V5 5/5] iio: adc: Clean up ADC code common to PMIC5 and PMIC7
Date: Thu, 28 May 2020 22:20:02 +0530	[thread overview]
Message-ID: <0078a610-fed8-7a18-ecd1-27b8eb5a8feb@codeaurora.org> (raw)
In-Reply-To: <20200524130440.250edb2e@archlinux>

Hi Jonathan,

On 5/24/2020 5:34 PM, Jonathan Cameron wrote:
> On Fri, 22 May 2020 19:54:12 +0530
> Jishnu Prakash <jprakash@codeaurora.org> wrote:
>
>> This commit includes the following changes:
>>
>> Add a common function used for read_raw callback for both PMIC5
>> and PMIC7 ADCs.
>>
>> Add exit function for ADC.
> Hi Jishnu,
>
> I don't understand why one is needed, and if it is you can't do
> what you have here without introducing some nasty races.
> So if you need it clearly explain why in comments in the code
> and also consider how it may race with new requests coming in etc
> as the userspace interfaces are still visible.
>
> Move the eoc_irq addition to the structure here as well as makes
> no sense in earlier patch.
>
> Thanks,
>
> Jonathan
>
>
>> Add info_property under adc_data to more efficiently distinguish
>> PMIC5 and PMIC7 ADCs.
>>
>> Signed-off-by: Jishnu Prakash <jprakash@codeaurora.org>
>> ---
>>   drivers/iio/adc/qcom-spmi-adc5.c   | 81 +++++++++++++++++++++-----------------
>>   drivers/iio/adc/qcom-vadc-common.h |  1 +
>>   2 files changed, 46 insertions(+), 36 deletions(-)
>>
>>   
>> +static int adc5_exit(struct platform_device *pdev)
>> +{
>> +	struct adc5_chip *adc = platform_get_drvdata(pdev);
>> +
>> +	if (adc->irq_eoc >= 0)
>> +		disable_irq(adc->irq_eoc);
> So here you are disabling an irq?  Why.  We should be removing it
> cleanly in the managed flow shortly anyway.  If you did do this
> here for some reason I'm not thinking of then you would have
> a race against the userspace being removed on the unwind
> of the iio device register.
>
>> +	return 0;
>> +}
>> +
You're right about the exit function, the actions done in it are not 
strictly required, so I'll remove it in the next post.

      reply	other threads:[~2020-05-28 16:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-22 14:24 [PATCH V5 0/5] iio: adc: Add support for QCOM SPMI PMIC7 ADC Jishnu Prakash
2020-05-22 14:24 ` [PATCH V5 1/5] iio: adc: Convert the QCOM SPMI ADC bindings to .yaml format Jishnu Prakash
2020-05-22 14:24 ` [PATCH V5 2/5] iio: adc: Add PMIC7 ADC bindings Jishnu Prakash
2020-05-22 14:24 ` [PATCH V5 3/5] iio: adc: Add support for PMIC7 ADC Jishnu Prakash
2020-05-22 15:37   ` Andy Shevchenko
2020-05-22 15:41     ` Andy Shevchenko
2020-05-28 16:47     ` Jishnu Prakash
2020-05-24 11:59   ` Jonathan Cameron
2020-05-28 16:47     ` Jishnu Prakash
2020-05-22 14:24 ` [PATCH V5 4/5] iio: adc: Update debug prints Jishnu Prakash
2020-05-22 15:39   ` Andy Shevchenko
2020-05-22 14:24 ` [PATCH V5 5/5] iio: adc: Clean up ADC code common to PMIC5 and PMIC7 Jishnu Prakash
2020-05-22 15:41   ` Andy Shevchenko
2020-05-28 16:49     ` Jishnu Prakash
2020-05-24 12:04   ` Jonathan Cameron
2020-05-28 16:50     ` Jishnu Prakash [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=0078a610-fed8-7a18-ecd1-27b8eb5a8feb@codeaurora.org \
    --to=jprakash@codeaurora.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=aghayal@codeaurora.org \
    --cc=agross@kernel.org \
    --cc=amit.kucheria@verdurent.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=kgunda@codeaurora.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-msm-owner@vger.kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mka@chromium.org \
    --cc=pmeerw@pmeerw.net \
    --cc=smohanad@codeaurora.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.