]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
firmware: raspberrypi: Use correct device for DMA mappings
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Tue, 26 Mar 2024 19:58:06 +0000 (21:58 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 16 Jun 2024 11:39:16 +0000 (13:39 +0200)
commiteb6d925fe70c2cb090e73055f29f1ba81d45904d
tree62cb04c1fd1d239fc08929a5df9f75741a661b68
parentd19ba2e3f5e70e65fe1d97ff068149beb1cfcae9
firmware: raspberrypi: Use correct device for DMA mappings

[ Upstream commit df518a0ae1b982a4dcf2235464016c0c4576a34d ]

The buffer used to transfer data over the mailbox interface is mapped
using the client's device. This is incorrect, as the device performing
the DMA transfer is the mailbox itself. Fix it by using the mailbox
controller device instead.

This requires including the mailbox_controller.h header to dereference
the mbox_chan and mbox_controller structures. The header is not meant to
be included by clients. This could be fixed by extending the client API
with a function to access the controller's device.

Fixes: 4e3d60656a72 ("ARM: bcm2835: Add the Raspberry Pi firmware driver")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Stefan Wahren <wahrenst@gmx.net>
Tested-by: Ivan T. Ivanov <iivanov@suse.de>
Link: https://lore.kernel.org/r/20240326195807.15163-3-laurent.pinchart@ideasonboard.com
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/firmware/raspberrypi.c