Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2491318rdb; Wed, 4 Oct 2023 02:57:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEo5gvB1tMz0+DQf5FE7j8ZbIPsLiuZs8AOPacEwaC5XaBLDMvym0ywAjWlxT2lzQUQ8H8P X-Received: by 2002:a17:90b:ed7:b0:268:7ec:51ae with SMTP id gz23-20020a17090b0ed700b0026807ec51aemr1570584pjb.41.1696413437995; Wed, 04 Oct 2023 02:57:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696413437; cv=none; d=google.com; s=arc-20160816; b=JsQrNZZKZxjZssh+LBbouLSumLC7NKIIuMxooDo8wrTlT0fbFMODTx+R2qz0iMVgOr ezFGF+uk64UIIz6KLcqzPFRy1EY3Yly82w1GusGvLnExSZamg+gbj7mcD4UpwCM4WlWE ayTMYNw7ZnoUZcpOwD7QWCndlvcr/LwNhO0nCwTy1u21y5JeYrJXG8sT/fGYr/H8VZiF NfRJG66yWmG0SqrH80l0mmLSDTVPq4W7G9csZIz0tjmu1UZT+Y+4pN8X8yoqUCHodzt7 3wEYiOSu5/JWIPopUzmFUkmkovg941ahk7MITzRjXK7v6D1WNncfug51HcE2keueDx6d SrBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=t3llrRzvIKILbc5TgXedn7Q8bVVVp8C9PO7vaMagqQM=; fh=C0iM1P1vh9Q5PWqP9WVwHpzUJPj3uMewFJDRbpjUWeQ=; b=G1ZgUTmzazvZ411rbLmS7eiAFJfQXQ08Puy5YCojLaSS7ZpEFWZMCt9m66tiaIKJUK +rmRSQzyqDy+F8l/4MMm7qWbzW3bYvSmC0q2JeBcEkEsxqRXgovjoKAugqSDMnvY15Q/ K0crDcyrUb1bY/tylSyfNdkBX5lNkHlKKLrKHx1fybrxb824FCjrAweUkY3ommb7/sIC ZjBMDNatm8kjUAIVgFEZp2P4RwxV3eERvL9R4MLuCaA6xEnJT2GzwQcpr0oP7+uzBJY+ oyNoWcWlTujCNfR+5oYZsuIVsYRdbP4VsFQ8xE0A4DSCTTZRAhN5aThqckYSX/62JYU8 OcKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KfOgvGht; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id gc16-20020a17090b311000b00274c6997c25si1210204pjb.110.2023.10.04.02.57.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 02:57:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KfOgvGht; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 595A181FDBB9; Wed, 4 Oct 2023 02:57:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241774AbjJDJ5G (ORCPT + 99 others); Wed, 4 Oct 2023 05:57:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232941AbjJDJ5E (ORCPT ); Wed, 4 Oct 2023 05:57:04 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72ED8B7 for ; Wed, 4 Oct 2023 02:56:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696413374; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=t3llrRzvIKILbc5TgXedn7Q8bVVVp8C9PO7vaMagqQM=; b=KfOgvGhtWWXIDiHsVzot17IqnJqvP0CbNDUekwdQzS4/laUj2w9PX5kinjz7QGC+RcqOg2 WJFNXwhFuPayArBfwjvc0ttyYwU6WuqqYuVo9A3qefM165hb8aTeVC2fc9YKbDL1maSbk5 1aiZdVC7ImJG3rfBs4xtbpIRWZ38b9c= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-197-qFRuRX92NemM2NI2simB4A-1; Wed, 04 Oct 2023 05:55:58 -0400 X-MC-Unique: qFRuRX92NemM2NI2simB4A-1 Received: by mail-ed1-f71.google.com with SMTP id 4fb4d7f45d1cf-533ca50404bso1607340a12.2 for ; Wed, 04 Oct 2023 02:55:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696413357; x=1697018157; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=t3llrRzvIKILbc5TgXedn7Q8bVVVp8C9PO7vaMagqQM=; b=l2ujlvLyV7dKZdI1LlEU6jT/G2ZX7U8nlP3T3ovhaNrI5+utGxIIp9Fcx/tFUIo7Ye QQZITGz7Iv2adbC5vFvicv0UOelgnBRSfqB8JsN7yLUs6NSYIYi/VC769WN71lp6Zi/+ yBzu+qox6oslf8uK1oYgirap5189Z2KDWFPj3/OEZfS8Y6mh2NwvTgHSMPKnXvfSWBDv wI6XSmovUoOqJsr51HOmSL85RZIAASEAa5MDEimwZTZatWkcN0KH5CQHRTb7jC3plyq5 j2BwN10at34nlWRB3ptTLrdnt1n7Tgn/UgpduKol+rhtdcdLnR7cc7806gwFr926pr25 kpmQ== X-Gm-Message-State: AOJu0YxFtiTHXwwNuwu5kbxMoIzpbn3PNNatuZAaxd8WXcgSWalpTYjc Y9AjB7Vu52h0yswvqF43Eknb3xvCfYegFLyFYjOf4fAin9XuZyFIrRd7OJaWxHmexuhO2EixRb0 LfAu9EO8UdhOVDkXStXY3tguN X-Received: by 2002:a50:fb12:0:b0:536:e03f:62b6 with SMTP id d18-20020a50fb12000000b00536e03f62b6mr1522887edq.30.1696413357193; Wed, 04 Oct 2023 02:55:57 -0700 (PDT) X-Received: by 2002:a50:fb12:0:b0:536:e03f:62b6 with SMTP id d18-20020a50fb12000000b00536e03f62b6mr1522871edq.30.1696413356839; Wed, 04 Oct 2023 02:55:56 -0700 (PDT) Received: from ?IPV6:2001:1c00:c32:7800:5bfa:a036:83f0:f9ec? (2001-1c00-0c32-7800-5bfa-a036-83f0-f9ec.cable.dynamic.v6.ziggo.nl. [2001:1c00:c32:7800:5bfa:a036:83f0:f9ec]) by smtp.gmail.com with ESMTPSA id dy26-20020a05640231fa00b005256771db39sm2170533edb.58.2023.10.04.02.55.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 Oct 2023 02:55:56 -0700 (PDT) Message-ID: Date: Wed, 4 Oct 2023 11:55:55 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH 1/1] platform/x86/intel/ifs: release cpus_read_lock() Content-Language: en-US, nl To: Jithu Joseph , markgross@kernel.org Cc: ashok.raj@intel.com, tony.luck@intel.com, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, patches@lists.linux.dev References: <20230927184824.2566086-1-jithu.joseph@intel.com> From: Hans de Goede In-Reply-To: <20230927184824.2566086-1-jithu.joseph@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 04 Oct 2023 02:57:15 -0700 (PDT) Hi, On 9/27/23 20:48, Jithu Joseph wrote: > Couple of error paths in do_core_test() was returning directly without > doing a necessary cpus_read_unlock(). > > Following lockdep warning was observed when exercising these scenarios > with PROVE_RAW_LOCK_NESTING enabled: > > [ 139.304775] ================================================ > [ 139.311185] WARNING: lock held when returning to user space! > [ 139.317593] 6.6.0-rc2ifs01+ #11 Tainted: G S W I > [ 139.324499] ------------------------------------------------ > [ 139.330908] bash/11476 is leaving the kernel with locks still held! > [ 139.338000] 1 lock held by bash/11476: > [ 139.342262] #0: ffffffffaa26c930 (cpu_hotplug_lock){++++}-{0:0}, at: > do_core_test+0x35/0x1c0 [intel_ifs] > > Fix the flow so that all scenarios release the lock prior to returning > from the function. > > Fixes: 5210fb4e1880 ("platform/x86/intel/ifs: Sysfs interface for Array BIST") > Cc: stable@vger.kernel.org > Signed-off-by: Jithu Joseph Thank you for your patch/series, I've applied this patch (series) to the pdx86 fixes branch: https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=fixes Note it will show up in the pdx86 fixes branch once I've pushed my local branch there, which might take a while. I will include this patch in my next fixes pull-req to Linus for the current kernel development cycle. Regards, Hans > --- > drivers/platform/x86/intel/ifs/runtest.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/drivers/platform/x86/intel/ifs/runtest.c b/drivers/platform/x86/intel/ifs/runtest.c > index 1061eb7ec399..43c864add778 100644 > --- a/drivers/platform/x86/intel/ifs/runtest.c > +++ b/drivers/platform/x86/intel/ifs/runtest.c > @@ -331,14 +331,15 @@ int do_core_test(int cpu, struct device *dev) > switch (test->test_num) { > case IFS_TYPE_SAF: > if (!ifsd->loaded) > - return -EPERM; > - ifs_test_core(cpu, dev); > + ret = -EPERM; > + else > + ifs_test_core(cpu, dev); > break; > case IFS_TYPE_ARRAY_BIST: > ifs_array_test_core(cpu, dev); > break; > default: > - return -EINVAL; > + ret = -EINVAL; > } > out: > cpus_read_unlock(); > > base-commit: 6465e260f48790807eef06b583b38ca9789b6072