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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C037EC433F5 for ; Fri, 7 Jan 2022 23:34:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231584AbiAGXeU (ORCPT ); Fri, 7 Jan 2022 18:34:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231559AbiAGXeT (ORCPT ); Fri, 7 Jan 2022 18:34:19 -0500 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1B4EC061574 for ; Fri, 7 Jan 2022 15:34:19 -0800 (PST) Received: by mail-pg1-x535.google.com with SMTP id s1so6970930pga.5 for ; Fri, 07 Jan 2022 15:34:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=zsOgJMsBCd5wqpBIMXgbd67V4MeoViUGyDjddUD4kPU=; b=WeLsW8ODuu55sZfvXliZfwSV7Gi1JTHpwyKmxA9qyyxSeuO1pG9tYcekSizjBNwLnu fp0AuBEmd8WeUr/hkPdOOLR+YjN9M6Lavc6Boqk57K/8WNnBgBifiYiG69vvhTvBHqzq RSZEN5w+1UZM7ykn5RuUb1mplLWUin4ZAvsCA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=zsOgJMsBCd5wqpBIMXgbd67V4MeoViUGyDjddUD4kPU=; b=KZ9e0fjORcA2mBDigcqMsUiMZpQ6X6PmDaVtYjtiGnT2hQpzrlsZldvEikHLWLoHli 6fea6HqluB9m+5yFs/UPwpsKriZUUGqdIRAdL56p1YK55F56aAnkd6DuVV1saIYgIBQl 8GQHWXn0P5JH2EAUab97GDj7uJh53jQqqVWNXPzLmf1IVcZnDifS2L5vqySnO/xvAdXg 58YJbJQXhS6NphgJi7iSysuq8JDjE38W3RR6hJM9sjROMV1G9pyA/ClrNf0KKCqH9tf7 cHj+9rqZ2X3xQVhgAgcxmfmIHAmzxg8ZfG/KuLK9Cpl31OGzgzHiMJCpRGEE4qjzsTUL QLbA== X-Gm-Message-State: AOAM530cwh219Y/61qpfhfBjEnbXKUOxSKi3WldRDzBMdDfJsa4PWq1j igwWezzeCiB5jRh8KV5U7qBnSw== X-Google-Smtp-Source: ABdhPJwUhZW9byS0cPGPMcT+LQ8VGZ/UJQsfgaNdtP9C91cQngX923SsGRxxbPGbb1MRbtm6h/ANsQ== X-Received: by 2002:a63:cd49:: with SMTP id a9mr58435443pgj.607.1641598459186; Fri, 07 Jan 2022 15:34:19 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id e11sm6873pjj.49.2022.01.07.15.34.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 15:34:18 -0800 (PST) Date: Fri, 7 Jan 2022 15:34:18 -0800 From: Kees Cook To: conleylee@foxmail.com Cc: davem@davemloft.net, kuba@kernel.org, mripard@kernel.org, wens@csie.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v6] sun4i-emac.c: add dma support Message-ID: <202201071532.57A08030@keescook> References: <20211228164817.1297c1c9@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 29, 2021 at 09:43:51AM +0800, conleylee@foxmail.com wrote: > From: Conley Lee > > Thanks for your review. Here is the new version for this patch. > > This patch adds support for the emac rx dma present on sun4i. The emac > is able to move packets from rx fifo to RAM by using dma. > > Change since v4. > - rename sbk field to skb > - rename alloc_emac_dma_req to emac_alloc_dma_req > - using kzalloc(..., GPF_ATOMIC) in interrupt context to avoid > sleeping > - retry by using emac_inblk_32bit when emac_dma_inblk_32bit fails > - fix some code style issues > > Change since v5. > - fix some code style issue > > Signed-off-by: Conley Lee > --- > drivers/net/ethernet/allwinner/sun4i-emac.c | 200 ++++++++++++++++++++ > 1 file changed, 200 insertions(+) This is causing build failures: $ make CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64 allmodconfig $ make CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64 -j... -k -s drivers/net/ethernet/allwinner/sun4i-emac.c: In function 'emac_configure_dma': drivers/net/ethernet/allwinner/sun4i-emac.c:922:60: error: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'resource_size_t' {aka 'long long unsigned int'} [-Werror=format=] 922 | netdev_info(ndev, "get io resource from device: 0x%x, size = %u\n", | ~^ | | | unsigned int | %llx 923 | regs->start, resource_size(regs)); | ~~~~~~~~~~~ | | | resource_size_t {aka long long unsigned int} drivers/net/ethernet/allwinner/sun4i-emac.c:922:71: error: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t' {aka 'long long unsigned int'} [-Werror=format=] 922 | netdev_info(ndev, "get io resource from device: 0x%x, size = %u\n", | ~^ | | | unsigned int | %llu 923 | regs->start, resource_size(regs)); | ~~~~~~~~~~~~~~~~~~~ | | | resource_size_t {aka long long unsigned int} -- Kees Cook 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 1CC59C433EF for ; Fri, 7 Jan 2022 23:35:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HmE2VpGrm3Sr2jgY2MqP02Uuzz5e9IQRZVjgqRhQtAs=; b=A8ais7b+h10qaW rHmcF58heoYI98ai6nqg44HW6MghQhBEFOihOQzYHDZ5bgQbNw4v0QR1ZBPT64K7EBAXMQ+i7HFWB ak9a92+3vGzX4Zf7mfuLy95oLLYfWtccxJb592cYpkNJHnEV7WHS5XhKy8mCWZRXZy3IfWkCGVBWg MLHbDMjKVztvcCFPzv9y3qeSWdtkuTGc5U3fOzup6TYQf4eUs+0sU8pRD2WJDS4HbqUgjt0pOMEvv Ypk4xUc6dfGUu6v3bwP+ZTGgRg2nVA//zKautp5VowxR2/dAqM82LSrI7DRdml5ieiTE8jnJ9ilmb ITEcmC0Mp9KwMYrls9/g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n5ykZ-005Vge-ID; Fri, 07 Jan 2022 23:34:23 +0000 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n5ykW-005Vfc-7i for linux-arm-kernel@lists.infradead.org; Fri, 07 Jan 2022 23:34:21 +0000 Received: by mail-pf1-x433.google.com with SMTP id t123so6414932pfc.13 for ; Fri, 07 Jan 2022 15:34:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=zsOgJMsBCd5wqpBIMXgbd67V4MeoViUGyDjddUD4kPU=; b=WeLsW8ODuu55sZfvXliZfwSV7Gi1JTHpwyKmxA9qyyxSeuO1pG9tYcekSizjBNwLnu fp0AuBEmd8WeUr/hkPdOOLR+YjN9M6Lavc6Boqk57K/8WNnBgBifiYiG69vvhTvBHqzq RSZEN5w+1UZM7ykn5RuUb1mplLWUin4ZAvsCA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=zsOgJMsBCd5wqpBIMXgbd67V4MeoViUGyDjddUD4kPU=; b=vV+OaStQCbbMqHQFic9MGS7lL9VAiD//xCLdwJ3cGCrT5drlORRMBMQ6u9wEm3laP4 TJmcYM/SuVYfmqTIWAQdnY13+wgzHs3Ez97yiAb0UOJozLPpCnCvFRW0vrhIp03q9ZSa 8/GOFnmehG3ifi2L1oF0WPs9M1OFq+21Pmn9/1gjJs9q9QVXAHiXdx7QcPhoEHCjvA4L TahOupM8I09Jk3/C7v6NhNCNfBYRh3fxA1nLsmsyoMfLiSphFkMPc69LEGFVnCdEU7bo te8E+4SjEtIZIk2GIk3M/ZyxW2JXcm7UzgV5W2Y8IKYLGQhaMz0p4SieecJulYjgLt8Z U76g== X-Gm-Message-State: AOAM531eoLMnzh7EY1lC+Su7QM+MkQXGP62aOthBA2Zzjca8airjNos5 S+MgjTcOqe5JT4RE2uorg6kPuw== X-Google-Smtp-Source: ABdhPJwUhZW9byS0cPGPMcT+LQ8VGZ/UJQsfgaNdtP9C91cQngX923SsGRxxbPGbb1MRbtm6h/ANsQ== X-Received: by 2002:a63:cd49:: with SMTP id a9mr58435443pgj.607.1641598459186; Fri, 07 Jan 2022 15:34:19 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id e11sm6873pjj.49.2022.01.07.15.34.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 15:34:18 -0800 (PST) Date: Fri, 7 Jan 2022 15:34:18 -0800 From: Kees Cook To: conleylee@foxmail.com Cc: davem@davemloft.net, kuba@kernel.org, mripard@kernel.org, wens@csie.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v6] sun4i-emac.c: add dma support Message-ID: <202201071532.57A08030@keescook> References: <20211228164817.1297c1c9@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220107_153420_332832_5AD8F588 X-CRM114-Status: GOOD ( 17.92 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Dec 29, 2021 at 09:43:51AM +0800, conleylee@foxmail.com wrote: > From: Conley Lee > > Thanks for your review. Here is the new version for this patch. > > This patch adds support for the emac rx dma present on sun4i. The emac > is able to move packets from rx fifo to RAM by using dma. > > Change since v4. > - rename sbk field to skb > - rename alloc_emac_dma_req to emac_alloc_dma_req > - using kzalloc(..., GPF_ATOMIC) in interrupt context to avoid > sleeping > - retry by using emac_inblk_32bit when emac_dma_inblk_32bit fails > - fix some code style issues > > Change since v5. > - fix some code style issue > > Signed-off-by: Conley Lee > --- > drivers/net/ethernet/allwinner/sun4i-emac.c | 200 ++++++++++++++++++++ > 1 file changed, 200 insertions(+) This is causing build failures: $ make CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64 allmodconfig $ make CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64 -j... -k -s drivers/net/ethernet/allwinner/sun4i-emac.c: In function 'emac_configure_dma': drivers/net/ethernet/allwinner/sun4i-emac.c:922:60: error: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'resource_size_t' {aka 'long long unsigned int'} [-Werror=format=] 922 | netdev_info(ndev, "get io resource from device: 0x%x, size = %u\n", | ~^ | | | unsigned int | %llx 923 | regs->start, resource_size(regs)); | ~~~~~~~~~~~ | | | resource_size_t {aka long long unsigned int} drivers/net/ethernet/allwinner/sun4i-emac.c:922:71: error: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t' {aka 'long long unsigned int'} [-Werror=format=] 922 | netdev_info(ndev, "get io resource from device: 0x%x, size = %u\n", | ~^ | | | unsigned int | %llu 923 | regs->start, resource_size(regs)); | ~~~~~~~~~~~~~~~~~~~ | | | resource_size_t {aka long long unsigned int} -- Kees Cook _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel