Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1580671ybg; Thu, 11 Jun 2020 13:40:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyssRvP7rnheGM/J4qaQcRxlxa/tEOUvbsQW7h02y4WSN1SJdxGnw+4qgp4pCWippUZcfF X-Received: by 2002:a17:906:ae85:: with SMTP id md5mr9963177ejb.213.1591908048564; Thu, 11 Jun 2020 13:40:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591908048; cv=none; d=google.com; s=arc-20160816; b=KSmQUrVfJCu1M7ul/PX1wI3ZgmuCoUHm5bgbSZspw+gks+N0d5g/OxszrTsZMXcHSm /DHBlz7FxLWQHgKmy0Oj1JCTL0X9P7uNBwPRUKDehf0KOYjAZYXoiU1Tup63Ax21+WiB /K6voBEVMLFni5DGj3sqYjqxYID3R96tnZyZ+/gxT7YS+xzoCX+sjao3dDYBHtCnm2vW wVtPZjIXlJ2BVvj4Mda8Go5ju7NgDNuCi5d8KtTmYlLzhKo267VmbnEOviJt6+jWIdhV dU3phEi6S8e/TsGed91n+I/6W0RKx/bjdJCRmEaB/NtA3aW1I+OB5oDZl68tMP3vJF/m HzzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:ironport-sdr:ironport-sdr; bh=x5GjXAfWnIuD4/Anno0JKVLocqFmJhC8wZVHH/Ssf9c=; b=XjL9bqGsz9U6SkC2rS0m8EMQbGp6fPIT5+YlYJ4yqOskFE5DMPhIf2TO6RH2B4MjJH lhUu/gxBoAXwQWCm+LsSkuPPib/cxT9UcnBnNJgeGM6er9IEMYuKk3k5nZppy0vy+Ztj 5c95WWSUXzCgTK6YJBinlwG81NT2G/zwaqtDYPilgAqOimnIEic+vCcFqWWygt6uAoU0 gEPCQbSs5Uewgqlbdbn3OEDuz50fycM0cC8J44sQDk1dZEa7hflTxOXE+P3g/opTM/bS H2m21F2xexpxJlvqi/nfdSXpl1fbtw1FeJQh/BKiKskDTQGZnAJafx5nYSccpDPLeG4g u2ig== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dr12si3389650ejc.352.2020.06.11.13.40.23; Thu, 11 Jun 2020 13:40:48 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726277AbgFKUhB (ORCPT + 99 others); Thu, 11 Jun 2020 16:37:01 -0400 Received: from mga05.intel.com ([192.55.52.43]:30161 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725782AbgFKUhB (ORCPT ); Thu, 11 Jun 2020 16:37:01 -0400 IronPort-SDR: PXV7M5sLYG8V5PksoWwDKYbcxT3ryHKibXqu5a8YBqazzYMD08Zp/sRZoGXgQQjF1FaXOQ8pyE pxir9525G3gw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jun 2020 13:37:00 -0700 IronPort-SDR: pepvTIbg9SIlqOWtoQ4OtOupzy32cfxyZsYPgMKHnzW0Mdk4DZZjFbx+yJ6d345eaUwBBgSk2T cxGwt5K3WxoA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,501,1583222400"; d="scan'208";a="260628282" Received: from mgesquiv-mobl.amr.corp.intel.com (HELO [10.254.106.112]) ([10.254.106.112]) by orsmga007.jf.intel.com with ESMTP; 11 Jun 2020 13:36:59 -0700 Subject: Re: [PATCH] ASoC: SOF: Intel: hda: unsolicited RIRB response To: Takashi Iwai , Ranjani Sridharan Cc: "Lu, Brent" , "alsa-devel@alsa-project.org" , "authored:2/16=12%,added_lines:21/248=8%,removed_lines:5/84=6%,),Liam" Girdwood DRIVERS ")" , "commit_signer:6/16=38%,authored:6/16=38%,added_lines:123/248=50% ,removed_lines:36/84=43%,Kai" Vehmanen DRIVERS ")" , "Daniel Baluta DRIVERS )" , Mark Brown , Jaroslav Kysela , Takashi Iwai , "Rojewski, Cezary" , Zhu Yingjiang , Keyon Jie , Bard Liao , "sound-open-firmware@alsa-project.orgDRIVERS" , "linux-kernel@vger.kernel.org" References: <1591883073-17190-1-git-send-email-brent.lu@intel.com> From: Pierre-Louis Bossart Message-ID: Date: Thu, 11 Jun 2020 15:36:58 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >>>> I added debug messages to print the RIRBWP register and realize >>>> that >>>> response could come between the read of RIRBWP in the >>>> snd_hdac_bus_update_rirb() function and the interrupt clear in the >>>> hda_dsp_stream_interrupt() function. The response is not handled >>>> but >>>> the interrupt is already cleared. It will cause timeout unless more >>>> responses coming to RIRB. >>> >>> Now I noticed that the legacy driver already addressed it recently >>> via >>> commit 6d011d5057ff >>> ALSA: hda: Clear RIRB status before reading WP >>> >>> We should have checked SOF at the same time, too... >> >> Thanks, Takashi. But the legacy driver but doesnt remove the loop. The >> loop added in the SOF driver was based on the legacy driver and >> specifically to handle missed stream interrupts. Is there any harm in >> keeping the loop? > > A loop there might be safer to keep, indeed. That's basically for a > difference kind of race, and it can still happen theoretically. > > Though, SOF is with the threaded interrupt, and it's interesting how > the behavior differs. I can imagine that, if a thread irq is running > while a new IRQ is re-triggered, the hard irq handler won't queue it > again. But I might be wrong here, need some checks. IIRC we added this loop before merging all interrupt handling in one thread, somehow the MSI mode never worked reliably without this change, so maybe we don't need this loop any longer. I'd really prefer it if we didn't tie the RIRB handing change to this loop change, removing the loop should only be done with *a lot of testing*.