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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 9A36FD16265 for ; Mon, 14 Oct 2024 13:42:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=GYUKyz0lXnV9gn8DY8eEHHwvZ07Vrvzx+UJYw9wmWds=; b=cWTeJbsR0LAFKaKGDGaxOaGvnZ UqQnSPayHG0khmX//CxiM7tsNvZCwKVUpOF6SpoXxNpbKus6TDuAKC6dg4jJDc+I9EkPhnTFFKQd8 ONxoefIty5fb9LRzyxzjDAI67NDKaOkTbp/QZICi72xWriYssDxtFfsX9KBTgUkpbHiOJ3nVzzYYF EvAGnCMA82yrWgLIhOW0G/Na+ymXBiNu26GOsDkUP2jambrskakCErwUhnBht6QNk7oHK5SFWbpTL r0qfkcSV+DmciKEGPilokfT5cRMQ8IDGmCmvPJ/w7jBkrGTXyaALSe/AfzlDO76Xk53/BfDqptH4v RHy/Gp+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0LKv-00000005KzR-3aB0; Mon, 14 Oct 2024 13:42:13 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0KZ0-000000059Kg-3hwr for linux-arm-kernel@lists.infradead.org; Mon, 14 Oct 2024 12:52:44 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 87E011007; Mon, 14 Oct 2024 05:53:11 -0700 (PDT) Received: from [10.57.86.130] (unknown [10.57.86.130]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 507043F71E; Mon, 14 Oct 2024 05:52:38 -0700 (PDT) Message-ID: <5e9ee10b-fc15-4c6a-a666-0d80ec8bdd9a@arm.com> Date: Mon, 14 Oct 2024 13:52:36 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH v1 22/57] sound: Remove PAGE_SIZE compile-time constant assumption Content-Language: en-GB To: Takashi Iwai Cc: Mark Brown , Andrew Morton , Anshuman Khandual , Ard Biesheuvel , Catalin Marinas , David Hildenbrand , Greg Marsden , Ivan Ivanov , Jaroslav Kysela , Kalesh Singh , Marc Zyngier , Mark Rutland , Matthias Brugger , Miroslav Benes , Takashi Iwai , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-sound@vger.kernel.org References: <20241014105514.3206191-1-ryan.roberts@arm.com> <20241014105912.3207374-1-ryan.roberts@arm.com> <20241014105912.3207374-22-ryan.roberts@arm.com> <6926988e-5532-457f-9e1a-135b03585c5d@arm.com> <8734kyyhzh.wl-tiwai@suse.de> From: Ryan Roberts In-Reply-To: <8734kyyhzh.wl-tiwai@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241014_055243_016376_BE165512 X-CRM114-Status: GOOD ( 18.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 14/10/2024 13:41, Takashi Iwai wrote: > On Mon, 14 Oct 2024 14:24:02 +0200, > Ryan Roberts wrote: >> >> On 14/10/2024 12:38, Mark Brown wrote: >>> On Mon, Oct 14, 2024 at 11:58:29AM +0100, Ryan Roberts wrote: >>>> -static const struct snd_pcm_hardware dummy_dma_hardware = { >>>> +static DEFINE_GLOBAL_PAGE_SIZE_VAR_CONST(struct snd_pcm_hardware, dummy_dma_hardware, { >>>> /* Random values to keep userspace happy when checking constraints */ >>>> .info = SNDRV_PCM_INFO_INTERLEAVED | >>>> SNDRV_PCM_INFO_BLOCK_TRANSFER, >>>> @@ -107,7 +107,7 @@ static const struct snd_pcm_hardware dummy_dma_hardware = { >>>> .period_bytes_max = PAGE_SIZE*2, >>>> .periods_min = 2, >>>> .periods_max = 128, >>>> -}; >>>> +}); >>> >>> It's probably better to just use PAGE_SIZE_MAX here and avoid the >>> deferred patching, like the comment says we don't particularly care what >>> the value actually is here given that it's a dummy. >> >> OK, so would that be: >> >> .buffer_bytes_max = 128*1024, >> .period_bytes_min = PAGE_SIZE_MAX, <<<<< >> .period_bytes_max = PAGE_SIZE_MAX*2, <<<<< >> .periods_min = 2, >> .periods_max = 128, >> >> ? >> >> It's not really clear to me how all the parameters interact; the buffer size >> 128K, which, if PAGE_SIZE_MAX is 64K, would hold 1 period of the maximum size. >> But periods_min is 2. So not sure that works? Or perhaps I'm trying to apply too >> much meaning to the param names... > > Right, when PAGE_SIZE_MAX is 64k, 128k won't be used because of the > constrant of periods_min=2. > > As Mark mentioned, here the actual size itself doesn't matter much. > So I suppose it'd be even simpler to define just 4096 and 4096 * 2 for > period_bytes_min and *_max instead of sticking with PAGE_SIZE. Then > it would become platform-agnostic, too. OK great I'll set these to 4096 and 4096*2 for the next version. Thanks for the feedback! > > > thanks, > > Takashi