Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4603448rdb; Tue, 12 Dec 2023 04:33:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IF4Gj9Nw/+w0U4ye6Z62XYCNTsA2uEKsU1dFsuPP1i7r3k6kGsoVb8tgeZHLbxzWLp9umYw X-Received: by 2002:a05:6a20:3ca0:b0:190:e5a:830e with SMTP id b32-20020a056a203ca000b001900e5a830emr3134030pzj.46.1702384388627; Tue, 12 Dec 2023 04:33:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702384388; cv=none; d=google.com; s=arc-20160816; b=bmrY1m2JaD0p15Pi/4GnvF+hLwYWMkupdlXbSq3KhROoKDnVNqOn7m0ya1nN2Zo1X4 CbbHP7qv011970aC0g5bMiOs+Hk7+1snOpWfILnMJ3sdFCyIR+pz3OjcMJl8y6LrNuti LYTzvq5mjr8/qeCSSYTVvIIi1PiNkxVIUhM02BReCoQwj9Wn26O3XWFK+KYzNSYOuHEq vCCWr4Wx9AokN3TA7BtyFstCSEDnJFeriMed8bXay9tPTmJ8ogh+zu0VgHd0QGhtb2WT 5kdCaubOXOOeAsMieLiaPnVM4zpxmOQFle156Xxy0/PwMlJEnWF1sVFPnhazL/gzviO4 //Yg== 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=S4iQ3WOkHEblQ3xu0B39kuBfSgqaQxZyrXhGlk5rPik=; fh=9mnnky+j06lU8Q9+LJHsRtuYzN8YjfD1IZvVBJ78pWQ=; b=0N6LbDLkXwx88obRI5PPvGV4qY57ZIvSajGdq7msgvkv/n9yrR/o6uHv+IintrFOQC 2LOVkGQe6KNZ5YH2kZkiBcSqoCnkySmszyjNzlgeDnXXjWF7aSCZ1e/up8YCdTzNdWRl R8GaBsRIqd1XpjDtVc3QjKhXT2WZTCTchzpKYNfgiXUnWLlIzp14BQyZ8tv9/UyjC4GO 6AP8yVSjZs+k3F4CYxxLjwcFpp/VPMoZ6DfDmA3qciG8ZrumWVyg60/A+2VVA80svesk KDMZV6bko8oRp+LuJ4LWhPCix9ZRmPqTpX6JGnBl58MFzeuHs620G0Lb2u25YPjK18nH UH5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AnM0wMWV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id v22-20020a056a00149600b006ce3c0dd603si6859079pfu.340.2023.12.12.04.33.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 04:33:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AnM0wMWV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 03CD3808A368; Tue, 12 Dec 2023 04:33:06 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346480AbjLLMcv (ORCPT + 99 others); Tue, 12 Dec 2023 07:32:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230234AbjLLMcu (ORCPT ); Tue, 12 Dec 2023 07:32:50 -0500 Received: from mail-yw1-x1133.google.com (mail-yw1-x1133.google.com [IPv6:2607:f8b0:4864:20::1133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3C249A for ; Tue, 12 Dec 2023 04:32:56 -0800 (PST) Received: by mail-yw1-x1133.google.com with SMTP id 00721157ae682-5e19bfb258cso11833147b3.3 for ; Tue, 12 Dec 2023 04:32:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1702384376; x=1702989176; 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=S4iQ3WOkHEblQ3xu0B39kuBfSgqaQxZyrXhGlk5rPik=; b=AnM0wMWVUuiYWw4wNu97nWbdaoKXFgBgbLDt9rxZkcVyKxx9E6Mi/Zkvh97AoyrSEH ZJlLfgOS43VfjCmDOir0qxdYfTG8wrvuvubl+cF2tnucGD5QPAHntUo5UYLgbVWI7xaK lB44IDsb+/U2CizSq50gyN9mLevxwuc4Qp9KYSViTPWn7ntCHME8zv9gOLh9wnge/Kg4 4Y8jQmtl6cZT3K9gxt8b+BV4tQFHZsnunqpLosjQJmH2m3ZElao+gAZnFYgGR9bKwHzp eO+9VUxIbtoTqhf6VD/0tgcKdZbRnQlLHE8wz6KvRaAGwJUdZUQWCPfWieFnmCPkF+gz Xm1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702384376; x=1702989176; 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=S4iQ3WOkHEblQ3xu0B39kuBfSgqaQxZyrXhGlk5rPik=; b=LW0rkLBpZ9+mvJGaCzY54kHhSJiTE8TVEZpVBt7jJOYgbLdhNFen9VAO0R4c4mE6F7 wLOyCsAnnRCguQsZ5ElCKqcHxZMP8r6fNq/ovqf4ch0JX68NOd/cNyI+6H9h9p5xVSxz 1FRwGCnIbQXKbL4ZtgBl9EO6RsXN2v+8VI81UkZqILKAwOSNn46UrIyT6UALJny1ntYM rb3lAXP5KrLfIrjAqT1xdmWtfDAbDtkgHIh4mnnPhFnys8at67UGr/gXmk6/Y8TANygd BVOmq1OotB9ADU22lBINEb1lBrF493Ar0V38QcE/tA4sqs9NOr8bbnXvsXkEsB1/T1DI oybw== X-Gm-Message-State: AOJu0YyYGeitkGkZJjUNrQW0oIgeyl8SJjP559Lu88W4oIyGFIbeCY07 2VR90ouqD2StT0eKnYEMZL8DUdJPLkhuxX+j2y3r9A== X-Received: by 2002:a0d:cc8a:0:b0:5b3:1d71:6df7 with SMTP id o132-20020a0dcc8a000000b005b31d716df7mr4619087ywd.22.1702384376192; Tue, 12 Dec 2023 04:32:56 -0800 (PST) MIME-Version: 1.0 References: <20231212105501.16347-1-brgl@bgdev.pl> In-Reply-To: <20231212105501.16347-1-brgl@bgdev.pl> From: Linus Walleij Date: Tue, 12 Dec 2023 13:32:44 +0100 Message-ID: Subject: Re: [PATCH] gpiolib: allocate memory atomically with a spinlock held To: Bartosz Golaszewski Cc: Andy Shevchenko , Kent Gibson , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , Dan Carpenter Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.9 required=5.0 tests=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 fry.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 (fry.vger.email [0.0.0.0]); Tue, 12 Dec 2023 04:33:06 -0800 (PST) On Tue, Dec 12, 2023 at 11:55=E2=80=AFAM Bartosz Golaszewski wrote: > From: Bartosz Golaszewski > > We will eventually switch to protecting the GPIO descriptors with a mutex > but until then, we need to allocate memory for the label copy atomically > while we're holding the global spinlock. > > Reported-by: Dan Carpenter > Closes: https://lore.kernel.org/linux-gpio/62588146-eed6-42f7-ba26-160226= b109fe@moroto.mountain/T/#u > Fixes: f8d05e276b45 ("gpiolib: remove gpiochip_is_requested()") > Signed-off-by: Bartosz Golaszewski Makes sense. Reviewed-by: Linus Walleij Yours, Linus Walleij