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=-4.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 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 B50F7C48BE8 for ; Tue, 15 Jun 2021 15:58:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 95B2D6162B for ; Tue, 15 Jun 2021 15:58:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231748AbhFOQAS (ORCPT ); Tue, 15 Jun 2021 12:00:18 -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-Google-Smtp-Source: ABdhPJzxd+19YUuuC7dp7PSqpG6zMz1GjqbkKB8x0UgFg+bpPlGxhB5l+HFRsBM/nFelIuD3dWFT/w== 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: devicetree@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