From patchwork Sat Oct 3 08:11:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiang Liu X-Patchwork-Id: 7320451 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A722CBEEA4 for ; Sat, 3 Oct 2015 08:12:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F2AFA2086D for ; Sat, 3 Oct 2015 08:12:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 338BC207C5 for ; Sat, 3 Oct 2015 08:12:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751514AbbJCILj (ORCPT ); Sat, 3 Oct 2015 04:11:39 -0400 Received: from mga01.intel.com ([192.55.52.88]:1257 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750925AbbJCILe (ORCPT ); Sat, 3 Oct 2015 04:11:34 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP; 03 Oct 2015 01:11:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,627,1437462000"; d="scan'208,223";a="783447598" Received: from unknown (HELO [10.254.211.7]) ([10.254.211.7]) by orsmga001.jf.intel.com with ESMTP; 03 Oct 2015 01:11:28 -0700 Subject: Re: [RFT v3] eata: Convert eata driver as normal PCI and platform device drivers To: Arthur Marsh , James Bottomley References: <20150916134211.GA21535@infradead.org> <1442907023-12709-1-git-send-email-jiang.liu@linux.intel.com> <5601D550.5000801@internode.on.net> <1442961929.15264.4.camel@HansenPartnership.com> <5601E5FE.7020706@internode.on.net> <56023771.5010006@linux.intel.com> <5602829C.5090500@internode.on.net> <1443019207.2240.27.camel@HansenPartnership.com> <56037C09.5050201@linux.intel.com> <560390A1.5060503@internode.on.net> <56063AB7.9030309@internode.on.net> Cc: Thomas Gleixner , Bjorn Helgaas , Hannes Reinecke , Ballabio Dario , Christoph Hellwig , Dario Ballabio , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-scsi@vger.kernel.org, x86@kernel.org From: Jiang Liu Organization: Intel Message-ID: <560F8DB0.8030704@linux.intel.com> Date: Sat, 3 Oct 2015 16:11:28 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <56063AB7.9030309@internode.on.net> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, T_TVD_MIME_EPI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 2015/9/26 14:27, Arthur Marsh wrote: > > > Arthur Marsh wrote on 24/09/15 15:26: >> >> >> Jiang Liu wrote on 24/09/15 13:58: >> >>> Hi James, >>> Thanks for review. How about the attached patch which addresses >>> the three suggestions from you? >>> Thanks! >>> Gerry >> >> I've applied the patch, rebuilt the kernel and verified that it allows >> unloading of the eata module and reloading it, as well as a successful >> kexec. >> >> Regards, >> >> Arthur. > > After some more thorough testing I've encountered an ongoing problem > trying to use kexec with filesystems mounted with the eata driver. > > If I boot up and have the eata driver loaded but no filesystem check or > mounting of filesystems on the disk attached to the DPT2044W controller, > then attempt a kexec reboot I get the reboot pausing after the > "synchronizing scsi cache" messages and getting the errors that I have > included as pictures in my previous reports. > > If I do a normal boot which includes eata being loaded, the disk > attached to the DPT2044W controller having its filesystems checked and > mounted, then attempt a kexec reboot, I get the reboot pausing after the > "synchronizing SCSI cache" messages as before. > > If I un-mount the filesystems on the disk attached to the DPT2044W > controller after start-up and try a reboot I get the same problem. > > If I do modprobe -r eata after un-mounting the filesystems on the disk > attached to the DPT2044W controller after a start-up kexec *works fine*. Hi Arthur, The above results suggest that we need to shutdown eata controller for kexec. So could you please try to apply the attached patch upon the previous two patches? Thanks! Gerry From 44a7ee9008951684a6ee1482a4445a64da61f54a Mon Sep 17 00:00:00 2001 From: Jiang Liu Date: Sat, 3 Oct 2015 15:57:39 +0800 Subject: [PATCH] eata: Implement shutdown callback for eata driver Implement shutdown callback for eata driver, so eata controllers will be put into ready state for kexec. Signed-off-by: Jiang Liu --- drivers/scsi/eata.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/scsi/eata.c b/drivers/scsi/eata.c index ceeba4d7b4ff..f3ef9ac97646 100644 --- a/drivers/scsi/eata.c +++ b/drivers/scsi/eata.c @@ -1517,6 +1517,11 @@ static void eata2x_pci_remove(struct pci_dev *pdev) pci_disable_device(pdev); } +static void eata2x_pci_shutdown(struct pci_dev *pdev) +{ + port_remove(&pdev->dev); +} + static struct pci_device_id eata2x_tbl[] = { { PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_SCSI << 8, PCI_ANY_ID) }, { }, @@ -1528,6 +1533,7 @@ static struct pci_driver eata2x_pci_driver = { .id_table = eata2x_tbl, .probe = eata2x_pci_probe, .remove = eata2x_pci_remove, + .shutdown = eata2x_pci_shutdown, }; static int eata2x_register_pci_driver(void) @@ -1569,8 +1575,14 @@ static int __exit eata2x_platform_remove(struct platform_device *pdev) return 0; } +static void eata2x_platform_shutdown(struct platform_device *pdev) +{ + port_remove(&pdev->dev); +} + static struct platform_driver eata2x_platform_driver = { .remove = __exit_p(eata2x_platform_remove), + .shutdown = eata2x_platform_shutdown, .driver = { .name = "eata_plat", .owner = THIS_MODULE, -- 1.7.10.4