Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3802974pxj; Tue, 15 Jun 2021 08:59:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSbxtkVg1Ndb18fMFVFnAYvSJINy/EoKGWDd7Oj8mDiUVl6HWBLBSSUGmaKsKbOmDxygUi X-Received: by 2002:a17:906:9706:: with SMTP id k6mr236717ejx.456.1623772779647; Tue, 15 Jun 2021 08:59:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623772779; cv=none; d=google.com; s=arc-20160816; b=wiK4FAEYUzTexsZTbdMmfWrrkJmfs0rlJhvrHk+WmO1QT34rMcxaZuYqRkbGLLWQ3A 5VbIQzTvFr/1YKyKC2eASeA6LL9ampuHKAC9pLA0jjh6V8yaw1EV6bFXGgUbOUPAe83N IFtBMt8pD80y12gX2aZs6CZN/IOrw0d7e8D4z9ETzgDacynpGXKf3W4BYi9bHPGPKlOX T5ZqwtR+lXKZDcWisj+9jc6IZMgppR00/GkRyREnQ29I/ygRSLCWkHbHKv1mxoexdW4e GxUlIeAJhQLZ2VliupQuiy/jmyUJQ2ewH5Ea2D7C6UMFwC/cRtnzWzY0xQ5F+rIo/Wef vmCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=k2dNOWTNlbIdh5i+8Nsx9KpD00S4Gm6luTuaXTJKuvA=; b=K5o/cfya3w0DKhzIBpzawXccCEcSRJqkgCmfsuccUOuTU9kXnNaK4bTBAOJrM7lfAg jBkgCeTrrDyay64I//8zVNLOwHNDWylJIvP9DBDxx8cR8Ug1/V7VLjWTkmjWBID9g4fR HF86qQQWLJu2v72UNaT0amGYSemCfaCcbJxykx2W2N34cdkIJ4368jVObZURbJm5I7+K ynOQjS21cEXWjmA8UEJYHnf4MgO2nlJSEAOejzDLqCpDbVF45yF25LgDYExec97AuwLs hqfWO2L9mlBb46dcmdyK3cUWRIBevS/FE3q21HcqQ8aKnPSy1bPx3yyxWnpxKP/eQSPi hI6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ChZgBAMq; 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 dp16si3565561ejc.454.2021.06.15.08.59.16; Tue, 15 Jun 2021 08:59:39 -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=ChZgBAMq; 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 S231749AbhFOQAT (ORCPT + 99 others); Tue, 15 Jun 2021 12:00:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233060AbhFOP7a (ORCPT ); Tue, 15 Jun 2021 11:59:30 -0400 Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BE2BC061D7C; Tue, 15 Jun 2021 08:51:38 -0700 (PDT) Received: by mail-pg1-x52d.google.com with SMTP id t9so11810816pgn.4; Tue, 15 Jun 2021 08:51:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=k2dNOWTNlbIdh5i+8Nsx9KpD00S4Gm6luTuaXTJKuvA=; b=ChZgBAMq1DPAkCXl3o9ThacQ8Rn81K9UwoROidAaA54sYtZ8SM0GPS9Tnm9zH2xNpq C8oeufkZzN7UGlvaq8W0w//ODCeHnzdzCEdXWAlbrsoKfjPM2cQ8mFBBojKuw82QMs3K EYctZLOzMqS4QJel5Al5+H0jc8AWYDnl4Ch7CgkuQbrR6EQbAwsg2hNKzdDSbkoPLUuT ohrGaEoIapADit3oW3Y2OlIgcwPGab3JDsMeGCqnVe+AGCcwhq7vZVbLkLIOM9rmzAad 43B1O1cUuacPjpsWlnJDpczV0tN28HgiuUd6rRNTUdOEFU89xtDN5SPDxx4GACuBtAdg +tDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=k2dNOWTNlbIdh5i+8Nsx9KpD00S4Gm6luTuaXTJKuvA=; b=RFjImuFurH6xs1CxdnsImGccgREm/HBuZSq5WuSDCyzqSUC14Ftj17WArx/JfkSRIq xaqeplr+5lvn8Qqj0xiUxgbpBUw4vg7NGOcqwKD9jK5iOveFedRSvabBeqZMa6aYhZEx X7f/p/ht53D3skKiExzXTsTbfuuJFALdB2dNQFzNf+GoZupy6g+Q4ZTEVXodPPkusq8C WUDzdF4D5mLc/z9eefu5EiWBUbOhU118i5kiBS4fCCn5J5OYWU2+QTZvQGTnZ9DGx8kL NQxqHTlfaS4l/9h9/y7C9KgDvGdTeay/j6pPLBtLYOmwmP0esCxWjuho5D94ssZSiZUG OCGQ== X-Gm-Message-State: AOAM532cdm5unLRWKSppIRg1ijVudacz7WmIulzEL8bsNfuiw3t7l3g2 mQiY20/intwXyZ8JxCZJCVA= X-Received: by 2002:a63:5c4e:: with SMTP id n14mr196153pgm.192.1623772297831; Tue, 15 Jun 2021 08:51:37 -0700 (PDT) Received: from [10.230.29.202] ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id k18sm3013838pff.63.2021.06.15.08.51.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 15 Jun 2021 08:51:36 -0700 (PDT) Subject: Re: [PATCH 2/2] mmc: sdhci-iproc: Add support for the legacy sdhci controller on the BCM7211 To: Ulf Hansson Cc: Linux PM , "Rafael J. Wysocki" , Al Cooper , Linux Kernel Mailing List , Adrian Hunter , BCM Kernel Feedback , DTML , Linux ARM , linux-mmc , Nicolas Saenz Julienne , Ray Jui , Rob Herring , Scott Branden References: <20210602192758.38735-1-alcooperx@gmail.com> <20210602192758.38735-2-alcooperx@gmail.com> <6acd480a-8928-89bb-0f40-d278294973a1@gmail.com> From: Florian Fainelli Message-ID: Date: Tue, 15 Jun 2021 08:51:26 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/15/2021 8:30 AM, Ulf Hansson wrote: > [...] > >>> >>>> >>>> In all honesty, I am a bit surprised that the Linux device driver model >>>> does not try to default the absence of a ->shutdown() to a ->suspend() >>>> call since in most cases they are functionally equivalent, or should be, >>>> in that they need to save power and quiesce the hardware, or leave >>>> enough running to support a wake-up event. >>> >>> Well, the generall assumption is that the platform is going to be >>> entirely powered off, thus moving things into a low power state would >>> just be a waste of execution cycles. Of course, that's not the case >>> for your platform. >> >> That assumption may hold true for ACPI-enabled machines but power off is >> offered as a general function towards other more flexible and snowflaky >> systems (read embedded) as well. >> >>> >>> As I have stated earlier, to me it looks a bit questionable to use the >>> kernel_power_off() path to support the use case you describe. On the >>> other hand, we may not have a better option at this point. >> >> Correct, there is not really anything better and I am not sure what the >> semantics of something better could be anyway. >> >>> >>> Just a few things, from the top of my head, that we certainly are >>> missing to support your use case through kernel_power_off() path >>> (there are certainly more): >>> 1. In general, subsystems/drivers don't care about moving things into >>> lower power modes from their ->shutdown() callbacks. >>> 2. System wakeups and devices being affected in the wakeup path, needs >>> to be respected properly. Additionally, userspace should be able to >>> decide if system wakeups should be enabled or not. >>> 3. PM domains don't have ->shutdown() callbacks, thus it's likely that >>> they remain powered on. >>> 4. Etc... >> >> For the particular eMMC driver being discussed here this is a no-brainer > > because it is not a wake-up source, therefore there is no reason not to >> power if off if we can. It also seems proper to have it done by the >> kernel as opposed to firmware. > > Okay, I have applied the $subject patch onto my next branch, along > with patch 1/2 (the DT doc change). > > However, I still think we should look for a proper long term solution, > because the kernel_power_off() path does not currently support your > use case, with system wakeups etc. Not really, it does work fine, some drivers like gpio-keys.c or gpio-brcmstb.c will ensure that the GPIOs that are enabled as wake-up interrupts are configured that way during kernel_power_off() and the various interrupt controllers like irq-brcmstb-l2.c will make sure they don't mask wake-up interrupts. > > I guess it could be a topic that is easier to bring up at the Linux > Plumbers Conf, for example. OK, not sure if I will be able to attend, but would definitively try to. -- Florian