diff options
| author | Jason Gunthorpe <jgg@nvidia.com> | 2021-08-30 09:49:59 -0300 |
|---|---|---|
| committer | Jason Gunthorpe <jgg@nvidia.com> | 2021-08-30 09:49:59 -0300 |
| commit | 6a217437f9f5482a3f6f2dc5fcd27cf0f62409ac (patch) | |
| tree | c82270181daeb43eb9984b586784b70f13ef1df4 /drivers/acpi/utils.c | |
| parent | 65f90c8e38c9900692338864156e7824cf8a6501 (diff) | |
| parent | 79fbd3e1241cea83dded06db2b8bcd5893d877d7 (diff) | |
| download | linux-6a217437f9f5482a3f6f2dc5fcd27cf0f62409ac.tar.bz2 | |
Merge branch 'sg_nents' into rdma.git for-next
From Maor Gottlieb
====================
Fix the use of nents and orig_nents in the sg table append helpers. The
nents should be used by the DMA layer to store the number of DMA mapped
sges, the orig_nents is the number of CPU sges.
Since the sg append logic doesn't always create a SGL with exactly
orig_nents entries store a total_nents as well to allow the table to be
properly free'd and reorganize the freeing logic to share across all the
use cases.
====================
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
* 'sg_nents':
RDMA: Use the sg_table directly and remove the opencoded version from umem
lib/scatterlist: Fix wrong update of orig_nents
lib/scatterlist: Provide a dedicated function to support table append
Diffstat (limited to 'drivers/acpi/utils.c')
| -rw-r--r-- | drivers/acpi/utils.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index e7ddd281afff..d5cedffeeff9 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c @@ -860,11 +860,9 @@ EXPORT_SYMBOL(acpi_dev_present); * Return the next match of ACPI device if another matching device was present * at the moment of invocation, or NULL otherwise. * - * FIXME: The function does not tolerate the sudden disappearance of @adev, e.g. - * in the case of a hotplug event. That said, the caller should ensure that - * this will never happen. - * * The caller is responsible for invoking acpi_dev_put() on the returned device. + * On the other hand the function invokes acpi_dev_put() on the given @adev + * assuming that its reference counter had been increased beforehand. * * See additional information in acpi_dev_present() as well. */ @@ -880,6 +878,7 @@ acpi_dev_get_next_match_dev(struct acpi_device *adev, const char *hid, const cha match.hrv = hrv; dev = bus_find_device(&acpi_bus_type, start, &match, acpi_dev_match_cb); + acpi_dev_put(adev); return dev ? to_acpi_device(dev) : NULL; } EXPORT_SYMBOL(acpi_dev_get_next_match_dev); |