Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp82108imm; Thu, 20 Sep 2018 15:37:33 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdagw+MI9QvcN7DehJBVIusqOEISp8Jwd27UgGeBAOmlRTHPDvh6/MYqYTsV+1p3a9wnGTHV X-Received: by 2002:a63:8c4:: with SMTP id 187-v6mr5381451pgi.396.1537483053251; Thu, 20 Sep 2018 15:37:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537483053; cv=none; d=google.com; s=arc-20160816; b=GPV3twpS6FMPCJ/suVuVjtNUCBh5FEitnkLVUs7ViRfSBFCARfS6zmvNhyUSrja0Zc clfNIDaSqzg9BHjLm34wG0Lfi0gBrwXkt7Cjp0WjaTx0Kufw5jbWIqbQAM/IA0SH6L3/ jBBAIsmerueg2OQktarjYXkjOegMU7c0ZA8jAcI/EHTlhWKusVAFjG0j8si2OJKlmuaS BAwW823i7JclYHCc3gqEimFrI8+qdJBXAdVQrVbH873k/3bXp61S1UQL07r3fnT8A87B wY6qpdXrSCxK74IfAMIoiiCwmw/cRJEuNrSQW8OIq0CL/rpFFKFgpGnefGpgJQ09rnSX AJFg== 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=5kW89ZDcdN6ntlPOVDFYEN9c9HT7XKN+R0Czrqisj4Y=; b=eFZDZBZp2P1zrtbk5AcgDJQ1LMY7Ih7Ntd35nPp9p1aeXIopakaBotA1lwmo4m3jRk b1eicWBsIszDQxLwpoiz9l/ojP+ZoEB4UaVnL08GGkRAoBNQinP/meysROiiHQ8hzUQW uIwqiWeorba0gnVJt7dtb9NF72rFMxphLnZODEAhTNOI4TygtMrRZyqVPzx0y1/uBjfT MP+CK8jM+xtPSDx/J4vkYqznwOlsBCLD0UyYTWLE+TTFFMQyJ1mg5gchlDneHXx/5ohA sePMyPmSB3BRFJLEEjRdOqDRc82qvge+ConerX5wzcDPjCcO8b70uAXUrVyNEf8bTB8J SDUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ykomb5c5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id z11-v6si22394777pgv.138.2018.09.20.15.37.17; Thu, 20 Sep 2018 15:37:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ykomb5c5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1728276AbeIUEWX (ORCPT + 99 others); Fri, 21 Sep 2018 00:22:23 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:34135 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725861AbeIUEWX (ORCPT ); Fri, 21 Sep 2018 00:22:23 -0400 Received: by mail-io1-f65.google.com with SMTP id c22-v6so10136595iob.1 for ; Thu, 20 Sep 2018 15:36:38 -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=5kW89ZDcdN6ntlPOVDFYEN9c9HT7XKN+R0Czrqisj4Y=; b=Ykomb5c58cT0fN4aVXVN5CHnIXa7xPvVJNDTVxsZ5uX3+NNghV924G0kPaKkqof1Bm V4t0oqYLqiLiO6mCOFP3J08RMPcdIaKLFkHmqZdSBxLfgA8f+G2XZ6U19F2NGolwBQJA noKQv5LFpefL0GXLY/P0nhKu5FZ+nAiEwHzc4= 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=5kW89ZDcdN6ntlPOVDFYEN9c9HT7XKN+R0Czrqisj4Y=; b=UMGI45bmCR96257nEiEW7hsyyQHU1IZFAdPVhW+W+FkPZAKKX3LJV7gJVUbq8vrC1r KiV9fRGtFB6XkJtAoFLdYxu2IYbn/Z/oTuSg45iqcKVbjv0Ivg3XmknuyioeYnJ9MpFm HABA+hzy6MQotP5r99fm33EXzOkPe6j/b1ERgTffHttGFCxf0TgsD03UmUs2Eo8oH5Pp uqHO145BNctvvj4eRLcRApT1kRg/ShwmUYS6sUrGeJ08o2dBjturk83IIFdbCsy389QV PxnsaTNBae1Q0wU6loCTkPbQNEjtpgJhlbj9lAsBgRJNkCul7SHu8hr3YOYya5OYEocQ 86cw== X-Gm-Message-State: APzg51CV5ozYp7yioC/zalamzL4WHip/1NhTrxJQvDcu8bQiPymjKXRK ZzA3iqCuMiFHTMZnkLAhrCnXyw5iJUqW4uCgPFx9Jg== X-Received: by 2002:a02:6c45:: with SMTP id w66-v6mr38714317jab.87.1537482998060; Thu, 20 Sep 2018 15:36:38 -0700 (PDT) MIME-Version: 1.0 References: <20180914070839.4667-1-ricardo.ribalda@gmail.com> <20180914070839.4667-2-ricardo.ribalda@gmail.com> In-Reply-To: From: Linus Walleij Date: Thu, 20 Sep 2018 15:36:26 -0700 Message-ID: Subject: Re: [PATCH] gpiolib: Show correct direction from the beginning To: timur@kernel.org Cc: Ricardo Ribalda Delgado , Stephen Boyd , "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 Thu, Sep 20, 2018 at 5:35 AM Timur Tabi wrote: > On 9/20/18 12:23 AM, Linus Walleij wrote: > > I think most gpiochips easily survives calling the .get_direction() > > early, Qualcomm's stand out here. > > > > Now that we have .valid_mask in the gpiochip could we simply just > > add this back, resepecting valid_mask and avoid checking the > > direction of precisely these GPIOs? > > Can you be more specific? One of the proposals made previously was to > add a check in msm_gpio_get_direction(), but that was rejected because > the consensus was the valid_mask checks in gpiolib are sufficient. What I mean is that $SUBJECT patch might not hurt Qualcomms GPIOs (not crash the platform) if and only if it is augmented to not try to get the initial direction from lines masked off in .valid_mask if .need_valid_mask is true. Whether it makes sense semantically is a different debate, but it seems possible to reintroduce calling .get_direction() without hurting anyone. Yours, Linus Walleij