Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp694222rdh; Wed, 14 Feb 2024 08:40:32 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXT6pAAah6LdkJgMMAIED0k6fnm/yUQ7+3oSBzIp/yl+wuOgvaVEuWT1wpr+gIRDMG9ENfK13ThNIxQHhrh22HUqVLYmN7VEVRMUEcl7Q== X-Google-Smtp-Source: AGHT+IEDo4CKsuzhrCDXHB0BcX8T7L1UX9hMD4zhIe7fdD15yqhQwXzJCFv7OnoUlcZWGwvobLhE X-Received: by 2002:a17:90b:23c5:b0:296:8409:aa07 with SMTP id md5-20020a17090b23c500b002968409aa07mr2699453pjb.3.1707928832043; Wed, 14 Feb 2024 08:40:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707928832; cv=pass; d=google.com; s=arc-20160816; b=aBxD8ko3xNWkGTfVEe7ep7BmHkOtYwj/aJwOaqxJ9KceeiqTxacoStB1Mxu2SQE3ZU Wgnir63es/6XbPrCJMniPCl4M5MJYoskqEkzT/HTpIW0ZLAulWTwqhYLYJzgDFb0GbLX waWuDj8/MmY93f1MCm1kziEZIdIJzCkWSo3zU9BbM2/PAO5wiRxoGV7++1T/0ZvXj9zH yOc5PM9+chHHG6uXKH5o2zZaLhZK3Bvhrw4IDON8rfbT4jIN1XDA9v9brs8xzHsMeDSi RqxUrM21kVHOxoCqKjlW8K2PJOA/DWQeGznpMuLPNe3eNogNXeDZ8y8l7tNzwvzdU67q 9WEQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=3Lb+cs6MZyEbSuIsnGR/lDtPPDEXeFotj9ffl8+8h2E=; fh=GbmzH5ChF8ePkwIeKoW822Ga7sghDFvPcbs1Z8TlaSw=; b=NXiM5qeUjqvzWDa+1bCaGlxJ182o5B5pJLloOFeyp1GdPjiX2AaV6yHdX85FujMjCF 6kVOhpGglm1tR3LHsJguCajLW4Bdc+hawFWpjU/2zhrRZ9/NUXxnfVPl5/vpxrQIhNbp pDQhSlpSA/dEomluIK1LDCU3rJrh6sDIfJpl8r/JsQCxIRL26oDkrnxQp5EsHHQAnb+J cckQskKbeENTintxtSwI3mvKrQIdd0divD2OcP9vcJaNOgtzXNrHlXX0pu/5bZBdODbD /N8D5BgigYWjxD7VJXznrZkcGBa8h1UOcjQcHJsktqBH0jMssy8vdYLtfixf/G8KXXaE Ss2w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jQ+iCbuM; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-65500-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65500-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=2; AJvYcCV6Vj2fqJcJKQT7yT+Apn4CKcMUyHcE5/uNuRHluw3aLP2Vc+BWqBlf7aZQL6u4A/j0YRWACCUOflewx2VxkfzoFunCI2ldLvR33X5hWg== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id ee15-20020a17090afc4f00b0029705da75absi1439357pjb.125.2024.02.14.08.40.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 08:40:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-65500-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jQ+iCbuM; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-65500-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65500-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 5C290B24994 for ; Wed, 14 Feb 2024 16:17:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 408F4604AA; Wed, 14 Feb 2024 16:16:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="jQ+iCbuM" Received: from mail-yb1-f180.google.com (mail-yb1-f180.google.com [209.85.219.180]) (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 CAA065FDD9 for ; Wed, 14 Feb 2024 16:16:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707927402; cv=none; b=n6T7KeBABzwb3lgb2DFI94Sgk85KY8NH8LNQ3OanXllUNQMvzj308ZImVLTz0NcjQ2iWbeBEuDW6EKh0k79oJFbuoGg+CuOPOiUwq2IffNEsnRpoocesKF/OL3/kqcOhn1Wi+SOSFIy2DhjQpdpchTihSaQlR+kdBFlutu+l+2o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707927402; c=relaxed/simple; bh=3Lb+cs6MZyEbSuIsnGR/lDtPPDEXeFotj9ffl8+8h2E=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=eexFkTm4ZyZRRK8UmnvRaiy+T/bk/n6CMfDliuY8LtTHJX64b9hI93CQV9bP4PBOwCC9RIvqdh3EVi9UTCm+AjGzQeseWnsWIa4+Z7ti+WYIkC8tZa/Ad52Pmqc72sxG/nnnn2CDDtuPsjNw21pI0dwjJdxW90rc/GTloI8dGAU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=jQ+iCbuM; arc=none smtp.client-ip=209.85.219.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-yb1-f180.google.com with SMTP id 3f1490d57ef6-dcd7c526cc0so1293559276.1 for ; Wed, 14 Feb 2024 08:16:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707927400; x=1708532200; 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=3Lb+cs6MZyEbSuIsnGR/lDtPPDEXeFotj9ffl8+8h2E=; b=jQ+iCbuMrZAiwtm9/t4D470IdQTpks8keGFfflbIGkU9FErMW2vjqmEqL9kLW5jxVF wllvm4+7fk9N5DbKP6cIt0sdiofAjlWZ8cGe0gG1FAOEoXZz43yCP7OtR12UfDr6QWs3 K6tGr9uY8F4xpyBmbA8Et1RYuEYHNrcu6w7yZzUQcuqUCm/WcrNMapomB06GfFuceSSk D71aeisgGFSDhLEgQmAIHpz21BMLVKcQ5uKXKnlm33aE47tq5tiMIxDVPTqQAq3FyDpC j1IUBak0n8IzhUHLk4b0xexYl+Z/eSC4InzelJu2/WdA4DcXVPEGJDHv74zb3aoFnr+l nqQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707927400; x=1708532200; 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=3Lb+cs6MZyEbSuIsnGR/lDtPPDEXeFotj9ffl8+8h2E=; b=ZCcNuFSWHZnZCeqJ4TeUu+XOXNWeei/vwG9I+DViOrlKDY4f7fNx5f5A0iHFsGSsNl 5pf75qdmp4FFCpgryn+i7shvGGLBN/rcE4Yxl/blr3+I+il8+AJWErb2ChGup9cAsj4P CecR+q2kp0i3I4Gdqo9SFudxaY+9zz7tJVQQCaoQLBy5mPpng4m6C/t/B2WTP+jS93pt aKzSh7kdgY9UvI1ggMUfhXXx0/JxlKFdN8NnT4kIXsl1/F/fFtczjpBJlJzz458TAIA+ n8sPLyHO1tgl/h1lT+ycfqI1zgSXJZbBdPv9XLCkKJQlRTRf5F7aNxlIiZqHB+AJSCKG 6bNA== X-Forwarded-Encrypted: i=1; AJvYcCW+WLLWv3lBwOk061XC0nMi+xgVr7g1K9GnicYXX+ELubmAspcEiiWqUUWLoNGBLpfVeYHUMV5Cn0obEr4b+LCo3QN6wav9L+hBOLK5 X-Gm-Message-State: AOJu0YwIM8pe7lPsExEv31fscKzn2WR/14MolDG9zsF78sqZvViaevbN LJ4OjByRh5Ml5gmgb9PvJOLEsKS3GA8DWDpGE57MHOo9JoOPLmvqfOivQ+2qDmvGHCfztwlOwyE i4qpocLeks6OHusgzsFNj6qR16yYh76dAyGgsDA== X-Received: by 2002:a25:9c82:0:b0:dcd:1d44:f6c1 with SMTP id y2-20020a259c82000000b00dcd1d44f6c1mr2763883ybo.16.1707927399794; Wed, 14 Feb 2024 08:16:39 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240214092438.10785-1-brgl@bgdev.pl> In-Reply-To: <20240214092438.10785-1-brgl@bgdev.pl> From: Linus Walleij Date: Wed, 14 Feb 2024 17:16:28 +0100 Message-ID: Subject: Re: [PATCH] serial: st-asc: don't get/put GPIOs in atomic context To: Bartosz Golaszewski Cc: Patrice Chotard , Greg Kroah-Hartman , Jiri Slaby , Dan Carpenter , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Bartosz Golaszewski Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Feb 14, 2024 at 10:24=E2=80=AFAM Bartosz Golaszewski wrote: > From: Bartosz Golaszewski > > Since commit 1f2bcb8c8ccd ("gpio: protect the descriptor label with > SRCU") gpiod_set_consumer_name() calls synchronize_srcu() which led to > a "sleeping in atomic context" smatch warning. > > This function (along with gpiod_get/put() and all other GPIO APIs apart > from gpiod_get/set_value() and gpiod_direction_input/output()) should > have never been called with a spinlock taken. We're only fixing this now > as GPIOLIB has been rebuilt to use SRCU for access serialization which > uncovered this problem. > > Move the calls to gpiod_get/put() outside the spinlock critical section. > > Reported-by: Dan Carpenter > Closes: https://lore.kernel.org/linux-gpio/deee1438-efc1-47c4-8d80-0ab2cf= 01d60a@moroto.mountain/ > Signed-off-by: Bartosz Golaszewski Good find! Reviewed-by: Linus Walleij Yours, Linus Walleij