Received: by 2002:ab2:2994:0:b0:1ef:ca3e:3cd5 with SMTP id n20csp446985lqb; Thu, 14 Mar 2024 16:37:47 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXScbANsOZkbrPWlg3AF9Rl1FXqnzsJ/Nt498ks3F6jB64wdcPy6g00UCdWboMl0oSih4xdYU5pggGiJB8cFjm8Zn1HjS5bB/JLQvNAJQ== X-Google-Smtp-Source: AGHT+IHcft8kNFvcCoyiPtdFbHskj0HroU6YSb66PVj7j07Y25EYiAAvCbIxOE4SwFzdXk/+IOFD X-Received: by 2002:a17:902:f790:b0:1dd:df89:5c2 with SMTP id q16-20020a170902f79000b001dddf8905c2mr5010721pln.22.1710459467204; Thu, 14 Mar 2024 16:37:47 -0700 (PDT) Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id m17-20020a170902f65100b001dee8339b9bsi989043plg.24.2024.03.14.16.37.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 16:37:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-103912-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=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=UgrDhKWy; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-103912-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103912-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 88185282DF1 for ; Thu, 14 Mar 2024 23:37:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 17C9614F62; Thu, 14 Mar 2024 23:34:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UgrDhKWy" Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9414714A81; Thu, 14 Mar 2024 23:33:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710459239; cv=none; b=WbUxa8mN0RJfFRZcIS8ItAsyoeY7ZjQsez/0QL4XsmInY2cTALp656/wcQHrF4dVoXNAa0RGF4yJxDKfFMRksxWeZSplrQ5w0dsQI1B1FUjNa6NplLGge0KBKStS41PGqNQSLBUcTyRjeYYjTTVO530bKXVPgVoKYt7LpzULgEs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710459239; c=relaxed/simple; bh=5cD+Utc3WZAxdjmYk1QQU76mBRdqBdbJ5yIsDLbC17g=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=LamkA9QTfTNEWDYkKdLZBhUuz9VhqwRb2ovrMyldBqYXFMmHGebBbiNpRVON34A+xUtLyq+u7w9qT+/NS2wj9/jINPq/38QlIW8RzaWa+tuNuWvjzOxgrRetjv1pV6lT3i/rmTH86DZWT7xT/Q8mmU+YzKu2ztiftGDr7TYySg0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=UgrDhKWy; arc=none smtp.client-ip=209.85.218.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-a44f2d894b7so160924166b.1; Thu, 14 Mar 2024 16:33:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710459236; x=1711064036; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=9/n7FNd6KF/52kgUyrLcID4ELpWfz14+WSwkN1SHe18=; b=UgrDhKWyrH6B5y5oCd7dl2R7JOVkrp+96seSLJuHH7H+w64GnPbEAHvS0rUGlflhVW nyClZyR5Oixzq23uT+YwU09W4L4o2OkW391KNU3gqRYEfKUTURHhmTItd/baMqbVBKpZ xPRHpI5exFsNAjHOLKA/G26XcDLaDxuX6a253KIKixHCfC3GbO+CSXYOxGv/BI/HT1C7 ard4/tZ+7PuFTfMnojVZ2MNsM+huYE9DGsSTHuc6IjDYkU+MZ+EEtlX9c40/Le83VxwH RbZjqE0szemiN58bvZlZcnLpkqlLbAQcU6V6HrhR/Wl6Hpef1toGV5gaLZuVGD8qOVTk nsXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710459236; x=1711064036; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9/n7FNd6KF/52kgUyrLcID4ELpWfz14+WSwkN1SHe18=; b=CheE/z8Zxp90PXqUHozlDlvRfcYgFkiGLbJrso91wIn9Y9uuVPL2wsGW2ZGjuCZLWW k06kTbzzU+VxCMUQXgRDhjNkL9Ozp3lSlX7PlsZD92hy8H0GQ0zh0KaVR8phbah5z6wx RUuIyv0mqCghYWqsppTqSGL5TzIAvnoEIPdTK70uVAVxKmYyEBKWCe/9GFGvMi9NBQrL FlsvOg8px4lLQMEUrLLzk8dxdQzDStRVK3AARHaq0WnekViLKU5quarjJEr00U3GWjr+ D79heBe7H2N/MxQLPH9mQiKJMN096MBT1wo2p3Y0z+hod4G9nMnP8w/pGGS2MdrqqNCj qDZw== X-Forwarded-Encrypted: i=1; AJvYcCWn6NUayyVMeHW5iO8B5yNjTMv8ab5Pd3O+jvlXwI0v/YkRgLmp3ksMzdjoInwFnjOY7JcQWY2roYGsXfzi+S72cCLk2kDS9NNGciVklDLhRgvaIIbgQyZ1dJ93QbI7HsEgiFsKXihnEw== X-Gm-Message-State: AOJu0YwccX4qRh/sGeblorfJb4qHw3+yI/E2B+B1RtrPkGdrv2+TC5Lk hExCLbsdXCowP6dVrO9KTxCgIOLJdspYt9Jc3XX+uhuXS3RkgfWQhAcojB+aAZlXAOqDZ2L45lf QwdqsiPGSEZBdYd5A/I0MggbHqlU= X-Received: by 2002:a17:907:c313:b0:a46:58b4:a34a with SMTP id tl19-20020a170907c31300b00a4658b4a34amr2815716ejc.47.1710459235740; Thu, 14 Mar 2024 16:33:55 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240314201856.1991899-1-gnstark@salutedevices.com> <20240314201856.1991899-2-gnstark@salutedevices.com> In-Reply-To: <20240314201856.1991899-2-gnstark@salutedevices.com> From: Andy Shevchenko Date: Fri, 15 Mar 2024 01:33:18 +0200 Message-ID: Subject: Re: [PATCH v7 1/8] locking/mutex: introduce devm_mutex_init() To: George Stark Cc: pavel@ucw.cz, lee@kernel.org, vadimp@nvidia.com, christophe.leroy@csgroup.eu, hdegoede@redhat.com, mazziesaccount@gmail.com, peterz@infradead.org, mingo@redhat.com, will@kernel.org, longman@redhat.com, boqun.feng@gmail.com, nikitos.tr@gmail.com, marek.behun@nic.cz, kabel@kernel.org, linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@salutedevices.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Mar 14, 2024 at 10:19=E2=80=AFPM 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(). .. > /*** Unrelated to your patch, but there are too many asterisks :-) > * mutex_destroy - mark a mutex unusable > * @lock: the mutex to be destroyed --=20 With Best Regards, Andy Shevchenko