Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp67641ybl; Thu, 9 Jan 2020 17:08:01 -0800 (PST) X-Google-Smtp-Source: APXvYqzZa/TTXE7kTp4uSQbHz+TnjW1xXwfH8KP21nqOQ2+iGwDKNLRW+n866HsReg/0HoRD4lBz X-Received: by 2002:a9d:470a:: with SMTP id a10mr557717otf.370.1578618481687; Thu, 09 Jan 2020 17:08:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578618481; cv=none; d=google.com; s=arc-20160816; b=qYQmG38d73W++NVhL7Rbvg31FDxiAZ+P77qNoPBTB4rX2TC1kgDNDUGRP26KiZBKIe +DkwTYdAhckVpSSEUwaP6qsK/juHNdoETVv99T+r3DZkr0nfLQtQrtl1KPfUMDBVXcKR uwMt+7FIargFnFmbnPjTxMdPJgBfTeh/XEmUnXjOa/mKaK6bT0MsS3sO4IoEIVaakCs8 8osHiy9PsdYZEdwd9CUKzJYL+nL9uFv/t3CjnkecPk0vRktJHgI1iSy68AtOWM8Mje+R ekz6oUbIkqFUNdp7zONFIsbzAyKqA7XJA3EY24H6yfO/16sqK/lQrF0nfXfU+3bupRlV fygA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=0AaGdesSrwy9CQvlbcsq69wkQKgx9ks9Un7URg79eFs=; b=CGUfX0Dq05076r1lmACT1FvzwAuskQfOeTgWaYgmLt8QTP4PAP0tDWyhVnxA2NdNCo D6mtd5kdUFRuSi3S/EpM/R5ObYxdsyBOMrMWzCQMnDGGk1/KU7IvOeOVmnmBoJK/gD78 lSV/z/STYfPKN2e4x34D19mznQlDs4WtIL6YnTkQOvwsxFxH4DqyeNK0IK56OZOfb1Hi ERY9D4NrIbUO+ZTI388vVswMi96aiSC9ltkzHRwyIP+/SeNapzbpq4+Anz6XPUUiAUFu AxdOw1SlQNjMOPbTgtdQrqJ5pe6gnStt8/TRDx+VffOnnNk1PzIijSjUQRNf0pRz9cDB p5mQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="Q/SpiVFs"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s64si118984oig.147.2020.01.09.17.07.44; Thu, 09 Jan 2020 17:08:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="Q/SpiVFs"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730403AbgAJBGL (ORCPT + 99 others); Thu, 9 Jan 2020 20:06:11 -0500 Received: from mail-io1-f65.google.com ([209.85.166.65]:40847 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730362AbgAJBGL (ORCPT ); Thu, 9 Jan 2020 20:06:11 -0500 Received: by mail-io1-f65.google.com with SMTP id x1so227503iop.7 for ; Thu, 09 Jan 2020 17:06:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0AaGdesSrwy9CQvlbcsq69wkQKgx9ks9Un7URg79eFs=; b=Q/SpiVFs4/CEUFt4OJSbX9xPIsfLj3jSr20AiDtXP9XvZICvdGeSQk0lhVHg5Qd5ZS 8VjrJNEgPxcXYOwEWkcs4vOmFRVOLcc8qYl7fD090QaaMrmq5H+H5eVVXXZjUIO6RwaS coZEj5xntuTb9jKxuehVxmW5QEaU9gi9tM0Sd9ENZdBR1/dXMyjy6yw0raRCe/i0RLxy SBed63A6k1u1GI0RmSCoxlYb8u+D7oW+/5KqjBw+xq6Dwx2vL77j0U9iaIkH5NOoYrsS tQzyxjlVTJE1fnAPu9bhvkp1lCm49fC8vZlK8HTeqq84e6+FresN1q5780lOqNG8NjId wgGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0AaGdesSrwy9CQvlbcsq69wkQKgx9ks9Un7URg79eFs=; b=f8cRrM4txXZ8zDwrsCfHfbQRztcmRy3YXi3FlYxTDU87MfVbIVCXVXo4w4Ng/8ybtE wHIiNQBsUAMhoo4SsLsNlzcYluXkvEI8pgCrFeWem2dh+CHv0G1GdkwWx72678CM+2X9 bN9p33UHGmusQ4YTgb0J2GhgSLOX/CxKoX1pNjLc9kLxwZMPLPsWZQJHbqF7w8/GXoIZ ugVmRpYxdGgJoP1o45XkUvsGUq9hH6MiHKIT+VR5CfWP3P57wkrsqHgZOZANbv91HaUK LrlG/sjc1gaHkyDOofiui6WfBMHYWbwDQTDnoOvWWPMxIp/0NbEP14R7jwyluk2zj+5s Y76A== X-Gm-Message-State: APjAAAWPScTUwWjDF8TKG1kjI8V6hEVZuQS1csJe0c0ebRWa0Aiz3b+D p/juDnKTSf+3xvh3El9tZuh9dVlEN0upPHAiQrmf/w== X-Received: by 2002:a6b:8f41:: with SMTP id r62mr300820iod.140.1578618370473; Thu, 09 Jan 2020 17:06:10 -0800 (PST) MIME-Version: 1.0 References: <20200108115007.31095-1-m.szyprowski@samsung.com> <20200108115007.31095-2-m.szyprowski@samsung.com> <83169752-ac05-d1b1-ece9-fbe1109287cf@samsung.com> In-Reply-To: <83169752-ac05-d1b1-ece9-fbe1109287cf@samsung.com> From: Tzung-Bi Shih Date: Fri, 10 Jan 2020 09:05:59 +0800 Message-ID: Subject: Re: [PATCH 2/2] ASoC: max98090: fix lockdep warning To: Marek Szyprowski Cc: ALSA development , Linux Kernel Mailing List , Linux Samsung SOC , Mark Brown , Sylwester Nawrocki , Dylan Reid , Jimmy Cheng-Yi Chiang , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 9, 2020 at 7:09 PM Marek Szyprowski wrote: > On 09.01.2020 06:36, Tzung-Bi Shih wrote: > > On Wed, Jan 8, 2020 at 7:50 PM Marek Szyprowski > > wrote: > >> Fix this by introducing a separate mutex only for serializing the SHDN > >> hardware register related operations. > > This fix makes less sense to me. We used dapm_mutex intentionally > > because: both DAPM and userspace mixer control would change SHDN bit > > at the same time. We should not use a separate lock. Either mixer control or DAPM would change the SHDN bit. The patch overlooks the calling path from DAPM. As a result, DAPM can change the bit in the middle of mixer control. > Nope. This is just a lockdep warning about possible hypothetical > situation on the test system during the normal boot. It doesn't mean > that the circular dependency actually happens (if so, it would end in > deadlock). It also doesn't mean that such circular dependency can be > really triggered, because some other dependencies that not known to > lockdep engine might protect against it. However the easiest way to fix > it is to use fine-grained locking instead of reusing some framework > locks for other purposes. Such approach is also usually a good practice. If the possible circular locking is a hypothetical situation, shall we ignore it since we are very sure userspace cannot see the control devices when building the sound card?