Received: by 2002:ab2:5c0e:0:b0:1ef:a325:1205 with SMTP id i14csp301056lqk; Thu, 14 Mar 2024 03:41:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXSWm1mXXNM7HpnVc1cwkbHIJy81YRj5DZ/ia08TbQ7/VoZtujBLvTSX3nguTkB6HQembGTjMyIVeWFJg9Y1SZAU3TQPyG3rQJz7/v4hQ== X-Google-Smtp-Source: AGHT+IGURGiDand50xxvQePAh9cCRsdTKlIGSTQAN5OwUoy/o2HIDvijZdJ5M7WysgpVa6conN7s X-Received: by 2002:a9d:7982:0:b0:6e4:df67:e2c9 with SMTP id h2-20020a9d7982000000b006e4df67e2c9mr1376985otm.17.1710412883300; Thu, 14 Mar 2024 03:41:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710412883; cv=pass; d=google.com; s=arc-20160816; b=0mGg5cLiWqywdnX7JrKlcMsJ3NVw48ij+bRCricqFT8o0BxG/pG5nQF8tHZH5vJVks 4p0ZOkya9ayzex1e0Lx7y3fJU3yo7oVvIxFa9L6LNSIi83IcjzFxObCTx8/8UR3j50Va Wj6pRwQBqdmOkAlSs8HQMbucD3o75vvAfrDahAHIJiLTBfI5ixvC8CpjH1yBufnUEzWV PILstOWx2L7rcGBYeaFqYtc2Sx0wa7tVaKjYAGHSH+EQG8VICXc0Xzw9tBzXNmwbhkc4 nJZfwQeU9ZNEKfDEkqvtZM402s1836EP2zb/ZQAH/IB4e+kRybZXNVgq3odeunNxYhck r5SQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=NKeKefPF6egagCg3IVA3tpwNCyhF4yfvOCdSY7XKMV0=; fh=C+mAaX4YyoIwf2epE7FwEzvTJ97aDFpK2qBuvPjmHEM=; b=jr3l9WKCyLYDImRQatRl9VzITjuaRaB6lxvk5W+BIzpmL8ThoK2XCVUHgP/9vqpUT4 +DrrTLf9OdDpuDI5lI5bmwYLt4SRt3ncy2wazOMVcO5Q3LaiPknNCFoTCD7oJ5SU5maw GT+7zE+e/AtYfw4lkdax/ZJG4m8RjFqh82LRMK22V2hT4RVa2Q9mQOh57FYNuomVfo+g 1yPWZdMTosEKLzm8SRpQdfjf71WHdWHE3geCduacdwJ1p30aRAj4YBqHB1OMUoVDi6iv p7J3PIS09nbIfWzcdp3Jp4AnOTyKzBRULxXwa6yotnYgg0zE1TOb+P64U3J/3nVSx9JK 6Q4g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=d5NqvJSi; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-103139-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103139-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id s1-20020a63dc01000000b005d8c5595ddbsi313402pgg.271.2024.03.14.03.41.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 03:41:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-103139-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=d5NqvJSi; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-103139-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103139-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id E9574284E6A for ; Thu, 14 Mar 2024 10:41:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BA5F46DCE3; Thu, 14 Mar 2024 10:41:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="d5NqvJSi" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D1D165DF0E; Thu, 14 Mar 2024 10:41:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710412870; cv=none; b=oXHHzzRx8Q1oKO+RC0DZyVGgpqdpBxvd+P8rDryiXVTCGB+WnRiMhWdJchx6HDPPKsWuWFVVd/3Rdotk7jMRdNIffz5ZniFcjgLEQ7lsyZ1Rx6n2TdpKFCxH6Ykp9u907Zhe/9iLHrC2PPyKbwsBNQ7sdBCzsFTPdEMCV8ukhlU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710412870; c=relaxed/simple; bh=NKeKefPF6egagCg3IVA3tpwNCyhF4yfvOCdSY7XKMV0=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=GIzPZTnugTCdGgv7lzHMQ0EJvnXO/Yvqco7uQnadOVoBtPLuJIntM7B5OqL+SsIAS530v0nt6VLp8pY6LcgAKanJ1vzwu5wg1E7qu9YDevY4fniPkriCy4WAbgnVFPC6+TOSoXpYZTCuMjg1qEmI9up7OYOQt9Ern9KG2rObcd4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=d5NqvJSi; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63136C433F1; Thu, 14 Mar 2024 10:40:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710412870; bh=NKeKefPF6egagCg3IVA3tpwNCyhF4yfvOCdSY7XKMV0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=d5NqvJSiJLIuJ8UfZzIlO+3hWCpzNH+tKOmCRquj6mVZpDuZpZPfJJqRpiTe1Ufj+ 4CDxEWnc+DhHW6ZcQVNa0FJm8l5qm51+tnWI5h5X30tDvkkmcbymgTgjPhmVu+skC+ fhKJyOoLRmBbkxKV5O5F7UCo7jjHlmQ4kp6QMh3tIcZtZetbwPw8vsjZKyvMt5lhOj ELghCvaa4Bip6VGbyvfldZNrilS4haYwvzT8JHXtvH1jG6+sMBV9f26/qUy7ajiMfM pvIThJ8v0fM4ud0wySZ1/ygDtkyG2wb8njNYj/jQ/p/QMHHarXbr9fLq/P0ASW4pa5 cTFtcNALYcL7Q== Date: Thu, 14 Mar 2024 11:40:25 +0100 From: Marek =?UTF-8?B?QmVow7pu?= To: George Stark Cc: , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH v6 1/9] locking/mutex: introduce devm_mutex_init Message-ID: <20240314114025.1e27399e@thinkpad> In-Reply-To: <20240314084531.1935545-2-gnstark@salutedevices.com> References: <20240314084531.1935545-1-gnstark@salutedevices.com> <20240314084531.1935545-2-gnstark@salutedevices.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.39; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Thu, 14 Mar 2024 11:45:23 +0300 George Stark wrote: > Using of devm API leads to a certain order of releasing resources. > So all dependent resources which are not devm-wrapped should be deleted > with respect to devm-release order. Mutex is one of such objects that > often is bound to other resources and has no own devm wrapping. > Since mutex_destroy() actually does nothing in non-debug builds > frequently calling mutex_destroy() is just ignored which is safe for now > but wrong formally and can lead to a problem if mutex_destroy() will be > extended so introduce devm_mutex_init() >=20 > Signed-off-by: George Stark > Suggested by-by: Christophe Leroy Reviewed-by: Marek Beh=C3=BAn