Re: [PATCH v2] cdx: add support for bus mastering

From: Greg KH
Date: Fri Jul 21 2023 - 08:09:35 EST


On Fri, Jul 21, 2023 at 05:16:22PM +0530, Nipun Gupta wrote:
> Introduce cdx_set_master() and cdx_clear_master() APIs to support
> enable and disable of bus mastering. Drivers need to use these APIs to
> enable/disable DMAs from the CDX devices.
>
> Signed-off-by: Nipun Gupta <nipun.gupta@xxxxxxx>
> Reviewed-by: Pieter Jansen van Vuuren <pieter.jansen-van-vuuren@xxxxxxx>
> ---
>
> Changes v1->v2:
> - Replace bme with bus_master_enable
> - Added check for dev_configure API callback
> - remove un-necessary error prints
> - changed conditional to if-else
> - updated commit message to use 72 columns
>
> drivers/cdx/cdx.c | 29 +++++++++++++
> drivers/cdx/controller/cdx_controller.c | 4 ++
> drivers/cdx/controller/mcdi_functions.c | 58 +++++++++++++++++++++++++
> drivers/cdx/controller/mcdi_functions.h | 13 ++++++
> include/linux/cdx/cdx_bus.h | 16 +++++++
> 5 files changed, 120 insertions(+)
>
> diff --git a/drivers/cdx/cdx.c b/drivers/cdx/cdx.c
> index d2cad4c670a0..71ddb56a5d08 100644
> --- a/drivers/cdx/cdx.c
> +++ b/drivers/cdx/cdx.c
> @@ -182,6 +182,35 @@ cdx_match_id(const struct cdx_device_id *ids, struct cdx_device *dev)
> return NULL;
> }
>
> +int cdx_set_master(struct cdx_device *cdx_dev)
> +{
> + struct cdx_controller *cdx = cdx_dev->cdx;
> + struct cdx_device_config dev_config;
> + int ret = EOPNOTSUPP;

"-EOPNOTSUP"