Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2891684rdb; Mon, 4 Dec 2023 10:12:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IHxIWjK/tEI/HBzAFlmMdpxAdM4sQhWf23VHkKRh0ALYEeoB+H5SzLhKb8RLDr4V29gaGWf X-Received: by 2002:a17:90a:cc01:b0:286:9204:c617 with SMTP id b1-20020a17090acc0100b002869204c617mr1242513pju.88.1701713564762; Mon, 04 Dec 2023 10:12:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701713564; cv=none; d=google.com; s=arc-20160816; b=wpnrU86QgOBK3PVQNXun6+EoxdE8nCtU3Cwt+HzeBR6OXnEilIJmpsy/cPOR5/N7Jl Xi4yrmULWn7TntktNUtYFDckw3m3cLDT7Sd+P12cOfcQCb9rg2rXsEmoylonlphqHg3c H5NeKvy7NJ32ZY2UcrwztWmOuBze8g6daAwoxHk/w3bUi+MUwW0aYu3veQB9/5Juhi8W vnJehHdTPSZomiAmHD3H2DYgcE3+p3/0iQFS9PUmAHUCfQ7YKYtDEbpqMWF5a3X1XT4/ gCAD3ZBsDp4dF1KeSGCH4bzZuVEY6d+FciUy+OHt+LEYKFHxHRRD6QsROQY05gSQx8VQ F+3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Be0ZogmXWjyNCUnYEc6/k4S4gqJjfHZoxi6an2eBP4w=; fh=ip/ReUgbAdiCih6pv53ThEVT4fVgWS0/mHlkk4qe+G4=; b=rR+j/HsxT6EEb6bQYwTOYWrvMVkYbrR55etO3GlM/h7Q+/eKxiJQj/1kbK8LoqAorF QArHwv+FYzP0eU34apBGmxB1h5EbsG//ARTt9fVHFPiGqzl3GLi7FFg4c+vtsORru4hQ ScJwrdWEUxIwnTfkuHvRseeI/2rcYf/pIIZIK5tEv+fnT3kpVvlrsF9bFjG7bgfLWMMj VQbVIVKTq3dgOZqTwjiuoIqURUUHXOOwNDaEVHKpl7oKmy3e+RqSOLAeLuizOuEP7b1t 0BfJtWPmIO4rx4mamqMDb2qJngObmRtThZi61tdFTVgi1fRqP33nIMcxX6ZOuhcFYRBS 7c0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Mysn4YBc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id fy22-20020a17090b021600b00285ebeed85fsi2544037pjb.123.2023.12.04.10.12.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 10:12:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Mysn4YBc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 346CF809A788; Mon, 4 Dec 2023 10:12:42 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230303AbjLDSM1 (ORCPT + 99 others); Mon, 4 Dec 2023 13:12:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229518AbjLDSM0 (ORCPT ); Mon, 4 Dec 2023 13:12:26 -0500 Received: from mail-oo1-xc32.google.com (mail-oo1-xc32.google.com [IPv6:2607:f8b0:4864:20::c32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF191B4; Mon, 4 Dec 2023 10:12:32 -0800 (PST) Received: by mail-oo1-xc32.google.com with SMTP id 006d021491bc7-58ceabd7cdeso2886343eaf.3; Mon, 04 Dec 2023 10:12:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701713552; x=1702318352; 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=Be0ZogmXWjyNCUnYEc6/k4S4gqJjfHZoxi6an2eBP4w=; b=Mysn4YBcXy5a/Gljr3CbJzSNPpVCqVPC3/4LUH/IBBiJk6wtFKZ904Ztx8896To5VS Qg1sawLZDCRh2Rtdmz2bhKX1+0ooNyVnVXJbClxxEha8zWg5D8L0Y9+ggsHdiQ25WuRS sk9XpNm9OT2uzjxk3SqE8b89CM0mM94cK/zH4iw1E6OLcNCa2umxYkmpX1WJw6lUzITq oNRcqb6YPgocKe7YZA/XMy5NT1XlCgh5wzjf+n5TB0RTTKc08oNBh7m/IIQDdP/UZiq3 StJ48xrZgfNd3cV+R4R9a1XOsJAwY4YCU4PC9xLeEKRe1E1q3HXwnUDqMOA09SuHA8Cy 2c2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701713552; x=1702318352; 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=Be0ZogmXWjyNCUnYEc6/k4S4gqJjfHZoxi6an2eBP4w=; b=lEP33tvhpyG2fQspe86wYMDuiDVfsFE0iD9VtybZ2/65mJNjAA09NtHNKNjfLRzdUD yTL90OREUiQvQwDRA5qyNGJ8hHPI7Ma2SU7hWSjQXbkY8l3MHNODyzBSA0py5Iofv4Qv uZ9CSe+H6s8sCCrLUUvJZi46Ydojr6K4Pf27F9AkqLoQoB/gSH3Oep+VlOTGZXXHinjP T7qlHZr7N+W3JOyYGUaN8cXOC5At+HgqdIvDH4LMtXadwF+LIZAcvDekaLgRyezOrJNG aZM5/Bj+/dGMac00MeBNaOYqZ25MkqBnp0oO6VhTX8ieC6wUaCD9ZNq8rqiivRF4qG8z Fg0w== X-Gm-Message-State: AOJu0YyPO12eAfmQA8WvL908UPBaxSQPerozcJ3U2fw1SvUSCh5FZXlm V5EphpgtDJYUW/eJD1o3rhBt5OP/GVa+ohDLv3o= X-Received: by 2002:a05:6870:d207:b0:1fa:dae2:8406 with SMTP id g7-20020a056870d20700b001fadae28406mr4513257oac.0.1701713552007; Mon, 04 Dec 2023 10:12:32 -0800 (PST) MIME-Version: 1.0 References: <20231204180603.470421-1-gnstark@salutedevices.com> <20231204180603.470421-2-gnstark@salutedevices.com> In-Reply-To: <20231204180603.470421-2-gnstark@salutedevices.com> From: Andy Shevchenko Date: Mon, 4 Dec 2023 20:11:55 +0200 Message-ID: Subject: Re: [PATCH v2 01/10] devm-helpers: 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, jic23@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 X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Mon, 04 Dec 2023 10:12:42 -0800 (PST) On Mon, Dec 4, 2023 at 8:07=E2=80=AFPM George Stark wrote: > > Using of devm API leads to 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() is > extended so introduce devm_mutex_init(). ... Do you need to include mutex.h? ... > +/** > + * devm_mutex_init - Resource-managed mutex initialization > + * @dev: Device which lifetime work is bound to > + * @lock: Pointer to a mutex > + * > + * Initialize mutex which is automatically destroyed when driver is deta= ched. the driver Have you run scripts/kernel-doc -v -Wall -none ... against this file? I'm pretty sure it will complain. > + */ --=20 With Best Regards, Andy Shevchenko