2021-04-09 09:09:44

by nicolas saenz julienne

[permalink] [raw]
Subject: [PATCH] pwm: raspberrypi-poe: Fix mailbox message initialization

For testing purposes this driver might be built on big-endian
architectures. So make sure we take that into account when populating
structures that are to be passed to RPi4's mailbox.

Reported-by: kernel test robot <[email protected]>
Fixes: 79caa362eab6 ("pwm: Add Raspberry Pi Firmware based PWM bus")
Signed-off-by: Nicolas Saenz Julienne <[email protected]>
---

@arndb: This was just meged into the arm-soc tree some days ago. Should I
prepare a second PR once it's been reviewed?

drivers/pwm/pwm-raspberrypi-poe.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pwm/pwm-raspberrypi-poe.c b/drivers/pwm/pwm-raspberrypi-poe.c
index 043fc32e8be8..78423e66f4fc 100644
--- a/drivers/pwm/pwm-raspberrypi-poe.c
+++ b/drivers/pwm/pwm-raspberrypi-poe.c
@@ -66,7 +66,7 @@ static int raspberrypi_pwm_get_property(struct rpi_firmware *firmware,
u32 reg, u32 *val)
{
struct raspberrypi_pwm_prop msg = {
- .reg = reg
+ .reg = cpu_to_le32(reg),
};
int ret;

--
2.30.2


2021-04-09 11:36:23

by Thierry Reding

[permalink] [raw]
Subject: Re: [PATCH] pwm: raspberrypi-poe: Fix mailbox message initialization

On Fri, Apr 09, 2021 at 11:08:19AM +0200, Nicolas Saenz Julienne wrote:
> For testing purposes this driver might be built on big-endian
> architectures. So make sure we take that into account when populating
> structures that are to be passed to RPi4's mailbox.
>
> Reported-by: kernel test robot <[email protected]>
> Fixes: 79caa362eab6 ("pwm: Add Raspberry Pi Firmware based PWM bus")
> Signed-off-by: Nicolas Saenz Julienne <[email protected]>
> ---
>
> @arndb: This was just meged into the arm-soc tree some days ago. Should I
> prepare a second PR once it's been reviewed?
>
> drivers/pwm/pwm-raspberrypi-poe.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Acked-by: Thierry Reding <[email protected]>


Attachments:
(No filename) (743.00 B)
signature.asc (849.00 B)
Download all attachments

2021-04-09 20:11:12

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH] pwm: raspberrypi-poe: Fix mailbox message initialization

On Fri, Apr 9, 2021 at 11:08 AM Nicolas Saenz Julienne
<[email protected]> wrote:
>
> For testing purposes this driver might be built on big-endian
> architectures. So make sure we take that into account when populating
> structures that are to be passed to RPi4's mailbox.
>
> Reported-by: kernel test robot <[email protected]>
> Fixes: 79caa362eab6 ("pwm: Add Raspberry Pi Firmware based PWM bus")
> Signed-off-by: Nicolas Saenz Julienne <[email protected]>
> ---
>
> @arndb: This was just meged into the arm-soc tree some days ago. Should I
> prepare a second PR once it's been reviewed?

Yes, that would be good. If you have no other driver patches that I should
pick up, just forward the patch (with the Ack) to [email protected] and I
can just apply it.

Arnd