linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandre Courbot <gnurou@gmail.com>
To: Colin Pitrat <colin.pitrat@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3] gpio: sch: Fix Oops on module load on Asus Eee PC 1201
Date: Sun, 19 Jun 2016 16:02:38 +0900	[thread overview]
Message-ID: <CAAVeFuJq1cxcXjHcdLsOW7qNNBHtM0fgQJBSfGy=5j4vVV3Q1Q@mail.gmail.com> (raw)
In-Reply-To: <20160618180458.GA1425@pitrat4.localdomain>

On Sun, Jun 19, 2016 at 3:05 AM, Colin Pitrat <colin.pitrat@gmail.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@gmail.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@nvidia.com>

  reply	other threads:[~2016-06-19  7:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-18 18:05 [PATCH v3] gpio: sch: Fix Oops on module load on Asus Eee PC 1201 Colin Pitrat
2016-06-19  7:02 ` Alexandre Courbot [this message]
2016-06-20  7:46 ` Mika Westerberg
2016-06-23  8:02 ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAVeFuJq1cxcXjHcdLsOW7qNNBHtM0fgQJBSfGy=5j4vVV3Q1Q@mail.gmail.com' \
    --to=gnurou@gmail.com \
    --cc=colin.pitrat@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).