From: Ville Tervo <ville.tervo@nokia.com>
To: "ext pavan_savoy@ti.com" <pavan_savoy@ti.com>
Cc: linux-bluetooth@vger.kernel.org, padovan@profusion.mobi,
marcel@holtmann.org
Subject: Re: [PATCH] Bluetooth: btwilink driver
Date: Mon, 7 Feb 2011 12:54:53 +0200 [thread overview]
Message-ID: <20110207105453.GZ874@null> (raw)
In-Reply-To: <1297075132-4694-1-git-send-email-pavan_savoy@ti.com>
Hi Pavan,
On Mon, Feb 07, 2011 at 04:38:52AM -0600, ext pavan_savoy@ti.com wrote:
> From: Pavan Savoy <pavan_savoy@ti.com>
>
> Gustavo,
>
> As suggested, the modifications to TI ST driver to remove the bluetooth
> references have been made and the changes have been merged to the
> linux-next tree.
>
> Find below the patch for the btwilink driver,
> I have taken care of your following comments,
> 1. channel IDs and the offsets are now being taken from the
> header file hci.h.
> 2. removed the un-necessary BT_ERR.
> 3. changed the order during return from st_register.
> 4. continue to unregister even if 1st unregister fails.
>
> Please review and provide comments,
Will do. Some comment
> +/* Called from HCI core to initialize the device */
> +static int ti_st_open(struct hci_dev *hdev)
> +{
> + unsigned long timeleft;
> + struct ti_st *hst;
> + int err, i;
> +
> + BT_DBG("%s %p", hdev->name, hdev);
> +
> + if (test_and_set_bit(HCI_RUNNING, &hdev->flags))
> + return -EBUSY;
> +
> + /* provide contexts for callbacks from ST */
> + hst = hdev->driver_data;
> +
> + for (i = 0; i < MAX_BT_CHNL_IDS; i++) {
> + ti_st_proto[i].priv_data = hst;
> + ti_st_proto[i].max_frame_size = HCI_MAX_FRAME_SIZE;
> +
> + err = st_register(&ti_st_proto[i]);
> + if (!err)
> + goto done_downloading_firmware;
> +
> + if (err != -EINPROGRESS) {
> + clear_bit(HCI_RUNNING, &hdev->flags);
> + BT_ERR("st_register failed %d", err);
> + return err;
> + } else {
No need for else. Less indentation looks better to me at least.
> + /* ST is busy with either protocol
> + * registration or firmware download.
> + */
> + /* Prepare wait-for-completion handler data structures.
> + */
> + init_completion(&hst->wait_reg_completion);
init_completion should be done before startin action which executes complete().
IOW this should be before st_register if I understood this correctly.
Otherwise the started action might call complete before init_completion and
wait_for_completion_timeout will just time even everything went fine.
--
Ville
next prev parent reply other threads:[~2011-02-07 10:54 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-07 10:38 [PATCH] Bluetooth: btwilink driver pavan_savoy
2011-02-07 10:54 ` Ville Tervo [this message]
2011-02-07 11:00 ` Pavan Savoy
-- strict thread matches above, loose matches on Subject: below --
2011-02-21 4:41 pavan_savoy
2011-02-09 13:59 pavan_savoy
2010-10-15 20:58 pavan_savoy
2010-10-18 17:32 ` Savoy, Pavan
2010-10-18 17:32 ` Savoy, Pavan
2010-10-18 19:48 ` Gustavo F. Padovan
2010-10-18 19:53 ` Savoy, Pavan
2010-10-18 19:53 ` Savoy, Pavan
2010-10-18 20:10 ` Gustavo F. Padovan
2010-10-18 20:14 ` Savoy, Pavan
2010-10-18 20:14 ` Savoy, Pavan
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=20110207105453.GZ874@null \
--to=ville.tervo@nokia.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=marcel@holtmann.org \
--cc=padovan@profusion.mobi \
--cc=pavan_savoy@ti.com \
/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.