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=-3.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 2B035C433E0 for ; Wed, 23 Dec 2020 05:30:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F2F59207C9 for ; Wed, 23 Dec 2020 05:30:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727202AbgLWF3v (ORCPT ); Wed, 23 Dec 2020 00:29:51 -0500 Received: from m43-15.mailgun.net ([69.72.43.15]:48028 "EHLO m43-15.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726069AbgLWF3v (ORCPT ); Wed, 23 Dec 2020 00:29:51 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1608701365; h=Content-Transfer-Encoding: Content-Type: MIME-Version: Message-ID: In-Reply-To: Date: References: Subject: Cc: To: From: Sender; bh=+PgCftFCNKFXUIzjrZaJrrb1dDkJP0N7TDJaNh3c03M=; b=P8KGtr8Ih/acNhKj7ec2Y1pWv6wpuKN2gGELepv2/Rkq6HBI5L4rIsRoxsauN8DTcFUUdJ2n umyAHf7D6MgqXH0NUzyjkqpQMiPc8frZangTw+VvT99oSDk33e0x3iBNXumqu2Ih7CwTMH6Z ke+BfXB0Xvm9FFcbqGIzZTmPewE= X-Mailgun-Sending-Ip: 69.72.43.15 X-Mailgun-Sid: WyI1YmJiNiIsICJkZXZpY2V0cmVlQHZnZXIua2VybmVsLm9yZyIsICJiZTllNGEiXQ== Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n05.prod.us-west-2.postgun.com with SMTP id 5fe2d591da471981883969b5 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 23 Dec 2020 05:28:49 GMT Sender: kvalo=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id DC5C9C43461; Wed, 23 Dec 2020 05:28:49 +0000 (UTC) Received: from x230.qca.qualcomm.com (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 460EBC433C6; Wed, 23 Dec 2020 05:28:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 460EBC433C6 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: =?utf-8?B?SsOpcsO0bWU=?= Pouiller Cc: Greg Kroah-Hartman , devel@driverdev.osuosl.org, devicetree@vger.kernel.org, Ulf Hansson , netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Rob Herring , linux-mmc@vger.kernel.org, Pali =?utf-8?Q?Roh=C3=A1r?= , "David S . Miller" Subject: Re: [PATCH v3 09/24] wfx: add hwio.c/hwio.h References: <20201104155207.128076-1-Jerome.Pouiller@silabs.com> <87lfdp98rw.fsf@codeaurora.org> <4279510.LvFx2qVVIh@pc-42> Date: Wed, 23 Dec 2020 07:28:44 +0200 In-Reply-To: <4279510.LvFx2qVVIh@pc-42> (=?utf-8?B?IkrDqXLDtG1l?= Pouiller"'s message of "Tue, 22 Dec 2020 22:02:09 +0100") Message-ID: <87im8t5bw3.fsf@codeaurora.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org J=C3=A9r=C3=B4me Pouiller writes: > On Tuesday 22 December 2020 16:27:01 CET Greg Kroah-Hartman wrote: >>=20 >> On Tue, Dec 22, 2020 at 05:10:11PM +0200, Kalle Valo wrote: >> > Jerome Pouiller writes: >> > >> > > +/* >> > > + * Internal helpers. >> > > + * >> > > + * About CONFIG_VMAP_STACK: >> > > + * When CONFIG_VMAP_STACK is enabled, it is not possible to run DMA= on stack >> > > + * allocated data. Functions below that work with registers (aka fu= nctions >> > > + * ending with "32") automatically reallocate buffers with kmalloc.= However, >> > > + * functions that work with arbitrary length buffers let's caller t= o handle >> > > + * memory location. In doubt, enable CONFIG_DEBUG_SG to detect badl= y located >> > > + * buffer. >> > > + */ >> > >> > This sounds very hacky to me, I have understood that you should never >> > use stack with DMA. >>=20 >> You should never do that because some platforms do not support it, so no >> driver should ever try to do that as they do not know what platform they >> are running on. > > Yes, I have learned this rule the hard way. > > There is no better way than a comment to warn the user that the argument > will be used with a DMA? A Sparse annotation, for example? I have not seen anything, but something like sparse annotation would be useful. Please let me know if you find anything like that. But I think that CONFIG_VMAP_STACK is irrelevant and the comment should be clarified that using stack memory must NOT be used for DMA operations in any circumstances. --=20 https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatc= hes