Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5314878imb; Thu, 7 Mar 2019 12:43:13 -0800 (PST) X-Google-Smtp-Source: APXvYqzMdgJk5vfzNYgRY/I76RcXm8hLewpctWHIjLQY/7zW9huOD+5qlqpRee6f0Z+DpMjaqeCu X-Received: by 2002:a65:568b:: with SMTP id v11mr13492252pgs.23.1551991393341; Thu, 07 Mar 2019 12:43:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551991393; cv=none; d=google.com; s=arc-20160816; b=wRL9pGcQk7Mi8Gq2A2lmMaDV32AKP2DZLr/3kW9aeDFFclrmZw2V5zSfEB/jPrDdDP 0bz8WOgYaGxRt4xYkFGEAcw/cJ0BOphAiM19Y80ZI/6bKw6RSAtnkSj+nIQ7r0mobA88 J/Eb3BaG5oWrCow5LZez8laK5g3zGMZ+3Sl7+SbZZrbPpzd1PZpTJaqYMNnMnYpP3HOg J9yIOjOg9pbmX3f1Bcu7YWqpBAVuWqCSCh+49j72cXJUp0/96xg55Q3xJfN7Wqc1SzfH fluSLCqPMpqIqaXCaUD6YRUO3Nmz74cX13WIGgYhXTz815CVVO9LMEADkAtNg0LIglCO B7Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=GDG8Xott1X36zkyKyY0ls+WD8rtU8WOAEx5fvkvCMBw=; b=ulKrVDCYW+SyAZh7zWehM9MUErMA9+a+7fbpfpsLwhwPqbJgxIv2Hrwa0MnQqyTy7M KFkw31nXkgPshvTn9ef/FJZNWRn6Nh6SKEBA+sziFEAnbybsHUV2Z3ZHEtvekPb+MfwR E8EH3LFRFz6zVX1h2Zc3LhwHSdyiMy3Ee8oBK8owCrxOGQOxqnCXZSpZzx7Re8v1LrWB 49QAXiX97ORDkjiB1HJvWrgSJqoaTOGgmVhTpd285CTB74+ehjqgTqfZ0Az8yCo69gtz RELfTVI32Rf/UHdsMnGENo/+A32V1v4OXn4bfNTuUV05yNcVPchdr2QLxxBEUthb8p0+ QbKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=OoTThACC; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b39si5238075pla.381.2019.03.07.12.42.57; Thu, 07 Mar 2019 12:43:13 -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=@chromium.org header.s=google header.b=OoTThACC; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726270AbfCGUm0 (ORCPT + 99 others); Thu, 7 Mar 2019 15:42:26 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:38934 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726234AbfCGUm0 (ORCPT ); Thu, 7 Mar 2019 15:42:26 -0500 Received: by mail-pg1-f194.google.com with SMTP id h8so12187684pgp.6 for ; Thu, 07 Mar 2019 12:42:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=GDG8Xott1X36zkyKyY0ls+WD8rtU8WOAEx5fvkvCMBw=; b=OoTThACCx97IcoTSG9sIWtVn5OIYaB+o0w4Fg/A9E+V0mjlt8FnFmhFDyT3kLtA0Ju pMY0mataz+LHQnXuAUUAPFyyBRJJtvo99IWaCt+wCHJ1kUR2BV3liXk6Dv4+GF/fpqRk dIJJuLkFcO2wsK2GqPnfEXFSXr6s055xLz7q8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=GDG8Xott1X36zkyKyY0ls+WD8rtU8WOAEx5fvkvCMBw=; b=Iu/NK0Ng0W2ADFez7DpSQdurnMbaeTBegDRqNE/o7GoO6RuNkXxHQuzHfUlChcnpfT CjN5um9P6S6c+t2S3XNGziQquHtRLFs2BMqPo2BZRnjbhR+NFXXAfFh2J+qMVpX/la6r sFBolMJZjwV4xAmeHuP7GTROe0xJMi0PYgKPaeGtssIbsd2fyGZOAqmuOVsG6BXB0d/y YaVJmOv6NkLCqxXX0tfWo501mGmowPQap4XMdeg21LC/BA6LYogoqoP2cja4TpsdYckv qSTYgL0HRTukjN0xjUSiMTB9b3zmEfzreOyN1IOdpv+lWj7c34ncA6FmnqNm89Z3orcF CcOA== X-Gm-Message-State: APjAAAWic7dlnJBejMzFiYxDDVMxp7Ie4uMsyrvcIJqj21ICFWh6h+O0 tuQ+tuB7tccnvG7sySWmq1T0hvM59Yg= X-Received: by 2002:a62:4414:: with SMTP id r20mr14736383pfa.37.1551991345300; Thu, 07 Mar 2019 12:42:25 -0800 (PST) Received: from localhost ([2620:15c:202:1:75a:3f6e:21d:9374]) by smtp.gmail.com with ESMTPSA id n4sm14675702pfh.8.2019.03.07.12.42.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Mar 2019 12:42:24 -0800 (PST) Date: Thu, 7 Mar 2019 12:42:24 -0800 From: Matthias Kaehlcke To: Balakrishna Godavarthi 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. Message-ID: <20190307204224.GD138592@google.com> References: <20190307101722.25871-1-bgodavar@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190307101722.25871-1-bgodavar@codeaurora.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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. Thanks Matthias