[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAVeFuJq1cxcXjHcdLsOW7qNNBHtM0fgQJBSfGy=5j4vVV3Q1Q@mail.gmail.com>
Date: Sun, 19 Jun 2016 16:02:38 +0900
From: Alexandre Courbot <gnurou@...il.com>
To: Colin Pitrat <colin.pitrat@...il.com>
Cc: Linus Walleij <linus.walleij@...aro.org>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3] gpio: sch: Fix Oops on module load on Asus Eee PC 1201
On Sun, Jun 19, 2016 at 3:05 AM, Colin Pitrat <colin.pitrat@...il.com> wrote:
> This fixes the issue descirbe in bug 117531
> (https://bugzilla.kernel.org/show_bug.cgi?id=117531).
> It's a regression introduced in linux 4.5 that causes a Oops at load of
> gpio_sch and prevents powering off the computer.
>
> The issue is that sch_gpio_reg_set is called in sch_gpio_probe before
> gpio_chip data is initialized with the pointer to the sch_gpio struct. As
> sch_gpio_reg_set calls gpiochip_get_data, it returns NULL which causes
> the Oops.
>
> The patch follows Mika's advice (https://lkml.org/lkml/2016/5/9/61) and
> consists in modifying sch_gpio_reg_get and sch_gpio_reg_set to take a
> sch_gpio struct directly instead of a gpio_chip, which avoids the call to
> gpiochip_get_data.
>
> Thanks Mika for your patience with me :-)
>
> Signed-off-by: Colin Pitrat <colin.pitrat@...il.com>
Besides fixing the issue, avoiding an upcast from gpio_chip in
functions that are not driver hooks seems a good practice to me.
Acked-by: Alexandre Courbot <acourbot@...dia.com>
Powered by blists - more mailing lists