Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp420244lqh; Sat, 4 May 2024 06:38:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVMyGNrZoMmmPRsuPEozvdRzHZE142bGUaXWNNGFjAH7gn0OFodQ9O2oz0QX3QbND0NZR/xS4AgpoxrQJJePAzDpIpa9OT6F9WRcnGspg== X-Google-Smtp-Source: AGHT+IG/7gggnmnW++c3ThkDeHBqQVkHsu9VWe64ccaiGUWmgcCavffRfgKHIN0GGgbaoAMxUFTK X-Received: by 2002:a05:6902:2410:b0:de0:d3af:f52f with SMTP id dr16-20020a056902241000b00de0d3aff52fmr6636073ybb.49.1714829884396; Sat, 04 May 2024 06:38:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714829884; cv=pass; d=google.com; s=arc-20160816; b=WD3Ejsq9/H8N29uopGqB1FAfIPn8eMVNEkVrPqJttLyflMr8o4NBRjrKiHWZHVG1/V Wf2tAdOOH2FAZgmQadLs/5xMPIaNhWRPsmrwme3Mo/JeIM2XKkUZ5zLanrIfIR6svakn nTfDU+QtZTck/JMsqU+WUw1B+qWPf4Nu57+qA00D66c8G4Y8ql3x3c+E9xomCBShmfzG obDIw3WZBeXSvXD8khoEYaIkOYn61DDoXhQ079MU13f0YkeC1GW3ns7Ts8WP6P/PPN4W UJp7ziM/QAFzL/Cssbfnk2dUHj/oNBIbfibM782UNeDNEuG1Wn/lcLPkE5LZPJC/gshe uTKA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :sender:dkim-signature; bh=Q4EGKr6FjTAXUcLBcVBwQzJVvnJMccoMO665tE3tYfk=; fh=dftfR31Sm3VzADSNMNdIrhY/rA5rMKWWi4hTejXxVYs=; b=zCFJOm61MGWHST2IrLpq/ov1GKQ8laIn4advlfspMiLVCBYACngkYOsv0ehLlLrJ9i taCERb4EtFZ1ojNVcEaHjG8eZg4xVzmDo8dJKV8L0b5LKlzBosvuU1pFwPK3yqVWkxvJ /pq9HOw/0vFXbG7QW2DdWNr8PbqXfuRZf0wsTDZwc2o7Uy5/6inEiamdZw3esj5iJmov RlZEIgqkYViVjBf5EB0Bj5FaMeLJarbYo7K2NS1HDKvv119+vl58MXWz8N4iYZ2y7/Tz f/m9A3D+9Dt1MRFuYvd3IbAS24wbjyCvuSwI9nHL5xWRVnj+Nk0/A5VKkIm77tmLRAS7 FM1g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=RE4gRyoP; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-168693-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168693-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id m8-20020a05622a054800b0043aecf949c9si5641691qtx.199.2024.05.04.06.38.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 May 2024 06:38:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168693-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=RE4gRyoP; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-168693-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168693-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 143BD1C20D54 for ; Sat, 4 May 2024 13:38:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A457639ACC; Sat, 4 May 2024 13:37:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RE4gRyoP" Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 259211799B; Sat, 4 May 2024 13:37:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714829876; cv=none; b=bRMLgBXgo2rNclPAlT6yOmo0DUaWfUv1MLTiJ2xiiWAQQEWIgcfvSVYDBlskQyGYYuhYNa4sc+rwENXDJX/KC7XiHuRWiYBqqbuXcmxvBDyVwAZfRf4jL3kNsbAe8SbKngBNgbJqEIZwHq0rDmEk07T9nS9oAbbdKgqH1HgSLCU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714829876; c=relaxed/simple; bh=+CJXx3koQLYN1B1om5/4IRE7tuuotyHp4wQJJOV4Vyk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Jmc+pmDt9wTBjduBAGVI+40te2lMojLzTx1QshrTTU9qLR1fiW5leayQNOCkFVm3V/stHqTBsif/ZztxV4JB5XpOo+feDq5Zc4kTpbiOh6nUp0VPKoyhvGUaeNwzk5l2f1seBo54PenDSivPcKvnurNoc9A56xzXUcFjZPEv+JE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=RE4gRyoP; arc=none smtp.client-ip=209.85.214.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-1e3ca546d40so4416355ad.3; Sat, 04 May 2024 06:37:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714829874; x=1715434674; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:sender:from:to:cc:subject:date:message-id:reply-to; bh=Q4EGKr6FjTAXUcLBcVBwQzJVvnJMccoMO665tE3tYfk=; b=RE4gRyoPM+vc418Qme2SDkwP4l09xPeJ+GkGZSevFmmLRDByhIViApofW7UGvPj8/r 3RBxmZreXZNX+eX8oi17QpcDBJGUwXQJhZT0dcKwv7GfZMXrbJU7QCnPwivF6jt9zh+Q 7Xwqy6LMB89c4jM60OeouxE+Ej7xHEPUGzfVlpnrf4AM12KZyEH7X3aod1lHq9U/tv4R HwjDNLnI0Ho8jleWFXgYkUHSP0fPP5XVFtfKcEs2/CUaXnb+KDlm76UG6OLzzu4PlJrU zL/RpMhAgnHuW8xnmmcw9OR5pDNS4RFBvJLI+Rol4py0vmo7cfrAu8rfVpEG49kJEapL wYjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714829874; x=1715434674; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Q4EGKr6FjTAXUcLBcVBwQzJVvnJMccoMO665tE3tYfk=; b=J0sNX55+ZvYCwGb4i3z8pzh+4bDRWgTQPgxuJPwp0KswbLbmRBVnCwUwLrp6cOO+cF 3r0SdxzswrjxRVn4txf3Vcb5t9t7noY1/Q+QC0hgq94tMNJM0f1TvsRjKm3zRq8khAyy v6vU+5MRuRguYnV5cZsXMusl8l/YW/cmOqBY+3QWp8Qm4zZ943dsC7NrPx3Pesq1PUkx N5Q7l3S2u+bAJvq3lIe5VrW/QugMucCb/VSSl8qY+phm7iTM3DzEdNjkGKcNjYpjc55y yQRFTgXoZrCMZsf/Uo15mJVkLjd99CZuT3vayWlMrNAxKwg3nNBKe2SvzAJsCJspylfu rnAQ== X-Forwarded-Encrypted: i=1; AJvYcCULlN9qMLTtM2xm9gNermFDpLejoHtPoo97GkB66By3NjQ75piX9oH6jxKt8FzPDHuOwRy4Brkk/esv+cpA0woR8D0Gbw7SBrjcPYsSoZk61DyNZhiLetgTXH4m3mWrsm9Rt53AfdIPc/8= X-Gm-Message-State: AOJu0Yzftu+rsSwt4KaE8PvWUYxYuQfEfIVAJRylfSgZrzPKyf3nt/d2 KQx/7XR7zU/aC5fIvLmG8eofgle01vdppnLzXpcUXoTrsHueBms2 X-Received: by 2002:a17:902:f682:b0:1e4:3c7f:c060 with SMTP id l2-20020a170902f68200b001e43c7fc060mr6182311plg.66.1714829874263; Sat, 04 May 2024 06:37:54 -0700 (PDT) Received: from ?IPV6:2600:1700:e321:62f0:329c:23ff:fee3:9d7c? ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id e14-20020a17090301ce00b001ec80dbb8b1sm5009265plh.73.2024.05.04.06.37.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 04 May 2024 06:37:53 -0700 (PDT) Sender: Guenter Roeck Message-ID: Date: Sat, 4 May 2024 06:37:52 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 0/3] hwmon: (corsair-cpro) Fix issues when hidraw is used To: Aleksa Savic , linux-hwmon@vger.kernel.org Cc: Jonas Malaco , Marius Zachmann , Jean Delvare , linux-kernel@vger.kernel.org References: <20240504092504.24158-1-savicaleksa83@gmail.com> Content-Language: en-US From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4FGxH10/H1O1+ApmcQ9i87XdZQiB9cpN RYHA7RCEK2dh6dDccykQk3bC90xXMPg+O3R+C/SkwcnUak1UZaeK/SwQbq/t0tkMzYDRxfJ7 nyFiKxUehbNF3r9qlJgPqONwX5vJy4/GvDHdddSCxV41P/ejsZ8PykxyJs98UWhF54tGRWFl 7i1xvaDB9lN5WTLRKSO7wICuLiSz5WZHXMkyF4d+/O5ll7yz/o/JxK5vO/sduYDIlFTvBZDh gzaEtNf5tQjsjG4io8E0Yq0ViobLkS2RTNZT8ICq/Jmvl0SpbHRvYwa2DhNsK0YjHFQBB0FX IdhdUEzNefcNcYvqigJpdICoP2e4yJSyflHFO4dr0OrdnGLe1Zi/8Xo/2+M1dSSEt196rXaC kwu2KgIgmkRBb3cp2vIBBIIowU8W3qC1+w+RdMUrZxKGWJ3juwcgveJlzMpMZNyM1jobSXZ0 VHGMNJ3MwXlrEFPXaYJgibcg6brM6wGfX/LBvc/haWw4yO24lT5eitm4UBdIy9pKkKmHHh7s jfZJkB5fWKVdoCv/omy6UyH6ykLOPFugl+hVL2Prf8xrXuZe1CMS7ID9Lc8FaL1ROIN/W8Vk BIsJMaWOhks//7d92Uf3EArDlDShwR2+D+AMon8NULuLBHiEUQARAQABzTJHdWVudGVyIFJv ZWNrIChMaW51eCBhY2NvdW50KSA8bGludXhAcm9lY2stdXMubmV0Ps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dAhajZnHHjA7FrJXsy3cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= In-Reply-To: <20240504092504.24158-1-savicaleksa83@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 5/4/24 02:25, Aleksa Savic wrote: > This patch series fixes the behavior of the corsair-cpro driver while > hidraw is used from userspace. > > The first patch introduces a separate buffer for sending commands to > the device to prevent it from being overwritten thanks to a hidraw > userspace call. > > The second patch replaces the complete() call in the raw event parsing > function with complete_all() to signify that the completion is done > until reinit. > > The third patch introduces locking for the ccp->wait_input_report > completion as it's touched in functions that could be executing in > parallel. > > Aleksa Savic (3): > hwmon: (corsair-cpro) Use a separate buffer for sending commands > hwmon: (corsair-cpro) Use complete_all() instead of complete() in > ccp_raw_event() > hwmon: (corsair-cpro) Protect ccp->wait_input_report with a spinlock > > drivers/hwmon/corsair-cpro.c | 45 +++++++++++++++++++++++++----------- > 1 file changed, 32 insertions(+), 13 deletions(-) > Series applied. Thanks, Guenter