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] [day] [month] [year] [list]
Message-ID: <273bac88-db72-4282-861d-e9886d32ca7f@linux.intel.com>
Date: Thu, 8 Feb 2024 13:52:56 -0800
From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@...ux.intel.com>
To: "David E. Box" <david.e.box@...ux.intel.com>, netdev@...r.kernel.org,
 ilpo.jarvinen@...ux.intel.com
Cc: linux-kernel@...r.kernel.org, platform-driver-x86@...r.kernel.org
Subject: Re: [PATCH 3/8] platform/x86/intel/sdsi: Add header file


On 1/31/24 5:07 PM, David E. Box wrote:
> In preparation for new source files, move common structures to a new
> header flie.

Add some detail about why you adding new source files.

Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@...ux.intel.com>
>
> Signed-off-by: David E. Box <david.e.box@...ux.intel.com>
> ---
>  MAINTAINERS                       |  1 +
>  drivers/platform/x86/intel/sdsi.c | 23 +----------------------
>  drivers/platform/x86/intel/sdsi.h | 31 +++++++++++++++++++++++++++++++
>  3 files changed, 33 insertions(+), 22 deletions(-)
>  create mode 100644 drivers/platform/x86/intel/sdsi.h
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 8d1052fa6a69..09ef8497e48a 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -11042,6 +11042,7 @@ INTEL SDSI DRIVER
>  M:	David E. Box <david.e.box@...ux.intel.com>
>  S:	Supported
>  F:	drivers/platform/x86/intel/sdsi.c
> +F:	drivers/platform/x86/intel/sdsi.h
>  F:	tools/arch/x86/intel_sdsi/
>  F:	tools/testing/selftests/drivers/sdsi/
>  
> diff --git a/drivers/platform/x86/intel/sdsi.c b/drivers/platform/x86/intel/sdsi.c
> index 05a35f2f85b6..d48bb648f0b2 100644
> --- a/drivers/platform/x86/intel/sdsi.c
> +++ b/drivers/platform/x86/intel/sdsi.c
> @@ -22,24 +22,16 @@
>  #include <linux/types.h>
>  #include <linux/uaccess.h>
>  
> +#include "sdsi.h"
>  #include "vsec.h"
>  
>  #define ACCESS_TYPE_BARID		2
>  #define ACCESS_TYPE_LOCAL		3
>  
>  #define SDSI_MIN_SIZE_DWORDS		276
> -#define SDSI_SIZE_MAILBOX		1024
>  #define SDSI_SIZE_REGS			80
>  #define SDSI_SIZE_CMD			sizeof(u64)
>  
> -/*
> - * Write messages are currently up to the size of the mailbox
> - * while read messages are up to 4 times the size of the
> - * mailbox, sent in packets
> - */
> -#define SDSI_SIZE_WRITE_MSG		SDSI_SIZE_MAILBOX
> -#define SDSI_SIZE_READ_MSG		(SDSI_SIZE_MAILBOX * 4)
> -
>  #define SDSI_ENABLED_FEATURES_OFFSET	16
>  #define SDSI_FEATURE_SDSI		BIT(3)
>  #define SDSI_FEATURE_METERING		BIT(26)
> @@ -103,19 +95,6 @@ struct disc_table {
>  	u32	offset;
>  };
>  
> -struct sdsi_priv {
> -	struct mutex		mb_lock;	/* Mailbox access lock */
> -	struct device		*dev;
> -	void __iomem		*control_addr;
> -	void __iomem		*mbox_addr;
> -	void __iomem		*regs_addr;
> -	int			control_size;
> -	int			maibox_size;
> -	int			registers_size;
> -	u32			guid;
> -	u32			features;
> -};
> -
>  /* SDSi mailbox operations must be performed using 64bit mov instructions */
>  static __always_inline void
>  sdsi_memcpy64_toio(u64 __iomem *to, const u64 *from, size_t count_bytes)
> diff --git a/drivers/platform/x86/intel/sdsi.h b/drivers/platform/x86/intel/sdsi.h
> new file mode 100644
> index 000000000000..d0d7450c7b2b
> --- /dev/null
> +++ b/drivers/platform/x86/intel/sdsi.h
> @@ -0,0 +1,31 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +#ifndef __PDx86_SDSI_H_
> +#define __PDx86_SDSI_H_
> +#include <linux/mutex.h>
> +#include <linux/types.h>
> +
> +#define SDSI_SIZE_MAILBOX		1024
> +
> +/*
> + * Write messages are currently up to the size of the mailbox
> + * while read messages are up to 4 times the size of the
> + * mailbox, sent in packets
> + */
> +#define SDSI_SIZE_WRITE_MSG		SDSI_SIZE_MAILBOX
> +#define SDSI_SIZE_READ_MSG		(SDSI_SIZE_MAILBOX * 4)
> +
> +struct device;
> +
> +struct sdsi_priv {
> +	struct mutex			mb_lock;	/* Mailbox access lock */
> +	struct device			*dev;
> +	void __iomem			*control_addr;
> +	void __iomem			*mbox_addr;
> +	void __iomem			*regs_addr;
> +	int				control_size;
> +	int				maibox_size;
> +	int				registers_size;
> +	u32				guid;
> +	u32				features;
> +};
> +#endif

-- 
Sathyanarayanan Kuppuswamy
Linux Kernel Developer


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ