Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp551652rwr; Thu, 4 May 2023 06:51:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5zBRtyWOcuzKzm3xecPxMPdHp06TT4q8U8SpJm0VX0rXHRhp1kj2MEDDd4M2NA8m4Z/vGS X-Received: by 2002:a05:6a20:d90b:b0:f3:3ea5:517b with SMTP id jd11-20020a056a20d90b00b000f33ea5517bmr2036634pzb.44.1683208273899; Thu, 04 May 2023 06:51:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683208273; cv=none; d=google.com; s=arc-20160816; b=h/9VtkpAO5WL84GyTMvbbaEzhu5MuFb8FXsklbhUeRlF74QclQh48rSEp/+/+ORFP6 R2Ai0azJwsS6QDgQX7UZres2JhDRZgD2RdCGN6xjJvwJISyiIepCAcm9VodBpYNybY8h kXVu2pqTJ/sQkfqvKGn+a2fCzsW4DDqDg5eyaPcIFLKRebOdHiHJsH0fGRW5hw2ZAf3i X37Iiw7H5QQlroRFG1AXbYHpvIzo8D3Jg5XMXMIRzxW9/f131j8z+2ct743Mhz5aXOSO F/a9hsqL9EO1A57frBxHSMoj31mmZY36CwhIo+i5l8hKbhHjaPxPIiH13Jgsw4GbcZ39 PLJg== 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=4WTzAI4qKOmBrA27xbgsCbo1hT20FZ27qp5n95zrtEg=; b=pULd5nZPua5sv4oeAp9x0V/kpRIiANeoFFd5yZef5eVFhgWDq+j0K/90/1NVVO/blW XKTzSSBVKZoaJKWjAEzQ6wG0r62sU/g2UVDq1NtVAkP32M/kQ5BZvlT+VXh43iw1+CXI cWh/iRswTveeEuXKxrMAOGEjeEGvLwctuspVH+GJxY50q7xqh6ZBckonwt6RvJY8ciPh gvi3ssICD7Xx566tosjVNbPWKTXCYF619isd7nJPUwyFOw673We5BVokk/F9amKmFiOZ sWO+phNAhum+CxW7rCQUMP6Oz1yU7LBNXlWdb2McjBTVvzMC4pjjeTFqd5jyWytDIEC+ Wjfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=O315kDjL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x12-20020a63484c000000b00519a3fb282esi34963236pgk.864.2023.05.04.06.51.00; Thu, 04 May 2023 06:51:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=O315kDjL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230508AbjEDNou (ORCPT + 99 others); Thu, 4 May 2023 09:44:50 -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> X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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