Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp975707ybh; Wed, 18 Mar 2020 12:34:06 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtpEV46tQarpChpsfQn9ltHXoXqDHPkAGS+Y74Vdd/RGnFWpbIh27xYuACzeUjub44W9EbZ X-Received: by 2002:aca:f183:: with SMTP id p125mr4654316oih.74.1584560046237; Wed, 18 Mar 2020 12:34:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584560046; cv=none; d=google.com; s=arc-20160816; b=SNfhvEda5XqV+0CpKUrK6US7MRsa7S4XZSZ/KYJVHk8JRWqpl6v5wrDbGn66I8Q/ap RLsP4qT45ZJR7CtYHOb3ROS4RsLGArvQquiSkITv88h2A/Brw/7Xw3WaKMjO66oQcLD5 TIbrvjwPWUuR75Kk2AJxiXlKP1l0RtP9rqA7UyWkPQopl9BmvjH49w9pQVaJ+k3xGftl ITrfmUdruRnpImJDILB6CHKb5BLkwoehbUvtrmPY/a2ivPjjjAKQyB+npnV+6oTXRVHy ORJ78jbkfUkVK7VcKbnajTkypYElpVllTOztLbFohU3pQUwG36yiAMLYN5gl0DmF/zld s8bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:mime-version:date:organization :references:in-reply-to:to:from:subject:message-id; bh=K4kyrzM/PYdIldhIRjUfXl8+Z06wmdlWnsUR5PfzVDs=; b=dc0pTQ6WtEFmxeQfcBf+nnaOlnxvtsfYMMYCj+s1aMOGnRzUqXQBuThXnLRGHf0rlF C29w/RyIyOE2ktgUh2SECcyCD2iPk8bdPB80kgyxIF7pLPEBrYXl2wbrBuk/8FN/00cL ipPPJ2xHsA99s8oiYUnL8GQnUgqSjZofhn2p6IGHbRGmlByUtmtQRktT88AK1YEXv4Gu qTfDyAbXafRAyZc3fkfhesYwZ2ehVZ2XpMd2E8/HOlOB12Xn8yKmoMJRZA00bCkdEM1/ HFSmP12iLiPPM03aoG6INEMI3xHiNAJaM3W1p2i7uc7nMIsAzoXiSgcLHhoWFfZGbFR+ qz6w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=archlinux.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s14si4075773otp.243.2020.03.18.12.33.54; Wed, 18 Mar 2020 12:34:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=archlinux.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727064AbgCRTXQ (ORCPT + 99 others); Wed, 18 Mar 2020 15:23:16 -0400 Received: from orion.archlinux.org ([88.198.91.70]:43296 "EHLO orion.archlinux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727027AbgCRTXP (ORCPT ); Wed, 18 Mar 2020 15:23:15 -0400 Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id E11721A33B3EAB; Wed, 18 Mar 2020 19:23:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on orion.archlinux.org X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=ALL_TRUSTED=-1,BAYES_00=-1, DMARC_FAIL_NONE=0.25,T_DMARC_POLICY_NONE=0.01,T_DMARC_TESTS_FAIL=0.01 autolearn=no autolearn_force=no version=3.4.4 X-Spam-BL-Results: Received: from genesis (unknown [IPv6:2001:8a0:f254:2300:dad6:8c60:8394:88da]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: ffy00) by orion.archlinux.org (Postfix) with ESMTPSA; Wed, 18 Mar 2020 19:23:11 +0000 (UTC) Message-ID: <5404e421520419a8031593179798b95bd0970bd8.camel@archlinux.org> Subject: Re: [PATCH] HID: logitech-dj: issue udev change event on device connection From: Filipe =?ISO-8859-1?Q?La=EDns?= To: Jiri Kosina , Benjamin Tissoires , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Hutterer , Hans de Goede , Mario Limonciello , Richard Hughes In-Reply-To: <20200318161906.3340959-1-lains@archlinux.org> References: <20200318161906.3340959-1-lains@archlinux.org> Organization: Archlinux Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-ciTeMDtrJBxBOS7lKYqJ" Date: Wed, 18 Mar 2020 19:23:10 +0000 MIME-Version: 1.0 User-Agent: Evolution 3.36.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-ciTeMDtrJBxBOS7lKYqJ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2020-03-18 at 16:19 +0000, Filipe La=C3=ADns wrote: > As discussed in the mailing list: >=20 > > Right now the hid-logitech-dj driver will export one node for each > > connected device, even when the device is not connected. That > > causes > > some trouble because in userspace we don't have have any way to > > know if > > the device is connected or not, so when we try to communicate, if > > the > > device is disconnected it will fail. >=20 > The solution reached to solve this issue is to trigger an udev change > event when the device connects, this way userspace can just wait on > those connections instead of trying to ping the device. >=20 > Signed-off-by: Filipe La=C3=ADns > --- > drivers/hid/hid-logitech-dj.c | 2 ++ > 1 file changed, 2 insertions(+) >=20 > diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid- > logitech-dj.c > index 48dff5d6b605..fcd481a0be1f 100644 > --- a/drivers/hid/hid-logitech-dj.c > +++ b/drivers/hid/hid-logitech-dj.c > @@ -1464,6 +1464,8 @@ static int logi_dj_dj_event(struct hid_device > *hdev, > if (dj_report- > >report_params[CONNECTION_STATUS_PARAM_STATUS] =3D=3D > STATUS_LINKLOSS) { > logi_dj_recv_forward_null_report(djrcv_dev, > dj_report); > + } else { > + kobject_uevent(&hdev->dev.kobj, KOBJ_CHANGE); > } > break; > default: Just noticed I was issuing the udev event on the receiver instead of the connected device. I will send a v2. Filipe La=C3=ADns --=-ciTeMDtrJBxBOS7lKYqJ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEE0jW0leqs33gyftiw+JPGdIFqqV0FAl5ydR4ACgkQ+JPGdIFq qV1RJBAAj8gSKs5gc9e2B7HN6c0ThwipBVm0xPCzfKpvXHga7vYi5ouUNcfCxQoo wLEbEtbkUWjxh/ooQQEudjA5PBCDIkcjrNpxttxEZuVM2UPrGLYKvnRusV8cCxnR o08Rgbx+882R0me5IMl1806TUfF8bPk3bhKXn7pry1sCAl0I2uYJGCoNU17e8DDC Q0c8IZg4+Kd1vEOJ9GjmFV4Tx4lX4m8kqZsxZ0Ku0KDdjM4mM9CDAT4Zh0oRfcce nfEs2I1w1a/aJRaIAI6VWFgaqXauSA+DTKeS/slit64tLdWhOhL6xbtOqCTqqPgv hkDISj8IZ6BDfkTWAp5ttxvm79m9qI7iK8GVX6KqLzBtuFHm1Xm4OnTMLFZMu8vi DrfqMrgezkoczFQja8PttcfITJQ/SaKTPt0rgxEXExt0JNDR2cuF1TPNkIaGI3DV nRbKN5vRkq66d/BoG4UFHQGHjitUcoZdoo17dd9A5qcM6LXVXi2J4kWHP98aYzxX CJmg+k8UlMUO8OuHQQXdAkYjfnZf/uDnxRGaRpfupeCh0PJp8bzBtmVNdhRFLa3s Hksu0F75X+Ujx5NtH6RG10iyN9sJtBsvnbJn0iuxeYMEJJIK+3vGfU31E1EqDjtH BUII0wcvBB/q9h23bkcIaNW+o7vW764gyEeDUZi0meA5eFEqNP4= =gWhb -----END PGP SIGNATURE----- --=-ciTeMDtrJBxBOS7lKYqJ--