Received: by 2002:ab2:5c0e:0:b0:1ef:a325:1205 with SMTP id i14csp297711lqk; Thu, 14 Mar 2024 03:34:07 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVzwy4GvV6PGzbmSg5zyPCWJ8kdod15Db9NFXgVWCBiN4cI6mAXx1kV8YqSrFzH1qVQbYQD93clhn8P8Xns0g2kpxTKkg/gF1C4wskyuA== X-Google-Smtp-Source: AGHT+IHKcHOCKHL8UfFdUwqz7XETv5xsaymK4suI7cZeGvJ76zBuIoyQpQJHLK5ioIw9oNQvq4YT X-Received: by 2002:a05:6a20:3d28:b0:1a3:30a8:2ad6 with SMTP id y40-20020a056a203d2800b001a330a82ad6mr1804830pzi.10.1710412447260; Thu, 14 Mar 2024 03:34:07 -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 u6-20020a656706000000b005d7957d53e6si302441pgf.678.2024.03.14.03.34.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 03:34:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-103125-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=IV1LJ3Gi; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-103125-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103125-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 E96412829CE for ; Thu, 14 Mar 2024 10:34:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B851E6EB50; Thu, 14 Mar 2024 10:33:50 +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="IV1LJ3Gi" Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) (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 33741347C1; Thu, 14 Mar 2024 10:33:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710412429; cv=none; b=PoJt8cOGpeZPXj6NhieQ9I3El2+m/if4D5puaw8xe5i0HiKup0tTLn48UkQAiLjQjAyCHKs6LTkkoRSbwWAvUru7oR1JwazTlZZRyKDRYovaby/TF0bQGvV15s8vStp9LsRHZUMdjKjpr5xJS5ux0s/o26iTWy9IrNO5O/IZKWc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710412429; c=relaxed/simple; bh=iZDy04kALp0HO9vpw+exKughW0nV83r8fp9t6svxXyc=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=Gh/OZlsJRyN8HZdCreaobwsmojDwrlMWSnWwBrZCTvBkv3VaIxLMtN/RKmYxcOGsfBj61JK9PDB+DuPIZA68h/OLXtRaU6m8rVEsNZPc3JDDP2T/6gnILwMEvDn6BFivKnZs+L+u7iPwJPb1wskxxSaGxCpS22ZzGKiekieJ660= 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=IV1LJ3Gi; arc=none smtp.client-ip=209.85.218.54 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-f54.google.com with SMTP id a640c23a62f3a-a450bedffdfso84418166b.3; Thu, 14 Mar 2024 03:33:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710412426; x=1711017226; 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=jue9nUfRRiSlNQWu5LcHhmk+uFTWQIyCfZh4ap/Abso=; b=IV1LJ3GihvXKYAysjrRNN812n2VHu6P4gAxZCVosMBx3NFbJXxAubv1LB3EZkQkNbQ HzZvtwpQAvN5Om5AbS65xCg42qgRTncW2icvdsFwGhwu3q9JxP06GUL0rakASNyu5t5V vKlDrMMbmaoTavAUdX6i1PWaAmuiKvco6upFTsyG29UbKFFc2/wpZSp0Ctu3nA35NfB8 wC+Ss9A+SI5+WWMpFClu4r1Y/G8bk81SBStYMzL8SBerLlqVI13qc0POgrQdSvfbBs/z nxtiY5DSYKmwPkBjqwpJm8eJ7pu7LH1NAXcrMppjr+VgcFk+1QUfD/hfpz71rCBikly+ msDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710412426; x=1711017226; 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=jue9nUfRRiSlNQWu5LcHhmk+uFTWQIyCfZh4ap/Abso=; b=YEOiq71JkhlJPSSrh2gvAd6izWic/wT77Idx3rkoM6QrJWGqLGtuA0PbsxpS5/vl8n 2fR9xEFmcl8hsX4s6H198147VXkHXUmiuy4CpFClswpukH0bE6gac4QBfIdhMkr0KN4E +/WQ0+nmU1Ixq9GcomTKMkUCP5BX6TEEnkPdAksb60gnsHXvvarmDV6vSJ471O3rSKR5 krjtuA9gNcbDJ6HNg+XNE77IFPwpuMidvIRioCDKgIaCZjbEaK8Z7Fd06qdTJP+NhQiV B0qsNsCq3YGZ1QoLHAJw20HlKjflqd0kLCTv6Y3mECPVUZeajlWbb1k/KBEAYBpuT9SU 0l/A== X-Forwarded-Encrypted: i=1; AJvYcCXYR5gocCfB7479BRJ7OaDxRg5ssZ7Ssu0Kc8YrcxmwVO5gseYOzSFt24Tu3FIsGRnWEIKLmkHe/mikE9VeaI6iclF14DLEagA1wWncP5LJ0ouZcXPphdlHTLEraqUV0WaEDyZtAbDNhA== X-Gm-Message-State: AOJu0Yy1Yb9aomsCoiz7a9tvmkNbO/KT/BAw6+JcJmILJs9Bk/K6iVZa yLSicyF+VLS3e+A73VQEXTC35RQvgpUKhwA9N5zK8oNDF3E3m7jnxTO8gNyYmfTrDoT+134WYw1 OLtexhr+WrTcyAkLe9VBVPLA65O8= X-Received: by 2002:a17:906:3752:b0:a44:8fa9:d36f with SMTP id e18-20020a170906375200b00a448fa9d36fmr927863ejc.41.1710412426337; Thu, 14 Mar 2024 03:33:46 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240314084531.1935545-1-gnstark@salutedevices.com> <20240314084531.1935545-2-gnstark@salutedevices.com> In-Reply-To: <20240314084531.1935545-2-gnstark@salutedevices.com> From: Andy Shevchenko Date: Thu, 14 Mar 2024 12:33:09 +0200 Message-ID: Subject: Re: [PATCH v6 1/9] locking/mutex: introduce devm_mutex_init To: George Stark Cc: pavel@ucw.cz, lee@kernel.org, vadimp@nvidia.com, mpe@ellerman.id.au, npiggin@gmail.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, linuxppc-dev@lists.ozlabs.org, kernel@salutedevices.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Mar 14, 2024 at 10:46=E2=80=AFAM 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() Missing period at the end. ... > Suggested by-by: Christophe Leroy Needs properly spelled tag. .. > +static inline int __devm_mutex_init(struct device *dev, struct mutex *lo= ck) > +{ > + /* > + * When CONFIG_DEBUG_MUTEXES is off mutex_destroy is just a nop s= o mutex_destroy() > + * no really need to register it in devm subsystem. in the devm > + */ > + return 0; > +} .. > @@ -19,6 +19,7 @@ > #include > #include > #include > +#include Without seeing much context can't say if there is a better (more ordered) place to squeeze a new header to. Please, check. .. After addressing the above comments Reviewed-by: Andy Shevchenko --=20 With Best Regards, Andy Shevchenko