Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1524841ybl; Wed, 28 Aug 2019 16:27:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqycgsPHAOmSfQua6bNhoa3nhKOGZVs+uHchDp+FFBIFZjFj939CUb/8IseQrlNUcxVK01aB X-Received: by 2002:a17:90a:e2d2:: with SMTP id fr18mr6636429pjb.98.1567034864309; Wed, 28 Aug 2019 16:27:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567034864; cv=none; d=google.com; s=arc-20160816; b=q4w92umlg9nR8V7b6DAH570N0nxILMMRRDABGH81JU8CvEqqlA9TUXmhht8btdf5Ig 4P7DSAZKvXiFxszjHVP1qVToHZOUKXSXmyiGtAHxvb4/MWxnOYEy2P8q1GYIw2h8y5yB VI6RRYOUlY9Jabzk0h5qLE9M7knte6WleF8G4ass+HJK0RTEcSON3YfqiW/oa7S/nEZ/ qxvaQn1CRwXpsCzFY8PshyYER9Nyz45Iqn3SL4lmp3esNxA2yoCx2lnKnXxR12lzcwzK gJnQeJ0vYrB4wmY9t5gfCK4N0y18s/kLLluFT82ZyvGeoXvWn5gxhZo6CZpxDuf4XXSV DdWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=zoBlXvJBemCrQzD12jpiGB+4gV2+A+K5Uq/oaYZLfFM=; b=ZFLLJts112xpwUCbBrS1tdGlbgwKOJw2mdPw3vR4VlWtO0x/of46k5YNe7MiB4YeDI FhkzN7vx0fA+3w0VDPuSyKmYzlyRk09ShxQuoKk6sAK2HgGBaeUe5Bf0F7Aj6eeBFnyn HERsPVBEy3rv5n9xJuj61rWKcLPHKxcOUlICiiwrvkMcYj6r7D9q5zUnk4qoDBTJsJ9f juockBaRfHzYG392fAt6U0Y2UvtBc4SGQMtQEBh+E3mAfV1xK0+X3HiDEkpD9w9GfVf2 w+l1WXM7cUPQXeHZ0VKoPZB9UYqVStM4QU2a2FPIEWFHJzKqsGV49ixsLHkzoja/xiz6 VKzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kIAEbPzM; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y13si444600pgp.339.2019.08.28.16.27.28; Wed, 28 Aug 2019 16:27:44 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kIAEbPzM; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727014AbfH1X0a (ORCPT + 99 others); Wed, 28 Aug 2019 19:26:30 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:43105 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726787AbfH1X0a (ORCPT ); Wed, 28 Aug 2019 19:26:30 -0400 Received: by mail-io1-f65.google.com with SMTP id 18so3006426ioe.10; Wed, 28 Aug 2019 16:26:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zoBlXvJBemCrQzD12jpiGB+4gV2+A+K5Uq/oaYZLfFM=; b=kIAEbPzMuxNRXuFYEiPtRR1a/KgojVQESDxJLyvyh3NwmbXEAq0U/nfjdEcuUDtB92 2nlRfn/kxtFVVN5IUpViUy35tdTSaBaIydEX58MGPq1B1KacUqaAuV5noU0AMtaLfad9 27j2m8soL7vuwiSkZKxsQEHnjIXjEF4Hq/XmZEaQh6VpD8Kk3HqwRWc8Y3TsiQruqcQx +ZqMCFNRDcPn3YNhJgpwUjSzTxles9+s2SumNLoZ/LjSSsDLMvTlGToidkVVHWJ4KHK6 VmhaR8b90Qw0XQB/52mVmK80Mt6jfTzzqtpi5HFZecUCOfRbUlG/msILdr36Ch3cDTbe yxHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zoBlXvJBemCrQzD12jpiGB+4gV2+A+K5Uq/oaYZLfFM=; b=o2IbC0jyWH2wMGqXPX/SfuiaY5mfaxJZk7lMJqqqmY2eIfjcwRUww6rUz+Yl4LJb4X U1E1Ch5MuKyt25dQdYlj9YmR2N/VeAkdW3pJ8z0yyu2PbJwvkdvRCiAxekVJU4tVz4YQ KPa4ai0cLw9yAjr4K4AOGMPFTRdi1jB3aA2aJjvVE/Yzr5/tO1VcWyZjXjW3QQEY4TvZ JwBMOfCGzgYSycHaRYifZiyX+PtJP/UzUFSxO4L+pcbnLc07iJe8yNa7VucTvFupXqvr wMsK+3o/DANlispMIAUSL1WadU+7ZxMsqNCEOvH8+Pvt6BcgvfmXuUpdcpZjVa0x2Zpn CrRw== X-Gm-Message-State: APjAAAUoFvLwLFNjA6giNKEGXH2nYyCKJRedmUCD4BwbXCN4eMjLpYq8 69wreXV3zCjSElI6IHrXGR0j5FAE4s3auZgy7hY= X-Received: by 2002:a6b:901:: with SMTP id t1mr2602161ioi.6.1567034788892; Wed, 28 Aug 2019 16:26:28 -0700 (PDT) MIME-Version: 1.0 References: <20190812152022.27963-1-stillcompiling@gmail.com> <20190812152022.27963-4-stillcompiling@gmail.com> In-Reply-To: <20190812152022.27963-4-stillcompiling@gmail.com> From: Joshua Clayton Date: Wed, 28 Aug 2019 17:26:18 -0600 Message-ID: Subject: Re: [PATCH v3 3/3] HID: core: fix dmesg flooding if report field larger than 32bit To: Jiri Kosina , Benjamin Tissoires , "open list:HID CORE LAYER" , open list Cc: Joe Perches Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ping? I'd love to see this get in. with distro kernel I have effectively no dmesg due to this issue On Mon, Aug 12, 2019 at 9:20 AM wrote: > > From: Joshua Clayton > > Only warn once of oversize hid report value field > > On HP spectre x360 convertible the message: > hid-sensor-hub 001F:8087:0AC2.0002: hid_field_extract() called with n (192) > 32! (kworker/1:2) > is continually printed many times per second, crowding out all else. > Protect dmesg by printing the warning only one time. > > The size of the hid report field data structure should probably be increased. > The data structure is treated as a u32 in Linux, but an unlimited number > of bits in the USB hid spec, so there is some rearchitecture needed now that > devices are sending more than 32 bits. > > Signed-off-by: Joshua Clayton > > diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c > index 210b81a56e1a..3eaee2c37931 100644 > --- a/drivers/hid/hid-core.c > +++ b/drivers/hid/hid-core.c > @@ -1311,8 +1311,8 @@ u32 hid_field_extract(const struct hid_device *hid, u8 *report, > unsigned offset, unsigned n) > { > if (n > 32) { > - hid_warn(hid, "hid_field_extract() called with n (%d) > 32! (%s)\n", > - n, current->comm); > + hid_warn_once(hid, "%s() called with n (%d) > 32! (%s)\n", > + __func__, n, current->comm); > n = 32; > } > > -- > 2.21.0 >