From: Sasha Levin <sashal@kernel.org>
To: Loic <hackurx@opensec.fr>
Cc: stable@vger.kernel.org, ard.biesheuvel@linaro.org, tj@kernel.org
Subject: Re: [PATCH] ahci: don't ignore result code of ahci_reset_controller()
Date: Mon, 5 Nov 2018 18:47:12 -0500 [thread overview]
Message-ID: <20181105234712.GV194472@sasha-vm> (raw)
In-Reply-To: <20181020195557.875dcc9c2424f3584b3cda72@opensec.fr>
On Sat, Oct 20, 2018 at 07:55:57PM +0200, Loic wrote:
>Hello,
>
>Please picked up this patch for linux 4.4 and 4.9.
>Compiled/tested without problem.
>
>[ Upstream commit d312fefea8387503375f728855c9a62de20c9665 ]
>
>From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>Date: Mon, 2 Oct 2017 19:31:24 +0100
>Subject: [PATCH] ahci: don't ignore result code of ahci_reset_controller()
>
>ahci_pci_reset_controller() calls ahci_reset_controller(), which may
>fail, but ignores the result code and always returns success. This
>may result in failures like below
>
> ahci 0000:02:00.0: version 3.0
> ahci 0000:02:00.0: enabling device (0000 -> 0003)
> ahci 0000:02:00.0: SSS flag set, parallel bus scan disabled
> ahci 0000:02:00.0: controller reset failed (0xffffffff)
> ahci 0000:02:00.0: failed to stop engine (-5)
> ... repeated many times ...
> ahci 0000:02:00.0: failed to stop engine (-5)
> Unable to handle kernel paging request at virtual address ffff0000093f9018
> ...
> PC is at ahci_stop_engine+0x5c/0xd8 [libahci]
> LR is at ahci_deinit_port.constprop.12+0x1c/0xc0 [libahci]
> ...
> [<ffff000000a17014>] ahci_stop_engine+0x5c/0xd8 [libahci]
> [<ffff000000a196b4>] ahci_deinit_port.constprop.12+0x1c/0xc0 [libahci]
> [<ffff000000a197d8>] ahci_init_controller+0x80/0x168 [libahci]
> [<ffff000000a260f8>] ahci_pci_init_controller+0x60/0x68 [ahci]
> [<ffff000000a26f94>] ahci_init_one+0x75c/0xd88 [ahci]
> [<ffff000008430324>] local_pci_probe+0x3c/0xb8
> [<ffff000008431728>] pci_device_probe+0x138/0x170
> [<ffff000008585e54>] driver_probe_device+0x2dc/0x458
> [<ffff0000085860e4>] __driver_attach+0x114/0x118
> [<ffff000008583ca8>] bus_for_each_dev+0x60/0xa0
> [<ffff000008585638>] driver_attach+0x20/0x28
> [<ffff0000085850b0>] bus_add_driver+0x1f0/0x2a8
> [<ffff000008586ae0>] driver_register+0x60/0xf8
> [<ffff00000842f9b4>] __pci_register_driver+0x3c/0x48
> [<ffff000000a3001c>] ahci_pci_driver_init+0x1c/0x1000 [ahci]
> [<ffff000008083918>] do_one_initcall+0x38/0x120
>
>where an obvious hardware level failure results in an unnecessary 15 second
>delay and a subsequent crash.
>
>So record the result code of ahci_reset_controller() and relay it, rather
>than ignoring it.
>
>Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>Signed-off-by: Tejun Heo <tj@kernel.org>
Queued for 4.4 and 4.9, thanks.
--
Thanks,
Sasha
prev parent reply other threads:[~2018-11-06 9:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-20 17:55 [PATCH] ahci: don't ignore result code of ahci_reset_controller() Loic
2018-11-05 23:47 ` Sasha Levin [this message]
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=20181105234712.GV194472@sasha-vm \
--to=sashal@kernel.org \
--cc=ard.biesheuvel@linaro.org \
--cc=hackurx@opensec.fr \
--cc=stable@vger.kernel.org \
--cc=tj@kernel.org \
/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