Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp225268pxb; Mon, 13 Sep 2021 17:39:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwScG2zlG/ZFWQ9fMjbyrZ8tTDwzsswPvViCe/1boFiKqr4bZf3dReQg72C5d+9K722YJhy X-Received: by 2002:a17:907:2717:: with SMTP id w23mr15870241ejk.283.1631579956684; Mon, 13 Sep 2021 17:39:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631579956; cv=none; d=google.com; s=arc-20160816; b=bDdF6UABfsZNypeOQ7cebyKawK6xQOF9Oa55kn9GuZeUhp1TlKuV8UF/uaBikKdEuS iZVos0NRIFMnMYXsvcOoY+QVg79uKOVybgSpf6hLZ82Hubc9oonAwDXmHJwWaXtJLF2i nGWOTVr2NGdzcPrfmGFc60xT7wCSSyb+s4byLa0Zv2J/x4IaTcjgO8euF71cMpV4IAvI yHy8PixyG1sskQy6riMCKxRhI93SwS0AL8Z97aicr9fAQozcWBmJRH1zS7ya9ZA8LeGr Iiid6J5tZbou91Ss6oHD9aE9IqAjIplbf0V1ZvxbJqKXbnfb+6Iuso4Tz+6pIS4xmZF9 bjDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=BVrxRWHKyUrGv+35tc6x5b7RGSJFUHhIxAEhdcNdIKs=; b=n6nRD/6vS5Us4i5uKbZuyeHv4j4leSmGNYSEmaTni0TAxOSHzHrwh+dZ9Nce5upMqb fWwJVtnA2HjAYR6SCnf9TGSdv0F1A47ByYD3lHWynuNU2ruODsvXc5PFHhCdO5l/eJgV aSEPmIu/QiPLXLald8VpQrcVzq7uwFthtQQ0I5B1aCk1tXb6EwCM0RkeevVd0oZJbkk6 IQVz4BvI++bc8/49F1nSXSUrVS2ADNQOji+m80ASrMFdVY34WsfrI1WJvVXrGkbCyEPl 3WTuSoFfLjtMG0A7NLQSjywyvVW1QHuF4nLcX8vzX2wfovY1b0egYaDGEqjg/7A6s6hJ epuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FakgeYfe; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 18si8971057ejj.568.2021.09.13.17.38.49; Mon, 13 Sep 2021 17:39:16 -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=@kernel.org header.s=k20201202 header.b=FakgeYfe; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244775AbhIMPeq (ORCPT + 99 others); Mon, 13 Sep 2021 11:34:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:44156 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241887AbhIMPem (ORCPT ); Mon, 13 Sep 2021 11:34:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C236F6103B; Mon, 13 Sep 2021 15:33:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631547206; bh=BVrxRWHKyUrGv+35tc6x5b7RGSJFUHhIxAEhdcNdIKs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FakgeYfeGaCUOVDhuplPOuxzkueMRigaWZPbFMdFaWzXE1bGfIIOH1Mm6EF0NCgJX Iluf7pmOjapb/XnI4+xibPLH3PNTzPQtwjQ1G+hkJcJfOmoWXgsYh9StzqKB3c5B0l Z58aIJ3VTZ8ov0dWfyQjkfnEQ0+E5nZoZ68DRIznchEDUSgnv9OjoUdbDRw5mZzfLD zYi7sK5wyxfa4wT+OBkNYTjBRRZVXRPio/dHjMwWBat9Aer4OgGDt55PZngQ0+SPUf IfaLvfbRcezowcvk0kZoz1CaRIS40SwyTYzT6x0TImW6ksMk4RdDCn3AQARF/azmqn gddnu7nozISGw== Date: Mon, 13 Sep 2021 16:32:46 +0100 From: Mark Brown To: Trevor Wu Cc: tiwai@suse.com, matthias.bgg@gmail.com, alsa-devel@alsa-project.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, dan.carpenter@oracle.com Subject: Re: [PATCH v2] ASoC: mediatek: common: handle NULL case in suspend/resume function Message-ID: <20210913153246.GI4283@sirena.org.uk> References: <20210910092613.30188-1-trevor.wu@mediatek.com> <20210910102358.GC4474@sirena.org.uk> <5fa1e99f1b9097336a3e610dc383170f09036b14.camel@mediatek.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="PWfwoUCx3AFJRUBq" Content-Disposition: inline In-Reply-To: <5fa1e99f1b9097336a3e610dc383170f09036b14.camel@mediatek.com> X-Cookie: Above all else -- sky. User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --PWfwoUCx3AFJRUBq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Sep 13, 2021 at 01:55:38PM +0800, Trevor Wu wrote: > On Fri, 2021-09-10 at 11:23 +0100, Mark Brown wrote: > > It seems like it'd be better to just allocate the buffer at probe > > time > > and fail in case we can't get it, I'd be surprised if there's many > > platforms using this hardware that don't also end up suspending and > > resuming. > Thanks for your suggestion. > I agree it's better to allocate the memory at probe time. > I think we can still keep the implementation in the suspend/resume > function as a fallback solution if user doesn't allocate the memory in > probe function. If you can't allocate it at probe time you should probably just fail the probe. > In the new mediatek SOCs, regcache has been used to handle register > backup. > Do I need to add the buffer allocation on probe function to the > platform in which mtk_afe_suspend and mtk_afe_resume are used? I think you should have separate implementations if you have both regmap and non-regmap versions of this. --PWfwoUCx3AFJRUBq Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmE/bx4ACgkQJNaLcl1U h9Arhgf/YT4zF+AifPO22fnvUWMW7ps029xRsDBaUGwyRl4XFu6O90vmI7jjaogy 2fFfMzXc8EoOGWfhZhrhZqkIogzIol1wDrEnHtWLDpdnWBOgejqTG6jh3hbIU4EI PRKbvL3qTXlzfhz23Qb+BjG4SQaDbVfRbb+e+nE4Om9qw5b199MIDht8Mye8KMgE Wqt+y6alWGPcl/1RsdRJ8pVWASpQyYmwwbaHnVtGEarrdVOZzmiEL2offMAwiW4G NDRcFOJcCrpu5eECoF2RM5XeRwzwJ8CxIvKMtlbhbniPDRyBPaLZ2zPGEUfInaoe 8lGIdpFSBHHvIq1QE7w6VAoqpmER4g== =eZc7 -----END PGP SIGNATURE----- --PWfwoUCx3AFJRUBq--