From mboxrd@z Thu Jan 1 00:00:00 1970 From: Timur Tabi Subject: Re: [PATCH] gpiolib: Show correct direction from the beginning Date: Thu, 20 Sep 2018 21:05:21 -0500 Message-ID: <27c8e13a-44bf-18b5-083b-25b87d7b8605@kernel.org> References: <20180914070839.4667-1-ricardo.ribalda@gmail.com> <20180914070839.4667-2-ricardo.ribalda@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: Linus Walleij Cc: Ricardo Ribalda Delgado , Stephen Boyd , "open list:GPIO SUBSYSTEM" , "linux-kernel@vger.kernel.org" List-Id: linux-gpio@vger.kernel.org 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). 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? 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.