Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1464484ybb; Thu, 9 Apr 2020 02:40:03 -0700 (PDT) X-Google-Smtp-Source: APiQypJ5qYR7KsyyILVCqsZytuiDsHiq0/PJyEdT8kqZyrNlZ4VwduBw5Uwf6Mi+r/Lk8P4YzSai X-Received: by 2002:a9d:64cd:: with SMTP id n13mr8917273otl.274.1586425202918; Thu, 09 Apr 2020 02:40:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586425202; cv=none; d=google.com; s=arc-20160816; b=nukGe6+Gpa4NZ9NgTncq829ty3kEUERr5/RVeH7sWp4dORujHgilAcLhZDrLJh2iST aqcWaEUNAOr9P+Ty/mC6+OzPjrdj6Nq0ItM9rs+9VYzoBHHKVeLNevYsvkS80Q12LKEs 0o6tw5KHyNXzV1OM0o6T8I1JSaCInONq1eG5v4S84vo7LH2Z+faZYuz5Al6RE2jVR460 YHxKk3anIxArFimErcOitqiAjXdZc7SI4zwDNzHKOgd1v3dKoBrXfvjs2ilE1p8LhjLm PyZ6RWEmpa13rdfarhbLAc1Llq8ScZ6br3u5qG+3Ob9UsRjRDRHR5pc44BHdpI/PVWi9 DrQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=RGFwgNOxy2c5vC5HpDYOZgBADwWmZdC/mr6ZrB/I1+o=; b=hpyRJEMfQs7RQCx1UcThbfngu8fdUn9mQavyUUJE6x4putKPNw8cP67EVtA9XELw4A riDcWtfA6v0omFr2Nqxs/XxLdMf9l/IeSS//PL0QL2aAZnfVTc8/OEYZjq3q623Y8Jow uGWp0soxoCWHxRvHtBgXXN/qQZ9zXlxTzECNl9aoFmqTkjy9F/NbNK4dU+n25Z9InsFJ MiSfeiSE89M9UpgdQcNvi1oVIutBltnLz6qRqAwSmI6FS8u/fF6wZGO5PMmdk9+Dov0H RrU5hT1AmuW+7Y+wUmKgqpQxljDX2qS5q0OIuAqNt2hPg0OMdPLR3OOxn8YDwESyZKwr 2cRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=vWxBeDjo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x6si3668891oto.92.2020.04.09.02.39.48; Thu, 09 Apr 2020 02:40:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=vWxBeDjo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726623AbgDIJiH (ORCPT + 99 others); Thu, 9 Apr 2020 05:38:07 -0400 Received: from pandora.armlinux.org.uk ([78.32.30.218]:42198 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725997AbgDIJiG (ORCPT ); Thu, 9 Apr 2020 05:38:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=RGFwgNOxy2c5vC5HpDYOZgBADwWmZdC/mr6ZrB/I1+o=; b=vWxBeDjoSh9OhHIils63Rrjju X/UBHlDShAXNcg2MZNhY2NIIxfBNU+JSAlmkVRvUgQTBlghcFNPpiUHZowfdnxdTq/fb/Gxa7Jvrj e1vCU5nLZN0NfaVhjPldRoZYQtw2ngYAd7Lu8YqTLNyziLFO/NDGA27gn3k1O5gkRSYjpcxRk9b6d yCA6MyIqCWhIXGJubHG302XX8XoW9PQpkhvI06Af6M5D/f9NwvXvPOmvp+/vX/NlrfNQVYrev9aSU dV3Qb/227TVaUkKHkKyOxPUZMgLbaPl04sL9OuxGSqtBG+Vy83yj7vHALT3TTgPgDk6j2DWgKIrFN O+3l+XINw==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:47690) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jMTdC-00035R-OS; Thu, 09 Apr 2020 10:37:54 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1jMTdA-0002hb-Ax; Thu, 09 Apr 2020 10:37:52 +0100 Date: Thu, 9 Apr 2020 10:37:52 +0100 From: Russell King - ARM Linux admin To: Hui Song Cc: Shawn Guo , Li Yang , Rob Herring , Mark Rutland , Linus Walleij , Bartosz Golaszewski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org Subject: Re: [PATCH] gpio: mpc8xxx: Add shutdown function. Message-ID: <20200409093752.GV25745@shell.armlinux.org.uk> References: <20200409090259.13126-1-hui.song_1@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200409090259.13126-1-hui.song_1@nxp.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 09, 2020 at 05:02:59PM +0800, Hui Song wrote: > From: Song Hui > > When the kexec command is executed, the memory area will be re-paginated. > The shutdown function needed to make interrupt handler to be NULL.If > not, an interrupt will be generated during this period. When the interrupt > handler is executed,the handler function address changed and crash will > occur. I still don't think this is adequate. When kexec takes effect, the existing kernel is shutdown and replaced with the new kernel, and it completely takes over the system. The dynamically allocated structures (which include pointers for the parent interrupt for mpc8xxx) are irrelevant, as they will need to be reallocated. It feels like you're just putting a band-aid over a real problem. I think rather than producing a patch, you need to give details of the crash you are seeing. Probably having the kernel message log across the kexec and into the new kernel up to the point where the crash occurs would be a good idea. > > Signed-off-by: Song Hui > --- > drivers/gpio/gpio-mpc8xxx.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/drivers/gpio/gpio-mpc8xxx.c b/drivers/gpio/gpio-mpc8xxx.c > index 604dfec..a24e6c5 100644 > --- a/drivers/gpio/gpio-mpc8xxx.c > +++ b/drivers/gpio/gpio-mpc8xxx.c > @@ -446,9 +446,21 @@ static int mpc8xxx_remove(struct platform_device *pdev) > return 0; > } > > +static int mpc8xxx_shutdown(struct platform_device *pdev) > +{ > + struct mpc8xxx_gpio_chip *mpc8xxx_gc = platform_get_drvdata(pdev); > + > + if (mpc8xxx_gc->irq) { > + irq_set_chained_handler_and_data(mpc8xxx_gc->irqn, NULL, NULL); > + irq_domain_remove(mpc8xxx_gc->irq); > + } > + > + return 0; > +} > static struct platform_driver mpc8xxx_plat_driver = { > .probe = mpc8xxx_probe, > .remove = mpc8xxx_remove, > + .shutdown = mpc8xxx_shutdown, > .driver = { > .name = "gpio-mpc8xxx", > .of_match_table = mpc8xxx_gpio_ids, > -- > 2.9.5 > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel > -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 10.2Mbps down 587kbps up