Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp28948imm; Fri, 21 Sep 2018 09:09:00 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaO2fRM+NSUswX5N1riPiTUbYS5Pwdi3tMt0nzi7PX2m2Qej/QkX7MZEN1pTn/0WeiZpIll X-Received: by 2002:a63:ea0c:: with SMTP id c12-v6mr41819627pgi.158.1537546140686; Fri, 21 Sep 2018 09:09:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537546140; cv=none; d=google.com; s=arc-20160816; b=hv2jCuUGQH6hYyuX+wm5mSk63f4LAVoWs3ycStXKsWrfdFZkYm9RZpI/2+E/oDGEZK awk+7okBwMUVVb13aeGgdj8gWH7e5IQ8rnqHw8c/PtmKjW5GQ/b3ejO7HF5KOysJyrow S7rBgS1+zVfXV8mxeyflBxQWmJ6enU0qLg8TIpXGlHv+1/gCojEvTdCCwuj1k52PVLfZ d9xz5LwVVyEkGY+i+amf6ftlqeQNGPGmq8g791KdmGVzvaiuLX3oXbwboj/q/hJfpbnZ ZKgEbZhy8NpwX5TaEIeF+e1fXf4SrQetuRgi5SDvs2IsmHXvS8DIMw3anqPdiNT9hfhe G8Sg== 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=ufKt1o6XZWWhy3FWmpYRN0ahckMTjd9MIhEaFudp5K8=; b=MnlDPEqUujncDWTYtwo8ox4WzdMg2j2bal01ioHR+hTeVA0tg7imGf1wZqRQ+wf0PX dfMZNhshjdYRh16MhEeEn5bexypDv3DrbhQ45StqyyAldcB1DOzseLKyYKrYU8LSrRrs UsJZP/1SnrGqGXDL+sel4Isd6GFf+eTqKsWqlMZboZLy7mtqYnxPlH1zQrgkgGKLG5Sn eH+qvstDumayRdhO2CmAWBIj6IBt8p2LZozUOgJXwgitUSbJxT7k8Z91Pln5+v7yFW8q 2+jj2ptnEbTr1UAGYRQkt3FeX4p+TE1Pf4k5T54zwEJf9NxyqGn6M/7m2r0S5g1Y8ZN1 N6WA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OSApUQ1z; 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 g8-v6si5209971pli.338.2018.09.21.09.08.35; Fri, 21 Sep 2018 09:09:00 -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=OSApUQ1z; 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 S2390422AbeIUV5Y (ORCPT + 99 others); Fri, 21 Sep 2018 17:57:24 -0400 Received: from mail-it1-f194.google.com ([209.85.166.194]:37651 "EHLO mail-it1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388909AbeIUV5Y (ORCPT ); Fri, 21 Sep 2018 17:57:24 -0400 Received: by mail-it1-f194.google.com with SMTP id h20-v6so2442728itf.2 for ; Fri, 21 Sep 2018 09:07:51 -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=ufKt1o6XZWWhy3FWmpYRN0ahckMTjd9MIhEaFudp5K8=; b=OSApUQ1zEDDwwZ0GeHcXSxIWexaztneKskDPc+pbnAtP0kezLMvVPYZo+QqcjAUCkA a52Y8jyMaffid5eizbWYTu2Y+l7fYAI71+ZZmjxk6Lwj+S5UgZkOzDGJWc/s+TetD8Bg UdMZXvPQtdxCRXiCk4MZO40bhU2adaLZ0Y/cM= 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=ufKt1o6XZWWhy3FWmpYRN0ahckMTjd9MIhEaFudp5K8=; b=Jxdd8H1fAEz6d85928dFv9SyIBe8R9WruskdCo6nJ/v8zOZ3xvn4aXiZaCFmz+wHcl N4ZpfRZnE6lnKf7Wl1oqTJjioLM4bZtyoiCKBRTDofWHNzmP3oKXg2Fji7/36NkpiSTr zsZGw2uxLPUyPjW/r+McBlAK9VMdFcnDAUJBh2ygGGuWhrAQxMgpeYoSF42VTxsF9jFM 7OLUINSARCqOTsZOasuOcGnSOFVL/vgNDPL/LS74QvBIAJoZSRFDsDQSu/SXw87DKIw6 4pgMSFTkV5gl2dS7CPQYSf6GgW/Ixrc/Q+j10d0PI2CssN/oKre3UyeM7/GuboxScRj2 H7oQ== X-Gm-Message-State: APzg51DgojKlG/HUWFKPHMeiC5u+ru1RdwCI6SHAtMPu3Fxp4rf52aSC AhE9ZY4lYx8GHFPdhZIsocg2HFsAkb5w2rhDjwIneA== X-Received: by 2002:a24:9d84:: with SMTP id f126-v6mr6588665itd.130.1537546070708; Fri, 21 Sep 2018 09:07:50 -0700 (PDT) MIME-Version: 1.0 References: <20180914070839.4667-1-ricardo.ribalda@gmail.com> <20180914070839.4667-2-ricardo.ribalda@gmail.com> <27c8e13a-44bf-18b5-083b-25b87d7b8605@kernel.org> In-Reply-To: <27c8e13a-44bf-18b5-083b-25b87d7b8605@kernel.org> From: Linus Walleij Date: Fri, 21 Sep 2018 09:07:38 -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 7:05 PM Timur Tabi wrote: > On 9/20/18 5:36 PM, Linus Walleij wrote: > > 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. > > That means that all the logic for checking valid_mask needs to be added > to the chip driver's .get_direction() function. We can add that logic > to msm_gpio_get_direction (at one point, I had a patch that did that, > but it was rejected). Nah, what is in patch v2 is better, just checking it when we need to. > My concern is: what if a driver depends on a .request call being made > (in order to configure muxes, for example) before touching the hardware? Hm. That is a good question. I wonder if we have that problem in practice. If this happens, maybe the driver needs to keep track of stuff a bit. I think if we just loop request over everything we could disturb other mux set-up. > I wonder if this is something that really should be handled in the > driver's .probe function. The driver should collect that information > and pass it to add_data. I see the idea, but it seems complicated compared to just calling the callbacks. Let's try the v2 patch approach first. Yours, Linus Walleij