diff options
author | Jason Gunthorpe <jgg@mellanox.com> | 2019-08-21 13:12:29 -0400 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2019-08-21 19:58:18 -0400 |
commit | daa138a58c802e7b4c2fb73f9b85bb082616ef43 (patch) | |
tree | be913e8e3745bb367d2ba371598f447649102cfc /drivers/gpio/gpiolib.c | |
parent | 6869b7b206595ae0e326f59719090351eb8f4f5d (diff) | |
parent | fba0e448a2c5b297a4ddc1ec4e48f4aa6600a1c9 (diff) |
Merge branch 'odp_fixes' into hmm.git
From rdma.git
Jason Gunthorpe says:
====================
This is a collection of general cleanups for ODP to clarify some of the
flows around umem creation and use of the interval tree.
====================
The branch is based on v5.3-rc5 due to dependencies, and is being taken
into hmm.git due to dependencies in the next patches.
* odp_fixes:
RDMA/mlx5: Use odp instead of mr->umem in pagefault_mr
RDMA/mlx5: Use ib_umem_start instead of umem.address
RDMA/core: Make invalidate_range a device operation
RDMA/odp: Use kvcalloc for the dma_list and page_list
RDMA/odp: Check for overflow when computing the umem_odp end
RDMA/odp: Provide ib_umem_odp_release() to undo the allocs
RDMA/odp: Split creating a umem_odp from ib_umem_get
RDMA/odp: Make the three ways to create a umem_odp clear
RMDA/odp: Consolidate umem_odp initialization
RDMA/odp: Make it clearer when a umem is an implicit ODP umem
RDMA/odp: Iterate over the whole rbtree directly
RDMA/odp: Use the common interval tree library instead of generic
RDMA/mlx5: Fix MR npages calculation for IB_ACCESS_HUGETLB
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/gpio/gpiolib.c')
-rw-r--r-- | drivers/gpio/gpiolib.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 3ee99d070608..f497003f119c 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c | |||
@@ -956,9 +956,11 @@ static int lineevent_create(struct gpio_device *gdev, void __user *ip) | |||
956 | } | 956 | } |
957 | 957 | ||
958 | if (eflags & GPIOEVENT_REQUEST_RISING_EDGE) | 958 | if (eflags & GPIOEVENT_REQUEST_RISING_EDGE) |
959 | irqflags |= IRQF_TRIGGER_RISING; | 959 | irqflags |= test_bit(FLAG_ACTIVE_LOW, &desc->flags) ? |
960 | IRQF_TRIGGER_FALLING : IRQF_TRIGGER_RISING; | ||
960 | if (eflags & GPIOEVENT_REQUEST_FALLING_EDGE) | 961 | if (eflags & GPIOEVENT_REQUEST_FALLING_EDGE) |
961 | irqflags |= IRQF_TRIGGER_FALLING; | 962 | irqflags |= test_bit(FLAG_ACTIVE_LOW, &desc->flags) ? |
963 | IRQF_TRIGGER_RISING : IRQF_TRIGGER_FALLING; | ||
962 | irqflags |= IRQF_ONESHOT; | 964 | irqflags |= IRQF_ONESHOT; |
963 | 965 | ||
964 | INIT_KFIFO(le->events); | 966 | INIT_KFIFO(le->events); |
@@ -1392,12 +1394,17 @@ int gpiochip_add_data_with_key(struct gpio_chip *chip, void *data, | |||
1392 | for (i = 0; i < chip->ngpio; i++) { | 1394 | for (i = 0; i < chip->ngpio; i++) { |
1393 | struct gpio_desc *desc = &gdev->descs[i]; | 1395 | struct gpio_desc *desc = &gdev->descs[i]; |
1394 | 1396 | ||
1395 | if (chip->get_direction && gpiochip_line_is_valid(chip, i)) | 1397 | if (chip->get_direction && gpiochip_line_is_valid(chip, i)) { |
1396 | desc->flags = !chip->get_direction(chip, i) ? | 1398 | if (!chip->get_direction(chip, i)) |
1397 | (1 << FLAG_IS_OUT) : 0; | 1399 | set_bit(FLAG_IS_OUT, &desc->flags); |
1398 | else | 1400 | else |
1399 | desc->flags = !chip->direction_input ? | 1401 | clear_bit(FLAG_IS_OUT, &desc->flags); |
1400 | (1 << FLAG_IS_OUT) : 0; | 1402 | } else { |
1403 | if (!chip->direction_input) | ||
1404 | set_bit(FLAG_IS_OUT, &desc->flags); | ||
1405 | else | ||
1406 | clear_bit(FLAG_IS_OUT, &desc->flags); | ||
1407 | } | ||
1401 | } | 1408 | } |
1402 | 1409 | ||
1403 | acpi_gpiochip_add(chip); | 1410 | acpi_gpiochip_add(chip); |