Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2433805pxa; Mon, 3 Aug 2020 16:23:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwuWrhjXtlJ9Qg9XpdGE27USus77fSXa+/KFLJWscFYS4tl56CmC++Ll0boYe/MaRGSpWL8 X-Received: by 2002:a17:906:3616:: with SMTP id q22mr19871801ejb.79.1596497037672; Mon, 03 Aug 2020 16:23:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596497037; cv=none; d=google.com; s=arc-20160816; b=ZTZQkXZSY5Dw1RB2WPBBj0QHkF53NUMYdFWyzu4A6KCEZncap0MsBfZsNpBwPeqgqq JEzfQJt1oYxsT/oxdVAWFDY4f8at+j7V1/n8TH7kGdNiz1JR6WociWa94HeJ5U3Nd170 3dQT6BCe+sYvq0LeJNyAe6i99YvgprEFBhA2ffFaQH5BBbtR0P3Pzkk6WY7ac5GM7Yr8 ITDCzSQ1deUKJowLQNMSAvMtPD1Q8+OUtQC3vbtylUC6iTUGjBDblsobZOSxUWHtJmX9 wDNAYrBVSETascLP0o0Ds0/fZV+tw3f/J9XpYAIiKyVg2Z9N7xvM6w60UoDl66NU/Ksa GFwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=iIqkaLsmRYNwvI6bANOrm3GY7t2TYOib7K7xtc0Wnx8=; b=xMmu/EvRb7l4NxP3S7V23GWdnCEDc+3XR3qoUoIKe42h+23C7f1oZ4NfMHWfjTw7iJ A0UMgcgMVQwuPdnOpjObX4EWbd7j1AOuAa0GwJRgWzrItP/HtydWW6V2dTzkbja+RF1x OHp4SBoRkdNU8zaL9TOLFfl3ofW4qKWiVXktvIGXDYRNgAGPv80u0HxYdKucE1l1o5df VhMErjMeWwDaOgIBFPWxsON+yo6rovDf5q0Zf7ZfHucRR/oeEltANsLaxf8ZxiaQsk/L zOo8YUqeylsNYrDNWPhsfi7cdgMNqGP7WaZ0P1F/AwuuMHJrCKDj65fUOyEOy/LNotYj 7SkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ekvkT2Ee; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cq3si10255197edb.474.2020.08.03.16.23.34; Mon, 03 Aug 2020 16:23:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ekvkT2Ee; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729197AbgHCXXY (ORCPT + 99 others); Mon, 3 Aug 2020 19:23:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726350AbgHCXXX (ORCPT ); Mon, 3 Aug 2020 19:23:23 -0400 Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87CEBC06174A for ; Mon, 3 Aug 2020 16:23:23 -0700 (PDT) Received: by mail-lj1-x242.google.com with SMTP id x9so41544190ljc.5 for ; Mon, 03 Aug 2020 16:23:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=iIqkaLsmRYNwvI6bANOrm3GY7t2TYOib7K7xtc0Wnx8=; b=ekvkT2EenRR1kmAkT6UQ9M/f2BfPNY/k7bzVRiOSaH8nhlJEjF17GKclZ4IfW+5bko fvzPAqqBfIePDWUc6FZ+AUsfn/03vAzON+BkgNVZC7zp98Ayp1EbOImCwIiQKE2ZrOc1 7rpm7BrRXeVXUDJE2mzyUpbRPj9r+46ThGxQ2xj7ZaOQh0I8jiJtSv/rvZdr/BWs/Rmd 6FMC3Xo2piygZJy9W38tVIx9+pC+wX13ftICj8HA+M44U5356voiWpEpQ0SaLLkKEgmo fgf+LKy0okYBqwhp1arfSMfzBJKbjfWUd3nDTZDeXSJ8yTnScrmBuE5TvQhUgBTt67RE wzvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=iIqkaLsmRYNwvI6bANOrm3GY7t2TYOib7K7xtc0Wnx8=; b=OqnV0t3U6F4kMJ4akaNZcTbTihgt+5snKYnRglUBQ9Xq1KOQGih54cgUdKNfnaeuH1 MCAhWHs1RZaKtG/7eBf0XbsbKH7/MtDDwFnsbiFYDc+r0UIHkjkdqEgJSwOkb8bEmJi6 aP08Z+r+0dXpPy2Yr8F6TISQYOcawImdnpspBXgq32dmCnNw9/wB9dQPeUb+faW3ct9o /1BggFKJ4USWdWT5tAyXoKIOmFe7XtjnXRrrA3NODn1iShO6EzXLq32xyCwMe80hqrbg VsciAkJOUaqr+PWh7zFMS9LSWT+1fjMZn9olIUOB4uuj3Zq+IAfL5UkBmONCnUQwfr0p hSuA== X-Gm-Message-State: AOAM531/gjUBBp3n/fi6mRPsQyrAJsfE6Yk/IQCPQoK2HavMpu3yLMly 0nWsUl50/MLoZfSCgFsJrH51P0khUYAaI2co3TWByQ== X-Received: by 2002:a2e:b80b:: with SMTP id u11mr5428827ljo.286.1596497002032; Mon, 03 Aug 2020 16:23:22 -0700 (PDT) MIME-Version: 1.0 References: <20200731123835.8003-1-a.fatoum@pengutronix.de> In-Reply-To: <20200731123835.8003-1-a.fatoum@pengutronix.de> From: Linus Walleij Date: Tue, 4 Aug 2020 01:23:11 +0200 Message-ID: Subject: Re: [PATCH] gpio: don't use same lockdep class for all devm_gpiochip_add_data users To: Ahmad Fatoum Cc: Bartosz Golaszewski , Grygorii Strashko , Thierry Reding , Sascha Hauer , "open list:GPIO SUBSYSTEM" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 31, 2020 at 2:39 PM Ahmad Fatoum wrote: > Commit 959bc7b22bd2 ("gpio: Automatically add lockdep keys") documents > in its commits message its intention to "create a unique class key for > each driver". > > It does so by having gpiochip_add_data add in-place the definition of > two static lockdep classes for LOCKDEP use. That way, every caller of > the macro adds their gpiochip with unique lockdep classes. > > There are many indirect callers of gpiochip_add_data, however, via > use of devm_gpiochip_add_data. devm_gpiochip_add_data has external > linkage and all its users will share the same lockdep classes, which > probably is not intended. > > Fix this by replicating the gpio_chip_add_data statics-in-macro for > the devm_ version as well. > > Fixes: 959bc7b22bd2 ("gpio: Automatically add lockdep keys") > Signed-off-by: Ahmad Fatoum > --- > This doesn't fix any particular problem I ran into, but the code > looked buggy, at least to my lockdep-user-not-developer eyes. Thanks patch applied, I think we had this fixed before but managed to loose it in some API rewrite. Thanks for fixing it up! Yours, Linus Walleij