Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3560967pxu; Tue, 15 Dec 2020 09:45:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJyVTOmeiW2eCxk+uM+HZHD+LlJ8Q40rEf7OJeocMKpfvvYAvyhF0MvsdRVQGqyAoeeSAujq X-Received: by 2002:a17:906:9382:: with SMTP id l2mr11855841ejx.162.1608054353876; Tue, 15 Dec 2020 09:45:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608054353; cv=none; d=google.com; s=arc-20160816; b=FTr1ATeE6dku3d49s0L0gz1STmyTZfDTL83/GlxjIIQO8IEZFELyWQP5qlG51C08Jg LYTN5rOiyhm870vp+LxiT8wXfxyK7SEQxyVoFKwUT2FTp/V2PqZn44dXoVpVVuNoM8Y/ nL4TBaa4ear2jMHc/y0+EsnQHY7iHqDxtk5e04NBiNLmhKL89CamMr9AtnkbS3y7N3zZ SFa7yHQ+UIZ9N1DrTzCU4k4SkctvEmi/fQD6j8ItFgR8w0jAr+i0YfOcVDswW/TGfzd9 9dkJQW3Fj1dEDbtdCEBerKA7gmxoZ/nXY+siDC2i5oDFb5vwhJhV6kGjWt+a2OGVlY2/ pt/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=OyPmNltZPbkGiq8ZU3o70mtt59kIUHa7iWyeMCJtAkM=; b=Xm32s+Hp7WOwphXeHksqyu1jVoCtGJL7ISx+okDGG2GPg/6RvB4CI8uCBIJrxk1hmr BHyf2noM/DTCrFNTwJ2LZk+403WX43WLHeY4X+H4CGRtnXrMdvfBAZAJ43A4S/KB7HpX 3THWenO1iBXEROZsFzNeTN+1ACGRrWSf7ASshXxqBP+mZ3DPDxHW/LBYHKJncRk9wwVX 882lYD9n1MgZ0T7MsbGS3F16OyoklT0icEPR+TT5QdYJUPxFAkbRgyjFvPZsJ1VSTdZS jpmgeUp+8TOYgnPorSW2ceze64COAbWU6sYJ33u0itRzzr56wfRULKnErL0SG+6CVkpH SnEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=Tufg4rny; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bu26si1177061edb.284.2020.12.15.09.45.29; Tue, 15 Dec 2020 09:45:53 -0800 (PST) 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=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=Tufg4rny; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729206AbgLORna (ORCPT + 99 others); Tue, 15 Dec 2020 12:43:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730153AbgLORn3 (ORCPT ); Tue, 15 Dec 2020 12:43:29 -0500 Received: from mail-ej1-x642.google.com (mail-ej1-x642.google.com [IPv6:2a00:1450:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D94CC0617A6 for ; Tue, 15 Dec 2020 09:42:49 -0800 (PST) Received: by mail-ej1-x642.google.com with SMTP id lt17so28928078ejb.3 for ; Tue, 15 Dec 2020 09:42:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OyPmNltZPbkGiq8ZU3o70mtt59kIUHa7iWyeMCJtAkM=; b=Tufg4rnymzNGJ4FWuhTaQkgREaEC6hpftCK9k82W0d40B1tsKbE0xyv8fZgtbdoXi/ MERjB/URiKpEZ36bB0stcV3RDsxy6vIhlPAX683NQmqd+MXJ5XMBprfEXf3uXqcl/FM4 4IfPF9yxOwTN8PhFmAGDPGJMd6leaPwLsfO/zo+2cbce9YiCL17SFguxblJoXsbZp9k8 rmRsmaWOHgws7YnDAAEhQDpj4Kx1hx7ot2pCLO34Go6Qll51odyA3ZqdyqzlHHG5xZGv u4iolhTaxS1r8A97MRe9/mtpPSSqvqnseyMuuRA4Vxx5W6PdInZQsJYFl+jMx6H+rMmS ktGw== 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=OyPmNltZPbkGiq8ZU3o70mtt59kIUHa7iWyeMCJtAkM=; b=p1+Borhgrx49lC81eTNr6iaGeqTCU5Mcj7ZQeXyNMHIV+KYjpLtjFBrBntyLoUZMh8 Rum+wWzCzGADv8sESv6v+FbwnY9MQLpuPg9BSh/J0ozb6pZUBbzLBHD7yKMT0nyM4GRV Keakt5oIZMiDSrEjOmSfCBkprxowEK5JNGQRuc6tRmowQix4Gv3ARiJjCRTVJ6o2VQ6/ KDwDmt3pqf/r/JskLqX3v2Z7qZ7AihXRScBxeqYkwUcYlVkGu6/BX5k6jNnBZxNBZ8o3 DRGknK3136Gi6d+xfNpoJLGM58/s5DyLW+J+kJdWuWNZTZ/AiOFbdqodszgDC9H8atWt U+8A== X-Gm-Message-State: AOAM530kfQ2JxuZHYTqutrhX9nrdP1jkKerFXDGrSXiwvU+4D5/KY/ni h0mJnlMASt9MUDvmariKK6jtI5RBo0+JAW/IbVFMpw== X-Received: by 2002:a17:906:d8dc:: with SMTP id re28mr27995623ejb.168.1608054167838; Tue, 15 Dec 2020 09:42:47 -0800 (PST) MIME-Version: 1.0 References: <20201215170308.2037624-1-bjorn.andersson@linaro.org> In-Reply-To: <20201215170308.2037624-1-bjorn.andersson@linaro.org> From: Bartosz Golaszewski Date: Tue, 15 Dec 2020 18:42:36 +0100 Message-ID: Subject: Re: [PATCH] gpiolib: Allow name duplicates of "" and "NC" To: Bjorn Andersson Cc: Linus Walleij , linux-gpio , LKML , linux-arm-msm@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 15, 2020 at 6:02 PM Bjorn Andersson wrote: > > Not all GPIO pins are exposed to the world and this is typically > described by not giving these lines particular names, commonly "" or > "NC". > > With the recent introduction of '2cd64ae98f35 ("gpiolib: Disallow > identical line names in the same chip")' any gpiochip with multiple such > pins will refuse to probe. > > Fix this by treating "" and "NC" as "no name specified" in > gpio_name_to_desc() > > Fixes: 2cd64ae98f35 ("gpiolib: Disallow identical line names in the same chip") > Signed-off-by: Bjorn Andersson > --- > > The introduction of 2cd64ae98f35 breaks pretty much all Qualcomm boards and > grepping the DT tree indicates that other vendors will have the same problem. > > In addition to this the am335x-* boards will also needs "[NC]", "[ethernet]", > "[emmc"], "[i2c0]", "[SYSBOOT]" and "[JTAG]" added to this list to allow > booting v5.11 with the past and present dtb/dts files. > > drivers/gpio/gpiolib.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c > index b3340ba68471..407ba79ae571 100644 > --- a/drivers/gpio/gpiolib.c > +++ b/drivers/gpio/gpiolib.c > @@ -302,7 +302,7 @@ static struct gpio_desc *gpio_name_to_desc(const char * const name) > struct gpio_device *gdev; > unsigned long flags; > > - if (!name) > + if (!name || !strcmp(name, "") || !strcmp(name, "NC")) > return NULL; > > spin_lock_irqsave(&gpio_lock, flags); > -- > 2.29.2 > I have a bad feeling about this. This opens the door for all kinds of exceptions: "N/A", "none" etc. Depending on whose boards are getting broken. If non-uniqueness of names is needed then let's better revert 2cd64ae98f35. Bartosz