Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp822198pxb; Wed, 6 Apr 2022 00:46:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwc1DD40bI172M5QsQUyMwDcf+qloWrzylwyWbMsIon8+ukrEG848WxcN9/HQjGoxIuSPZz X-Received: by 2002:a17:902:6b89:b0:154:623c:9517 with SMTP id p9-20020a1709026b8900b00154623c9517mr7218579plk.45.1649231186079; Wed, 06 Apr 2022 00:46:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649231186; cv=none; d=google.com; s=arc-20160816; b=WapUkkmn1G5dAqNg6eSGF7r1qVPSnR2vsBR5z6dIG6n3dWzwtsWwc/Y2OEKg9OmC2M 19O0WsVD8xfLgFfH/ImM/rDRK+yJ05GlVX0PvpaMWuEr6g1H718THJWmdGtXYdP1G9Je ZoXlQ8ZLYLXz2Yv2dTkuRhbb5g4NQ2yWxbRfqCL0K4f95fWrSEiWBKKyuH7a8fSsZ6q4 cvk+6syNK8ae/kskrugkMn/hu/L/XYB/SeBqVnkqnp4mLpOIbqeSrsaOH6k9VRhguo8k GoRmbSPJrRJkYTRFiNou9E4y8oAxwLtkm5RftC6mSbHW669/yu87UlCqu1s3iszNlunF pcGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=5oEnGhA3oYlwUcWtHHVx+1352rYRH8JCFQASdtCnIdc=; b=j1ZGAZOwtwjVA16w82WHJ5TpPjKxvhDgjRXfq7rk06gQWW4cJ+pE1nl2M6OvNpk6uX RxEy3xzQeqKwMXcmDoot8cRBqawu2szwQ9O4DKTbeQbl+LUsCP07J3gXKsZ1+Z9j5VhB 8emBW6v6VuX0Q2TQw6d9ieNyClJK9XDuXlI6LeaE+YBIXX1ounAlf9J1MnhGs7DWcsom 2MR7JUM9ASQEGk/sYB5PCZV1yDH9uGhZV9z4oqRfBHNbLT9SBSKf7c1+1a1sKOIgRg4T rJZLU487BJgNwtCcePvuiUAHRtK8K9AsbmSNvJd9+k1fsy51BuDC9Rblvqdl4uLNnivS +V0Q== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id 20-20020a630614000000b003816043efe8si14361099pgg.477.2022.04.06.00.46.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 00:46:26 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 93E5950D26D; Wed, 6 Apr 2022 00:15:06 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1836722AbiDFAjP (ORCPT + 99 others); Tue, 5 Apr 2022 20:39:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1389310AbiDENdn (ORCPT ); Tue, 5 Apr 2022 09:33:43 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D547BE886D for ; Tue, 5 Apr 2022 05:37:25 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9BE56D6E; Tue, 5 Apr 2022 05:37:25 -0700 (PDT) Received: from [10.57.41.19] (unknown [10.57.41.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A44BC3F5A1; Tue, 5 Apr 2022 05:37:24 -0700 (PDT) Message-ID: Date: Tue, 5 Apr 2022 13:37:19 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH] ALSA: emu10k1: Stop using iommu_present() Content-Language: en-GB To: Takashi Iwai Cc: perex@perex.cz, tiwai@suse.com, iommu@lists.linux-foundation.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org References: <5ac9b54285b2189b848da2595408eb3cae8e5e9d.1649160813.git.robin.murphy@arm.com> From: Robin Murphy In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 2022-04-05 13:29, Takashi Iwai wrote: > On Tue, 05 Apr 2022 14:13:33 +0200, > Robin Murphy wrote: >> >> iommu_get_domain_for_dev() is already perfectly happy to return NULL >> if the given device has no IOMMU. Drop the unnecessary check. >> >> Signed-off-by: Robin Murphy > > This will change the code behavior. The current code does nothing if > no IOMMU is found, but after your removal of the check, the code > reaches to emu->iommu_workaround = true incorrectly. Ah, right you are - I should have looked more closely at the second check, where of course "domain &&" wants tweaking to "!domain ||" as well. I'll send a v2 in a bit... Thanks, Robin. > > > thanks, > > Takashi > >> --- >> sound/pci/emu10k1/emu10k1_main.c | 3 --- >> 1 file changed, 3 deletions(-) >> >> diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c >> index 86cc1ca025e4..5ffab343b89c 100644 >> --- a/sound/pci/emu10k1/emu10k1_main.c >> +++ b/sound/pci/emu10k1/emu10k1_main.c >> @@ -1751,9 +1751,6 @@ static void snd_emu10k1_detect_iommu(struct snd_emu10k1 *emu) >> >> emu->iommu_workaround = false; >> >> - if (!iommu_present(emu->card->dev->bus)) >> - return; >> - >> domain = iommu_get_domain_for_dev(emu->card->dev); >> if (domain && domain->type == IOMMU_DOMAIN_IDENTITY) >> return; >> -- >> 2.28.0.dirty >>