Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp736148pxb; Tue, 5 Apr 2022 21:01:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyOaE6XebT1R9YlRhnH1Gca7vX1LnouTVRIXvGGLGmZ4TYGazFdb2eKjKiApij6ifPSNqL X-Received: by 2002:a17:90b:4c8e:b0:1c6:8dfb:3cb6 with SMTP id my14-20020a17090b4c8e00b001c68dfb3cb6mr7794970pjb.72.1649217717882; Tue, 05 Apr 2022 21:01:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649217717; cv=none; d=google.com; s=arc-20160816; b=0FfFBU0T5UMCe5SQd0eTurQfPvlJ7yNYp1nq3Sd7Gm0hARD+ggY0dmJlH2pGFQHRUB 6RiAgrr/ZHodjOPhQMnRhkBD2F7s6DGTt07qTSw6/MorwHr2OHJn3uM4BH+yOv2HIt6g gZEFktr2gaJgHIxibXcPYbRWk5XFbSXMwxCgbV8TKb83sH1wj1rxoW6M5hBKtGmcaCrc TqmDg6HvUNJDG+b2pUFBXOLrT/Ikxw/DW1AAwbfkdcXXtfY+qXZgfxiaAjZLZej/a4yy x1sZtxOK2/jRFHffdrF1f6uEMVr1ztzBAJsiIy4Kvk/kuuDQ09+M9DdG/BhvsKOQ7ZEV ma5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature:dkim-signature; bh=LX1Y1wytzXUwD49XoymIggwDFSmAem8nS60r7OHveSY=; b=KrRscTTGlYYEtpjPtGDzidqu6Lqp+3wWBSrMED9QJ9KAVRGIqzqs4OmWEVBRDXBp1n gScJptt+F9VYoP6H+QthE3yPu6MeNiH/0itiYiEcQuHV47Hzb3FD3kw39QyvJ6lQ4HPW KEF3ZKRB+w9ZHZV/vYFMFp2c93RB3LYQZ/cceMdjck/M1dNbFL6zNh/mr7pt39410U2I rhqCsGZ5LK4RvP07/Cw3OvenXFWfXG3/jXaIZlaXEnD0HQ/VP9ndwi0jd3xM7c0lUjSW TcTiMflPSZBQau7MUpDex1IAhC9Y4/YrcHTlM8or2b5V//rNp9i5b7BQwS12ezfWXQPn E3cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=LNyuR9n5; dkim=neutral (no key) header.i=@suse.de header.b=oNP8ulzX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id b13-20020a63714d000000b003816043efe9si17155456pgn.478.2022.04.05.21.01.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 21:01:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=LNyuR9n5; dkim=neutral (no key) header.i=@suse.de header.b=oNP8ulzX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CA68B183B2; Tue, 5 Apr 2022 20:43:05 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1839803AbiDFBFw (ORCPT + 99 others); Tue, 5 Apr 2022 21:05:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1383538AbiDENaw (ORCPT ); Tue, 5 Apr 2022 09:30:52 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59DE63EAA0 for ; Tue, 5 Apr 2022 05:29:35 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 58AE5210EA; Tue, 5 Apr 2022 12:29:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1649161774; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=LX1Y1wytzXUwD49XoymIggwDFSmAem8nS60r7OHveSY=; b=LNyuR9n5V63kXQ4u02QTDo3+rxmPzzHfTsEsTny+dqeOrCbA9qYZvNqxjVSz0Fc7fOwzGb PrZdpcVSlmlw6KmhOiHINFP3p8YyGzsGgVA7pfLe14Ovd23T3n5CsbagnN0TV4b0uAX+vo PbjWnA3Yq4sN+lJpOk8AiXuMRUYtlIQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1649161774; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=LX1Y1wytzXUwD49XoymIggwDFSmAem8nS60r7OHveSY=; b=oNP8ulzXNzBvshg0+gstblohTrD+/4vq7Z30nb/vxaTnUA/koNXeLfV7D+mX7UkCZtBFw2 isk2iVy84jtcoPDw== Received: from alsa1.suse.de (alsa1.suse.de [10.160.4.42]) by relay2.suse.de (Postfix) with ESMTP id 426B3A3B89; Tue, 5 Apr 2022 12:29:34 +0000 (UTC) Date: Tue, 05 Apr 2022 14:29:34 +0200 Message-ID: From: Takashi Iwai To: Robin Murphy Cc: perex@perex.cz, tiwai@suse.com, iommu@lists.linux-foundation.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ALSA: emu10k1: Stop using iommu_present() In-Reply-To: <5ac9b54285b2189b848da2595408eb3cae8e5e9d.1649160813.git.robin.murphy@arm.com> References: <5ac9b54285b2189b848da2595408eb3cae8e5e9d.1649160813.git.robin.murphy@arm.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 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. 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 >