Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp2057368ybg; Fri, 5 Jun 2020 04:38:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySjk7FfmvMZzU1Z2eU5PcnSbLZDj9OtigqM1/NFLX10/q6E6QWyv0/LO0UGe/9yw3gxRcg X-Received: by 2002:aa7:c2d3:: with SMTP id m19mr8658842edp.382.1591357093614; Fri, 05 Jun 2020 04:38:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591357093; cv=none; d=google.com; s=arc-20160816; b=bOKG1xHT948o786iLRvem3xu5ENg7rSDxOwzxk6OdYmxqf4m0OYUnr3BVSiUMigsVS EMsmh/utx5s7hBmAAz4+s6yxrmXetpSD+urA0SFnXdH0TkVP9AcFYz1DDNcJMZp7UR3o AWIVzuQKByH1bE8Sp2NAU9JmUJvC7ZCm2TFKfZd82G/U2SbFAMLZF5b1Tu8sTZLYdcqO 8hfaYcYSRPguv1mZQuwyZSea2AfYzyfK/vKHEY3CDsp8OTPlbTFjbxXfDhC92drgQ2xo rPdF9Mh9NieKZXjkeBJWaLHOYUtvM3b6pXz21K5LurycLMFAPbElhK1F1sSXO99T0UMY 4TDw== 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:message-id:subject:cc:to:from:date; bh=lQBbSCzjWbkPDNLjpxIxdn5LCnK52FE0DtGhbS5KjVk=; b=UrGC6t5xxxAkJ8qRNAzO1XHXz7GyrwzwoSOqkeiOVa+9UpYP1kaCdhUJHsGLQv1l0o YgZSujkVdKhIOPPs8p6a8l/VPIDYHEp9Fbp1OCxUSf90OfvKfadzVx9GCWHMnk4HgRlO AGBs3AOnOkOOqg/bCd16esk9ahd2ygJ3MKFzuoe7gHurgB3VyehIjawuqPGlDReRgIsa PT5Sq9oZZXCAdgqbwCR98rEdrZSIiEnX5FSuTloWxXZC8Yi+gO+UxrSvcFo5LnnHlbAw kSgc1atNHbNowhXLyt/O1Ro2XiJIj5iqr76HJfqQXUHeqBpvG6pzA7xXu9ZStVVMOSxu kl8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ds17si3773166ejc.619.2020.06.05.04.37.50; Fri, 05 Jun 2020 04:38:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726349AbgFELgB (ORCPT + 99 others); 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