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=-2.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED,USER_AGENT_SANE_2 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 F04B2CA9EAF for ; Thu, 24 Oct 2019 06:25:27 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C1E6C21655 for ; Thu, 24 Oct 2019 06:25:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Vm9Pvnyl" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C1E6C21655 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Date:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pMPD2jUqad3S7tLnJNATVkZK814yb/4ZMsQO23vH0rY=; b=Vm9Pvnyls/hW8l d/G7evpm1xWN3FMT/M5/EYhjbo8p2kAKG7s3sFVt5lcOiVo0XS3KV21sMqzbUtLCCE2ig/A7TxxZx N+NYCBjSfzp3IIG8e1ii6yi7nFGhpUkD6lahFQGuIB3b07vf8dmL0TR14YA/nD/1wOgFZmk/4F2iT +a3O1wV0yGza+Uhm1hHFs0Zkv2bJeYOz1RSQgmQTIKkkJz+w+rtOvDRtUVy8vjuGe/PZ0CUAkWeXm /8XgrIqn3+Pe84/rsKyrEnSgHIVmxmbAbkv63iN/VmGHxoKfwriIVChO7TRolzK6+umq7FmRBsjC/ mgL8LP1P1Kpx6QtsPPLg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iNWYi-0005oT-ET; Thu, 24 Oct 2019 06:25:20 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iNWYf-0005mf-5q; Thu, 24 Oct 2019 06:25:18 +0000 X-UUID: a874f3a9fc704192ac3b215dc9f2d57b-20191023 X-UUID: a874f3a9fc704192ac3b215dc9f2d57b-20191023 Received: from mtkcas67.mediatek.inc [(172.29.193.45)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 1452921731; Wed, 23 Oct 2019 22:25:06 -0800 Received: from mtkmbs07n1.mediatek.inc (172.21.101.16) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 23 Oct 2019 23:25:09 -0700 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 24 Oct 2019 14:25:08 +0800 Received: from [10.15.20.246] (10.15.20.246) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Thu, 24 Oct 2019 14:25:07 +0800 Message-ID: <1571898319.4311.3.camel@mbjsdccf07> Subject: Re: [PATCH 1/1] spi: mediatek: add power control when set_cs From: luhua xu To: Mark Brown Date: Thu, 24 Oct 2019 14:25:19 +0800 In-Reply-To: <20191023151121.GC5723@sirena.co.uk> References: <1571834322-1121-1-git-send-email-luhua.xu@mediatek.com> <1571834322-1121-2-git-send-email-luhua.xu@mediatek.com> <20191023151121.GC5723@sirena.co.uk> X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191023_232517_223758_00065BDF X-CRM114-Status: UNSURE ( 8.84 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: wsd_upstream@mediatek.com, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, linux-mediatek@lists.infradead.org, Matthias Brugger , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, 2019-10-23 at 16:11 +0100, Mark Brown wrote: > On Wed, Oct 23, 2019 at 08:38:42AM -0400, Luhua Xu wrote: > > From: "luhua.xu" > > > Use runtime PM to power spi when set_cs > > As set_cs may be called from interrupt context, > > set runtime PM IRQ safe for spi. > > Why might we be trying to set the chip select state while the device is > runtime idle? It seems like whatever is trying to set the chip select > should be dealing with this, not the chip select operation itself since > that's unlikely to be happening in isolation. Hi Mark, Spi framework provideds spi_setup() to modify spi settings for spi device (maybe spi is runtime idle now), and this will call spi_controller->set_cs() accessing registers. Other spi_controller callbacks that need to access hardware registers, are triggered by spi transfer. Spi framework will get and put runtime power in __spi_pump_message(). _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel