Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1030944rdb; Wed, 6 Dec 2023 06:58:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IFof+5+IGr14kgo9V/46pv+ErsWqPqLPtsnRvxyZ+LpakYT3L9llSipvv1wZKzjLUFN5jp8 X-Received: by 2002:a05:6a20:be03:b0:186:2389:a73e with SMTP id ge3-20020a056a20be0300b001862389a73emr1145231pzb.55.1701874725928; Wed, 06 Dec 2023 06:58:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701874725; cv=none; d=google.com; s=arc-20160816; b=aRZjvJVh84ATWd1q9NmU9Kyw6UD8d1P99Xe49AmFun/wCy/sKzPuVO4JrAGUV1xx5f MYB3NPY4r3JiilJWH//3dCI7nPIxeRXZsF+Fq2lfNI7kn3vUHuLYhxN98GWZZtogSeRJ J9HtRjD93hzOQaBlhRBR3D2WyHVDBFiqVixrAq8fzhyd6tgYWQT9aBbLYHOoAQgNPHUn Y63NpAuvQ3K84BOeYFZ3cdtJt8+Fdkt+ENNB30L13cGa7u/9leNDU0i9mKngHyr0n864 SVSQpW6s/x3qfALCUrJqvKgxR9b76SkmqVUebMNcF5bs+DjE8GLkXGfSN5YXmCOUq5eb Dk4Q== 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=lI8W6CO+u1S10tMvsZNrVhiLtm/T33ov+fTqgOUmfWo=; fh=SyNyR4SvaluAi4oalWYxHaTETZ0edNvpDXE5NzJoFWI=; b=Snc9T9XSKJbX0WXdvXYPsMlRAYPXEEDRWOQM1yCg7w6weEvHmokicW6uavqV3BZMol GgeR1gv1X4w6kalAM4psIqtC9FxjvoVVUgMOEfFVINe5kIcYRZZ6FB1zT/3qEbywj2pR fjwuIXfyhIfYJxfRExeyzHc0i8XRI5WLz27VlUDYxKSY7ZmsXye6nc9q/xy3KY9I1Rla SMM7x7dEUb4owoVLmA+gLjxPgwIUF6luA2qd8YPF1otBw07OZ4GCXzkDPLgK7r0OVhAN B3Vipp4ql8ooQABpkoIKO4ZQypda8Pyz1Y1ngmUGfo4YgPgfTIszvT/rI7Mptn831ihs gcBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=i475HHpH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id c26-20020a631c1a000000b005c20241fdf2si33896pgc.49.2023.12.06.06.58.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 06:58:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=i475HHpH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id 3975A802ACCA; Wed, 6 Dec 2023 06:58:43 -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 S1379025AbjLFO61 (ORCPT + 99 others); Wed, 6 Dec 2023 09:58:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379000AbjLFO6Z (ORCPT ); Wed, 6 Dec 2023 09:58:25 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF7A2B5 for ; Wed, 6 Dec 2023 06:58:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701874711; 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=lI8W6CO+u1S10tMvsZNrVhiLtm/T33ov+fTqgOUmfWo=; b=i475HHpH2DLydJNBRo85fJyNhaDqqI6F6Wx7CcNHyWuWSllUfFWEalnBo71c9MbOhIUo5r V1XD6Xyzy/1z9JLb758dTqzA3MJaSzgGIZEd3tsnKKmspOKOtSFtTtgvzXrpXDnyZt1HiR xh22OgrJq9ibzvEx+xE/q/W4458lxWI= Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-118-IqVHfIo9PPiV4gfpXZ7htQ-1; Wed, 06 Dec 2023 09:58:26 -0500 X-MC-Unique: IqVHfIo9PPiV4gfpXZ7htQ-1 Received: by mail-lj1-f200.google.com with SMTP id 38308e7fff4ca-2c9f5bf236fso36091881fa.1 for ; Wed, 06 Dec 2023 06:58:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701874705; x=1702479505; 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=lI8W6CO+u1S10tMvsZNrVhiLtm/T33ov+fTqgOUmfWo=; b=LMS4raEQ4qOjBslWx779la4HjqVw7RS/R9D56GuwS2f9Yh1uPDU6UNSFCDBjtelY+M Rhf4txrdleI94OoaCIf54IHhTlh06XlC/PCPO/D1I+EYubQmclv5M+9O0e/gUDFf1GCu 6rTvDwF4v9XkiqA6sO+JxPYw/mI4moj8fu7EQFUbCo4ivFejrEZz30QXsfLtcstYBBBb eqSDly5TEJAlHb6wh4BpERTn5IOO2IyFb7TTLx0TmpdlOCKb7+XaxrX2ig6hX2EALm+Q i1RTfaIdtS6aW/VMLgK5nlekvn+z5yxfbqbiwHK44DmfDAPdH8LeYl45eYt8M7pvuo3u 8KDg== X-Gm-Message-State: AOJu0YyzcqU/snP4clqXlU1eOk9vHcZ/HdZoSDhZdzfy2G7wG19tugb6 JhwyXy2LR70BiGnIgIvuw2MnFkRd7lCHOH1IeSP85Tq2PgVHTlvj9zdQxklofT7j0S4+M5XbI0O IfxW4oy2eB38d/UnfcChVzFT4 X-Received: by 2002:a2e:879a:0:b0:2c9:f2ef:cf14 with SMTP id n26-20020a2e879a000000b002c9f2efcf14mr784403lji.67.1701874705516; Wed, 06 Dec 2023 06:58:25 -0800 (PST) X-Received: by 2002:a2e:879a:0:b0:2c9:f2ef:cf14 with SMTP id n26-20020a2e879a000000b002c9f2efcf14mr784392lji.67.1701874705190; Wed, 06 Dec 2023 06:58:25 -0800 (PST) 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 br20-20020a170906d15400b00a1dcfd8f95csm27081ejb.37.2023.12.06.06.58.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 06 Dec 2023 06:58:24 -0800 (PST) Message-ID: <6381d523-8f49-48e2-8576-b74a14eead30@redhat.com> Date: Wed, 6 Dec 2023 15:58:23 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 01/10] devm-helpers: introduce devm_mutex_init Content-Language: en-US, nl To: George Stark , Andy Shevchenko Cc: pavel@ucw.cz, lee@kernel.org, vadimp@nvidia.com, mpe@ellerman.id.au, npiggin@gmail.com, christophe.leroy@csgroup.eu, mazziesaccount@gmail.com, jic23@kernel.org, linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kernel@salutedevices.com References: <20231204180603.470421-1-gnstark@salutedevices.com> <20231204180603.470421-2-gnstark@salutedevices.com> <48ea90f9-922d-4a03-86da-cbb5aa9908b6@salutedevices.com> From: Hans de Goede In-Reply-To: <48ea90f9-922d-4a03-86da-cbb5aa9908b6@salutedevices.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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]); Wed, 06 Dec 2023 06:58:43 -0800 (PST) Hi, On 12/6/23 08:56, George Stark wrote: > Hello Andy > > Thanks for the review. > > On 12/4/23 21:11, Andy Shevchenko wrote: >> On Mon, Dec 4, 2023 at 8:07 PM 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? > It's already included in linux/device.h which is included in devm-helpers. Should I include mutex.h explicitly? Yes you must explicitly include all headers you use definitions from. Relying on other headers to do this for you is error prone. Regards, Hans