From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53876C433EF for ; Mon, 31 Jan 2022 14:57:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349193AbiAaO5I (ORCPT ); Mon, 31 Jan 2022 09:57:08 -0500 Received: from smtp-out2.suse.de ([195.135.220.29]:56258 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232149AbiAaO5G (ORCPT ); Mon, 31 Jan 2022 09:57:06 -0500 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 1C4D61F380; Mon, 31 Jan 2022 14:57:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1643641025; 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=oGbrB4jkSsv8ztmFHI1kkrhQ9Pcbl+Xj8CjWST+LroU=; b=w3IaXZzw3qmQ6aAR88iBgj2WH4L/+KEMADWdgR3bpKxJYAFPRVM9yt9py1+D86rOu9yTwU HYpxsU06OMbC7SRvQBB362VTOIntkwKsXHHnkdVrbA8J1yjDj9mTcooW587Ampb8pyxW8g B+5wNNxtHEmGnwSzCoPDEoV8fWCuan8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1643641025; 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=oGbrB4jkSsv8ztmFHI1kkrhQ9Pcbl+Xj8CjWST+LroU=; b=oRH6TwzDWmKnwD2uRG2sWCAH1Pilwr+RYro8ldfbAmW0tgMV//zyxFISND88ptcTOlFQrq FQqs6UmPWeUVkGAQ== Received: from alsa1.suse.de (alsa1.suse.de [10.160.4.42]) by relay2.suse.de (Postfix) with ESMTP id CB527A3B8C; Mon, 31 Jan 2022 14:57:04 +0000 (UTC) Date: Mon, 31 Jan 2022 15:57:04 +0100 Message-ID: From: Takashi Iwai To: Alexander Sergeyev Cc: Jeremy Szu , tiwai@suse.com, "moderated list:SOUND" , Kailang Yang , open list , Huacai Chen , Jian-Hong Pan , Hui Wang , PeiSen Hou Subject: Re: [PATCH 1/4] ALSA: hda/realtek: fix mute/micmute LEDs for HP 855 G8 In-Reply-To: <20220130111020.44gzrm5ckrakjta2@localhost.localdomain> References: <20220114183720.n46wealclg6spxkp@localhost.localdomain> <20220115152215.kprws5nja2i43qax@localhost.localdomain> <20220119093249.eaxem33bjqjxcher@localhost.localdomain> <20220122190522.ycaygrqcen7d3hj2@localhost.localdomain> <20220122205637.7gzurdu7xl4sthxw@localhost.localdomain> <20220129144704.xlmeylllvy3b3fum@localhost.localdomain> <20220130111020.44gzrm5ckrakjta2@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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 30 Jan 2022 12:10:20 +0100, Alexander Sergeyev wrote: > > On Sat, Jan 29, 2022 at 05:47:07PM +0300, Alexander Sergeyev wrote: > > But unbind-bind problems with IO_PAGE_FAULT and "out of range cmd" are not > > eliminated. IO_PAGE_FAULT are often logged without accompanying "out of range > > cmd". And after adding debugging printk() I haven't managed to trigger "out > > of range cmd" yet. But IO_PAGE_FAULT are more easily triggered. > > IO_PAGE_FAULTs go away with CONFIG_IOMMU_DEFAULT_PASSTHROUGH enabled. As I > understand, this leads to reduced DMA device isolation which is generally not > desirable. I was initially thinking about races between some delayed code and > io-memory pages unmapping, but first IO_PAGE_FAULTs (running non-passthrough > iommu) happen during bind operations as well. That's logical, as IOMMU is bypassed for DMA with that option. I still don't get what really triggers it. This won't happen when you build modules and load/unload the driver instead of dynamic binding? And the out-of-range access is puzzling, too. I guess this comes from the update of a COEF, i.e. it reads a strange value and tries to update the value based on it. The problem is that it's no -1 but some random value. This might be tied with the IOMMU error, and it might reading unexpected address, which would be really bad. In anyway, we need to track down exactly which access triggers those errors... > What is also interesting, unbind & bind consistently fails on 31th bind: > > echo -n '0000:05:00.6' > /sys/bus/pci/drivers/snd_hda_intel/bind > -bash: echo: write error: No such device > > And does not recover from there until a reboot. This is intended behavior. The driver has a static device index that is incremented at each probe, so that the driver may probe multiple instances. It'll be tricky to reset this for dynamic binding, though. This problem is not only for HD-audio but for most of other drivers. But I leave this as is for now, since the dynamic binding is rarely used for PCI and other buses, so far. Takashi