Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp427278lqp; Sat, 13 Apr 2024 03:22:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXvwZd9xpRBsHlXf7fetyOM/NfUmr9ecDDHwxt91phdQfMfdBdIy43UdPDyFRnZ7GlXvyoWtrXz6eL1zIBwo7QMK6CCXLUXrqwvtvBQNQ== X-Google-Smtp-Source: AGHT+IFsatcbh3B8k/pUfOJUeOH5wstchW3pljxzmTlfHSVAvfxh2uukhGOesJryewbv0Tyo2bE/ X-Received: by 2002:a17:906:d0d6:b0:a51:f63d:84d0 with SMTP id bq22-20020a170906d0d600b00a51f63d84d0mr2862555ejb.64.1713003739567; Sat, 13 Apr 2024 03:22:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713003739; cv=pass; d=google.com; s=arc-20160816; b=VMu+KmNXYQIgVjFG5IO+ZO9PNgVjoZ4ng2hA9TpbZ/bwbtZ2dPJYRR6cUMDrfcWAG0 K/plP/5dtr3G9NAihvTAaT+pKYxHCeEyE852AYiKp1XtsJxeesLlbSf1Q3R5emaZRIdV 9V3d0ZWRYem/5c7lgH7UID91ig/LEa3HDos/geFFaIx3Z7fcxCokyNqfbcpfVrdk5TF9 C2mfme4M8fxVIp5vPDfWEdQQ/fxVd0T3HMCQUHOnUns7nCMeY1qkOEjJ/oYf6P18Mwp5 4cOLqJgjKLLMncoUsQ7/gytUhmLzc9JxOCjWDsgVkFpRIiSf7DIMi5jBqQyrKuHKq6Ln AmEg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=hKioNLjl6/C0v3RD4UfwZjREdBavrP7jjpQBG5zRlgM=; fh=/LePuznICel9vXaepbbfaahVHSFm2FDWTkJdxn5LzPc=; b=TDJt5g3iBiBNXwayBruf01nLxhgud+bZ+MucSqsSH4mSLhRXyGAmAjhpougjVOWQfk KKgKLwPac/rI6unToLBlheM3AuYch90ayp+PQWM/Xt91L4SlRiaSplOEcPF9+MZN5FLO QaHO8ueIqQ5Z9l8a6LflK4bO6eJLCqznP5/qQD6xvqNJwyitlF8eB3/zuLN1otmgDYpA XGKAKVvJi9n+3tbxeS48D1z5XtmXnsP+XtwRsthA3Nttt2rgRsP2IQJkShgnorPP/u9b YSaEnLiiCiqEDnMuqNzQXnrKKZqYjG2etE1ev8x28d4H3WajTDQYandQAT0RYktz6D1Y 5LmA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=rockwork.org); spf=pass (google.com: domain of linux-kernel+bounces-143674-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143674-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id e26-20020a170906045a00b00a4ea02e824fsi2608836eja.366.2024.04.13.03.22.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Apr 2024 03:22:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-143674-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=rockwork.org); spf=pass (google.com: domain of linux-kernel+bounces-143674-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143674-linux.lists.archive=gmail.com@vger.kernel.org" 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 4E9161F21E7A for ; Sat, 13 Apr 2024 10:22:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 296663D552; Sat, 13 Apr 2024 10:22:13 +0000 (UTC) Received: from rockwork.org (rockwork.org [45.32.92.205]) (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 842E024A0D for ; Sat, 13 Apr 2024 10:22:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.32.92.205 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713003732; cv=none; b=JMxA/+3xYKmcT0yrQFMrA2LIfaRt5nE/S5omh6ZdeH4L5aV2IpN2R76W7/L1MW6huTOWlglDDBi1Sy5E6+t7rGqPry4thq7DwL5EP1faqub6fwRsrVr/2oZpscg8tCCrvGM6CLm4UU9KpjPrqCGb4ZwjWhk0jUpy+nozIu7dZFE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713003732; c=relaxed/simple; bh=cKfJqzwn1UM58rtsZxhexJzGwK67MEdN/QUZgx3CAHw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=TC/k2do+hJcXlBLvAOnPKeNOGhkLymf0edGRdlmuw8E6/2Lwi45wA/m+hKs+n3CDcqo63/K47LPdV5YA9wrJsi4c189fbqpnMpriO9tIT3Ty7yrRjKjmq9FOZki4vzuVDGNjXukZzwZbm28JC+EKHJFnONQXVuWxWqMp9G+Js7I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rockwork.org; spf=pass smtp.mailfrom=rockwork.org; arc=none smtp.client-ip=45.32.92.205 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rockwork.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rockwork.org Received: from [IPV6:2408:8340:c42:16f0:eb78:1cb0:d0a9:e8e3] (unknown [IPv6:2408:8340:c42:16f0:eb78:1cb0:d0a9:e8e3]) by rockwork.org (Postfix) with ESMTPSA id 6537B5DD4A; Sat, 13 Apr 2024 10:15:11 +0000 (UTC) Message-ID: <2688421d-37c2-4038-8d03-24ae175f137e@rockwork.org> Date: Sat, 13 Apr 2024 18:15:05 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 01/11] RISC-V: drivers/iommu: Add RISC-V IOMMU - Ziommu support. To: Tomasz Jeznach , Joerg Roedel , Will Deacon , Robin Murphy , Paul Walmsley Cc: Anup Patel , Albert Ou , linux@rivosinc.com, linux-kernel@vger.kernel.org, Sebastien Boeuf , iommu@lists.linux.dev, Palmer Dabbelt , Nick Kossifidis , linux-riscv@lists.infradead.org References: Content-Language: en-US From: Xingyou Chen In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 7/20/23 03:33, Tomasz Jeznach wrote: > ... > +#endif /* _RISCV_IOMMU_BITS_H_ */ > diff --git a/drivers/iommu/riscv/iommu-pci.c b/drivers/iommu/riscv/iommu-pci.c > new file mode 100644 > index 000000000000..c91f963d7a29 > --- /dev/null > +++ b/drivers/iommu/riscv/iommu-pci.c > @@ -0,0 +1,134 @@ > ... > + > +static struct pci_driver riscv_iommu_pci_driver = { > + .name = KBUILD_MODNAME, > + .id_table = riscv_iommu_pci_tbl, > + .probe = riscv_iommu_pci_probe, > + .remove = riscv_iommu_pci_remove, > + .driver = { > + .pm = pm_sleep_ptr(&riscv_iommu_pm_ops), > + .of_match_table = riscv_iommu_of_match, > + }, > +}; > + > +module_driver(riscv_iommu_pci_driver, pci_register_driver, pci_unregister_driver); There's helper macro to be considered, and not forced to: module_pci_driver(riscv_iommu_pci_driver); > diff --git a/drivers/iommu/riscv/iommu-platform.c b/drivers/iommu/riscv/iommu-platform.c > new file mode 100644 > index 000000000000..e4e8ca6711e7 > --- /dev/null > +++ b/drivers/iommu/riscv/iommu-platform.c > @@ -0,0 +1,94 @@ > ... > + > +static struct platform_driver riscv_iommu_platform_driver = { > + .driver = { > + .name = "riscv,iommu", > + .of_match_table = riscv_iommu_of_match, > + .suppress_bind_attrs = true, > + }, > + .probe = riscv_iommu_platform_probe, > + .remove_new = riscv_iommu_platform_remove, > + .shutdown = riscv_iommu_platform_shutdown, > +}; > + > +module_driver(riscv_iommu_platform_driver, platform_driver_register, > + platform_driver_unregister); And also: module_platform_driver(riscv_iommu_platform_driver);