From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753758AbdEQLjx (ORCPT ); Wed, 17 May 2017 07:39:53 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:55688 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751531AbdEQLjj (ORCPT ); Wed, 17 May 2017 07:39:39 -0400 Subject: Re: [PATCH] serdev: Restore serdev_device_write_buf for atomic context To: Johan Hovold , Rob Herring , Greg Kroah-Hartman References: <1493380041-14710-1-git-send-email-stefan.wahren@i2se.com> <20170502090638.GB2973@localhost> <20170502131854.GA17710@localhost> <20170508151858.GB30445@localhost> Cc: Jiri Slaby , Sebastian Reichel , Guenter Roeck , Andy Shevchenko , Andrey Smirnov , "linux-serial@vger.kernel.org" , "linux-kernel@vger.kernel.org" From: Stefan Wahren Message-ID: <8a24cad2-26d7-3394-509a-a0c038345d13@i2se.com> Date: Wed, 17 May 2017 13:38:40 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170508151858.GB30445@localhost> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:HxUe/YHpXqZWRFdoPeSk+LVKRTFgFMijKqy0GaSsNqylSCf81Hf woCYIVrPzxeYh6cWzKLfuJ4xHN9BatnAy72TwUZf0LQdL5SoCLCc7laCqB/x+ZB/DO9z/uS SSoWdtRO5S7eQyEEoVoV+aza7uJmtIlZfT+rHVpRn122he4C0UhNzflgk/hMOIERePwpQXs JkRUJAgQvihWI8TvdeAJQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:B9//uJrBL7w=:McfRkdWfTzLhwzap2REqCJ Saoxc/QyBm6kehKW/fbnPI9WNbh0WmdTAQ1nq5i6QVuzqh9wqErYUzLJu//8CFU4nMYftntM5 Q8ob5i+GwR3w3qhql/rWmZnBylimNlIarSL1jVIvC7+m9BKl0OdkRozc6nBRSG5vBDdXtBsvB 1yEwgDUA+hBEmcfeRz5zl6LXBvA7xNtnvzlwTErz6/ON2aijeOz0NZbjYIxAOkLxcoSqMkHk3 YKeGMvXLy2/Bs1nMqDhgTf+jPoGI/XO++50awV/tGOeUVQQfm/OS6qieolPOUqmol2f4xUckU vhWLJcwHWC3lzdBuafpxk/eJv0Q5oCbs7naMAwSXlzlXwmlC4fBISlheoghnJ3AlDqKCNxDK3 +pJlFazgYlVDYgff5e52FPSpHl3wlWd1TpU/AFYOOgZ3Hm7eHy7I1efNy2MA6+IFI8IiApqtZ NPEyfVSiw6uQFtaAZxlWtelt+N91GrIV4KBUI7Y9RkTaJiDYIns6B9IeFns3xR0waUUfxCxtm XziEAnrZLRydfwNmfz+EinJsOac4BtN5+4E2NBcvWVeJNqKYEEk0BA8aXkdp/5CZ0lc3zUB9L KxDH5KWSlOrmuLKIHNNBQiowxNiu/lOQ4MNY7LPj6jXLSGSGkAtaVgyDgxKkjIQgtbwjSfNC1 W3x5VFp1O9R8m2U+l03/I+gToG9nrV11f1ZNZPYiVSiPXotVTICzkQ5ZKvM2WktYRkvW55U8B CISMv+jjK71w1P62 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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 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