Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp314661pxb; Mon, 2 Nov 2020 23:35:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJzBJPyhvtmemQui9KloncCIyekyw7tIOP1g37RYRH9IDgDh8Klz5onHtWi2mgUMPk3bdUuO X-Received: by 2002:a05:6402:141:: with SMTP id s1mr19699256edu.87.1604388929458; Mon, 02 Nov 2020 23:35:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604388929; cv=none; d=google.com; s=arc-20160816; b=wSi5qCMd+76B5Y7dDHvHavoSGkirZyzg6EY4Ta6p/J6rFLBXuI7ZecFtVplvhmhxUd j9GztKSCaR78P2pbOdacJMEpmg1Z6j2afkMIyxKN+gb/+RGf0akPlnvDpxHa/zrEFiMx h9zL366Tc6pFQTBAMTHWuh4OYXW4dXZqFrtbGlFQiJkKyxhxEC80hklpKsVYXmHzmfoc tAGLu9mp38BIY2tfQsikkgf5sH4MqWAUGAvJZYepf6dsuT3LvxcaiGZ5t/XFg/44FB68 s0TlrgucHSMGE9NnaB+9r3m9uCAC0Gm6C1bc1gP6PQ5rkpIdTButve1iHX2jckvWxo0z qScg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=7KgVirmbvdIiMP21lEZ8ftkXaG9MKlrI/k0Ihfcw+g0=; b=lQnx5UXGf9a0zPsTh8RVOC1UwW503yFdFhpQ5VBoCB7zk6fDtF/n9Ap4nYN5G8VH/6 VI7RDjI8eMA3nIC7Bovj6K9OBaBfw5AwSEElJcddu36uKm9TSdPflPOoGAf74Mwf5m0G /SDH+irsETJmLYgcrl+GQvNTAy/WPS8z1Q+Pwc/TVTpgNgunB0uZsU49010mEpCy2lYW Id9gCJEn6+dsJgHcwaocuNQ0MD0d0j091A4YqVwp4jWsOh5+PAtVAsS+N/nqkCdcl1Z4 Sogim99sHvmkKsFZSTy2qJQ0jR4BGwpsYNaCnSE+Rao7h3C84ANyqDG/AYjRTaHZ4L0j gJ8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=R4eovI3s; 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 f4si11645245eja.252.2020.11.02.23.35.06; Mon, 02 Nov 2020 23:35:29 -0800 (PST) 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=R4eovI3s; 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 S1727930AbgKCHbE (ORCPT + 99 others); Tue, 3 Nov 2020 02:31:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725997AbgKCHbD (ORCPT ); Tue, 3 Nov 2020 02:31:03 -0500 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65476C0617A6; Mon, 2 Nov 2020 23:31:03 -0800 (PST) Received: by mail-wm1-x343.google.com with SMTP id e2so11735394wme.1; Mon, 02 Nov 2020 23:31:03 -0800 (PST) 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=7KgVirmbvdIiMP21lEZ8ftkXaG9MKlrI/k0Ihfcw+g0=; b=R4eovI3sazeMepUekKxQCQLY9UEJRs1DIZjvUfZFzNXzhw1rtq7bgCxkajL5B6AmOi Uf8zidW1HxXGIKtok6YhpF0Bdbmp7uGOM3PMtrSmi7H/YktZUViNF1LqH2s68uXPoLec J8MD5mVuwuqt4wMi/aUR4Raq2zz0yb83ldKo3vaFssYFrciaAfRdv5X7frYVUZKo/jzM 0/a9vqqbCb+2zdQIxkxpI5eU7iktXN2FxIC93Jyjoeu5TjYZLR+CAhFgLGvtf1ZsZ1bv J8J/5voz2dVgt/XHt6CO9c3kAM5VBtRxGnm9bv9oqA6CG2T6DekL+7YxFyNhRdfqqG3f kajA== 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=7KgVirmbvdIiMP21lEZ8ftkXaG9MKlrI/k0Ihfcw+g0=; b=IB+DnCC9XeP9IV5dLO8DeIBWPrljrfZz/uBsThnZN/RfJzvR+5mFXvhyzkp2liCpVv Zq1JvFx7NCbb1i/Jj3OVMnqnn3oqc/5vsgY4qKWZM2tUITV+KurgJmkQd8z9zTovYWGs fDyCseduYPc4o9ZaLF6/iqLWJQm/9slat6GgZpqU9ejCbWXw6ow9XGiuvpQWiCVg84hb Lfwxad977EWLITZorHfghhDAoSEAtMhnIIM1rqJ6Jlfx/pr8gjSfy+UOYgZLE9pXdoZI RUCWfj9opKpAE4pVM2XCo8myRjFmuKPvS82g8QnT1TZp4S7db2O3vDcOcHbYY3f0h3+P oAzg== X-Gm-Message-State: AOAM532vQJz35As5+m/iN0EiGwplV5zGP9dd5U1BsM8cVufxNRn/Pgvy sL7DesW008sEGAM6WHBEQx4o40M/lcEMDImH2lo= X-Received: by 2002:a1c:61c2:: with SMTP id v185mr1987039wmb.152.1604388660534; Mon, 02 Nov 2020 23:31:00 -0800 (PST) MIME-Version: 1.0 References: <20201102112239.19218-1-zhang.lyra@gmail.com> <20201102181655.GC5014@sirena.org.uk> In-Reply-To: <20201102181655.GC5014@sirena.org.uk> From: Chunyan Zhang Date: Tue, 3 Nov 2020 15:30:24 +0800 Message-ID: Subject: Re: [PATCH] spi: add runtime PM for transfer_one_message To: Mark Brown Cc: linux-spi@vger.kernel.org, Linux Kernel Mailing List , Orson Zhai , Baolin Wang , Chunyan Zhang , Bangzheng Liu Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 3 Nov 2020 at 02:17, Mark Brown wrote: > > On Mon, Nov 02, 2020 at 07:22:39PM +0800, Chunyan Zhang wrote: > > From: Chunyan Zhang > > > Before transfer message, spi devices probably have been in runtime suspended, > > that would cause the kernel crash on some platforms once access spi > > registers, such as on Unisoc's SoCs. The spi devices can be suspended > > until message transfer completed. > > This commit message is a bit hard to follow so I don't really understand > what the issue is. We only ever call transfer_one_message() from within > __spi_pump_messages() which already handles auto_runtime_pm so I'm not > seeing the situation where we might get to transfer_one_message() > without having already runtime resumed the controller. What exactly is > the error situation here? This code has been around for a while and I'm > not aware of reports of issues here and I can't see anything unusual > that the Spreadtrum driver is doing. With further tests and looking into this part of code, the problem we found recently on our platform which runs kernel 4.14 can be fixed by this commit [1]. In a word, there's no issue here indeed, this patch should be ignored, sorry for the noise and thanks for your review. Chunyan [1] https://lkml.org/lkml/2019/10/30/173 > > Also why are we doing this in transfer_one_message() where it will only > work for controllers using that? If we're missing runtime PM in some > paths then presumably controllers with a custom implementation are also > going to be affected as well, auto_runtime_pm is supposed to work for > them as well.