All of lore.kernel.org
 help / color / mirror / Atom feed
From: Loic Poulain <loic.poulain@intel.com>
To: Frederic Danis <frederic.danis@intel.com>,
	Marcel Holtmann <marcel@holtmann.org>,
	Frederic Danis <frederic.danis@linux.intel.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH v3 3/3] Bluetooth: hci_bcm: Add suspend/resume runtime PM functions
Date: Fri, 11 Sep 2015 11:44:45 +0200	[thread overview]
Message-ID: <55F2A28D.9010506@intel.com> (raw)
In-Reply-To: <55F19651.8090908@intel.com>

Hi Fred

>> For hci_intel we are doing this in the enqueue function when the
>> Bluetooth subsystem has to send us data. Why would we do this on the
>> TTY receiving side here? If the device is not active, we would not be
>> receiving anything in the first place. I am failing to see the logic
>> here.
> hci_intel also performs this when receiving LPM_OP_TX_NOTIFY packets.
> Afaik, Broadcom device does not have this feature and we need to delay
> the suspend when we receive a packet.
>
> I will move bcm_schedule_work() after h4_recv_buf() to perform it only
> on completed packet.

What about using a delayed work with work_delay << autosuspend_delay so 
that the work is not queued each time but every work_delay in worst case.

hci_uart proto callback is called with rx spinlock in
hci_uart_tty_receive which is the receive_buf ldisc callback.
In drivers/tty/tty_buffer.c we can see that flush_to_ldisc (work) locks
a mutex (&buf->lock) and push the data to ldisc via receive_buf.

So, I don't see any problem to remove the hci_ldisc rx_spinlock and 
replace it by a mutex, or even don't use locking at all.

Regards,
Loic
-- 
Intel Open Source Technology Center
http://oss.intel.com/

      reply	other threads:[~2015-09-11  9:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-09  7:54 [PATCH v3 0/3] Bluetooth: hci_bcm: Add wake-up and PM runtime support Frederic Danis
2015-09-09  7:54 ` [PATCH v3 1/3] Bluetooth: hci_bcm: Fix IRQ polarity for T100 Frederic Danis
2015-09-09 16:13   ` Marcel Holtmann
2015-09-10  9:33     ` Frederic Danis
2015-09-09  7:54 ` [PATCH v3 2/3] Bluetooth: hci_bcm: Prepare PM runtime support Frederic Danis
2015-09-09 16:18   ` Marcel Holtmann
2015-09-10  9:35     ` Frederic Danis
2015-09-09  7:54 ` [PATCH v3 3/3] Bluetooth: hci_bcm: Add suspend/resume runtime PM functions Frederic Danis
2015-09-09 16:29   ` Marcel Holtmann
2015-09-10 14:40     ` Frederic Danis
2015-09-11  9:44       ` Loic Poulain [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=55F2A28D.9010506@intel.com \
    --to=loic.poulain@intel.com \
    --cc=frederic.danis@intel.com \
    --cc=frederic.danis@linux.intel.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.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.