Linux bluetooth development
 help / color / mirror / Atom feed
From: Szymon Janc <szymon.janc@tieto.com>
To: Johan Hedberg <johan.hedberg@gmail.com>
Cc: Andre Guedes <andre.guedes@openbossa.org>,
	"linux-bluetooth@vger.kernel.org"
	<linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH 02/12] Bluetooth: Add basic start/complete HCI transaction functions
Date: Fri, 15 Feb 2013 09:36:03 +0100	[thread overview]
Message-ID: <22685873.dZ0kFmHBbe@uw000953> (raw)
In-Reply-To: <20130215082236.GA5232@x220>

Hi Johan,

On Friday 15 of February 2013 10:22:36 Johan Hedberg wrote:
> > > +int hci_start_transaction(struct hci_dev *hdev)
> > > +{
> > > +       struct hci_transaction *transaction;
> > > +       int err;
> > > +
> > > +       hci_transaction_lock(hdev);
> > > +
> > > +       /* We can't start a new transaction if there's another one in
> > > +        * progress of being built.
> > > +        */
> > > +       if (hdev->build_transaction) {
> > > +               err = -EBUSY;
> > > +               goto unlock;
> > > +       }
> > > +
> > > +       transaction = kmalloc(sizeof(*transaction), GFP_ATOMIC);
> > 
> > I've failed to see why we need GFP_ATOMIC here. As this code is not
> > running in any atomic section, we can allocate memory using
> > GFP_KERNEL.
> 
> Since one of the intentions of this API is to create an async version of
> hci_request() I think it's better to keep GFP_ATOMIC here. One situation
> where you couldn't for sure use hci_request() is if you're in an atomic
> section and then a HCI request would be the only other alternative.

You lock mutex in hci_start_transaction so it is non-atomic anyway..

-- 
BR
Szymon Janc


  reply	other threads:[~2013-02-15  8:36 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-13 14:50 [PATCH 00/12] Bluetooth: Asynchronous HCI transaction API Johan Hedberg
2013-02-13 14:50 ` [PATCH 01/12] Bluetooth: Add initial hooks for HCI transaction support Johan Hedberg
2013-02-13 14:50 ` [PATCH 02/12] Bluetooth: Add basic start/complete HCI transaction functions Johan Hedberg
2013-02-14 17:48   ` Andre Guedes
2013-02-15  8:22     ` Johan Hedberg
2013-02-15  8:36       ` Szymon Janc [this message]
2013-02-15  9:06         ` Johan Hedberg
2013-02-15  9:18           ` Szymon Janc
2013-02-15  9:52             ` Johan Hedberg
2013-02-13 14:50 ` [PATCH 03/12] Bluetooth: Add hci_transaction_cmd_complete function Johan Hedberg
2013-02-14 17:48   ` Andre Guedes
2013-02-13 14:50 ` [PATCH 04/12] Bluetooth: Add hci_transaction_from_skb function Johan Hedberg
2013-02-13 14:50 ` [PATCH 05/12] Bluetooth: Switch from hdev->cmd_q to using transactions Johan Hedberg
2013-02-13 14:50 ` [PATCH 06/12] Bluetooth: Remove unused hdev->cmd_q HCI command queue Johan Hedberg
2013-02-13 14:50 ` [PATCH 07/12] Bluetooth: Fix mgmt powered indication by using a HCI transaction Johan Hedberg
2013-02-13 14:50 ` [PATCH 08/12] Bluetooth: Enable HCI transaction support cmd_status 0 Johan Hedberg
2013-02-14 17:48   ` Andre Guedes
2013-02-13 14:50 ` [PATCH 09/12] Bluetooth: Add HCI init sequence support for HCI transactions Johan Hedberg
2013-02-13 17:10   ` Anderson Lizardo
2013-02-15  8:17     ` Johan Hedberg
2013-02-13 14:50 ` [PATCH 10/12] Bluetooth: Convert hci_request to use " Johan Hedberg
2013-02-13 14:50 ` [PATCH 11/12] Bluetooth: Remove unused hdev->init_last_cmd Johan Hedberg
2013-02-13 14:50 ` [PATCH 12/12] Bluetooth: Remove empty HCI event handlers Johan Hedberg
     [not found]   ` <CAMXE1-pn2V-6mgvqpwDygaqgsUr90yV7BS_txyzGQytA4gTABw@mail.gmail.com>
2013-02-18  7:51     ` Johan Hedberg

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=22685873.dZ0kFmHBbe@uw000953 \
    --to=szymon.janc@tieto.com \
    --cc=andre.guedes@openbossa.org \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox