Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1733175ybt; Mon, 15 Jun 2020 08:04:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqlOLQrKzBes8ApUGw8Vz7hbZ91JtiWOM0i1P8GxU1+HP5lmi1Npf0vpkpLNKnW67rGdHj X-Received: by 2002:aa7:cd6c:: with SMTP id ca12mr24670430edb.36.1592233487285; Mon, 15 Jun 2020 08:04:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592233487; cv=none; d=google.com; s=arc-20160816; b=HaCFJ91IgilNEb+Fg2S6ApPMM+JZy0aCpynGH38z5PhhWSuCZwl+V4ThZBsQFUljii pPWTAbgg0UwiJjxufTNukOvHk2V9Yv0J/irK+2EimTlpLGNGGu9O0spWEGIa/iY8gGd8 I6aFTQHe2jL06G2Uti1VhdFGWFw+URxWZjBoorWvoxbKUafYGCHMPYyinCfktyS1UFhb ja3LiuinC/vGo1Y84JjlNacW0x66v+lDE5CB2BX/dxvniXJiZkAuBh6YF6kAmGo1btCK 7E5035yO8r70mZPtGnP+oRwHBpW/mCw/1zE+wJQYgR9g+LSWDIa/1sltt7Brukq0kBtJ lxJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=QoZq+ReLXchiw7LYSzZo84zmyZwrWU3yCXnArJEC3ik=; b=SVhl0PkhhTVwWeStSIXQbsCOmF+yQwBAvP31LpXFV67DWvekU/Cg+2JMHyl69aEz7Y egzp1Myi9VRAGKuFo0TiT76b8N00CDoVt6ZIig+p9cKkZohitIR/312+KEzAi9QQVFPr 5i0iNYBuxJESM1hVS9mkNTmBLQq7K7cIN4tsj3iWiOR3/VsGdgKbbfgNL7mp59FuSwkt mnqWpqhy7pdqIrpz+u5FOyvIWrsHzeYVthm9DC/e1l6O/nIbAJfMHTTixBOmnVuqKl9h NxNShGKIi8wgMDC6qFT5bnXvbcCRxqnUKfFZLU+fSacB0otk+TZzoU/+LvFbuOWbc+RX d5vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TWHvBItR; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a62si8571248edf.361.2020.06.15.08.04.23; Mon, 15 Jun 2020 08:04:47 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TWHvBItR; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730880AbgFOO7r (ORCPT + 99 others); Mon, 15 Jun 2020 10:59:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730629AbgFOO7q (ORCPT ); Mon, 15 Jun 2020 10:59:46 -0400 Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4DD0C061A0E; Mon, 15 Jun 2020 07:59:45 -0700 (PDT) Received: by mail-ej1-x643.google.com with SMTP id k11so17776302ejr.9; Mon, 15 Jun 2020 07:59:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QoZq+ReLXchiw7LYSzZo84zmyZwrWU3yCXnArJEC3ik=; b=TWHvBItRY4XgOfbULNlCfXBRexrhuYmPJ4YWP3qSUFi88BprBD7quxMVD3JbCjQout nijewoKytD63bEA+oTEb5yCfjl70v4c1tqeRexUVXtJRrKLwitpOpIoHTf1RlsJvyH4v OQRAesyP5JD/TPmljx8FEGic2mR/MgbP1iaEOFy+MGmMU6bKvEfTSun7+x6+T7haj9/h mFdwQueeOixyGdG350LqbDvyf9sQI/+IMcn2VUfDszMVySRkEq4qjKk5lETVpAfTZdRU DVZXCoUJwZSZGp1Fmgof0RUHiBEWmOkskrWNAx5XenPy26U7VFvA7mgloLXpOLE+Ef4W NRlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QoZq+ReLXchiw7LYSzZo84zmyZwrWU3yCXnArJEC3ik=; b=PtAKuxmeQCzBD60/+A9ORjjNjwc9lRZ5qeQIyA6KpZlxymSjCvBl4FOAmkW4UdC+D7 Fe0k02JNrU+Y8s9EmkSAo6XySqMk/0caYdHHRSPTfhrROpdoLlwM3pbkUrm8kJUu+yJq 558aZ+F3hXGOokYjcs+805DWvfYUGDg3X03XnIMAxMiecKCZPie3uLZD8S5cbCa431c/ +mwvt8rydmOLbBBH4Ks6On2n5D9hR1gIA/jD9a1g0OfuEJRbDgvYIzCgz5gQpYzoofdn kZ06ON+YSoqgVDj6japSVR8GUTqAiyuIS7KdIaoc9Tz8p5KBoBUdm8pZKwMJRQjLUCEc 0gxA== X-Gm-Message-State: AOAM532necJ4FCKh12pHQcWcb2Tf6hYm8rIulVw93J1V0oXnn1Yu4cEL mcwqiXSUubQvwKvN6ClnvQVqzacinL3o1/2eAhI= X-Received: by 2002:a17:906:198d:: with SMTP id g13mr13284509ejd.281.1592233184564; Mon, 15 Jun 2020 07:59:44 -0700 (PDT) MIME-Version: 1.0 References: <1592208439-17594-1-git-send-email-krzk@kernel.org> <20200615123052.GO4447@sirena.org.uk> <20200615131006.GR4447@sirena.org.uk> <20200615134119.GB3321@kozik-lap> <20200615145711.GA24927@kozik-lap> In-Reply-To: <20200615145711.GA24927@kozik-lap> From: Vladimir Oltean Date: Mon, 15 Jun 2020 17:59:33 +0300 Message-ID: Subject: Re: [PATCH v2 1/3] spi: spi-fsl-dspi: Fix external abort on interrupt in exit paths To: Krzysztof Kozlowski Cc: Mark Brown , Marc Kleine-Budde , Thomas Gleixner , Vladimir Oltean , linux-spi , lkml , Wolfram Sang , stable@vger.kernel.org, Pengutronix Kernel Team Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 15 Jun 2020 at 17:57, Krzysztof Kozlowski wrote: > > On Mon, Jun 15, 2020 at 05:23:28PM +0300, Vladimir Oltean wrote: > > On Mon, 15 Jun 2020 at 16:41, Krzysztof Kozlowski wrote: > > > > > > On Mon, Jun 15, 2020 at 04:12:28PM +0300, Vladimir Oltean wrote: > > > > On Mon, 15 Jun 2020 at 16:10, Mark Brown wrote: > > > > > > > > > > > > > > It's a bit unusual to need to actually free the IRQ over suspend - > > > > > what's driving that requirement here? > > > > > > > > clk_disable_unprepare(dspi->clk); is driving the requirement - same as > > > > in dspi_remove case, the module will fault when its registers are > > > > accessed without a clock. > > > > > > In few cases when I have shared interrupt in different drivers, they > > > were just disabling it during suspend. Why it has to be freed? > > > > > > Best regards, > > > Krzysztof > > > > > > > Not saying it _has_ to be freed, just to be prevented from running > > concurrently with us disabling the clock. > > But if we can get away in dspi_suspend with just disable_irq, can't we > > also get away in dspi_remove with just devm_free_irq? > > One reason why they have to be different could be following scenario: > 1. Device could be unbound any time and disabling IRQ in remove() would > effectively disable the IRQ also for other devices using this shared > line. First disable_irq() really disables it, the latter just > increases the counter. > 2. However during system suspend, it is expected that all drivers in > their suspend (and later resume) callbacks will do the same - disable > the shared IRQ line. And finally the system disables interrupts > globally so the line will be balanced. > > Freeing IRQ solves the case #1 without causing any imbalance between > enables/disables or requests/frees. Disabling IRQ solves the #2, also > without any imbalance. > > Best regards, > Krzysztof > > > So the answer to my question is 'yes', right?