Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp10526416rwr; Fri, 12 May 2023 09:13:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7t6cTeQuAu43oz+WE9pK3eJqPTt/ISK0U80UViMGAYXn1WjS4pBQsL7ZG84I9Kv8wVz5A2 X-Received: by 2002:a05:6a20:729f:b0:101:5743:fd01 with SMTP id o31-20020a056a20729f00b001015743fd01mr17639890pzk.25.1683907985844; Fri, 12 May 2023 09:13:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683907985; cv=none; d=google.com; s=arc-20160816; b=RMM7r/Q3T1sbIimMnNGfoOIqs0edpYiiEY4ycZWg2F6Ijk0i3T7A14AJxuG4FEtIzs R9R1QT3rR2OFmCCQaSlTfv5KKKZqLp3arUbY7GQR6gOGRCw07h1xm4W1Ht5Fra+Vpvba LyR7IYXgbYxFqhpis1tc6waBzOJvNF3H9cZ/7Tz3mN/fmfbI2K4TYeE3dzvEQqu5Lw/C evjV+QezcWD/06dmYaLz8T034LhG+JVeWeWoSlgdrltlXcrT4SBokTKogq+gQvy7kyfN kpcj59ypHNUlx1u0QH0hUUHlindTnviTWjn6tqmZT6Nqsqi0Dw/MyEIoeKxIb4wyej4x 2pDQ== 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=sxTNfTIyW/nEcDvx6yT+yObQ3uEy7YzQuDGF0VMrRAs=; b=JrOdKzBIpW1IM9uaiIIJrHD1cfBOdu03YQ63X1g8BQ7W2tXMRSHhqv8f4XbwXDPPVM Mwukerndn8oQ+AxuHA+O94cFMvqNs4JlbJLLWt60MZbhpS00XI+f4SdwkOMZVnMgvY46 a5VZwOazmk5OzVHTWbTFXtEmyT8qLu4ResvjL8eK76QnJPg45ywuJMkDwbWgePkRX4iY OL32wnNRPN4Y58f4AOvgDWm/E/m2MQE5GJ7kkklIk+K9iNoShfJHYNHXv8BdFO7DRPJO JCQh+oNUh97a578NuAzsZhgeVbuGxnoS97EBEx90HsKynMHUYCDCGAsZ+kqkrDwxg2s1 JqtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=JStZksNP; 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 d9-20020a633609000000b0050301265ffcsi9414500pga.471.2023.05.12.09.12.53; Fri, 12 May 2023 09:13:05 -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=JStZksNP; 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 S241907AbjELQCq (ORCPT + 99 others); Fri, 12 May 2023 12:02:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241611AbjELQCn (ORCPT ); Fri, 12 May 2023 12:02:43 -0400 Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C8C626BF; Fri, 12 May 2023 09:02:42 -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 34CF338N001679; Fri, 12 May 2023 11:02:28 -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=sxTNfTIyW/nEcDvx6yT+yObQ3uEy7YzQuDGF0VMrRAs=; b=JStZksNPNYMIMqczfGRO7suA6nUHCLyVAvjikIsNtGK3qRIujoBL8uvkontvfzxZWr74 5FtZ/M4ek4dcfvpD47Vk7jy9nW0nrdwIOoYAfhL1Objhv64VvCLr4vGRGJ2rBaWkHfqC eo74uPqtgAHuO2RXdtv+R9Pf+f4twQDMIxKaAKmYablqQakylypjArbdj2iY70hpL4fJ 6Pe0FNXVf0EtynUX4t2kU8JGKDT23dgjD6JZ8DFF5ybHqz8gwDFBHrgVvJ+/6IgGnVUC h+l8XA1yw9KrIEeD2sRjY4+f2j5QlwilDcmzZSRdkvErhTGCBLuwYhr0GdEWl/kNa0ZL 6A== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3qf7nb5pe5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 12 May 2023 11:02:27 -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:02:24 -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:02:24 -0500 Received: from ediswmail.ad.cirrus.com (ediswmail.ad.cirrus.com [198.61.86.93]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 4000D11A8; Fri, 12 May 2023 16:02:24 +0000 (UTC) Date: Fri, 12 May 2023 16:02:24 +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: <20230512160224.GK68926@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> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <0471f085-14bf-c159-9b92-62983af6c19a@linux.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Proofpoint-ORIG-GUID: 4w6vreW3yXhaxD8tHcn7X6KMWwrZKHrP X-Proofpoint-GUID: 4w6vreW3yXhaxD8tHcn7X6KMWwrZKHrP 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 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. Thanks, Charles