Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1655385ybt; Mon, 15 Jun 2020 06:14:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJykH5iVlX2DHIeX6SKq1gjpIu1SORuQNrskpE3EDcqJP5gyuYvJbzFRvp327aNdnkUo4OA0 X-Received: by 2002:a17:906:f49:: with SMTP id h9mr26728028ejj.155.1592226846451; Mon, 15 Jun 2020 06:14:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592226846; cv=none; d=google.com; s=arc-20160816; b=EwuSkayaeVdtDz9eNIs70KfVQ3vi0FwOP0wKb0FktJ4unapFpgfZo8bfE5lTGawDQr 0Dz9ZvgIcFliP8WNQaAc7Vs35Z12g/cdRQSOfK4tsqMEtWn+UjuIYdGWOFu+A9iCPAQ4 a3di82Fjak+A1dVuDYhwYtYWhM8qVOKJoUW1CSuLPLdXxuIny0aMD9q2AlSCH42soM3T h3bd/rA8nYGNlHKUd1N7jJNAFafj15ovBgrgga1EFH0+jm9C6K6jMjeUCT9a2b7MxfoV vmnzMtX9jNhkxh9stxDgeVrU4H+ys/gQIwP14CfMC9AygO5TWrLFH4K4F6YCtiap1OOz NJZQ== 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; bh=dYUzTCoFGyBENEloMMCzFkHMfOOssrsDD4uM84BbR08=; b=e6GMAwo+CiNu+7QpnNckhVUfHLMsYmOkOHWmz/TSCSYbE8Z2KL/xHe8RJGWNgZSk2x Qwz/UHGuryPiXGVRUFmKPoCmZDs+8go37WnynpyUxboNkamrIClaLU33riiBYrBujf30 2r3guk+g4svconMx887u0GmnkD5s7+Q5T1exI2sB+dkEnOFxOHJ3C++5AF21mq7C8H3R 01/LebnR7E8eUaJbFFg4FQpDneEaGVp7KJTHKgezqDL3MsAx0HmQc4hW/xq70otm7ooO kEyR4mpSe34pAjjT29bOKYc0zbzuld98wL5OD9F72E66GnX/YO727EH5/hKl997AxwfY r63Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ay4si9311740ejb.439.2020.06.15.06.13.42; Mon, 15 Jun 2020 06:14:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730322AbgFONKT (ORCPT + 99 others); Mon, 15 Jun 2020 09:10:19 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:35939 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729875AbgFONKS (ORCPT ); Mon, 15 Jun 2020 09:10:18 -0400 Received: by mail-wr1-f68.google.com with SMTP id q11so17089329wrp.3; Mon, 15 Jun 2020 06:10:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=dYUzTCoFGyBENEloMMCzFkHMfOOssrsDD4uM84BbR08=; b=eeoTmkiOEtoDNOdzhAUncodKBwcJPnkZ4MiKftVLI2/hcfQyaM1dDKC12vlaPdVSIH 1g7vGt7m5r7ZxeI2QFGbwmynf6fwJN1tQsqI8slzNV/vWBLpssaBJoYQRY/VrFt5AzZ0 f6ZvmfP9EXpOJ58XbRuIjJxFwwPwEFOeXDMxXMr/YocNHxZ4v2Kv7L4W6WdhBN+Odbld B4nKDP4BkqiNfN8cYAniDf2RJtTpnbvgfK4FtRXSrZ+8rqAAxitMTNBX8z+ELkhEBwA1 cNCzAdC6cykN6Ou0Qf4pKiJSawsqi7j9417Iq+OXlIaBkqJg0LVA9cwJhHcSOC7zUqOv boCg== X-Gm-Message-State: AOAM531HwayWkR6XwITHfIHfuz5gw4adGaMvhBheZDCYwHntTUKfDnAZ 9KAvcmqy5gxmnJpsb2wdkXk= X-Received: by 2002:a5d:4cd1:: with SMTP id c17mr28679368wrt.199.1592226615248; Mon, 15 Jun 2020 06:10:15 -0700 (PDT) Received: from kozik-lap ([194.230.155.184]) by smtp.googlemail.com with ESMTPSA id o82sm23173112wmo.40.2020.06.15.06.10.13 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 15 Jun 2020 06:10:14 -0700 (PDT) Date: Mon, 15 Jun 2020 15:10:12 +0200 From: Krzysztof Kozlowski To: Vladimir Oltean Cc: Mark Brown , Marc Kleine-Budde , Thomas Gleixner , Vladimir Oltean , linux-spi , lkml , Wolfram Sang , stable@vger.kernel.org, Pengutronix Kernel Team Subject: Re: [PATCH v2 1/3] spi: spi-fsl-dspi: Fix external abort on interrupt in exit paths Message-ID: <20200615131012.GB2634@kozik-lap> References: <1592208439-17594-1-git-send-email-krzk@kernel.org> <20200615123052.GO4447@sirena.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 15, 2020 at 03:56:01PM +0300, Vladimir Oltean wrote: > On Mon, 15 Jun 2020 at 15:35, Mark Brown wrote: > > > > > > > Indeed. The upshot of all this is that the interrupt needs to be freed > > not disabled before the clocks are disabled, or some other mechanism > > needs to be used to ensure that the interrupt handler won't attempt to > > access the hardware when it shouldn't. As Vladimir says there are > > serious issues using devm for interrupt handlers (or anything else that > > might cause code to be run) due to problems like this. > > And the down-shot is that whatever is done in dspi_remove (free_irq) > also needs to be done in dspi_suspend, but with extra care in > dspi_resume not only to request the irq again, but also to flush the > module's FIFOs and clear interrupts, because there might have been > nasty stuff uncaught during sleep: > > regmap_update_bits(dspi->regmap, SPI_MCR, > SPI_MCR_CLR_TXF | SPI_MCR_CLR_RXF, > SPI_MCR_CLR_TXF | SPI_MCR_CLR_RXF); > regmap_write(dspi->regmap, SPI_SR, SPI_SR_CLEAR); > > So it's pretty messy. It is a slightly different bug which so this patch should have a follow up. Best regards, Krzysztof