Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1643288 > unrolled thread

Re: [PATCH] serdev: Restore serdev_device_write_buf for atomic context

Started byStefan Wahren <stefan.wahren@i2se.com>
First post2017-05-17 13:50 +0200
Last post2017-05-17 14:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] serdev: Restore serdev_device_write_buf for atomic  context Stefan Wahren <stefan.wahren@i2se.com> - 2017-05-17 13:50 +0200
    Re: [PATCH] serdev: Restore serdev_device_write_buf for atomic  context Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-05-17 14:50 +0200

#1643288 — Re: [PATCH] serdev: Restore serdev_device_write_buf for atomic context

FromStefan Wahren <stefan.wahren@i2se.com>
Date2017-05-17 13:50 +0200
SubjectRe: [PATCH] serdev: Restore serdev_device_write_buf for atomic context
Message-ID<tI5CN-2wd-11@gated-at.bofh.it>
Hi Greg,

Am 08.05.2017 um 17:18 schrieb Johan Hovold:
> On Thu, May 04, 2017 at 03:32:53PM -0500, Rob Herring wrote:
>> On Thu, May 4, 2017 at 11:22 AM, Stefan Wahren <stefan.wahren@i2se.com> wrote:
>>> Am 02.05.2017 um 15:18 schrieb Johan Hovold:
>>>> On Tue, May 02, 2017 at 07:41:34AM -0500, Rob Herring wrote:
>>>>> On Tue, May 2, 2017 at 4:06 AM, Johan Hovold <johan@kernel.org> wrote:
>>>>>> On Fri, Apr 28, 2017 at 01:47:21PM +0200, Stefan Wahren wrote:
>>>>>>> Starting with commit 6fe729c4bdae ("serdev: Add serdev_device_write
>>>>>>> subroutine") the function serdev_device_write_buf cannot be used in
>>>>>>> atomic context anymore (mutex_lock is sleeping). So restore the old
>>>>>>> behavior.
>>>>>> Yeah, preventing use in atomic context seems unnecessary, although any
>>>>>> clients writing must now deal with serialisation themselves (as before,
>>>>>> and as they should).
>>>>> We could just remove the mutex for serdev_device_write and always make
>>>>> the client responsible for serialization.
>>>> That sounds reasonable.
>>> So it's unwanted to have 2 write functions (non-atomic, atomic)?
>> No, it's unwanted to have more than we need.
>>
>> Looking closer, we'd also have to ensure the wait for completion is
>> not called also. So probably better to just leave it as you have done
>> it.
> Indeed. Sorry if my reply above was unclear on that point (i.e. that
> Stefan's patch is still needed regardless of whether we keep the mutex
> or not).
>
> Thanks,
> Johan

are you okay with this patch and can you please apply it?

Stefan

[toc] | [next] | [standalone]


#1643337

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-05-17 14:50 +0200
Message-ID<tI6yT-392-29@gated-at.bofh.it>
In reply to#1643288
On Wed, May 17, 2017 at 01:38:40PM +0200, Stefan Wahren wrote:
> Hi Greg,
> 
> Am 08.05.2017 um 17:18 schrieb Johan Hovold:
> > On Thu, May 04, 2017 at 03:32:53PM -0500, Rob Herring wrote:
> >> On Thu, May 4, 2017 at 11:22 AM, Stefan Wahren <stefan.wahren@i2se.com> wrote:
> >>> Am 02.05.2017 um 15:18 schrieb Johan Hovold:
> >>>> On Tue, May 02, 2017 at 07:41:34AM -0500, Rob Herring wrote:
> >>>>> On Tue, May 2, 2017 at 4:06 AM, Johan Hovold <johan@kernel.org> wrote:
> >>>>>> On Fri, Apr 28, 2017 at 01:47:21PM +0200, Stefan Wahren wrote:
> >>>>>>> Starting with commit 6fe729c4bdae ("serdev: Add serdev_device_write
> >>>>>>> subroutine") the function serdev_device_write_buf cannot be used in
> >>>>>>> atomic context anymore (mutex_lock is sleeping). So restore the old
> >>>>>>> behavior.
> >>>>>> Yeah, preventing use in atomic context seems unnecessary, although any
> >>>>>> clients writing must now deal with serialisation themselves (as before,
> >>>>>> and as they should).
> >>>>> We could just remove the mutex for serdev_device_write and always make
> >>>>> the client responsible for serialization.
> >>>> That sounds reasonable.
> >>> So it's unwanted to have 2 write functions (non-atomic, atomic)?
> >> No, it's unwanted to have more than we need.
> >>
> >> Looking closer, we'd also have to ensure the wait for completion is
> >> not called also. So probably better to just leave it as you have done
> >> it.
> > Indeed. Sorry if my reply above was unclear on that point (i.e. that
> > Stefan's patch is still needed regardless of whether we keep the mutex
> > or not).
> >
> > Thanks,
> > Johan
> 
> are you okay with this patch and can you please apply it?

I'll work to catch up on tty/serial patches soon...

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web