From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 232D1C77B78 for ; Thu, 4 May 2023 13:44:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230457AbjEDNot (ORCPT ); Thu, 4 May 2023 09:44:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230500AbjEDNot (ORCPT ); Thu, 4 May 2023 09:44:49 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E5467D93; Thu, 4 May 2023 06:44:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A6967633EA; Thu, 4 May 2023 13:44:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 116E2C433EF; Thu, 4 May 2023 13:44:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683207886; bh=cxXZ0Mv9fZe8AzkErEvTVxOOrlIoataPJcnAJ93nNR4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=O315kDjLiPUAsQ6xGpos4WTKEs50qI7zNpaj3f5JBpT11niVq2Dd4d0nT4K+WWtC6 bihPy/onuSp3833LpgoGH3e1AeRuCL3oBwHcyGEzQ/5zvencqvm51XpP7wCIulpwsG T/rIndpoISt6pzekCOJk/PuT/VFxrsK0UMfKL+OFYDqQif6XoSP7jPd7ekerDuLNw6 WoXACFIqNAA2xC9mPvNVqYkqvayWczEmfyy0OJFQwZoAObGqcUWWAtZS3jiyBaWsAp Ywse2+V3+hjXG/wFqwGAs4foDgViBq2TSYTgsj4CsDelqYDKwNMBRYhlGNsDcGOJJp CVgaKL/iiCKjw== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1puZGP-00078W-RV; Thu, 04 May 2023 15:44:54 +0200 Date: Thu, 4 May 2023 15:44:53 +0200 From: Johan Hovold To: Bjorn Andersson Cc: Vinod Koul , Kishon Vijay Abraham I , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/7] phy: qcom-qmp-combo: Introduce orientation variable Message-ID: References: <20230425034010.3789376-1-quic_bjorande@quicinc.com> <20230425034010.3789376-4-quic_bjorande@quicinc.com> <20230504032907.GF870858@hu-bjorande-lv.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230504032907.GF870858@hu-bjorande-lv.qualcomm.com> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Wed, May 03, 2023 at 08:29:07PM -0700, Bjorn Andersson wrote: > On Tue, May 02, 2023 at 01:48:16PM +0200, Johan Hovold wrote: > > On Mon, Apr 24, 2023 at 08:40:06PM -0700, Bjorn Andersson wrote: > > > static void qmp_v3_dp_aux_init(struct qmp_combo *qmp); > > > @@ -1955,29 +1962,23 @@ static void qmp_v3_configure_dp_tx(struct qmp_combo *qmp) > > > static bool qmp_combo_configure_dp_mode(struct qmp_combo *qmp) > > > { > > > u32 val; > > > - bool reverse = false; > > > + bool reverse = qmp->orientation == TYPEC_ORIENTATION_REVERSE; > > It also looks like these callbacks end up being called without holding > > the qmp->phy_mutex via phy->power_on(). Perhaps there is no risk for a > > concurrent switch notification and dp phy power-on but it's not that > > obvious. > It seems we're arriving here from hpd_event_thread(), while > phy_power_on() and phy_power_off() will be called in some other context. > I've not been able to convince myself if DP driver ensures ordering, or > if we have an existing race here... > Unless you insist, I would prefer to follow up with an additional patch > once we've landed this series. The fix will depend on the phy_mutex > shuffling patch anyways... Sure. But perhaps you can just move the orientation == qmp->orientation check under the mutex in qmp_combo_typec_switch_set() for now (in case I forgot to point that out earlier). Johan