Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1688706pxj; Fri, 4 Jun 2021 23:47:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHifX0ipYpY59iUWOFje2Oosn6wemmjx58tjGrHVbgNOGnaixaQV1eShx92DR4sX2DsY2V X-Received: by 2002:a17:906:28d8:: with SMTP id p24mr7786907ejd.64.1622875655019; Fri, 04 Jun 2021 23:47:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622875655; cv=none; d=google.com; s=arc-20160816; b=gEwodTMRhqKMS7FYqXwZWGv5rztaDs77WqWA+Q7+2q8tT9u0vUllcrqrqUtFqUtNKs LZR2ry6HaFtUoVSDvNVbbGo8XQzUmm7asL1U5kbExgVz69mDII4laitXxGeCe8LGU8As hCPY029X0dGB8JALiwh+tKV44muaTx1ghDrB4uucLPTxDzRVvSpbgb9rT3wOxXLwALvM RhwSirdCFbJH0ZCvnpsTrVIygSG6KVgsRRSfxc7NErg2gXBQDT2LODZjM29fdycuyNZ/ h1q0HutWpSK41pEfbZnTdRmOW5KzN9IPBsxWmWQtR/aItZzP0jyL/mng54eeNeWCSdyt CdrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=LBKKGrR9BqRtkkOQ/g7bhsrZehNA6gi7/GnRcaw1a88=; b=0GYZe7aGcRBC1RJNQbbnTu1Bt1awilLT0EpGo8aifaJ2fmXAz9v7OUYO9IBgf1DH0V wiUL4NyCBY7c8YqPwsk+mLRGFsmcsQXYQfuDDpKMHeuNWEjvmZfrsMHXqHbY7cF1IOfK UZem3lfI5gSDCI6WeZwq32/XY33Y9epyd2GGSw0u4acRs3L6BTticZ7DrryZGNHP4hh8 by1N9oXVAjq7qIFPmgy3PjTDAYd7S7qdgcqdahp7/EvbtrVXlZwUGPsjPNrwUaW0gKDX 5xGrzFReAQVL9FXcQKSq29SnNTp6LJeHwK5jnptuEMfVQqkx9Lv+zpdIN+JY2ouokebm vw3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1+SThqw8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i1si6500350ejv.412.2021.06.04.23.47.11; Fri, 04 Jun 2021 23:47:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1+SThqw8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229933AbhFEGpa (ORCPT + 99 others); Sat, 5 Jun 2021 02:45:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:39726 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229660AbhFEGpa (ORCPT ); Sat, 5 Jun 2021 02:45:30 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8C0F061380; Sat, 5 Jun 2021 06:43:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622875414; bh=TtRDgCW7OQ1zC3hQd1LY9Z/qTlTG9FRmSnSfEj5iwp0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=1+SThqw8h3ikUWbPOVEdqdULG5Hgdn/wqmaXQlXN4g+vcHHQF0USqMoEcVM7kF/aC nrwUW42x9XbF0DZtg2xT2j1W5jeW4goQ6uwT9UtmEj2nDIKCnDXdpB3X+OTGxsjJfb B1nDJSzTGMxLziHsBbovlo2ki1qKye1gUle+RwxI= Date: Sat, 5 Jun 2021 08:43:30 +0200 From: Greg KH To: Pascal Giard Cc: Jiri Kosina , Benjamin Tissoires , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Daniel Nguyen Subject: Re: [PATCH] HID: sony: fix freeze when inserting ghlive ps3/wii dongles Message-ID: References: <20210604161023.1498582-1-pascal.giard@etsmtl.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210604161023.1498582-1-pascal.giard@etsmtl.ca> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 04, 2021 at 12:10:23PM -0400, Pascal Giard wrote: > This commit fixes a freeze on insertion of a Guitar Hero Live PS3/WiiU > USB dongle. Indeed, with the current implementation, inserting one of > those USB dongles will lead to a hard freeze. I apologize for not > catching this earlier, it didn't occur on my old laptop. > > While the issue was isolated to memory alloc/free, I could not figure > out why it causes a freeze. So this patch fixes this issue by > simplifying memory allocation and usage. > > We remind that for the dongle to work properly, a control URB needs to > be sent periodically. We used to alloc/free the URB each time this URB > needed to be sent. > > With this patch, the memory for the URB is allocated on the probe, reused > for as long as the dongle is plugged in, and freed once the dongle is > unplugged. > > Signed-off-by: Pascal Giard > --- > drivers/hid/hid-sony.c | 98 +++++++++++++++++++++--------------------- > 1 file changed, 49 insertions(+), 49 deletions(-) This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read: https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html for how to do this properly.