From patchwork Tue Jun 28 17:30:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Leach X-Patchwork-Id: 12898603 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 CC174C43334 for ; Tue, 28 Jun 2022 17:31:14 +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=Yt9CUWXhGzh10kLbZh837HBmzNcZkYjK9ZWqyCzUUrk=; b=ZvDdfRLtrD6hXb BNj7QzciawzyLxRiATKi6rCA5bH/XVxP+QT1icb9OoJBgW0qyBU26lYd1AVa8xQFfnhUVZIYVJwZj /4Flv5d2+r+uuz0QpTAnt7sRD/wPFWIWa+MCCAgE7gm6qFNrzH6qXGcvWiS9kqg6cKm31m0Z5Wht4 7A4uxrd0Kj12cWiLq1o44r4he9W8AqoSpZnZRNLDJIxrPAr2toEr8+MjiVTwpzNNnTBmTAPsaXGBm SYMLAnD98d81HZqmvpNnE9/boI58RDFN2eiGurhdKbD9Ex0FlYviILINxA+feG3z8vS2XSSbe41ye 2xdDG70eYjPVyndDtzWA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6F2U-007PPq-F0; Tue, 28 Jun 2022 17:30:14 +0000 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6F2R-007PNf-AW for linux-arm-kernel@lists.infradead.org; Tue, 28 Jun 2022 17:30:12 +0000 Received: by mail-wr1-x429.google.com with SMTP id q9so18718008wrd.8 for ; Tue, 28 Jun 2022 10:30:08 -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=GRRKzrNnHGZqm9KLR56CirOVPwx94wFaWabtc6gsHbQ=; b=DP1nseSN9A6rvi4pKtcu71w0H7kvGvFPkYc9FVIOD45RBupwc5pKvgOAHDqzRjJrua e7cNt4SGP8W3/UiswC8B/YuaXcl4OR+PVZGKNnaddlv1Z8BwXUK7YI7vT+I4U0ISkn1w K/Ntumk8urc43d2DuUfWk26eOiCQVga1sJ+KypyQSpo3MY7ZyKbYFgH9neNJvjtbhbwc UY6EVVRHl1bLsyLgSQ7Ks5YxMV/wDGPoWtqxYIUNL+q4YeNWJER2K2bVtAtbWEdE2Ifh XgrbJQRxVIsqf/l+6c/9gI9V9Yz9E3lrFJE6UZlzIPfbNbXcUO1aCusLYTi8F3wiXoDY gm7g== 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=GRRKzrNnHGZqm9KLR56CirOVPwx94wFaWabtc6gsHbQ=; b=r6acCwUEZ+iHbT3VuoHyPzCUHByo/0XzEQhx0LdgGthibqJhFHoNjc53g3zgsvFjPK Nwdjz9Sx+BPLQcA4x2qBSPB4MUfpoaMisETG5Wb9oHp6O0brdszRXNQbNHNREKT4imnl Lac0dvK86Va3bFXwb9Sizs9M/u8+ASRliUQNVN29vo2kL55aATpBdxW3oJ/7tHIsGTKP Ooo7anjsr4mrB9Pht0XqtXFM/2lEy4bU5ahmj7OM2ut1iVl0pJFAuT4fC1I2FtAtX5X2 SkViOBEl+wUB3Mcha8fBB2bPqhh8Dt85nG2+AV+Vy/ewS+8rNQS3a/KlYwCXhyGz1puf oxGg== X-Gm-Message-State: AJIora8RutV8F27+sccAgNjJdwBgRIzg3S6Bh5mZ3heHFW4CYOUd+Alu HSgnRFOHSW9bvqgPEvV51iw+e4qJJTYSFQ== X-Google-Smtp-Source: AGRyM1sQdBwKRwiCuG1owRihnc3VNzqKVZLXfM0L7f1eq3qbP2c5CKu7d8D5URF9BDrDCkq5ogjRjg== X-Received: by 2002:a5d:4b04:0:b0:21b:8640:273f with SMTP id v4-20020a5d4b04000000b0021b8640273fmr18650895wrq.195.1656437407668; Tue, 28 Jun 2022 10:30:07 -0700 (PDT) Received: from linaro.org ([2a00:23c5:6809:2201:1855:d450:f918:3965]) by smtp.gmail.com with ESMTPSA id c3-20020a05600c0a4300b003a03e63e428sm267540wmq.36.2022.06.28.10.30.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jun 2022 10:30:07 -0700 (PDT) From: Mike Leach To: linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org, mathieu.poirier@linaro.org, suzuki.poulose@arm.com Cc: leo.yan@linaro.org, Mike Leach Subject: [PATCH v5 0/2] Fix lockdep issues seen in CoreSight configfs interface Date: Tue, 28 Jun 2022 18:30:02 +0100 Message-Id: <20220628173004.30002-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-20220628_103011_419737_A4A66FAC X-CRM114-Status: GOOD ( 11.26 ) 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 v4: No functional change - fixed comment in patch header 1/2 and error string format to remove checkpatch warning as requested by Mathieu. 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 | 298 +++++++++++++++--- .../hwtracing/coresight/coresight-syscfg.h | 13 + 3 files changed, 261 insertions(+), 52 deletions(-)