Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5614996imb; Thu, 7 Mar 2019 21:13:52 -0800 (PST) X-Google-Smtp-Source: APXvYqzYvbUDnMIjMNde8/d/0eOrY0/ReKoL3Cux9WpvcgFBWOaqUuMokrLmD4qI0zQhGPqPJ50t X-Received: by 2002:a63:1060:: with SMTP id 32mr15080129pgq.126.1552022032257; Thu, 07 Mar 2019 21:13:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1552022032; cv=none; d=google.com; s=arc-20160816; b=oBTb30eseeqBFOYcQRP/OCtf4arLWE9oWA5wousyEcrk2Bb8Q9pQj4Cq2Sbs+WqQ8P lnDEfdEYJorUM0O8wJh4iUpXAa4lYMCNdJm1ox7Gzeh5fp40PWQXolNx6gXMLsQBsOCz Ge1qZrB6GF5QnAz28qtFLPS4Rr2MerpK6KDNWMVnHRlcEYsH3kkC1d6V7FTqcUevsZxT EPt+0K5BFvanqFgEjH+47FmmLj8NEK0/V+SzREze0r8EGPKDjTo34bqhWnEdiVWlf/kT zCCx9HgFBNAcf8AyoeOR60FlWUS6jPYITN2uiKtkOYchHrgwt//HvzW2L27ipQcVUUgS mlPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:dkim-signature; bh=v+vCMO4VaJp7bFYwS9Pj4rVsVkchuzTugHuzTI7LZ1g=; b=VkDEnSTx0liz5M/iO0Y3h8idsOVPmpvZbcgvTytIU+gNZzz7M+6vjpXjwgHHukivep JDL38iwIocjIctbE2iHBnzR9mRM0sUWfxW6jKTilyS0UEzMDaZuVtzHiCyEGlAqNn0St 0Ii2/yCSSONaFsRtJPDbQlIh478CZox8R2pqLG7JDqyzPzs8FE6IF9iVsslxzTL3fabL Y5Pq9WITLaoivUFXr56uWxHrpsibFKwR+7FGS8XfQmO1HytXjcRL1QMKPMa2+j+vTpbp hxZpquMcOxjuzBfrPLJIkJp3Zb6+UfHX+oZNwB6lEIvdD7uHdfBq/MbGsdSof093AYWp /Vjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=dVucFrEj; dkim=pass header.i=@codeaurora.org header.s=default header.b=dVucFrEj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 76si6276566pft.132.2019.03.07.21.13.36; Thu, 07 Mar 2019 21:13:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=dVucFrEj; dkim=pass header.i=@codeaurora.org header.s=default header.b=dVucFrEj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726297AbfCHFNR (ORCPT + 99 others); Fri, 8 Mar 2019 00:13:17 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:45120 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725298AbfCHFNQ (ORCPT ); Fri, 8 Mar 2019 00:13:16 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id AEDB16034E; Fri, 8 Mar 2019 05:13:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1552021995; bh=boH7gqwvvNYPPnvKs4lDxycg0Jd5ZPt3IOoDfg1GZgk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=dVucFrEjy4T/ROfPMaKwDftIWO9F+Pz62t9IjlArBeRub5zv5MANWQ/GNKbhCffyu /iTppbQd9x6j/pBjUU3AXe43W+xvN0IarjB3jJwkyQwBDHfAuK21W9EHu7z/Tp8Eky 2MxDPQ45FJSSsGhxua1xDeJvKHHgHP7uCCLaiWnU= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id E74CB60316; Fri, 8 Mar 2019 05:13:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1552021995; bh=boH7gqwvvNYPPnvKs4lDxycg0Jd5ZPt3IOoDfg1GZgk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=dVucFrEjy4T/ROfPMaKwDftIWO9F+Pz62t9IjlArBeRub5zv5MANWQ/GNKbhCffyu /iTppbQd9x6j/pBjUU3AXe43W+xvN0IarjB3jJwkyQwBDHfAuK21W9EHu7z/Tp8Eky 2MxDPQ45FJSSsGhxua1xDeJvKHHgHP7uCCLaiWnU= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 08 Mar 2019 10:43:14 +0530 From: Balakrishna Godavarthi To: Matthias Kaehlcke Cc: marcel@holtmann.org, johan.hedberg@gmail.com, linux-kernel@vger.kernel.org, linux-bluetooth@vger.kernel.org, hemantg@codeaurora.org, linux-arm-msm@vger.kernel.org, rjliao@codeaurora.org Subject: Re: [PATCH v1] Bluetooth: hci_qca: Enable the ldisc for ROME for x86 platforms. In-Reply-To: <20190307204224.GD138592@google.com> References: <20190307101722.25871-1-bgodavar@codeaurora.org> <20190307204224.GD138592@google.com> Message-ID: <6e0abe10b3ed44053e92ad6a21c75d93@codeaurora.org> X-Sender: bgodavar@codeaurora.org User-Agent: Roundcube Webmail/1.2.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Matthias, On 2019-03-08 02:12, Matthias Kaehlcke wrote: > Hi Balakrishna, > > On Thu, Mar 07, 2019 at 03:47:22PM +0530, Balakrishna Godavarthi wrote: >> When using btattach to setup Rome over ldisc we observed a crash >> in qca_setup as it will try to access the serdev which is not >> available in the ldisc proto. This patch will fix the crash by >> support both the ldisc and serdev way in the qca hci_uart driver. >> >> Signed-off-by: Balakrishna Godavarthi > > Oh, I wasn't aware of the instantiation through ldisc and was actually > considering to *remove* some of the seemingly unnecessary serdev > checks. > >> --- >> drivers/bluetooth/hci_qca.c | 47 >> ++++++++++++++++++++++--------------- >> 1 file changed, 28 insertions(+), 19 deletions(-) >> >> diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c >> index 237aea34b69f..0a5c98d46864 100644 >> --- a/drivers/bluetooth/hci_qca.c >> +++ b/drivers/bluetooth/hci_qca.c >> @@ -963,7 +963,7 @@ static int qca_set_baudrate(struct hci_dev *hdev, >> uint8_t baudrate) >> { >> struct hci_uart *hu = hci_get_drvdata(hdev); >> struct qca_data *qca = hu->priv; >> - struct qca_serdev *qcadev; >> + struct qca_serdev *qcadev = NULL; > > In many cases the only field that is accessed is qcadev->btsoc_type. I > think something like 'qca_get_soc_type(struct hci_dev *hdev / struct > hci_uart *hu)' would make things more readable. > [Bala]: sure will update this in other patch once this change is landed as this has to go in priority as we have crash coming. > IMO the whole 'qcadev' vs 'qca(_data)' is confusing anyway, in this > sense even better if we can make most of the 'qcadev' references > disappear. > [Bala]: will note this improvement point and do it with the above change. > Thanks > > Matthias -- Regards Balakrishna.