Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp641186pxb; Mon, 7 Feb 2022 21:52:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJyePPTB+v08nIlAuARkg5SuP6Kx2bXlCOOIebva5Hp0grt5/nW5yEKe1zzlxFWraSD72CgP X-Received: by 2002:a17:90b:4f4b:: with SMTP id pj11mr2670503pjb.120.1644299537288; Mon, 07 Feb 2022 21:52:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644299537; cv=none; d=google.com; s=arc-20160816; b=iFo0SK6PqlkDQ5GosPC51tcigCTBvkc8dJFsgVSdiLKkAAxoLKFGPCUJ2z79uW4f0D dZG4i2X1QAF44qkpsdmsABJD/k4UgRtgCgaSZEpZbIQcBDj5QLW9RaBoLWC8EtmdAX0e I2yk76Fsd09PmBCpU0eJy/QNpCfR+z7Qg+2XWKfHsXsGJNex6QOOvas0E5bO1lrCEFmp Bk4lQoGPvPrnSjidMgrhV9pIZ/QZUNN5JO/v+80xP/VCLR+d2f9NxOnQ6FFuzSa39PGl bAAKpTkHppmoguEU3tSDxODH86lWiSAQI0GTiKzUrzYBKj5IeQb5Y0TMpoAgm1wV7J6C H/uw== 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=sAhh4gqPC9v9hFbZq/l77CXsNyM7wDN8WvcunYKnnQw=; b=C+s9nfddA+/GnpOiTpdrGq1kkJ8yi89tMUtYPIGChsoXoRSWCfXJrZpMjTKohjnzJK VfEUKEKH5izgQLk7McxKlEpDxfwMTbxVXCwmyzkYaYOmv6n9JitDhg4rdzkJF9x2dXOT PDAeOej33SU+9ese4juGK0O13UFLAYPIkryUO8dxqdffkWNnDaD79/seNxEzucEIRK3H 8sd1q1IbsqaYZgNe0AJuvCZ2lFO0hV5q0l8k0JnqibAaHPEKNlrnKI2Um5xNW+oC3DEu CN2s2svrfP3V9IawiGgsOITRn4Npxeiifx5YMVxRFEA6ykReH6OE5HLdvu+TAgAQYTG4 t2Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="iBfqES/I"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j186si11751140pge.570.2022.02.07.21.52.03; Mon, 07 Feb 2022 21:52:17 -0800 (PST) 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=@suse.de header.s=susede2_rsa header.b="iBfqES/I"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1382994AbiBGOnu (ORCPT + 99 others); Mon, 7 Feb 2022 09:43:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1391741AbiBGOWC (ORCPT ); Mon, 7 Feb 2022 09:22:02 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2A1AC0401EA for ; Mon, 7 Feb 2022 06:21:59 -0800 (PST) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 6B311210FD; Mon, 7 Feb 2022 14:21:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1644243718; 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=sAhh4gqPC9v9hFbZq/l77CXsNyM7wDN8WvcunYKnnQw=; b=iBfqES/I9Wd6THlQ1EkiHdjWlvW8EKqfLotzLJoSA0USixJN5V0aqNq/Fo6ROlJNgJjgAJ IWvahUOFHfQ2eTuqh9MIud46EK4vsQfGYlrjkO9K121XHYTo1o04Wi6/ANXqoaGqRPQcP2 4pG8SlgNbKN08ml0TDaOlbToHc5NM/Q= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1644243718; 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=sAhh4gqPC9v9hFbZq/l77CXsNyM7wDN8WvcunYKnnQw=; b=QXXXuqoIaBjXf1BCW9WHoz6QzhXCnPDaxMbtyE3OR6hyPWOWo9ZJTGvdZcA+w8DSi6DWRZ MSS7W/MkYd2LXWAA== Received: from alsa1.suse.de (alsa1.suse.de [10.160.4.42]) by relay2.suse.de (Postfix) with ESMTP id 18B42A3BA1; Mon, 7 Feb 2022 14:21:58 +0000 (UTC) Date: Mon, 07 Feb 2022 15:21:58 +0100 Message-ID: From: Takashi Iwai To: Alexander Sergeyev Cc: "moderated list:SOUND" , Kailang Yang , Jeremy Szu , Huacai Chen , open list , tiwai@suse.com, Hui Wang , PeiSen Hou , Jian-Hong Pan Subject: Re: [PATCH 1/4] ALSA: hda/realtek: fix mute/micmute LEDs for HP 855 G8 In-Reply-To: <20220205175132.ihwp5wlxga4efngl@localhost.localdomain> References: <20220115152215.kprws5nja2i43qax@localhost.localdomain> <20220119093249.eaxem33bjqjxcher@localhost.localdomain> <20220122190522.ycaygrqcen7d3hj2@localhost.localdomain> <20220122205637.7gzurdu7xl4sthxw@localhost.localdomain> <20220129144704.xlmeylllvy3b3fum@localhost.localdomain> <20220130111020.44gzrm5ckrakjta2@localhost.localdomain> <20220205150016.gvrst7ldvgjh7fra@localhost.localdomain> <20220205175132.ihwp5wlxga4efngl@localhost.localdomain> 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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,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 Sat, 05 Feb 2022 18:51:32 +0100, Alexander Sergeyev wrote: > > On Mon, Jan 31, 2022 at 03:57:04PM +0100, Takashi Iwai wrote: > > In anyway, we need to track down exactly which access triggers those > > errors... > > I went deeper into codec reads and writes: > - snd_hda_codec_write > - snd_hdac_codec_write > - codec_write > - snd_hdac_exec_verb > - codec_exec_verb > - snd_hdac_bus_exec_verb_unlocked > - azx_send_cmd / azx_get_response > - snd_hdac_bus_send_cmd / azx_rirb_get_response > > In the last functions a circular buffer is used to write commands. The > problem is that "bus->corb.buf[wp]" and "bus->rirb.res[addr]" are > nowhere close to the IOMMU-reported address of the offending memory > access. It's likely that I've missed other communication channels. But > is it possible that IOMMU-reported address and buffers addresses are of > different kinds (physical/virtual) or different regions mapped to the > same physical pages? > > Example: > snd_hdac_bus_send_cmd: bus->corb.buf[wp] = cpu_to_le32(val) // = 0x3b8000, wp=0xfb, &buf[wp]=00000000f1fd4592 > snd_hdac_bus_get_response: reading result from 0000000059c4003d > snd_hdac_bus_send_cmd: bus->corb.buf[wp] = cpu_to_le32(val) // = 0x339000, wp=0xfc, &buf[wp]=000000007f14c128 > snd_hdac_bus_get_response: reading result from 0000000059c4003d > snd_hdac_bus_send_cmd: bus->corb.buf[wp] = cpu_to_le32(val) // = 0x1470740, wp=0xfd, &buf[wp]=00000000a6b14901 > snd_hdac_bus_get_response: reading result from 0000000059c4003d > snd_hdac_bus_send_cmd: bus->corb.buf[wp] = cpu_to_le32(val) // = 0x14ba000, wp=0xfe, &buf[wp]=00000000d8d1672a > snd_hdac_bus_get_response: reading result from 0000000059c4003d > snd_hdac_bus_send_cmd: bus->corb.buf[wp] = cpu_to_le32(val) // = 0x14b8000, wp=0xff, &buf[wp]=00000000b87b3287 > snd_hdac_bus_get_response: reading result from 0000000059c4003d > snd_hdac_bus_send_cmd: bus->corb.buf[wp] = cpu_to_le32(val) // = 0x2ba000, wp=0x0, &buf[wp]=000000002162c728 > snd_hdac_bus_get_response: reading result from 0000000059c4003d > snd_hdac_bus_send_cmd: bus->corb.buf[wp] = cpu_to_le32(val) // = 0x2b8000, wp=0x1, &buf[wp]=0000000095f61061 > snd_hda_intel 0000:05:00.6: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0015 address=0x1fffff800 flags=0x0020] Hm, I'm not sure, either. But let's try to avoid some possible confusion at first, e.g. a patch like below. Takashi -- 8< -- diff --git a/sound/hda/hdac_controller.c b/sound/hda/hdac_controller.c index f7bd6e2db085..074199aa73ea 100644 --- a/sound/hda/hdac_controller.c +++ b/sound/hda/hdac_controller.c @@ -618,7 +618,7 @@ int snd_hdac_bus_alloc_stream_pages(struct hdac_bus *bus) if (WARN_ON(!num_streams)) return -EINVAL; /* allocate memory for the position buffer */ - err = snd_dma_alloc_pages(dma_type, bus->dev, + err = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, bus->dev, num_streams * 8, &bus->posbuf); if (err < 0) return -ENOMEM; @@ -626,7 +626,7 @@ int snd_hdac_bus_alloc_stream_pages(struct hdac_bus *bus) s->posbuf = (__le32 *)(bus->posbuf.area + s->index * 8); /* single page (at least 4096 bytes) must suffice for both ringbuffes */ - return snd_dma_alloc_pages(dma_type, bus->dev, PAGE_SIZE, &bus->rb); + return snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, bus->dev, PAGE_SIZE, &bus->rb); } EXPORT_SYMBOL_GPL(snd_hdac_bus_alloc_stream_pages);