linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] HID: usbhid: hid-pidff: Set Replay Length to Infinite when set to 0
@ 2022-09-30 22:51 Paul Jones
  2022-10-01  7:08 ` Greg KH
  2022-10-02 11:25 ` Slade Watkins
  0 siblings, 2 replies; 3+ messages in thread
From: Paul Jones @ 2022-09-30 22:51 UTC (permalink / raw)
  To: jikos, anssi.hannula; +Cc: linux-, linux-usb, linux-kernel

Greetings,
 
Started using my Accuforce v2 Sim wheel on Linux. I was getting no response from racing simulators through Wine, but native linux test tools worked fine. It seems that many real-world applications will send 0 as the replay length, which was resulting in the behavior I was experiencing (nothing). It makes sense to interpret 0 as an infinite effect and therefore set the replay length of the effect to 0xffff. While the PID document does not explicitly state that 0 should be infinite, it does hint toward null values being interpreted as infinite.
 
---
 
diff --git a/drivers/hid/usbhid/hid-pidff.c b/drivers/hid/usbhid/hid-pidff.c
index 3b4ee21cd811..70653451c860 100644
--- a/drivers/hid/usbhid/hid-pidff.c
+++ b/drivers/hid/usbhid/hid-pidff.c
@@ -301,7 +301,7 @@ static void pidff_set_effect_report(struct pidff_device *pidff,
 pidff->block_load[PID_EFFECT_BLOCK_INDEX].value[0];
pidff->set_effect_type->value[0] =
 pidff->create_new_effect_type->value[0];
- pidff->set_effect[PID_DURATION].value[0] = effect->replay.length;
+ pidff->set_effect[PID_DURATION].value[0] = effect->replay.length == 0 ? 0xffff : effect->replay.length;
pidff->set_effect[PID_TRIGGER_BUTTON].value[0] = effect->trigger.button;
pidff->set_effect[PID_TRIGGER_REPEAT_INT].value[0] =
 effect->trigger.interval;
 
-- 
 
- Paul
 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] HID: usbhid: hid-pidff: Set Replay Length to Infinite when set to 0
  2022-09-30 22:51 [PATCH 1/1] HID: usbhid: hid-pidff: Set Replay Length to Infinite when set to 0 Paul Jones
@ 2022-10-01  7:08 ` Greg KH
  2022-10-02 11:25 ` Slade Watkins
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2022-10-01  7:08 UTC (permalink / raw)
  To: Paul Jones; +Cc: jikos, anssi.hannula, linux-, linux-usb, linux-kernel

On Fri, Sep 30, 2022 at 10:51:27PM +0000, Paul Jones wrote:
> Greetings,
>  
> Started using my Accuforce v2 Sim wheel on Linux. I was getting no response from racing simulators through Wine, but native linux test tools worked fine. It seems that many real-world applications will send 0 as the replay length, which was resulting in the behavior I was experiencing (nothing). It makes sense to interpret 0 as an infinite effect and therefore set the replay length of the effect to 0xffff. While the PID document does not explicitly state that 0 should be infinite, it does hint toward null values being interpreted as infinite.
>  
> ---
>  
> diff --git a/drivers/hid/usbhid/hid-pidff.c b/drivers/hid/usbhid/hid-pidff.c
> index 3b4ee21cd811..70653451c860 100644
> --- a/drivers/hid/usbhid/hid-pidff.c
> +++ b/drivers/hid/usbhid/hid-pidff.c
> @@ -301,7 +301,7 @@ static void pidff_set_effect_report(struct pidff_device *pidff,
>  pidff->block_load[PID_EFFECT_BLOCK_INDEX].value[0];
> pidff->set_effect_type->value[0] =
>  pidff->create_new_effect_type->value[0];
> - pidff->set_effect[PID_DURATION].value[0] = effect->replay.length;
> + pidff->set_effect[PID_DURATION].value[0] = effect->replay.length == 0 ? 0xffff : effect->replay.length;
> pidff->set_effect[PID_TRIGGER_BUTTON].value[0] = effect->trigger.button;
> pidff->set_effect[PID_TRIGGER_REPEAT_INT].value[0] =
>  effect->trigger.interval;
>  
> -- 
>  
> - Paul
>  

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- Your patch is malformed (tabs converted to spaces, linewrapped, etc.)
  and can not be applied.  Please read the file,
  Documentation/email-clients.txt in order to fix this.

- Your patch does not have a Signed-off-by: line.  Please read the
  kernel file, Documentation/SubmittingPatches and resend it after
  adding that line.  Note, the line needs to be in the body of the
  email, before the patch, not at the bottom of the patch or in the
  email signature.

- You did not specify a description of why the patch is needed, or
  possibly, any description at all, in the email body.  Please read the
  section entitled "The canonical patch format" in the kernel file,
  Documentation/SubmittingPatches for what is needed in order to
  properly describe the change.

- You did not write a descriptive Subject: for the patch, allowing Greg,
  and everyone else, to know what this patch is all about.  Please read
  the section entitled "The canonical patch format" in the kernel file,
  Documentation/SubmittingPatches for what a proper Subject: line should
  look like.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] HID: usbhid: hid-pidff: Set Replay Length to Infinite when set to 0
  2022-09-30 22:51 [PATCH 1/1] HID: usbhid: hid-pidff: Set Replay Length to Infinite when set to 0 Paul Jones
  2022-10-01  7:08 ` Greg KH
@ 2022-10-02 11:25 ` Slade Watkins
  1 sibling, 0 replies; 3+ messages in thread
From: Slade Watkins @ 2022-10-02 11:25 UTC (permalink / raw)
  To: Paul Jones; +Cc: jikos, anssi.hannula, linux-, linux-usb, linux-kernel

Hi,

> On Sep 30, 2022, at 6:51 PM, Paul Jones <paul@spacefreak18.xyz> wrote:
> 
> Greetings,
>  
> Started using my Accuforce v2 Sim wheel on Linux. I was getting no response from racing simulators through Wine, but native linux test tools worked fine. It seems that many real-world applications will send 0 as the replay length, which was resulting in the behavior I was experiencing (nothing). It makes sense to interpret 0 as an infinite effect and therefore set the replay length of the effect to 0xffff. While the PID document does not explicitly state that 0 should be infinite, it does hint toward null values being interpreted as infinite.
>  
> ---

No Signed-off-by? 

Also, the formatting is weird here.

-srw


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-02 11:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-30 22:51 [PATCH 1/1] HID: usbhid: hid-pidff: Set Replay Length to Infinite when set to 0 Paul Jones
2022-10-01  7:08 ` Greg KH
2022-10-02 11:25 ` Slade Watkins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).