Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp2017996ybg; Fri, 5 Jun 2020 03:31:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5EM4ZjDOxILMWmt0Bhu882bp7N0kcOGM42bW8NdMa+fUBM8+46MHuaj1GQXrIoPo2HnCk X-Received: by 2002:aa7:cac8:: with SMTP id l8mr8741332edt.103.1591353098661; Fri, 05 Jun 2020 03:31:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591353098; cv=none; d=google.com; s=arc-20160816; b=TXns4IHdvWiCOyUBWFQGyKwqmzPSDwP8Z4HCfl+9Rvz9hK1NPqjEU3tNFQj7yJDmTN 7V86NdAc7rbTBjyVrS6hSSnZDPfNpU92kjIATq+L+v7Lj5IX0fW04bwaEucItDsggqca SdOfjiMQprqXDVl8/1c2IaXEPEnBH1ta2Td+UK2mgEYLaIKZYKyiqDa6fuLGQmxxjgCG N+Qzbbq/WJnmhL4aZpN9Hgy6BALVRzHmDLLuBgdvGM9DdwZfVrDKWW9F8K7qsl+/mj8+ mMuaIIgTVycCUH0GYmy93V5zkZiN28KCUQDRYLhJtFNpy+Qyl5SmRu9MzLu1LPWztAMg K3Xg== 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=nlfa2o8f5OpWs8l7tHMWFCRMLm0kl6ycJ0emh/4ke8A=; b=do/lWD0iGxJm7GGTfbfC7Oy3kWQcoG/mn900xJuFzJ4ZHJhdASwflV7KubvjFK0B0T JAdgiAHU6FDT8inC6Tup/p9r4smQiQDWSaFBtpdX98k7dxqD/Wwo4l27D+0yrIogvPcs uh96q1JkRLwgJDxoFbGLErssbEI8g3g9pGt1VYqD9kez+HmF0irdfOg2LnwSNoDpYfgF CqXdimEhlWE+qoUffx3UJFvdOfjkP1i1YN4RFTOtLtiDy6NY+OukOK2Uzl8VGLy6Eohw u8RP2/uJUuDe8ArGxlv7eei3VBDWXTLn3s9ybbLF0xvsX7ZL16uq+J7DX2dJg+msjhDF jDjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UM8OrjMX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dr12si4239420ejc.352.2020.06.05.03.31.15; Fri, 05 Jun 2020 03:31:38 -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; dkim=pass header.i=@kernel.org header.s=default header.b=UM8OrjMX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726529AbgFEK3C (ORCPT + 99 others); Fri, 5 Jun 2020 06:29:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:38644 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726077AbgFEK27 (ORCPT ); Fri, 5 Jun 2020 06:28:59 -0400 Received: from localhost (fw-tnat.cambridge.arm.com [217.140.96.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 37ABC2074B; Fri, 5 Jun 2020 10:28:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591352938; bh=yVCgfIlqCzi+uxjyo1zLQ98C29QSMhFXMCE8J+smxzk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=UM8OrjMXAVHbcSwvCYTfQDj36kyTpdwaC9wenIPr85WsEQYQcCDaaxBmNEXNkxKgx dzmVHYOYm06xJNMWYZaCgfbeJkZ+cZc8ulSvs4+sQTHYK+Hd+2G7odslRiKHcXPBbT 6OmM2mF0tvQgFrf0GpONLnjjojvObsNAG0LOl3Bw= Date: Fri, 5 Jun 2020 11:28:56 +0100 From: Mark Brown To: Florian Fainelli Cc: 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 , lukas@wunner.de Subject: Re: [PATCH 3/3] spi: bcm2835: Enable shared interrupt support Message-ID: <20200605102856.GB5413@sirena.org.uk> References: <20200604034655.15930-1-f.fainelli@gmail.com> <20200604034655.15930-4-f.fainelli@gmail.com> <20200604123220.GD6644@sirena.org.uk> <21772111-fa1f-7a50-aa92-e44b09cff4eb@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="0eh6TmSyL6TZE2Uz" Content-Disposition: inline In-Reply-To: <21772111-fa1f-7a50-aa92-e44b09cff4eb@gmail.com> X-Cookie: Air is water with holes in it. 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 --0eh6TmSyL6TZE2Uz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jun 04, 2020 at 09:05:46AM -0700, Florian Fainelli wrote: > On 6/4/2020 5:32 AM, Mark Brown wrote: > > This feels hacky - it's essentially using the compatible string to set a > > boolean flag which isn't really about the IP but rather the platform > > integration. It might cause problems if we do end up having to quirk > > this version of the IP for some other reason. > I am not sure why it would be a problem, when you describe a piece of > hardware with Device Tree, even with the IP block being strictly the > same, its very integration into a new SoC (with details like shared > interrupt lines) do warrant a different compatible string. Maybe this is > more of a philosophical question. The big concern here is trying to support things going forwards - if it turns out that any quirks are required by this version of the IP then it gets very confusing and hard to keep DTs stable if you've already quirked something that clearly isn't the IP version with the compatible string. Conversely if we start putting flags into the binding for every feature that might be changed in a given IP that gets complex as we can't ever learn new things about an existing IP version without updating all the DTs which is also bad. > Instead of counting the number of SPI devices we culd request the > interrupt first with flags = IRQF_PROBE_SHARED, if this works, good we > have a single SPI master enabled, if it returns -EBUSY, try again with > flags = IRQF_SHARED and set-up the bcm2835_spi_sh_interrupt interrupt > handler to manage the sharing. Like you said in a followup patch that doesn't work as the first device to probe will think the interrupt isn't shared. You'd need a callback to change to shared mode from genirq which feels... inelegant. --0eh6TmSyL6TZE2Uz Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl7aHmcACgkQJNaLcl1U h9Cibwf/c8EkXuOornxa8rgJTVll6CNfZJosZy2JB/9uRxBsBkr+C0AmOA5gLJ0G /blupLSwZR6QOO5HP8QR29piU1V1gXX3/zQcDnz7HtTDrD3q+SSJADKu9rMvXrMW /FeddfnOo2o2P62qopKisrQS3tK6sRQxm/hlqCCa8lHWfDZ10Iuow00sUAnI1x9h 4OG1erLcr9L5tJtAWvyvbtL75yHNJl7Dbsvwz0I0+NFMLu9etTbQ4OXtwIiab6Xu LlkhofTCHh9B3yD/Fh8RmRZNJUwcXUmjwMBbIAdITglUNtDMiJaZtxUrn25V4PiJ UKlz+CR4Hi2Me0h1JgY79Xnam2hf9w== =Pvqk -----END PGP SIGNATURE----- --0eh6TmSyL6TZE2Uz--