Return-Path: MIME-Version: 1.0 In-Reply-To: References: <20150818220604.05b7a862@angwin.home> <20150819161441.GA8142@hau.nz> <20150819220231.58a3b14f@angwin.home> Date: Mon, 24 Aug 2015 13:48:24 +0300 Message-ID: Subject: Re: IdleTimeout behavior for Sony PS3 remote in Bluez 5 From: Luiz Augusto von Dentz To: David Herrmann Cc: "Mark A. Haun" , "linux-bluetooth@vger.kernel.org" , David Herrmann Content-Type: text/plain; charset=UTF-8 Sender: linux-bluetooth-owner@vger.kernel.org List-ID: Hi David, On Mon, Aug 24, 2015 at 1:40 PM, David Herrmann wrote: > Hi > > On Mon, Aug 24, 2015 at 10:12 AM, Luiz Augusto von Dentz > wrote: >> Hi David, >> >> On Fri, Aug 21, 2015 at 12:03 PM, David Herrmann wrote: >>> Hey >>> >>> On Thu, Aug 20, 2015 at 10:52 AM, Luiz Augusto von Dentz >>> wrote: >>>> @David: Since apparently you was the author of the patch the remove >>>> setting EUNATCH to sk_err can you tell if that was intentional or you >>>> did not know that it could affect the timeout implementation? Btw, it >>>> would nice if you could comment regarding moving the timeout policy to >>>> the HID driver. >>> >>> This sounds like an oversight. From a quick look, >>> hidp_session_terminate() should set these errors properly. I can try >>> to craft a patch on Monday. >> >> I wonder if it isn't better to just call kernel_sock_shutdown directly >> since either way we want to disconnect and the userspace is not really >> doing anything special with EUNATCH either, it just see there is an >> error and close its reference which happens to be the last one causing >> it disconnect. > > I'm not very comfortable with -net internals, so not sure what > behavior you want. Calling kernel_sock_shutdown() sounds fine, but > that cannot be done from hidp_session_terminate(). Instead, you must > call it from hidp_session_thread() somewhere near hidp_del_timer(), > before hidp_session_put(). Then lets keep it simple and just set EUNATCH as it was before. -- Luiz Augusto von Dentz