Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4E75C433E2 for ; Mon, 25 May 2020 13:23:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8F2AC2070A for ; Mon, 25 May 2020 13:23:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390674AbgEYNXa (ORCPT ); Mon, 25 May 2020 09:23:30 -0400 Received: from mga05.intel.com ([192.55.52.43]:43498 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388685AbgEYNX3 (ORCPT ); Mon, 25 May 2020 09:23:29 -0400 IronPort-SDR: fSsqYVOSDpe3GEq07WThveHS5V6+K0M2Cw6smlyHdOcZqbRV8PVvSr9757ThF+EBD+yLjsW84B ubGYXIT9kw5Q== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 May 2020 06:23:29 -0700 IronPort-SDR: E4qERus38693IFp7jgHzLDA2T05pE1UTbJXjREL0QP7ykx4yOSIVTTD2wtTrZ3R+Ayf2q90uqP LNnk6zZdo9QQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,433,1583222400"; d="scan'208";a="413510522" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga004.jf.intel.com with ESMTP; 25 May 2020 06:23:26 -0700 Received: from andy by smile with local (Exim 4.93) (envelope-from ) id 1jdD4j-008nBa-7s; Mon, 25 May 2020 16:23:29 +0300 Date: Mon, 25 May 2020 16:23:29 +0300 From: Andy Shevchenko To: Lukas Wunner Cc: Mark Brown , Jarkko Nikula , linux-spi@vger.kernel.org, Baruch Siach , Serge Semin , Tsuchiya Yuto , Daniel Mack , Haojian Zhuang , Robert Jarzmik Subject: Re: [PATCH 0/3] Intel SPI unbind fixes Message-ID: <20200525132329.GY1634618@smile.fi.intel.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org On Mon, May 25, 2020 at 02:25:00PM +0200, Lukas Wunner wrote: > Fix unbind ordering issues in the Designware and PXA2xx SPI controllers > built into Intel SoCs. > > To test, you'll also need the following commit: > https://git.kernel.org/broonie/spi/c/84855678add8 > > This is compile-tested only, so please review and test thoroughly. > > Pay particular attention to the IRQ handlers dw_spi_irq() and ssp_int(): > Both drivers request the interrupt with IRQF_SHARED, so the IRQ handler > may run even though the SPI controller itself hasn't signalled an > interrupt. The IRQ is requested before registering the controller and > freed after unregistering the controller. Thus, the IRQ handler should > immediately bail out if the controller is not yet or no longer registered, > e.g. by checking in the controller's registers whether an interrupt is > actually pending. The drivers may need to disable interrupts in the > controllers' registers upon unbinding and they need to make sure that > the registers are accessible until the IRQ is freed. > > I don't have a datasheet for these SPI controllers but I hope someone > who is more familiar with them will be able to check for correctness > of the IRQ handling. Thank you for this! I reviewed all three, but I have no means to reliably test it. From the description and logic point of view this sounds correct. So, let's wait for Tsuchiya Yuto to test and confirm that it's right way to go. > > Lukas Wunner (3): > spi: dw: Fix controller unregister order > spi: pxa2xx: Fix controller unregister order > spi: pxa2xx: Fix runtime PM ref imbalance on probe error > > drivers/spi/spi-dw.c | 4 +++- > drivers/spi/spi-pxa2xx.c | 5 +++-- > 2 files changed, 6 insertions(+), 3 deletions(-) > > -- > 2.25.0 > -- With Best Regards, Andy Shevchenko