From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from cae.in-ulm.de (cae.in-ulm.de [217.10.14.231]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 09B36125C0; Wed, 17 Jan 2024 07:45:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.10.14.231 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705477537; cv=none; b=B0svbNU3az1Ib/USr45Czd4ld+no8iAROie7BpCU7UX1WhAqiHa7a+ai4qe4qOVBAmhnwOtTbqTL+r48AqAyhPxXlV9CjavsGH9QW/iu5UM4Pb9jZZjbfQy6tQ+Y8J0eJqMLA1y3UUywkSTEdqF9SwZQ2BMsEgdsDr9iwh4BcJc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705477537; c=relaxed/simple; bh=XTlJMeq1LcRVPc4P3E1fOfdg//1N2HH8XnYT7USTq14=; h=Received:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; b=O4/8dr3JjrfZKeMiKepOHGp+1e2V4n4IV8fUVRwU6ZG5Y6wM9dRCzsZKbJq/1F+prZJxk3wW8peay2PVZbUlqUMB7tRqzwQFdYrHyIeEBUaQZ73fsw7gL7V9JexlNDFYEu+pk1S1uX1nDiU9SMlicR1WWf0ODzl1+iKW8sPHR2k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=c--e.de; spf=pass smtp.mailfrom=c--e.de; arc=none smtp.client-ip=217.10.14.231 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=c--e.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=c--e.de Received: by cae.in-ulm.de (Postfix, from userid 1000) id 4EE1D140327; Wed, 17 Jan 2024 08:45:32 +0100 (CET) Date: Wed, 17 Jan 2024 08:45:32 +0100 From: "Christian A. Ehrhardt" To: Greg Kroah-Hartman Cc: Heikki Krogerus , linux-usb@vger.kernel.org, Dell.Client.Kernel@dell.com, Neil Armstrong , Hans de Goede , Jack Pham , Fabrice Gasnier , Samuel =?utf-8?B?xIxhdm9q?= , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] usb: ucsi: Add missing ppm_lock Message-ID: References: <20240116224041.220740-1-lk@c--e.de> <20240116224041.220740-2-lk@c--e.de> <2024011726-exhaust-writing-29d4@gregkh> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2024011726-exhaust-writing-29d4@gregkh> On Wed, Jan 17, 2024 at 06:44:40AM +0100, Greg Kroah-Hartman wrote: > On Tue, Jan 16, 2024 at 11:40:39PM +0100, Christian A. Ehrhardt wrote: > > Calling ->sync_write must be done while holding the PPM lock as the > > mailbox logic does not support concurrent commands. > > > > Thus protect the only call to ucsi_acknowledge_connector_change > > with the PPM lock as it calls ->sync_write. All other calls to > > ->sync_write already happen under the PPM lock. > > > > Signed-off-by: Christian A. Ehrhardt > > --- > > NOTE: This is not a theoretical issue. I've seen problems resulting > > from the missing lock on real hardware. > > What commit id does this fix? It's hard to tell (due to rewrites, logic and API changes). After digging a bit more I think it is at least a theoretical issues since the introduction of partner tasks. I'll wait a bit for additional feedback and fix this and other issues noticed by your patch bot (sorry for those) in the next iteration. > Should it be cc: stable? Not sure. The race is triggered much more ofter after the quirk added in patch 3/3, so this may not be a practical issue before that. I'll add the tag in the next iteration, though. thanks Christian