Re: [PATCH] gpiolib: Show correct direction from the beginning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 20, 2018 at 7:05 PM Timur Tabi <timur@xxxxxxxxxx> 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



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux