Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp876304pxf; Wed, 7 Apr 2021 13:55:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOViFO9rGf7UAYF+9q+7UTTuIjmecOyEwfPQxtTPh2HDwCuseCLCeDitrNY1CumlSniiYR X-Received: by 2002:a17:907:3393:: with SMTP id zj19mr6092498ejb.347.1617828937779; Wed, 07 Apr 2021 13:55:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617828937; cv=none; d=google.com; s=arc-20160816; b=zvCXYAgqVizYV2X2B7+HeQU61QYYr4VsH4L7K8bVyOLcTVgijzOAfXx+8dSInzH5rx VIcI0+Z0QrUi3NCE6ZHqdG34Oc7BZQ0eIhEvgoulFNhB6AD59Ij13+EyKTxA1b9z2J9c qGVjDqM3DKSy81YVRMU+I7EXoJOAUH3jM8Vmcc/FL5x/Eh5NGKno99eCJ1BQcWCSVw72 VfEmNcz4Wtck63/iyf0iSQZiWgL5tlLRY279edmG9Li01agVJP0kK2ka9dZGgKx6HK6Q 23zkMM8BqvEcilhNP2y6auQrvl9fHvvBkc+xpoRUyropcDCENKf3ROHrUSOpD/N0Qmo3 WJHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dmarc-filter:sender :dkim-signature; bh=dRkaKojvnawlYO3e1C9wxx79COw07pLsiCqaSEnReIk=; b=HQbZ7Z6OktXagrbdjJhbUtOjwIURfIQ7HU+G2P1lmwt2RRi9db08nA9hqL3lV9nUum nBveBrykSzjmvA5KjuDjK3egl4bpnKEtngokgHvCM5PyHM2hy4LpoFyCJKG6suxgUfA4 9BcO/3SJitU7viftio7lIlSt0caEUEyOzDfKu4LtPGWaM+1eFRTZeVuOlWCSzF1uYhGj uh+/Dv3x2NZG9yXVpVgvEBHop8fG5Xi6jo4FwHVKs3q2+PXI85kKe+OmI3kydcqYT/jP 6gSOPydwpkRUpB3wkv3EF8qaQCB0iI98dEh01Bh6sODdzwnaxpWl5ECk6S3gIU8uLJ0c Huqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=veu3quot; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dy26si18579730edb.174.2021.04.07.13.55.15; Wed, 07 Apr 2021 13:55:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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=@mg.codeaurora.org header.s=smtp header.b=veu3quot; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351963AbhDGMA4 (ORCPT + 99 others); Wed, 7 Apr 2021 08:00:56 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:37489 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231315AbhDGMAx (ORCPT ); Wed, 7 Apr 2021 08:00:53 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1617796844; h=Content-Type: MIME-Version: Message-ID: In-Reply-To: Date: References: Subject: Cc: To: From: Sender; bh=dRkaKojvnawlYO3e1C9wxx79COw07pLsiCqaSEnReIk=; b=veu3quoti3INewFeTEH+d2XlX7KPy9fWyZsM8s0BRWXU4DS2itR9RnhVKCkynWAoJ5FuONMU 5b6mp7zPV1HHgk4lJtZXePwZ4HH84/RCFjM/YugbhdbJH1AAMqe2OnQSO7xEQ5xe29sY/ceq ndJD7wBsJKLnnBv7/NuYbzk34JA= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyI3YTAwOSIsICJsaW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n04.prod.us-east-1.postgun.com with SMTP id 606d9ed78166b7eff70a4f4d (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 07 Apr 2021 12:00:23 GMT Sender: kvalo=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 0381BC43464; Wed, 7 Apr 2021 12:00:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from potku.adurom.net (88-114-240-156.elisa-laajakaista.fi [88.114.240.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: kvalo) by smtp.codeaurora.org (Postfix) with ESMTPSA id 53876C433CA; Wed, 7 Apr 2021 12:00:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 53876C433CA Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=kvalo@codeaurora.org From: Kalle Valo To: Ulf Hansson Cc: =?utf-8?B?SsOpcsO0bWU=?= Pouiller , linux-wireless , netdev , driverdevel , Linux Kernel Mailing List , Greg Kroah-Hartman , "David S . Miller" , DTML , Rob Herring , linux-mmc , Pali =?utf-8?Q?Roh=C3=A1r?= Subject: Re: [PATCH v5 08/24] wfx: add bus_sdio.c References: <20210315132501.441681-1-Jerome.Pouiller@silabs.com> <4503971.bAhddQ8uqO@pc-42> <5713463.b6Cmjs1FeV@pc-42> Date: Wed, 07 Apr 2021 15:00:17 +0300 In-Reply-To: (Ulf Hansson's message of "Tue, 23 Mar 2021 20:12:06 +0100") Message-ID: <87pmz6mhim.fsf@codeaurora.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Ulf Hansson writes: >> If I follow what has been done in other drivers I would write something >> like: >> >> static int wfx_sdio_suspend(struct device *dev) >> { >> struct sdio_func *func = dev_to_sdio_func(dev); >> struct wfx_sdio_priv *bus = sdio_get_drvdata(func); >> >> config_reg_write_bits(bus->core, CFG_IRQ_ENABLE_DATA, 0); >> // Necessary to keep device firmware in RAM >> return sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER); > > This will tell the mmc/sdio core to keep the SDIO card powered on > during system suspend. Thus, it doesn't need to re-initialize it at > system resume - and the firmware should not need to be re-programmed. > > On the other hand, if you don't plan to support system wakeups, it > would probably be better to power off the card, to avoid wasting > energy while the system is suspended. I assume that means you need to > re-program the firmware as well. Normally, it's these kinds of things > that need to be managed from a ->resume() callback. Many mac80211 drivers do so that the device is powered off during interface down (ifconfig wlan0 down), and as mac80211 does interface down automatically during suspend, suspend then works without extra handlers. -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches