From mboxrd@z Thu Jan 1 00:00:00 1970 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=-0.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 60DE2C433E0 for ; Fri, 15 May 2020 21:37:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3B0C12073E for ; Fri, 15 May 2020 21:37:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lLMDRCN6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726730AbgEOVh0 (ORCPT ); Fri, 15 May 2020 17:37:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726301AbgEOVh0 (ORCPT ); Fri, 15 May 2020 17:37:26 -0400 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 798CBC061A0C for ; Fri, 15 May 2020 14:37:26 -0700 (PDT) Received: by mail-pl1-x644.google.com with SMTP id k22so1428691pls.10 for ; Fri, 15 May 2020 14:37:26 -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=12PJ4LVKC32hDA7ji0l5dHls/k0wf58AYdIns1gYhdY=; b=lLMDRCN6cFeiFSGoky9NJRQT0lRkcF/+YQaFJKWg+V7rqtGOUR0ArOS3wbNm22u7pe TWZFTJIpYSqlDEmn9mNy9LRQZTqxOUFCTI+kP0T6U69YvxsDkb/iYgSuiob3oX+vf19f 7Ba+iErAE1Vu4oU9rF+WmUOzpTB7slxGv0cX/bPp5yd4YGrtHv437VYchJWxYHJWA5VT jgNhflbGEkXpcCzP/t7Pjo9P+piGo/+fQyo+6VOv7f97YKVL9uoKZ+PFBOs4gKa2SPQa 0b1cwn+c9FY6eYmdPWMFaLIWI3NEQNPA4CdVYz54Lx+7THvEKropeTQ+PJVLv4S0romu 7EcQ== 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=12PJ4LVKC32hDA7ji0l5dHls/k0wf58AYdIns1gYhdY=; b=sRLis7/gblQYD+tq/eHJCo0EZHjk/Qhi43MqQcvIa8cbJYhlaqeR3GOnYi2zEnMzNR cBSsEpV+jP7rWrQMcDZ14KmRiHga42oKAlcXSBrzG7ScoROd0gcWCpvVOSO4NWUQBZjt wEpB9ustENuH3DzRXuExOj1+kNJFc76f3Edq0ebeBw7akpWMAiNHSS0+C5CY3K/gg7Q/ B8PZ/5qupkxW6O2JxBxyDNR4I5Rwpwhh8qKlLcP4C+vyFR8oSZW/WZDm6EtYxnZCJLP+ NT11hZLl/rKTW1y/4GW5V67hDTuv4R40FMug1foZZa5/zJc6CvzbMyqv3Fb+p8yhLT+s dTOg== X-Gm-Message-State: AOAM533sxErcuqj9vCl+HCC3KEIbY00L9vWjCfaHbiRqHDu9N8UqBAqx 9DaYTc8KeEx+07+Omw4QTfGwFkxk/2e69v0NbBI= X-Google-Smtp-Source: ABdhPJx5/8oNtWN1M6mE+TtSVDTz4HIgpG8Cry8bXsPjHyVZlZn6EAN35E04T6KCXm5nir5hzXFpJtCD4HLmpWcav1M= X-Received: by 2002:a17:90b:94a:: with SMTP id dw10mr5768706pjb.228.1589578646010; Fri, 15 May 2020 14:37:26 -0700 (PDT) MIME-Version: 1.0 References: <8aaf9d44c153fe233b17bc2dec4eb679898d7e7b.1589557526.git.lukas@wunner.de> <20200515162725.GG5066@sirena.org.uk> <20200515163147.3u4xjqdxci2neup7@wunner.de> In-Reply-To: <20200515163147.3u4xjqdxci2neup7@wunner.de> From: Andy Shevchenko Date: Sat, 16 May 2020 00:37:17 +0300 Message-ID: Subject: Re: [PATCH 1/5] spi: Fix controller unregister order To: Lukas Wunner Cc: Mark Brown , Nicolas Saenz Julienne , Martin Sperl , linux-spi , linux-rpi-kernel , Linus Walleij Content-Type: text/plain; charset="UTF-8" Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org On Fri, May 15, 2020 at 7:41 PM Lukas Wunner wrote: > > On Fri, May 15, 2020 at 05:27:25PM +0100, Mark Brown wrote: > > On Fri, May 15, 2020 at 05:58:01PM +0200, Lukas Wunner wrote: > > > However since commit ffbbdd21329f ("spi: create a message queueing > > > infrastructure"), spi_destroy_queue() is executed before unbinding the > > > slaves. It sets ctlr->running = false, thereby preventing SPI bus > > > access and causing unbinding of slave devices to fail. > > > > Devices should basically never fail an unbind operation - if something > > went seriously wrong there's basically nothing that can be done in terms > > of error handling and keeping the device around isn't going to help. > > I guess the word "fail" in the commit message invites misinterpretations. > The driver does unbind from the slave device, but the physical device is > not left in a proper state. E.g. interrupts may still be generated by > the device because writing a register to disable them failed. I didn't check a patch, but I see a bug on kernel bugzilla against spi-pxa2xx because of this. It requires quite untrivial ->remove() in order to quiescent the DMA and other activities. -- With Best Regards, Andy Shevchenko