Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp594011ybl; Fri, 13 Dec 2019 01:18:38 -0800 (PST) X-Google-Smtp-Source: APXvYqxlaFAgatXehNc1froV7uLBfmeSf59f7zvEMXBAsbkHdAuD0n0SQcfrSrG+sCe4/DrV3+hr X-Received: by 2002:a9d:7593:: with SMTP id s19mr12944473otk.219.1576228718423; Fri, 13 Dec 2019 01:18:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576228718; cv=none; d=google.com; s=arc-20160816; b=ywQ88dcDaXuuPFpPNQh9ZIuVe4VEl5yvwUWXCRb9+aGl9yafWSq8aYNB96R56adqxD DbxfJpaQFa0UfHG20XmWGzQw5FMmO3ixBnWLSUjxtMfumec7ZBIO+Gz6Fc+HeT3rKvH6 vakfaFtdpKFRQGaxvswMgSU8V1UFWB2ippw8tTcR9lLieWfgn66B0rl02pLWVvaHLisa z7SA6gewXQYlCCmAguWvXrZVEHXyG7z3I8Ue3K0YG2h1UAXHPP01qJruZhDJhOBwMUSs rj5vJNvyR6AiM/cHqwQXq9TK3A+parDySD/eKy2k3WICYD/8Z11vdRdJBvYrUBhwkEDf ol7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=RZ51uRTlJcv6c8enjZTOzifIqw0cVu1vMI6dvmNCekw=; b=Ok97u2ab0nSVnAqPq2K5lm/HFJSiXh/7X6sP/+93/gBpd/JrLRwz5sXZjp0/2cDIXE NA03MF327cxUK7uyc8lvjd5j/lcIpvM2qPPWR8isSuZDT2hzHE0Ee+ezhqAs26Pu5Zs3 g76U+qIzL0tFliqd4Ovd7eLn07sthyyN3dePoIhwY7fEZ/YV2DlN47wEI8hFIMev2nk/ jZB/1hDgpC+YxGvxMyKtZJDYCvsZudiUMstpiZwz1vean3MennPj6TLubqFvJxXWRXhv E8RJX3OfOmchg5+5pT6R4ujB1mFB5ELTBNEDEDiCFbzcUp+1I16xUlloa3apbpCgqWp0 Bw1w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o6si4810183otk.201.2019.12.13.01.18.15; Fri, 13 Dec 2019 01:18:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726170AbfLMJSL (ORCPT + 99 others); Fri, 13 Dec 2019 04:18:11 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:36767 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725882AbfLMJSL (ORCPT ); Fri, 13 Dec 2019 04:18:11 -0500 Received: by mail-lj1-f196.google.com with SMTP id r19so1853074ljg.3; Fri, 13 Dec 2019 01:18:09 -0800 (PST) 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; bh=RZ51uRTlJcv6c8enjZTOzifIqw0cVu1vMI6dvmNCekw=; b=B9gNUvtBEcd5FIuqBENpVyMAb01UBNBoM0kwj6htPtJ2jNXH7qwC/qvRs8Kes3/UR8 cNnR7lPY0YGmgjC2GjkgrK+ncBrqPDz1uS7IdrNBb20iVTMyJ9ORbRANTGp1LewtsnhB iIOV4NJWzwmIE5qJJmXd0t7m0wC6rAhqpOEgv2N29clLpB78A0g5AWyjInv1cXsM1swB lXYVFUfcerhUHHVhalLYYsfGbJ3WppoW04/MyWQNJWqjkwjoRuShD32bmM+Hb0KreZDw WunR1E3Z514HmiW2dmIHfehb8tJFPNiexO0fWLEBt9XXG/34pbl1c06OGYj70GzwuIYb wMzQ== X-Gm-Message-State: APjAAAWtfA1e6ku2DSbwWyQjRw5EW1pW8RGuTsm9yL7dZQugH+xj0Ssj 9NLh1ITZ+91Zi1hzBW5p5hI= X-Received: by 2002:a2e:850f:: with SMTP id j15mr8768401lji.91.1576228688991; Fri, 13 Dec 2019 01:18:08 -0800 (PST) Received: from xi.terra (c-14b8e655.07-184-6d6c6d4.bbcust.telenor.se. [85.230.184.20]) by smtp.gmail.com with ESMTPSA id l21sm4223245lfh.74.2019.12.13.01.18.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2019 01:18:08 -0800 (PST) Received: from johan by xi.terra with local (Exim 4.92.3) (envelope-from ) id 1ifh5N-0007ZJ-0d; Fri, 13 Dec 2019 10:18:09 +0100 Date: Fri, 13 Dec 2019 10:18:09 +0100 From: Johan Hovold To: Marcel Holtmann Cc: Nicolas Saenz Julienne , Guillaume La Roque , Johan Hedberg , BlueZ , lkml , khilman@baylibre.com, linux-rpi-kernel Subject: Re: [PATCH v3] bluetooth: hci_bcm: enable IRQ capability from node Message-ID: <20191213091809.GW10631@localhost> References: <20191211094923.20220-1-glaroque@baylibre.com> <0CF02341-CF69-4680-B61F-DC5C0702F1A2@holtmann.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0CF02341-CF69-4680-B61F-DC5C0702F1A2@holtmann.org> Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org On Thu, Dec 12, 2019 at 09:46:32PM +0100, Marcel Holtmann wrote: > Hi Nicolas, > > >> Actually IRQ can be found from GPIO but all platforms don't support > >> gpiod_to_irq, it's the case on amlogic chip. > >> so to have possibility to use interrupt mode we need to add interrupts > >> field in node and support it in driver. > >> > >> Signed-off-by: Guillaume La Roque > >> --- > >> drivers/bluetooth/hci_bcm.c | 3 +++ > >> 1 file changed, 3 insertions(+) > > > > This triggers the following panic on Raspberry Pi 4: > > > > [ 6.634507] Unable to handle kernel NULL pointer dereference at virtual > > address 0000000000000018 > >> diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c > >> index f8f5c593a05c..9f52d57c56de 100644 > >> --- a/drivers/bluetooth/hci_bcm.c > >> +++ b/drivers/bluetooth/hci_bcm.c > >> @@ -1409,6 +1409,7 @@ static int bcm_serdev_probe(struct serdev_device > >> *serdev) > >> { > >> struct bcm_device *bcmdev; > >> const struct bcm_device_data *data; > >> + struct platform_device *pdev; > >> int err; > >> > >> bcmdev = devm_kzalloc(&serdev->dev, sizeof(*bcmdev), GFP_KERNEL); > >> @@ -1421,6 +1422,8 @@ static int bcm_serdev_probe(struct serdev_device > >> *serdev) > >> #endif > >> bcmdev->serdev_hu.serdev = serdev; > >> serdev_device_set_drvdata(serdev, bcmdev); > >> + pdev = to_platform_device(bcmdev->dev); > > > > Ultimately bcmdev->dev here comes from a serdev device not a platform device, > > right? > > I was afraid of this, but then nobody spoke up. Can we fix this or > should I just revert the patch? Just revert it, the patch is plain broken and makes no sense. As Nicolas pointed out, bcmdev->dev is a member of struct serdev_device so cannot be cast to a platform device. Johan