linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Enric Balletbo Serra <eballetbo@gmail.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Enric Balletbo i Serra <enric.balletbo@collabora.com>,
	linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org,
	Wim Van Sebroeck <wim@iguana.be>,
	Martyn Welch <martyn.welch@collabora.com>
Subject: Re: [PATCH v2] watchdog: ziirave_wdt: Add support to upload the firmware.
Date: Thu, 21 Jul 2016 15:40:45 +0200	[thread overview]
Message-ID: <CAFqH_52=6r-1ATvpsVT9Hh8RPdPWoxhZRFJ1bCWio=GaqoCZCg@mail.gmail.com> (raw)
In-Reply-To: <5790CD25.5030002@roeck-us.net>

2016-07-21 15:24 GMT+02:00 Guenter Roeck <linux@roeck-us.net>:
> On 07/21/2016 01:59 AM, Enric Balletbo Serra wrote:
>
> [ ... ]
>
>>>>
>>>> +static ssize_t ziirave_wdt_sysfs_store_firm(struct device *dev,
>>>> +                                           struct device_attribute
>>>> *attr,
>>>> +                                           const char *buf, size_t
>>>> count)
>>>> +{
>>>> +       struct i2c_client *client = to_i2c_client(dev->parent);
>>>> +       struct ziirave_wdt_data *w_priv = i2c_get_clientdata(client);
>>>> +       const struct firmware *fw;
>>>> +       int err;
>>>> +
>>>
>>>
>>>
>>> What happens if this file is opened twice and written in parallel ?
>>> What if any
>>> other attribute is accessed while the firmware download is ongoing ?
>>>
>>
>> Good point. So you think I need to protect all with mutexes or there
>
>
> Yes, you have to protect any possible damaging parallel access with mutexes.
>
>> is another way? From a quick look on other drivers i didn't see this
>> kind of protection (something to look at in the future)
>>
>
> Really ? Can you point me to some examples ? This would be a bug.
>
> You'll have to fix the to get your patch accepted. Pointing to other
> examples with the same or a similar bug is not an argument.
>

Yeah I know, I didn't want to justify me, I didn't express well if
this was your impression, I just wanted to point that there are some
drivers in other subsystems that I think that have this problem, I
only did a quick look though (is some upstreaming work that I can add
to my TODO list)

Already fixed in next v3 :)


> Thanks,
> Guenter
>

      reply	other threads:[~2016-07-21 13:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-20 10:31 [PATCH v2] watchdog: ziirave_wdt: Add support to upload the firmware Enric Balletbo i Serra
2016-07-21  3:42 ` Guenter Roeck
2016-07-21  8:59   ` Enric Balletbo Serra
2016-07-21  9:09     ` Enric Balletbo Serra
2016-07-21 13:24     ` Guenter Roeck
2016-07-21 13:40       ` Enric Balletbo Serra [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='CAFqH_52=6r-1ATvpsVT9Hh8RPdPWoxhZRFJ1bCWio=GaqoCZCg@mail.gmail.com' \
    --to=eballetbo@gmail.com \
    --cc=enric.balletbo@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=martyn.welch@collabora.com \
    --cc=wim@iguana.be \
    /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;
as well as URLs for NNTP newsgroup(s).