From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754213AbcEDOkU (ORCPT ); Wed, 4 May 2016 10:40:20 -0400 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:49571 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753050AbcEDOkQ convert rfc822-to-8bit (ORCPT ); Wed, 4 May 2016 10:40:16 -0400 From: Amitkumar Karwar To: Marcel Holtmann CC: "linux-bluetooth@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Ganapathi Bhat Subject: RE: [PATCH v9 3/3] Bluetooth: hci_uart: Support firmware download for Marvell Thread-Topic: [PATCH v9 3/3] Bluetooth: hci_uart: Support firmware download for Marvell Thread-Index: AQHRogF3PULMzQq9C02gqJdSrAaz95+mZYiAgAJ4j8A= Date: Wed, 4 May 2016 14:40:10 +0000 Message-ID: <7a96f0ab0acb4b97a4590ba037cc8dd2@SC-EXCH04.marvell.com> References: <1461925478-31851-1-git-send-email-akarwar@marvell.com> <1461925478-31851-3-git-send-email-akarwar@marvell.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.93.176.43] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-05-04_05:,, signatures=0 X-Proofpoint-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1603290000 definitions=main-1605040218 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Marcel, Thanks for your comments. We are working to resolve them. > > + > > +/* Receive data */ > > +static int mrvl_recv(struct hci_uart *hu, const void *data, int > > +count) { > > + struct mrvl_data *mrvl = hu->priv; > > + > > + if (test_bit(HCI_UART_DNLD_FW, &mrvl->flags)) { > > + mrvl->fwdata->skb = mrvl_process_fw_data(hu, mrvl->fwdata- > >skb, > > + (u8 *)data, count); > > + if (IS_ERR(mrvl->fwdata->skb)) { > > + int err = PTR_ERR(mrvl->fwdata->skb); > > + > > + bt_dev_err(hu->hdev, > > + "Receive firmware data failed (%d)", err); > > + mrvl->fwdata->skb = NULL; > > + return err; > > + } > > + return 0; > > + } > > So I really want to get rid of this part in the driver ->recv should be > kept compartmentalized between before HCI is ready and when HCI is > ready. > We already have HCI_UART_REGISTERED bit in "hu->flags". I think, we can use it to know if HCI is ready or not. We will define two recv handlers. "->recv" and "->recv_for_prepare" OR let us know if you want us to use single "->recv" and have code under "if (HCI_UART_REGISTERED)" and "else" in our handler. Regards, Amitkumar From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Amitkumar Karwar To: Marcel Holtmann CC: "linux-bluetooth@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Ganapathi Bhat Subject: RE: [PATCH v9 3/3] Bluetooth: hci_uart: Support firmware download for Marvell Date: Wed, 4 May 2016 14:40:10 +0000 Message-ID: <7a96f0ab0acb4b97a4590ba037cc8dd2@SC-EXCH04.marvell.com> References: <1461925478-31851-1-git-send-email-akarwar@marvell.com> <1461925478-31851-3-git-send-email-akarwar@marvell.com> In-Reply-To: Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 List-ID: Hi Marcel, Thanks for your comments. We are working to resolve them. > > + > > +/* Receive data */ > > +static int mrvl_recv(struct hci_uart *hu, const void *data, int > > +count) { > > + struct mrvl_data *mrvl =3D hu->priv; > > + > > + if (test_bit(HCI_UART_DNLD_FW, &mrvl->flags)) { > > + mrvl->fwdata->skb =3D mrvl_process_fw_data(hu, mrvl->fwdata- > >skb, > > + (u8 *)data, count); > > + if (IS_ERR(mrvl->fwdata->skb)) { > > + int err =3D PTR_ERR(mrvl->fwdata->skb); > > + > > + bt_dev_err(hu->hdev, > > + "Receive firmware data failed (%d)", err); > > + mrvl->fwdata->skb =3D NULL; > > + return err; > > + } > > + return 0; > > + } >=20 > So I really want to get rid of this part in the driver ->recv should be > kept compartmentalized between before HCI is ready and when HCI is > ready. >=20 We already have HCI_UART_REGISTERED bit in "hu->flags". I think, we can use= it to know if HCI is ready or not. We will define two recv handlers. "->recv" and "->recv_for_prepare" OR let us know if you want us to use single "->recv" and have code under "i= f (HCI_UART_REGISTERED)" and "else" in our handler. Regards, Amitkumar