region.c (af3ea9ab61d728d5a8be01bbec6d5cf7551b9600) region.c (cbbd05d036e91b9dd976af4382f6c8d91b69b38a)
1// SPDX-License-Identifier: GPL-2.0-only
2/* Copyright(c) 2022 Intel Corporation. All rights reserved. */
3#include <linux/memregion.h>
4#include <linux/genalloc.h>
5#include <linux/device.h>
6#include <linux/module.h>
7#include <linux/slab.h>
8#include <linux/uuid.h>

--- 400 unchanged lines hidden (view full) ---

409 rc = granularity_to_eig(val, &ig);
410 if (rc)
411 return rc;
412
413 /*
414 * When the host-bridge is interleaved, disallow region granularity !=
415 * root granularity. Regions with a granularity less than the root
416 * interleave result in needing multiple endpoints to support a single
1// SPDX-License-Identifier: GPL-2.0-only
2/* Copyright(c) 2022 Intel Corporation. All rights reserved. */
3#include <linux/memregion.h>
4#include <linux/genalloc.h>
5#include <linux/device.h>
6#include <linux/module.h>
7#include <linux/slab.h>
8#include <linux/uuid.h>

--- 400 unchanged lines hidden (view full) ---

409 rc = granularity_to_eig(val, &ig);
410 if (rc)
411 return rc;
412
413 /*
414 * When the host-bridge is interleaved, disallow region granularity !=
415 * root granularity. Regions with a granularity less than the root
416 * interleave result in needing multiple endpoints to support a single
417 * slot in the interleave (possible to suport in the future). Regions
417 * slot in the interleave (possible to support in the future). Regions
418 * with a granularity greater than the root interleave result in invalid
419 * DPA translations (invalid to support).
420 */
421 if (cxld->interleave_ways > 1 && val != cxld->interleave_granularity)
422 return -EINVAL;
423
424 rc = down_write_killable(&cxl_region_rwsem);
425 if (rc)

--- 1635 unchanged lines hidden ---
418 * with a granularity greater than the root interleave result in invalid
419 * DPA translations (invalid to support).
420 */
421 if (cxld->interleave_ways > 1 && val != cxld->interleave_granularity)
422 return -EINVAL;
423
424 rc = down_write_killable(&cxl_region_rwsem);
425 if (rc)

--- 1635 unchanged lines hidden ---