From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.kernel.org ([198.145.29.99]:34018 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725760AbeKFJJd (ORCPT ); Tue, 6 Nov 2018 04:09:33 -0500 Date: Mon, 5 Nov 2018 18:47:12 -0500 From: Sasha Levin To: Loic 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() Message-ID: <20181105234712.GV194472@sasha-vm> References: <20181020195557.875dcc9c2424f3584b3cda72@opensec.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20181020195557.875dcc9c2424f3584b3cda72@opensec.fr> Sender: stable-owner@vger.kernel.org List-ID: 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 >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] > ... > [] ahci_stop_engine+0x5c/0xd8 [libahci] > [] ahci_deinit_port.constprop.12+0x1c/0xc0 [libahci] > [] ahci_init_controller+0x80/0x168 [libahci] > [] ahci_pci_init_controller+0x60/0x68 [ahci] > [] ahci_init_one+0x75c/0xd88 [ahci] > [] local_pci_probe+0x3c/0xb8 > [] pci_device_probe+0x138/0x170 > [] driver_probe_device+0x2dc/0x458 > [] __driver_attach+0x114/0x118 > [] bus_for_each_dev+0x60/0xa0 > [] driver_attach+0x20/0x28 > [] bus_add_driver+0x1f0/0x2a8 > [] driver_register+0x60/0xf8 > [] __pci_register_driver+0x3c/0x48 > [] ahci_pci_driver_init+0x1c/0x1000 [ahci] > [] 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 >Signed-off-by: Tejun Heo Queued for 4.4 and 4.9, thanks. -- Thanks, Sasha