Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp616213rdg; Tue, 10 Oct 2023 23:40:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHvxyNznQbYiUF/KFtBM/TvByE2squ3utYbu4+W8Z2xy83SFwCItctIO9iteW0jusgGaeDw X-Received: by 2002:a05:6870:160d:b0:1d6:e8bd:5b48 with SMTP id b13-20020a056870160d00b001d6e8bd5b48mr19504095oae.56.1697006454959; Tue, 10 Oct 2023 23:40:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697006454; cv=none; d=google.com; s=arc-20160816; b=Mw6dPuym9z9BAQ3DnRrvDiv8jV2Oqh97ptbQ+xjGhMBEwIRfbtCZ22xq9IUUj2Xwtw BIgQWawdJkpcM7ZjlydcvYuQwwmKKeHJJT5H3SYMb1MIhu8muTn2EwAC79ySDN5813Ma BqLfKzEZJ5oNusRqgAuK/ahgNEc61ZfQI4nP2Lgm82ivt1WGWFZDqSiFiLpaAkk2X25X Tq/t2cpeCQEPWBeQB2yi3CkUYrER06qMd461Mlk2EvcTiq5MnGjzefBSXFhhaSz3t4D4 7XYvuV0LgGS20tOrVVww7nQP22xlRWbJC8RuNo1inGLBrcj+nWwQ0qMsV/2NrLQzeiax MdGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=ia+oudd1GuNYiqxwtg9epIyMsLn5EHS/WlxsAYLBkt0=; fh=CydSKgSLs+Miyx/01Q4/ooWl91ZWfQQhM0C9cAN135I=; b=x4rVnf76nBERvQGVBVs8pbLnYSaVLZNJkShgaXCthZm9gvfkpp5lqFGgGeu+e+Lhos BzUKITgFKIKKuQlyCgkxlZSA672piGwHw2aZvpaBbF3Mhhijpf26izaRFQtvc7lCUs+2 bU6O3l5HqdIfP7+N4y0AvErgVKmKuEZcLTgbFfn7Q5DjzM5V78dcHjnH+3Tgz3TJXss2 LdsXTfC/wEu+LSCyap/hzmHQ8wTb9KENGnl6BVgRyXzuxg1h643lm4lEMW58OLUb/obw OGPI7c5z2RX4cQ4ydToWz5O8wfq5LqG/+K9r0394jI/aOyE5C7Q5EiDB8CGEMbR77uXX sgpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=TzfdFwa2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id m125-20020a633f83000000b005895b62fe76si13928961pga.462.2023.10.10.23.40.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 23:40:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=TzfdFwa2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id B03638074E0A; Tue, 10 Oct 2023 23:40:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345499AbjJKGkY (ORCPT + 99 others); Wed, 11 Oct 2023 02:40:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345447AbjJKGkW (ORCPT ); Wed, 11 Oct 2023 02:40:22 -0400 Received: from mail-yw1-x1134.google.com (mail-yw1-x1134.google.com [IPv6:2607:f8b0:4864:20::1134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6EC6B6; Tue, 10 Oct 2023 23:40:21 -0700 (PDT) Received: by mail-yw1-x1134.google.com with SMTP id 00721157ae682-5a7b91faf40so23808997b3.1; Tue, 10 Oct 2023 23:40:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697006421; x=1697611221; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ia+oudd1GuNYiqxwtg9epIyMsLn5EHS/WlxsAYLBkt0=; b=TzfdFwa27OPrDO2o5JDaXASqh6yBj6+VplOW1O/clL4PvkQGYj1IalVR6FpjIyc3aX wGuFj7nPg5moGM/YvQLeKle9EzepIQ5WwJBA41c2V8rrgM/p7+BCVWme0NDlPc/U/1WU wFz6AoU86y2ciZgF05osF9L2KtAzhMXnAnhxDjhps+VQDP+E/6CnzhEGHODy8doetx/K ugW26/VVSGSmaxQmn20E5iq1s6cUCalywbH4a432s3Elzf/532M0JHsBBd1wPR+m3VmX 3LcOP7gel54A+XFEJPXka41bSAJ6nDP0p90Re9SnIAHcd34vsY0t+1Ayxs+p7ClAlUH4 VKBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697006421; x=1697611221; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ia+oudd1GuNYiqxwtg9epIyMsLn5EHS/WlxsAYLBkt0=; b=O75mYtAzLOHbrXR3HCKh7J/qc3sI42gP4hxWCLwEO1qc1Czq+A74wUB1ehmOaRi+Qd 0Ao5UvvtxHxal5wL5zpc0eJrmcjQpt0pXbbsxVg6fnvPTpx00WRGQq34ozBbvP8O9ECH p7m3z79PM/zDZho6hm2hx95rM/xuZH3ZsJm76dP3ybxJrD2hawpOmFUNpVM94o3ObWTL wHeajlN5y6dZ+itdgoUpncTZrcOXuw5oqq3MXUyC6p13UNbB58D316QWgRk8nErveuPq 7T+CjG36OoNsDchKK9Q/g9/A5O6Q6HdlRIilQvhQNUc2u0td9cfjC5S3VITQkI3guNDT OD6A== X-Gm-Message-State: AOJu0Yw20nMrn0TGcCmokGG1+ILcxrgfGf44ccdlw4ot4hAR656t4FSs Ctp0w3lsVN6IDagb+MCChc8BPBNT9m3trvcEYVTvYppqq5I= X-Received: by 2002:a5b:708:0:b0:d84:ce15:8335 with SMTP id g8-20020a5b0708000000b00d84ce158335mr18768805ybq.10.1697006420892; Tue, 10 Oct 2023 23:40:20 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: John Salamon Date: Wed, 11 Oct 2023 17:10:09 +1030 Message-ID: Subject: Re: uinput: waiting for UI_FF_UPLOAD events will not inform user when allocation is required To: dmitry.torokhov@gmail.com, rydberg@bitmath.org Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=3.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_SBL_CSS, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 10 Oct 2023 23:40:37 -0700 (PDT) X-Spam-Level: ** Correction, "old" is a pointer to struct ff_effect, which after being set to NULL looks like it gets pushed out by uinput on a struct uinput_request. On Tue, Oct 10, 2023 at 5:38=E2=80=AFPM John Salamon = wrote: > > Currently the "fake" input events generated by uinput in response to > effect uploads will return an effect with an id that has already been > handled by input_ff_upload in ff-core.c, which can modify the effect > id. This causes a problem specifically when the effect originally > uploaded via the EVIOCSFF ioctl contained an effect with -1, as the > userspace code handling UI_FF_UPLOAD receives an effect with an id > other than -1, and therefore will not know an allocation was > requested. > > I notice that the "old" field on the ff_effect struct is set to NULL > when the -1 id is changed (in input_ff_upload), which can serve as a > flag that an allocation was requested. If it is the intention is that > uinput users check if old =3D=3D NULL to know when allocations are needed > I think uinput documentation should describe this. > > I first noticed this using python-evdev, see my issue report here: > https://github.com/gvalkov/python-evdev/issues/199