Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp10575460rwr; Fri, 12 May 2023 09:52:13 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4FEfE/7UJilPuomB5av/mPG5D2H5wYKd4DV1UpZKDuLWU185fKnsySf1H8XzT2O0IeeC8X X-Received: by 2002:a17:903:11c7:b0:1a9:7b5e:14ba with SMTP id q7-20020a17090311c700b001a97b5e14bamr30196493plh.29.1683910333241; Fri, 12 May 2023 09:52:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683910333; cv=none; d=google.com; s=arc-20160816; b=DsAUd4yiOgN8MGQe4nxx7fjIxxukDqyoqZDUyTCopnZ/65QJKn0yqQ2VtkxFoMjKOR LgVFnWcO4N9Z5irz1mektLho8680Ch9vVl9zvBi+exMYcGbKwc2DxQVfpZ+VTtHhdfoR LldMblKmv8MbvRFbOQZrbXKY2XwAEH8dTRQmob0VHOAMAv9wb/kYuH5A8fiJHyElS/Gu uEQRIaVisdk1IhB/qduR1+0sv8XQ/GBCXM0EF8YoCn7SOG7sCSxnbbVmXHf0du9tgL49 3jCA79vlQByIFQJ69HJEQKfM62gkc7Ih9DEJ3WGmd3yArKwBYuTmkhb2e8Y0mOzkyD0S 0BzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=KHP+zGWNNyEYE5XHABG55hQK3WgV3doZaTwhtsR76zM=; b=ZRYTIYsji4mAvZV0+abCRLVs/c2QPsnI0pnchcGHmuK3tp/oPmwX/tcLozfCFhfr4o fvzzeswyFY4KZMjG22CwVgVClFEM5J6VkioZi6E2Op8ME9VwFTx3uyCJFVZHZOIRswi4 5BJHnu7bE9nF0pCN2JysWpUr4ETYkV+7cGOAxpbfmFFh+2zyPVQYr8zHSGQfVEHnW5PE kWNndszKwkuMm4oD60biP9RssJ/sXlp26U9TmGZvDvPsbQZ3jWvYt3gUCulT0O0KtLDM thZyH7wEXLQV2y44iHw7bRZTiT1bpeMMMjDt/ZU3KgcwVLuy5kq4E/pLDxTaQvhCp28p wiPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=Fyny9AMP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h7-20020a170902704700b001aae1eefc9bsi9293806plt.238.2023.05.12.09.51.59; Fri, 12 May 2023 09:52:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=Fyny9AMP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237233AbjELQoB (ORCPT + 99 others); Fri, 12 May 2023 12:44:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237183AbjELQn4 (ORCPT ); Fri, 12 May 2023 12:43:56 -0400 Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF7F94C1F; Fri, 12 May 2023 09:43:55 -0700 (PDT) Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34CGhg8j002411; Fri, 12 May 2023 11:43:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=PODMain02222019; bh=KHP+zGWNNyEYE5XHABG55hQK3WgV3doZaTwhtsR76zM=; b=Fyny9AMPJnQBeSmw7GKI8YAxgT4aRKeApQ/nFtPDj1eu3PYBhfHlZZHkIzGtqyFgD2cx SVR65Fz1Z5CwcMms6IIGGHyxsOT92q4qB9Xb/sngsD6VEpvb+yXRUrfS6rWMOJrQgWht la7mK6UC0sFzksXpPXu/+jigbnSCitkpPNAYQeLefwq36Y3NJQcVVxD43FQrver+74lE tUVOiURbOciTmuAiTgbnzto7tyJKOPUPI0PjYC+4VKRAFpQTsnjZYm9XwF62PaxIb+6k b97gupOvD88OX/mw6TGL022a48m/xbOT4gBKqcKrO55ZIoPQG/ouLjDO5FnD1Fcfd2wO Ag== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3qf7nb5r4r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 12 May 2023 11:43:42 -0500 Received: from ediex02.ad.cirrus.com (198.61.84.81) by ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Fri, 12 May 2023 11:43:40 -0500 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by anon-ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Fri, 12 May 2023 11:43:40 -0500 Received: from ediswmail.ad.cirrus.com (ediswmail.ad.cirrus.com [198.61.86.93]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 098AC45; Fri, 12 May 2023 16:43:40 +0000 (UTC) Date: Fri, 12 May 2023 16:43:40 +0000 From: Charles Keepax To: Pierre-Louis Bossart CC: , , , , , , , , , , , , , , , , , Subject: Re: [PATCH 01/10] soundwire: bus: Allow SoundWire peripherals to register IRQ handlers Message-ID: <20230512164340.GO68926@ediswmail.ad.cirrus.com> References: <20230512122838.243002-1-ckeepax@opensource.cirrus.com> <20230512122838.243002-2-ckeepax@opensource.cirrus.com> <0471f085-14bf-c159-9b92-62983af6c19a@linux.intel.com> <20230512160224.GK68926@ediswmail.ad.cirrus.com> <5363c7b7-7a5b-490c-445b-fb7ccd693c63@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <5363c7b7-7a5b-490c-445b-fb7ccd693c63@linux.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Proofpoint-ORIG-GUID: CoZYeJn9JTKmEOtjTGiNl15yYAnAwqjj X-Proofpoint-GUID: CoZYeJn9JTKmEOtjTGiNl15yYAnAwqjj X-Proofpoint-Spam-Reason: safe X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 12, 2023 at 11:34:44AM -0500, Pierre-Louis Bossart wrote: > > > On 5/12/23 11:02, Charles Keepax wrote: > > On Fri, May 12, 2023 at 08:45:51AM -0500, Pierre-Louis Bossart wrote: > >>> @@ -1711,6 +1739,9 @@ static int sdw_handle_slave_alerts(struct sdw_slave *slave) > >>> struct device *dev = &slave->dev; > >>> struct sdw_driver *drv = drv_to_sdw_driver(dev->driver); > >>> > >>> + if (slave->prop.use_domain_irq && slave->irq) > >>> + handle_nested_irq(slave->irq); > >>> + > >> > >> I am a bit lost here, I can understand that alerts would be handled by a > >> dedicated handler, but here the code continues and will call the > >> existing interrupt_callback. > >> > >> Is this intentional? I wonder if there's a risk with two entities > >> dealing with the same event and programming the same registers. > >> Shouldn't there be some sort of 'either or' rule? > >> > > > > I guess there is a risk of them "handling" the IRQ twice, > > although it is hard to see why you would write the driver that > > way. Also since they are sequencial the second would I guess > > just see that no IRQs are pending. > > > > The intention for calling both is that it facilitates using > > the same IRQ handler for I2C and SoundWire. At least on the > > Cirrus devices there are a bunch of chip specific registers > > that need treated exactly the same on I2C and SoundWire, but > > then a couple of extra registers that need handled in the > > SoundWire case. This way the handling of those can be kept > > completely in the SoundWire part of the code and not ifdef-ed > > into the main IRQ path. > > Sounds good to me, but it's worth adding a comment and improving the > commit message with design intent/rules since it's a common part in > drivers/soundwire/ Yeah no issues with updating the commit message to explain that in more detail. Thanks, Charles