From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56904C433E1 for ; Fri, 5 Jun 2020 11:36:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3650D2074B for ; Fri, 5 Jun 2020 11:36:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726364AbgFELgB (ORCPT ); Fri, 5 Jun 2020 07:36:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725997AbgFELgB (ORCPT ); Fri, 5 Jun 2020 07:36:01 -0400 Received: from bmailout1.hostsharing.net (bmailout1.hostsharing.net [IPv6:2a01:37:1000::53df:5f64:0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21F07C08C5C2; Fri, 5 Jun 2020 04:36:01 -0700 (PDT) Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified)) by bmailout1.hostsharing.net (Postfix) with ESMTPS id 820A0300020B3; Fri, 5 Jun 2020 13:35:59 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 5361E2913BD; Fri, 5 Jun 2020 13:35:59 +0200 (CEST) Date: Fri, 5 Jun 2020 13:35:59 +0200 From: Lukas Wunner To: Florian Fainelli Cc: Mark Brown , linux-kernel@vger.kernel.org, Rob Herring , Nicolas Saenz Julienne , Ray Jui , Scott Branden , "maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE..." , "open list:SPI SUBSYSTEM" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" , "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" , Martin Sperl Subject: Re: [PATCH 3/3] spi: bcm2835: Enable shared interrupt support Message-ID: <20200605113559.oia5xmc2r5n7e2fd@wunner.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <21772111-fa1f-7a50-aa92-e44b09cff4eb@gmail.com> <8c8d6007-e4c6-8484-9d40-3b679842be27@gmail.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 04, 2020 at 01:24:54PM -0700, Florian Fainelli wrote: > So we do need to know for the first time we install the interrupt > handler whether we will be in a shared situation or not, I cannot think > of any solution other than counting the number of available DT nodes > with the "brcm,bcm2835-spi" compatible string. In principle it would be possible to iterate over the entire DT using for_each_of_allnodes() and call of_irq_parse_one() on each device_node if it's enabled and not the one we're probing. Then check if any of that device_node's IRQs is identical to that of the device_node we're probing. That would give you a generic method to test for sharedness of an interrupt. However the solution you've found is simpler and cheaper than such a brute-force search, hence seems perfectly valid to me. > I appreciate that > Lukas has spent some tremendous amount of time working on this > controller driver and he has a sensitivity for performance. Thanks! Indeed I think spi-bcm2835.c is by now among the best performing and most featureful SPI drivers in the kernel. I've recently had a discussion on netdev with someone testing an SPI-attached Ethernet chip on iMX6Q and on STM32MP1 and couldn't get it to work. With a BCM2837 no problem at all: https://lore.kernel.org/netdev/ac0f7227-a4ae-b6cd-36ec-3bcb02b1adbe@denx.de/ Lukas