lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4ecf2dd3-dd88-aeb8-c1c3-0322c17438ab@huawei.com>
Date: Tue, 11 Mar 2025 19:21:36 +0800
From: "lihuisong (C)" <lihuisong@...wei.com>
To: Sudeep Holla <sudeep.holla@....com>, <linux-acpi@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>
CC: Jassi Brar <jassisinghbrar@...il.com>, Adam Young
	<admiyo@...amperecomputing.com>, Robbie King <robbiek@...ghtlabs.com>
Subject: Re: [PATCH v2 05/13] mailbox: pcc: Use acpi_os_ioremap() instead of
 ioremap()


在 2025/3/6 0:38, Sudeep Holla 写道:
> The Platform Communication Channel (PCC) mailbox driver currently uses
> ioremap() to map channel shared memory regions. However it is preferred
> to use acpi_os_ioremap(), which is mapping function specific to EFI/ACPI
> defined memory regions. It ensures that the correct memory attributes
> are applied when mapping ACPI-provided regions.
>
> While at it, also add checks for handling any errors with the mapping.
>
> Signed-off-by: Sudeep Holla <sudeep.holla@....com>
> ---
>   drivers/mailbox/pcc.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c
> index 5a9ae67f5c50a3e43d30aa368c31c80b81db01f7..b1b8223b5da7002fc522523dbc82f6124215439a 100644
> --- a/drivers/mailbox/pcc.c
> +++ b/drivers/mailbox/pcc.c
> @@ -418,8 +418,12 @@ int pcc_mbox_ioremap(struct mbox_chan *chan)
>   		return -1;
>   	pchan_info = chan->con_priv;
>   	pcc_mbox_chan = &pchan_info->chan;
> -	pcc_mbox_chan->shmem = ioremap(pcc_mbox_chan->shmem_base_addr,
> -				       pcc_mbox_chan->shmem_size);
> +
> +	pcc_mbox_chan->shmem = acpi_os_ioremap(pcc_mbox_chan->shmem_base_addr,
> +					       pcc_mbox_chan->shmem_size);
> +	if (!pcc_mbox_chan->shmem)
> +		return -ENXIO;
> +
>   	return 0;
>   }
>   EXPORT_SYMBOL_GPL(pcc_mbox_ioremap);
LGTM,
Acked-by: Huisong Li <lihuisong@...wei.com>
Tested-by: Huisong Li <lihuisong@...wei.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ