diff for duplicates of <20101117165248.GB21729@vigoh> diff --git a/a/1.txt b/N1/1.txt index 76ecce6..fb7bce0 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -3,17 +3,16 @@ Hi Pavan, * Pavan Savoy <pavan_savoy@sify.com> [2010-11-17 11:13:26 +0530]: > On Wed, Nov 17, 2010 at 4:50 AM, Vitaly Wool <vitalywool@gmail.com> wrote: -> >>> + =A0 =A0 /* Registration with ST layer is successful, -> >>> + =A0 =A0 =A0* hardware is ready to accept commands from HCI core. -> >>> + =A0 =A0 =A0*/ -> >>> + =A0 =A0 if (test_and_set_bit(HCI_RUNNING, &hdev->flags)) { -> >>> + =A0 =A0 =A0 =A0 =A0 =A0 clear_bit(HCI_RUNNING, &hdev->flags); -> >>> + =A0 =A0 =A0 =A0 =A0 =A0 err =3D st_unregister(ST_BT); -> >>> + =A0 =A0 =A0 =A0 =A0 =A0 if (err) -> >>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 BT_ERR("st_unregister() fai= -led with error %d", err); -> >>> + =A0 =A0 =A0 =A0 =A0 =A0 hst->st_write =3D NULL; -> >>> + =A0 =A0 } +> >>> + /* Registration with ST layer is successful, +> >>> + * hardware is ready to accept commands from HCI core. +> >>> + */ +> >>> + if (test_and_set_bit(HCI_RUNNING, &hdev->flags)) { +> >>> + clear_bit(HCI_RUNNING, &hdev->flags); +> >>> + err = st_unregister(ST_BT); +> >>> + if (err) +> >>> + BT_ERR("st_unregister() failed with error %d", err); +> >>> + hst->st_write = NULL; +> >>> + } > >> > >> > >> What are you trying to do here? test_and_set_bit() result doesn't say @@ -24,21 +23,21 @@ led with error %d", err); > > > > Yeap, this piece of code beats me is well. Why is it an error if this > > bit wasn't already set? ->=20 +> > Vitaly, Gustavo, ->=20 +> > I suppose I never understood HCI_RUNNING flag that way, as in an error > check mechanism to avoid multiple hci0 ups. ->=20 +> > What I understood was that HCI_RUNNING suggested as to when hci0 was > ready to be used. With this understanding, I wanted to make sure I > downloaded the firmware for the chip before I proclaim to the world > that the hci0 is ready to be used, as in HCI_RUNNING. ->=20 +> > For example, I didn't want my _send_frame to be called before I did > the firmware download - since firmware download takes time - 45kb > send/wait commands :( ->=20 +> > But I suppose I now understand - What I would rather do is test_bit in > the beginning of function and do a set_bit at the end of function - > does this make sense ? @@ -46,6 +45,6 @@ led with error %d", err); It does, but does it as test_and_set and then clear if error as we do in other drivers. ---=20 +-- Gustavo F. Padovan http://profusion.mobi diff --git a/a/content_digest b/N1/content_digest index 8403550..eb62920 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -17,17 +17,16 @@ "* Pavan Savoy <pavan_savoy@sify.com> [2010-11-17 11:13:26 +0530]:\n" "\n" "> On Wed, Nov 17, 2010 at 4:50 AM, Vitaly Wool <vitalywool@gmail.com> wrote:\n" - "> >>> + =A0 =A0 /* Registration with ST layer is successful,\n" - "> >>> + =A0 =A0 =A0* hardware is ready to accept commands from HCI core.\n" - "> >>> + =A0 =A0 =A0*/\n" - "> >>> + =A0 =A0 if (test_and_set_bit(HCI_RUNNING, &hdev->flags)) {\n" - "> >>> + =A0 =A0 =A0 =A0 =A0 =A0 clear_bit(HCI_RUNNING, &hdev->flags);\n" - "> >>> + =A0 =A0 =A0 =A0 =A0 =A0 err =3D st_unregister(ST_BT);\n" - "> >>> + =A0 =A0 =A0 =A0 =A0 =A0 if (err)\n" - "> >>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 BT_ERR(\"st_unregister() fai=\n" - "led with error %d\", err);\n" - "> >>> + =A0 =A0 =A0 =A0 =A0 =A0 hst->st_write =3D NULL;\n" - "> >>> + =A0 =A0 }\n" + "> >>> + \302\240 \302\240 /* Registration with ST layer is successful,\n" + "> >>> + \302\240 \302\240 \302\240* hardware is ready to accept commands from HCI core.\n" + "> >>> + \302\240 \302\240 \302\240*/\n" + "> >>> + \302\240 \302\240 if (test_and_set_bit(HCI_RUNNING, &hdev->flags)) {\n" + "> >>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 clear_bit(HCI_RUNNING, &hdev->flags);\n" + "> >>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 err = st_unregister(ST_BT);\n" + "> >>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 if (err)\n" + "> >>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 BT_ERR(\"st_unregister() failed with error %d\", err);\n" + "> >>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 hst->st_write = NULL;\n" + "> >>> + \302\240 \302\240 }\n" "> >>\n" "> >>\n" "> >> What are you trying to do here? test_and_set_bit() result doesn't say\n" @@ -38,21 +37,21 @@ "> >\n" "> > Yeap, this piece of code beats me is well. Why is it an error if this\n" "> > bit wasn't already set?\n" - ">=20\n" + "> \n" "> Vitaly, Gustavo,\n" - ">=20\n" + "> \n" "> I suppose I never understood HCI_RUNNING flag that way, as in an error\n" "> check mechanism to avoid multiple hci0 ups.\n" - ">=20\n" + "> \n" "> What I understood was that HCI_RUNNING suggested as to when hci0 was\n" "> ready to be used. With this understanding, I wanted to make sure I\n" "> downloaded the firmware for the chip before I proclaim to the world\n" "> that the hci0 is ready to be used, as in HCI_RUNNING.\n" - ">=20\n" + "> \n" "> For example, I didn't want my _send_frame to be called before I did\n" "> the firmware download - since firmware download takes time - 45kb\n" "> send/wait commands :(\n" - ">=20\n" + "> \n" "> But I suppose I now understand - What I would rather do is test_bit in\n" "> the beginning of function and do a set_bit at the end of function -\n" "> does this make sense ?\n" @@ -60,8 +59,8 @@ "It does, but does it as test_and_set and then clear if error as we do in\n" "other drivers.\n" "\n" - "--=20\n" + "-- \n" "Gustavo F. Padovan\n" http://profusion.mobi -9d883ee61aac31c1c6d7f8a187e06ead3bc5a0a4d8cfd03509b4698bcf8d073e +2b8e1b490ab8566f5b954c443ccdf6e3b3ec859032e915e991c61c70d30a9ffc
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.