From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pdx-out-014.esa.us-west-2.outbound.mail-perimeter.amazon.com (pdx-out-014.esa.us-west-2.outbound.mail-perimeter.amazon.com [35.83.148.184]) (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 99A1435F605 for ; Mon, 11 May 2026 16:16:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=35.83.148.184 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778516216; cv=none; b=ohdesbDrAhQRqgOOM/Byhv9pUIQIpXbjRgl+p8IbsNt+pj9tuUT8y0bypc6OUFL4G1MwKmwtWsQBqAfCfZLILhag4YXKZh+2bM9j0XjM4OiUwO7S2FkKjJNbamifrK4Go+8+RXtv3SX3iML5wASBS+hJwzV+Amk2KGs0ktyrrP0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778516216; c=relaxed/simple; bh=cJrGvqmwU4asmn3HXsfUPAmOxi+E20ureKQmpUEayx4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=dtnPpzWf05QTiLqe/Lh628Kly7Y5mMLOiThguhiT9iywtXr0v3XrnJ7hQHUuG7vdRZln013HgguU8VEZJ8Wv0HtGFfSExQBkbH1bD1eiH0F2Ky8EjKkSUFJzV2dQdRpj2andsb1dFQT/Qjlban5z1e1NafwkmlCVOVQDlinRBkA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com; spf=pass smtp.mailfrom=amazon.com; dkim=pass (2048-bit key) header.d=amazon.com header.i=@amazon.com header.b=SoWI7RKH; arc=none smtp.client-ip=35.83.148.184 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amazon.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=amazon.com header.i=@amazon.com header.b="SoWI7RKH" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazoncorp2; t=1778516215; x=1810052215; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=cJrGvqmwU4asmn3HXsfUPAmOxi+E20ureKQmpUEayx4=; b=SoWI7RKH7BkWrU76Kc9P/oH+7id9KoOjlNEUc4fRQ0iICVQoUdfQgdIK Oz/5IEOeIKd6/bnQ2JRmInokTslbjfnYkmPTADD2PjUWda8pqnuUwgUNT 6+J/5Z/3lGr8tgcQthbSgLcGqhX4cQJ9rgzucOahqlsJYsjJWbsNIQjsQ mvP9qIum+IyCWMJh7Lc3XUsWH3GOWq3VmTR0BsTCmgBlejqLCvIejFp7L iSj6N5Y6l5DBKJ9EttHsUpethoDxcSLlsqXqEg5Ndc7pFu43uVdU6Zs3X oyHvC8CciW0VyE3HXlWp88FVgpZVRq8xq8ct69hovLuK4c7UKle7sRL4O g==; X-CSE-ConnectionGUID: KTZ7zmijQWqxz1kXCJD+RA== X-CSE-MsgGUID: wPFF1nLfRP2/GInga2U5tw== X-IronPort-AV: E=Sophos;i="6.23,229,1770595200"; d="scan'208";a="19155049" Received: from ip-10-5-9-48.us-west-2.compute.internal (HELO smtpout.naws.us-west-2.prod.farcaster.email.amazon.dev) ([10.5.9.48]) by internal-pdx-out-014.esa.us-west-2.outbound.mail-perimeter.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2026 16:16:55 +0000 Received: from EX19MTAUWA001.ant.amazon.com [205.251.233.182:28528] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.4.227:2525] with esmtp (Farcaster) id c7facc59-0cc7-4506-9fbe-a43f504d0868; Mon, 11 May 2026 16:16:54 +0000 (UTC) X-Farcaster-Flow-ID: c7facc59-0cc7-4506-9fbe-a43f504d0868 Received: from EX19D001UWA001.ant.amazon.com (10.13.138.214) by EX19MTAUWA001.ant.amazon.com (10.250.64.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.37; Mon, 11 May 2026 16:16:53 +0000 Received: from dev-dsk-ravib-2a-f2262d1b.us-west-2.amazon.com (10.169.187.85) by EX19D001UWA001.ant.amazon.com (10.13.138.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.37; Mon, 11 May 2026 16:16:53 +0000 From: Ravi Kumar Bandi To: , CC: , , , , , Subject: Re: [PATCH] resource: export iomem_get_mapping() for loadable modules Date: Mon, 11 May 2026 16:16:43 +0000 Message-ID: <20260511161643.30662-1-ravib@amazon.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: EX19D035UWA002.ant.amazon.com (10.13.139.60) To EX19D001UWA001.ant.amazon.com (10.13.138.214) On Mon, May 11, 2026 at 00:17:45 -0700, Christoph Hellwig wrote: > And why? On Mon, May 11, 2026 at 09:14:04 +0200, David Hildenbrand wrote: > Which in-tree driver wants to make use of this? Thank you both for reviewing the patch. Currently this is needed by a PCIe endpoint driver that handles surprise removal on a device without a hot-plug pin routed to the CPU. The link-down event is detected by the in-tree Xilinx DMA PL PCIe controller driver (drivers/pci/controller/pcie-xilinx-dma-pl.c), which notifies the endpoint driver via the link-down callback. When link-down is detected, the endpoint driver needs to zap existing userspace BAR mappings (mmap'd via sysfs resource files) to deliver SIGBUS rather than leaving stale mappings to a dead device, preventing kernel crashes on subsequent accesses. unmap_mapping_range() is already EXPORT_SYMBOL'd for this purpose (mm/memory.c), but without iomem_get_mapping() being exported, loadable modules cannot use it correctly for PCI BAR mappings, forcing ugly workarounds such as walking all process VMAs. Regards, Ravi Kumar Bandi