From patchwork Wed Jun 22 10:16:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Leach X-Patchwork-Id: 12890460 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 33D95C433EF for ; Wed, 22 Jun 2022 10:20:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:Subject:Cc:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=57OiM5ykulKJD+7XphRvfl6AVrALvjA2NZ24QD4Nfwo=; b=UzwwAhD69dWQcV jqqVIdOTOQ0roaXIEXDViMw+CtedenSr2snv+KuHiOWAY1RYGL+aKFE/lJQdQ+Em3/rM/zJlCAwP8 tyoWzWSBVF7qVyXXbBPy6imu7XUY9YH6h0SxH3uNFt5dee5I2JQOKGoOnU/FC3FPvBCnfaV9K2sTb ccKdOtJS/1WMmUPHz9GvpTlsykbVcQRcrqR0OV20OuAsxo4mhnzqi9CYAd50HLn3UaRTMkHZ9X/jS iewCKbP5NyOJRJEq3K21BdEOvKYRWcM6LRVlGnkYhd/hEkyfJNBe1hhvh5nRykWgLp72U11nki5WI G1kXBlnGbOlNgH3hwQKQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o3xSH-009pz2-G7; Wed, 22 Jun 2022 10:19:25 +0000 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o3xPQ-009odq-Pw for linux-arm-kernel@lists.infradead.org; Wed, 22 Jun 2022 10:16:32 +0000 Received: by mail-wm1-x331.google.com with SMTP id l2-20020a05600c4f0200b0039c55c50482so10795735wmq.0 for ; Wed, 22 Jun 2022 03:16:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=Hhbdb7t2DFLWoFZi68TNLjcE1MDmXHC8omnkFx7IEJg=; b=YRfT4GfVVQXcXpK0d0xutTik/itRzUQh5mzPOxtea30ltYzeLtGOYFzOXaPaLRpAZ3 c8vLmQbiC8pY/LV6BSj0R12Xkl9IrzITqOECR5JxpTV613/S+3PESDnjsBcd1byisNQ8 xcbOfkgDZ0w6HWxEm0LRVImSHwSRMieDzViARqr5SvLFtmjxNjtaybs1ZEditG6+Qrc3 2/zmRaxZwq6C7QFweK2E0YSl6vIrxY5+8vLAgdtcqx6avALnip1oM8YgweBWLm9JSNMg prKU0jbJtWtaeE05DSQleUVekT2vCA9aq8CufO56wgUmJlO/XS5X+IYu0zCs6oiuSpj8 TSlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Hhbdb7t2DFLWoFZi68TNLjcE1MDmXHC8omnkFx7IEJg=; b=oPC0NiSy87ubluLW8/JZrm2D82pcsep0790JESQO3/CuCfJSi82mtbNMG95Fukcm4G Hwnnjv8kO5GNhHVAigFU50dmHy4Ol0BukeG36hDUcPzVJD2D2JTkcaBeQjUz4dN0Awth VFe/WuAQ+I0xyThulxWIS01+6sjbd2ckRsHUAmaVOXVBql7hReT86IYq1AURliVtfwxS c0FAbCNOhMQwJZlVcMQZnJT2bCp4IAtrwgWxtYAbUe/rnddiRcBBNzka+hI3/YlJpHFg vOl9f6PvJz6xfBXN7xpf9SKBcCueP+Up7gHb25D/3bBd9F9gEYipwgsr6a/xv05IlP3w YcpA== X-Gm-Message-State: AOAM5327Dt/RdGSVhAh1f9ep2ogfhc60xu499qG7/xXJLSgPECjN0Wmk 7MmT8YOOriY69Km1uRb8BrQeRYJBIMt3Pw== X-Google-Smtp-Source: ABdhPJwyzIPQ/zp2QSJiGq99JcoMM+FOcurmH5asOak3lHkUPZY/TG6Hf6eN/dJb00ufhwc4FeDIlA== X-Received: by 2002:a05:600c:34c4:b0:39c:9236:4e9e with SMTP id d4-20020a05600c34c400b0039c92364e9emr46328996wmq.67.1655892984339; Wed, 22 Jun 2022 03:16:24 -0700 (PDT) Received: from linaro.org ([2a00:23c5:6809:2201:546d:7d59:1703:bf96]) by smtp.gmail.com with ESMTPSA id cl10-20020a5d5f0a000000b0021b92171d28sm8850936wrb.54.2022.06.22.03.16.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jun 2022 03:16:23 -0700 (PDT) From: Mike Leach To: linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org, suzuki.poulose@arm.com Cc: mathieu.poirier@linaro.org, leo.yan@linaro.org, Mike Leach Subject: [PATCH v4 0/2] Fix lockdep issues seen in CoreSight configfs interface Date: Wed, 22 Jun 2022 11:16:19 +0100 Message-Id: <20220622101621.4312-1-mike.leach@linaro.org> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220622_031628_905742_587B845D X-CRM114-Status: GOOD ( 10.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Issues with lockdep possible deadlock scenarios have been reported when using the coresight configfs interface handling complex configuration, when unloading modules. These are due to holding the main configuration mutex during configfs register, but taking it later when accessing configfs files. The patches improve the clean up of configurations and update load and unload of configurations and initialisation of configfs to fix the locking mechanisms. Applies to coresight/next (5.19-rc2) Tested on DB410c (with patch [0] also applied to fix separate console boot issue). Fixes: eb2ec49606c2 ("coresight: syscfg: Update load API for config loadable modules") Reported-by: Suzuki Poulose Signed-off-by: Mike Leach [0] https://lkml.kernel.org/r/20220614124618.2830569-1-suzuki.poulose@arm.com Changes since v3: Addressed minor issues raised by Suzuki. Changes since v2: Added additional work to fix load and unload ops after issue recurred due to file access. Mike Leach (2): coresight: configfs: Fix unload of configurations on module exit coresight: syscfg: Update load and unload operations .../hwtracing/coresight/coresight-config.h | 2 + .../hwtracing/coresight/coresight-syscfg.c | 299 +++++++++++++++--- .../hwtracing/coresight/coresight-syscfg.h | 13 + 3 files changed, 262 insertions(+), 52 deletions(-)