Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp1160332rdb; Fri, 16 Feb 2024 07:09:06 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUnAc2r4aTJggjO7oWCkbVxYB79VwCzYjyO+v/25hd2N2DcNOqQstKVZNnH9aDJcyIuLiT3e4JiAeZvpRDW7yAgusNfGckxMh0n51Psdw== X-Google-Smtp-Source: AGHT+IFFRaJBjdKetOJ+FS0qD9jKISSn0vXPmho15Ii1O/wMgCCuEcB7mkpt+hTzw4mq+Ot+fVJQ X-Received: by 2002:a05:6a21:1585:b0:1a0:8c9c:acfa with SMTP id nr5-20020a056a21158500b001a08c9cacfamr1038945pzb.34.1708096146621; Fri, 16 Feb 2024 07:09:06 -0800 (PST) Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id cm22-20020a056a020a1600b005dc864bb6e6si5091pgb.634.2024.02.16.07.09.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 07:09:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-68774-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=W5vs9+uo; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-68774-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68774-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 59157B22A99 for ; Fri, 16 Feb 2024 15:00:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9A40012F37E; Fri, 16 Feb 2024 15:00:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="W5vs9+uo" Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2075.outbound.protection.outlook.com [40.107.6.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E527D12F36C; Fri, 16 Feb 2024 15:00:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.6.75 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708095621; cv=fail; b=BxjmsMe3q6m2kwMaow/yQym2GpxEdkof8qkdjLLvYimC3dfZ4VTS0SQ9zTI2bTK9Hk+9714KW14r4pt/AK5Zo0MHWj12zO65AfM1iGykcF6vt6/wJ/HupOzGZz6gvtEOMiNxvm9cJbQsCpExvxDTKgvgOeN9Pdqj+mlYZzKhrKo= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708095621; c=relaxed/simple; bh=MaSA6Vc1UWaEU3RXFZiTQGhIl+wPmjSdEn/3a47JyiI=; h=Date:From:To:Cc:Subject:Message-ID:References:Content-Type: Content-Disposition:In-Reply-To:MIME-Version; b=Z5tK8J5TwJE8yNUPqt730io+9HnauoYpODnEIx8z5U4Vxmhb0JR4Q7jdHRsZl6ASX3B31J37nkRX8oLF26RsMEcpgbQu17xI1a7JDVE3w/a1RTxz13QBgo3I9zKa4VE+Ox/y81Mc+WlJkoNzGNk1ZCQ/Zyw/siJWKcfzWTKUKHg= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=W5vs9+uo; arc=fail smtp.client-ip=40.107.6.75 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h03nQg4Dc3WxUAkOe1kZzsJiEiZJpMJEYXYylRwMReH2ETO7sMNZiRAfJYBxBRck4nW60fpiob5dVIuF+j7DQv/w5NyHR9uwjCkQYmhGTgJPaRUg2xyvgULRxNAAz8VjAD/v1wTD/5BHrBjmGt69+5zk1rzbr9+UirK0JNzgHjf987fVkLcsQgGjD+guTaC++BCKB+9P0DrsDCtqSaG0IcGXCwHJMDAtOQaNNJKHz87BWnmEsLSrfkFVZhgzv59I+ZSiuC+nzxfStxsxK13vuKfamH4WgoKw7/FRBMQdkeNTrPQq1eMNaXqDZBYFgi2EHMWR4fwYRRds7/59d5+n4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=utx49Jwe8hW1w8hFoRzOoVXaUW6s4tcYlg7R/mZMxpA=; b=G4sjDx+q9tt4vcwcp037Vl+PWg3h2Tjr1w9vxppW5W4FUYp9lDQMY25e6EarlXI9QRMyUimhwcXJef8TmF4wXc53h8tB8t9awR+61IRn20486aEbgJiQ0D6R1l0IKRqywR3JMmCHVfL+AnobZPzyV347eF8sDGh8oUJmtXm/+yHe9fBjAaOHgVJqQW/M1v8cJzhvTzaaQgh2JIFjFNnzH84ZnQj4n5u5fYhR9GqffnHwh3VfsJaD8uRdbEvrsZ08BsIg6/FIl38RByZkNQ9URItJ4FubvLnejo34RG5EHwmN7xJBa0gaE5E++frcNYnzfwaMGSalMJp1XS5RlrGqVw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=utx49Jwe8hW1w8hFoRzOoVXaUW6s4tcYlg7R/mZMxpA=; b=W5vs9+uo1c9SZhaidqL6cnWW0QcSwPbwvdFB4qaMXGwwLlg1BQTzxdPA6wYijyhEVT/E7u+SVEVaTQh3/9/0kvu0izHeFB0u+tHExWYtjn8lkR56gMQYJe5h9F53jJzrYWhgF95Rfsy4sC2R/bUFYV7tHnqh/PI0vF+x7mvTd2A= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by AS8PR04MB8689.eurprd04.prod.outlook.com (2603:10a6:20b:428::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.39; Fri, 16 Feb 2024 15:00:15 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::c8b4:5648:8948:e85c]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::c8b4:5648:8948:e85c%3]) with mapi id 15.20.7292.027; Fri, 16 Feb 2024 15:00:15 +0000 Date: Fri, 16 Feb 2024 10:00:08 -0500 From: Frank Li To: Vinod Koul Cc: "open list:DMA GENERIC OFFLOAD ENGINE SUBSYSTEM" , open list , imx@lists.linux.dev Subject: Re: [PATCH 1/1] dmaengine: fsl-qdma: add __iomem and struct in union to fix sparse warning Message-ID: References: <20240209210837.304873-1-Frank.Li@nxp.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: SJ0PR05CA0087.namprd05.prod.outlook.com (2603:10b6:a03:332::32) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|AS8PR04MB8689:EE_ X-MS-Office365-Filtering-Correlation-Id: fae122ed-8f75-48ea-41f7-08dc2efffbd5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: w3gcxfsjTRWCHsZFFNVRZrQWrRVkdVTR5NFLZbf4Bf3ZhbnbArOfEt7Zt5iCK4jZGzjk8aXJl1zdXDKaklZ9G3A6x40sB7/WXMl56IzYBnVANBhMEox//67dPT3719mOVF/zDjw0Igh469UmxwSg+TmhvNdKYVCESD1NxdSfgeSLkCKj3pa7GT/bdLXrEybF5kYY3OSYl+n94JqkxE8HGZp734WynWPpgAtp6WD9/6mfRPLPTPbDrM9c0uLUHukhjekS7g8a99042yC8wf0YVEKaOIbnTB1zW1rSX9STXi4PQwnihBMRXYe8qvYF9Cq8zHXzDd2dEM9C+SKr24rP2HRgYoGfCtapPaZTxE6LNvr1ZS4TKF3hSIHrOO1bznKJIP3ONAB2ctVP1oTymxHzjIjy/HJCKmhghv3yvC4N9RHCkMVdcw0vkYYuhoGTZRB9ATQeww73ARSRCG/B9MtS+WmSedIW3cxS3/b5bEw4IJmp12xwhiKtKhrGfCwsYyBebgZg4o6n1BWR0yefPf+aIvbfnzWOn7Gy26YorqCYqr5jHwdjzqEbDpAXqbhZMO/VMFMYydHd9swK8ECjjOUHmSoLIjcwiybcEBKx+LPYV3w= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(7916004)(136003)(366004)(376002)(396003)(346002)(39860400002)(230273577357003)(230922051799003)(186009)(64100799003)(451199024)(1800799012)(38350700005)(2906002)(8676002)(53546011)(54906003)(6666004)(41300700001)(966005)(52116002)(9686003)(6512007)(6506007)(6486002)(478600001)(66476007)(66556008)(6916009)(4326008)(5660300002)(8936002)(316002)(26005)(83380400001)(66946007)(86362001)(33716001)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?Q+EaZzv07XPemZKAGYxZfI3E7N4oS7PU8MWffzoWXhRMc8hMUnzZHjfhb52t?= =?us-ascii?Q?C1yrHhqFyrQWAf1HcKh8skbOlWYjWKmoiDTUG7LCwz2JmYp5mTbtRz4Nmjoo?= =?us-ascii?Q?084NuxPp/z7tQBqeLRcif2ac6fYQemDNDC55mL2MkZ5hBvXdSo2/QFQua+Id?= =?us-ascii?Q?8ixBbPBBlpyP2b1eLrUcZqO5ha5TKI9v0RMNH09Po0VVwYQgUkMKmdGHBsmR?= =?us-ascii?Q?tYSRiH2dMEl/fRXIzW4mCONC0PpwGWiSVzpGH+KEuyp3oXkHJ7Q9/6b/lk6I?= =?us-ascii?Q?6eLXws0rWQnj3N+6c7Q2kNCt/5pKLXhaRZj/9OKPGOHKg+5NlyeKv8JmP3ln?= =?us-ascii?Q?2WqOGgg9Iklgd6Or5nZlfPIXAgPNdXzKdCxc9DBq/H8Wt+oltkslhTyPccCE?= =?us-ascii?Q?lF9NZxPFMaEXNExvUOGPRiVS9IzXeTyACHpRSr96uhtsEhDpcJqyS+ZlbCWm?= =?us-ascii?Q?eHvq1+AHOReHaLvNlMSy8uKPJiTbRU9Vx4Gs2pQiaUnK+X2OM2t64yMkuePy?= =?us-ascii?Q?kikk0+/9IvuLSXyRG9UDRPsYNWpruYiYIJIflr4Ad5StmIoVNO87SB1u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edZRboIgn78kOskBgU9+Ep2gh3cWwyhBlyS?= =?us-ascii?Q?Riri/vaU2CzeGEu6qTrsdOLHRzF31FglC3Ai5N/cJmXJq6WW2qM9CCEjFJQq?= =?us-ascii?Q?WU4z5bspyQSoKYdlrnK+sH8JZoprqqABC9vVqYG6?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: fae122ed-8f75-48ea-41f7-08dc2efffbd5 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Feb 2024 15:00:15.7529 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: raTBpeyilJSoApW5cd/3vqw4tx6zwpGY0ILcu9mAktiGpbbz7NaVU3od1Iiw1pZLmniyvAH1YZS1JVjPkEve6A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8689 On Fri, Feb 16, 2024 at 06:03:29PM +0530, Vinod Koul wrote: > On 09-02-24, 16:08, Frank Li wrote: > > Fix below sparse warnings. > > > > drivers/dma/fsl-qdma.c:645:50: sparse: warning: incorrect type in argument 2 (different address spaces) > > drivers/dma/fsl-qdma.c:645:50: sparse: expected void [noderef] __iomem *addr > > drivers/dma/fsl-qdma.c:645:50: sparse: got void > > > > drivers/dma/fsl-qdma.c:387:15: sparse: sparse: restricted __le32 degrades to integer > > drivers/dma/fsl-qdma.c:390:19: sparse: expected restricted __le64 [usertype] data > > drivers/dma/fsl-qdma.c:392:13: sparse: expected unsigned int [assigned] [usertype] cmd > > Please document why you are adding the annotations Okay, I will add at next version. > > Also I see this after the patch: Strange!, it is difference driver (fsl-qdma.c, which will not touch fsl-edma*). the below warning should exist or invovled by other patches. Did you try antoher patches https://lore.kernel.org/imx/20240209213606.367025-1-Frank.Li@nxp.com/T/#t what's command do you build to see below warning. Frank > > dmaengine/drivers/dma/fsl-edma-main.c:56:16: warning: cast removes address space '__iomem' of expression > dmaengine/drivers/dma/fsl-edma-main.c:60:9: warning: cast removes address space '__iomem' of expression > dmaengine/drivers/dma/fsl-edma-common.c:76:15: warning: cast removes address space '__iomem' of expression > dmaengine/drivers/dma/fsl-edma-common.c:93:9: warning: cast removes address space '__iomem' of expression > dmaengine/drivers/dma/fsl-edma-common.c:100:22: warning: cast removes address space '__iomem' of expression > dmaengine/drivers/dma/fsl-edma-common.c:101:25: warning: cast removes address space '__iomem' of expression > dmaengine/drivers/dma/fsl-edma-common.c:104:15: warning: cast removes address space '__iomem' of expression > dmaengine/drivers/dma/fsl-edma-common.c:106:9: warning: cast removes address space '__iomem' of expression > dmaengine/drivers/dma/fsl-edma-common.c:131:19: warning: cast removes address space '__iomem' of expression > dmaengine/drivers/dma/fsl-edma-common.c:137:17: warning: cast removes address space '__iomem' of expression > dmaengine/drivers/dma/fsl-edma-common.c:140:9: warning: cast removes address space '__iomem' of expression > CC [M] drivers/dma/idma64.o > dmaengine/drivers/dma/fsl-edma-common.c:473:17: warning: cast removes address space '__iomem' of expression > dmaengine/drivers/dma/fsl-edma-common.c:473:17: warning: cast removes address space '__iomem' of expression > > > > > Reported-by: kernel test robot > > Closes: https://lore.kernel.org/oe-kbuild-all/202402081929.mggOTHaZ-lkp@intel.com/ > > Signed-off-by: Frank Li > > --- > > drivers/dma/fsl-qdma.c | 21 ++++++++++----------- > > 1 file changed, 10 insertions(+), 11 deletions(-) > > > > diff --git a/drivers/dma/fsl-qdma.c b/drivers/dma/fsl-qdma.c > > index 1e3bf6f30f784..5005e138fc239 100644 > > --- a/drivers/dma/fsl-qdma.c > > +++ b/drivers/dma/fsl-qdma.c > > @@ -161,6 +161,10 @@ struct fsl_qdma_format { > > u8 __reserved1[2]; > > u8 cfg8b_w1; > > } __packed; > > + struct { > > + __le32 __reserved2; > > + __le32 cmd; > > + } __packed; > > __le64 data; > > }; > > } __packed; > > @@ -355,7 +359,6 @@ static void fsl_qdma_free_chan_resources(struct dma_chan *chan) > > static void fsl_qdma_comp_fill_memcpy(struct fsl_qdma_comp *fsl_comp, > > dma_addr_t dst, dma_addr_t src, u32 len) > > { > > - u32 cmd; > > struct fsl_qdma_format *sdf, *ddf; > > struct fsl_qdma_format *ccdf, *csgf_desc, *csgf_src, *csgf_dest; > > > > @@ -384,15 +387,11 @@ static void fsl_qdma_comp_fill_memcpy(struct fsl_qdma_comp *fsl_comp, > > /* This entry is the last entry. */ > > qdma_csgf_set_f(csgf_dest, len); > > /* Descriptor Buffer */ > > - cmd = cpu_to_le32(FSL_QDMA_CMD_RWTTYPE << > > - FSL_QDMA_CMD_RWTTYPE_OFFSET) | > > - FSL_QDMA_CMD_PF; > > - sdf->data = QDMA_SDDF_CMD(cmd); > > - > > - cmd = cpu_to_le32(FSL_QDMA_CMD_RWTTYPE << > > - FSL_QDMA_CMD_RWTTYPE_OFFSET); > > - cmd |= cpu_to_le32(FSL_QDMA_CMD_LWC << FSL_QDMA_CMD_LWC_OFFSET); > > - ddf->data = QDMA_SDDF_CMD(cmd); > > + sdf->cmd = cpu_to_le32((FSL_QDMA_CMD_RWTTYPE << FSL_QDMA_CMD_RWTTYPE_OFFSET) | > > + FSL_QDMA_CMD_PF); > > + > > + ddf->cmd = cpu_to_le32((FSL_QDMA_CMD_RWTTYPE << FSL_QDMA_CMD_RWTTYPE_OFFSET) | > > + (FSL_QDMA_CMD_LWC << FSL_QDMA_CMD_LWC_OFFSET)); > > } > > > > /* > > @@ -626,7 +625,7 @@ static int fsl_qdma_halt(struct fsl_qdma_engine *fsl_qdma) > > > > static int > > fsl_qdma_queue_transfer_complete(struct fsl_qdma_engine *fsl_qdma, > > - void *block, > > + __iomem void *block, > > int id) > > { > > bool duplicate; > > -- > > 2.34.1 > > -- > ~Vinod