Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp3998458rwr; Mon, 8 May 2023 00:59:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ68LD3YUGyfR5RiOjKTftimCtfI8M2xyqUoE4dkhxOfplBu1CbxfE8sD9WopTjOI48oDjSh X-Received: by 2002:a05:6a21:3284:b0:100:9a80:2e90 with SMTP id yt4-20020a056a21328400b001009a802e90mr2071750pzb.59.1683532785830; Mon, 08 May 2023 00:59:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683532785; cv=none; d=google.com; s=arc-20160816; b=HLFpldUzcYMQ2mg9ufjCZ+mFm1ANBu727lcXNNu3L375UPzNP27P9Oe0Vvgfdbxw34 cIojXFj8SYmI0567SOwkl6mdBT4nhiUUw7fW9CZp1kMVawXJu+A6DXyhgehfA6bhFtCu vX30Dl23Qar7UcF0i6/AH/WM3uvw6wYF85ZfdG0djMlM0VJc39V7006oGGGYFfMw6vz1 nbODX7mVvTERHrniPb5nxZt95nvtqeSOrGvK2l6FhnIRH4LyrTVeiZV85LtyyVMY3M02 D1x7KXUkCYhT99Y71n4O9Kt0cBSlDiU/FvOGWVrUfQKyzbn/+7DOQ/a7yujVfpAw+496 iMAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=LLrPjIUDkWjQwk/TzqHgxxRCD47ZajqYpQqYRyeuP78=; b=ER2QY4JswaJYb5nE5BNl4or5WuL7Ja6kL+d6zDGjZOIE9A8RKqm8a9up4+mieYha/a U9oHUUm4mPAT6I8CWofomGPYqDSSmFpK5+sTWyT61XRIBgpi08lBl7pT2Jry0BVuQDkv Q9CjJk8qOAxf6HYl/4yl8NtS/DkLMz7Eb8RKI6UsFvG189k4aiEBZcibNwlkk5MgaIC8 MkI9lCAe7zzhDICqSsIKE3RU37KvXtoOmEEt1gAzlsKONi4ptonVCjQspv2PB3KsVlj7 eP/CSerpvSDe6cIAG0WKVGrzQ6fKliZurdzi5FKsqGG4mAAsR1lZ/0EgimPN1rNzhrin +NHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="ksQ/haKd"; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m9-20020a654389000000b00524b56d9e63si7862389pgp.324.2023.05.08.00.59.31; Mon, 08 May 2023 00:59:45 -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=@kernel.org header.s=k20201202 header.b="ksQ/haKd"; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232674AbjEHHdg (ORCPT + 99 others); Mon, 8 May 2023 03:33:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229464AbjEHHdf (ORCPT ); Mon, 8 May 2023 03:33:35 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81C84138 for ; Mon, 8 May 2023 00:33:34 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 176F761236 for ; Mon, 8 May 2023 07:33:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D93C0C433D2; Mon, 8 May 2023 07:33:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683531213; bh=Ewso4HhzAJsqbCT6d20i437Q1SAxJH/VSuHeEApsxno=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ksQ/haKdEaXlVJf5aV4SAe7/h6YRzUWHQCOmPabBVhnPsYgPWDktr8vLtVV48Egem 4N/QFzD9aUhobzl9LNc/vuuaRS62YMRs5epnu3teAICr7Up3NVXpKZxx2L27potgiZ Wg3tYcGgfte+jBAzGZwsHkxInQUbJUZjngdOn5h14yVWOg9TKsX+cI8YvopmOlakH0 CmqtfQ+xEMvl2CsAQeXz4C45wXoAuO/ejo1jo3DhfToz5M0PPsTxn2zA1Mchuqb91q OeamyywMW7+YLJopIGyCSfqBnp/ZzP0JDMUYNpJpJzGGHr4Cu3tjqjbcxeCOGZMZNB s60WuEqbbPFaA== Date: Mon, 8 May 2023 13:03:29 +0530 From: Vinod Koul To: Charles Keepax Cc: yung-chuan.liao@linux.intel.com, pierre-louis.bossart@linux.intel.com, sanyog.r.kale@intel.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com Subject: Re: [PATCH v2] soundwire: bus: Don't filter slave alerts Message-ID: References: <20230418140650.297279-1-ckeepax@opensource.cirrus.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230418140650.297279-1-ckeepax@opensource.cirrus.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 18-04-23, 15:06, Charles Keepax wrote: > It makes sense to have only a single point responsible for ensuring > that all currently pending IRQs are handled. The current code in > sdw_handle_slave_alerts confusingly splits this process in two. This > code will loop until the asserted IRQs are cleared but it will only > handle IRQs that were already asserted when it was called. This > means the caller must also loop (either manually, or through its IRQ > mechanism) until the IRQs are all handled. It makes sense to either do > all the looping in sdw_handle_slave_alerts or do no looping there and > let the host controller repeatedly call it until things are handled. > > There are realistically two sensible host controllers, those that > will generate an IRQ when the alert status changes and those > that will generate an IRQ continuously whilst the alert status > is high. The current code will work fine for the second of those > systems but not the first with out additional looping in the host > controller. Removing the code that filters out new IRQs whilst > the handler is running enables both types of host controller to be > supported and simplifies the code. The code will still only loop up to > SDW_READ_INTR_CLEAR_RETRY times, so it shouldn't be possible for it to > get completely stuck handling IRQs forever, and if you are generating > IRQs faster than you can handle them you likely have bigger problems > anyway. > > This fixes an issue on the Cadence SoundWire IP, which only generates > IRQs on an alert status change, where an alert which arrives whilst > another alert is being handled will never be handled and will block > all future alerts from being handled. Applied, thanks -- ~Vinod