Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1677165rwd; Mon, 15 May 2023 01:08:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ65UOxgqgP6XPqT9GeFy3Y/uD5iR2lx+MSF87bsNFxTQn9lq74Te//1mvYx6A5n3g6uRrEw X-Received: by 2002:a05:6a21:6d84:b0:103:fcd7:544d with SMTP id wl4-20020a056a216d8400b00103fcd7544dmr17894047pzb.47.1684138132402; Mon, 15 May 2023 01:08:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684138132; cv=none; d=google.com; s=arc-20160816; b=hhs+PilGY++bCm07LAw6ETpmqLCOij/UrsdLpoA7RjwliPywPuWsDU4kh7koiY1DQ6 WH4WdaJizBZTHwsJXYk5SIOoXCBLkQhK/FgitGdbS3CQZH0XKmQ92RVN7zgjBJCRKpso CSeIYX6jyMq2WcB1P8LNCJPz3LKx4vzZIv1Xo8NRS5tysPAlQT4r9uI+vWndiqgbK8+G UWKPi3UdpdNpCWUx3KoSQXv4hBiqbWUabaVMfh6HQlHVf1gUK7hGtVMFgwUUMHr5bqcA Z4VHyWi7J0m8et7uAnIJeLlVeFFam/JMBSCiMQX/r9I9LJe/489/cMXc467cvQe5zRzo +ByA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=HGvoX7lczyV78ixl9xNBvUm2ilfATdKRkppWa5RZ2Eg=; b=gYEZK8EodWQV+Lg8upuGWjDcqZHaWEvo1gaAh7J63YjvN93RHlfcAUsaO9I8oypPgl vL2MvQ6Cv5PAP5HDlsCB7Pwdlz11FGZJia/2AXgmZTVR0X/5H+y17oT7uJTMN29S1Stt VZyJnK6zjEBDJ1gDL4hhDzQsaN4RcenC5PFUf0S0YZ6Qw8NVeh15IR+zB++Kez2wENAm zj7xZ06SCb3cLqTTud03BrRGOH3E3pTP9ny8pyER4OswYe1DiBpA9gt1F/7riaA14t1l K+nUthJtavO4OXLH3CBfq6/wKPF6aGX3D2Ms+5UEOQmkTmu3DZ0mGo4DXve+9JV3iNdU 2n4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=iK0dDyeE; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l197-20020a633ece000000b0051b9938a68esi15496384pga.128.2023.05.15.01.08.40; Mon, 15 May 2023 01:08:52 -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=@intel.com header.s=Intel header.b=iK0dDyeE; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239746AbjEOHwo (ORCPT + 99 others); Mon, 15 May 2023 03:52:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229898AbjEOHwd (ORCPT ); Mon, 15 May 2023 03:52:33 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C279E76 for ; Mon, 15 May 2023 00:52:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684137152; x=1715673152; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=SiCBDBnlz88gKGLR73uUCWFOWyCRfe4txr9qACADick=; b=iK0dDyeE7/IsaBANPNL5Zz0glSoC4QwiCchAdzi2I1CwNAd+y6NztTp5 iZfg9Uo96DcAKGCKxztCKWfyEHmO4C7eiiZg1RWZbQiDpX4He/TapP7cy Q6vHmMD2go5mDmb3EDiwsQgFqF/LSIPfjHrjHouFu2ORpIavANdm0SJoX AcIt435T+ADTS2wip/aL6AJtQjUPDKUXuY1FCLC6fzg2cSQ84OSwyFPeE PtC5rdJgYzGKaPnBCyUUGLtq5Jyo+30v3kT1eItWme8cSjOAHfmAALnwc YsO71ZBjExrWKn3269GqpxMq/b11dDWb4C8IwsHN3Q2T4idlY19plR6vJ Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10710"; a="335676055" X-IronPort-AV: E=Sophos;i="5.99,276,1677571200"; d="scan'208";a="335676055" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 May 2023 00:52:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10710"; a="731550650" X-IronPort-AV: E=Sophos;i="5.99,276,1677571200"; d="scan'208";a="731550650" Received: from bard-ubuntu.sh.intel.com ([10.239.185.57]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 May 2023 00:52:30 -0700 From: Bard Liao To: alsa-devel@alsa-project.org, vkoul@kernel.org Cc: vinod.koul@linaro.org, linux-kernel@vger.kernel.org, pierre-louis.bossart@linux.intel.com, bard.liao@intel.com Subject: [PATCH] soundwire: intel: read AC timing control register before updating it Date: Mon, 15 May 2023 16:13:01 +0800 Message-Id: <20230515081301.12921-1-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE, 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 From: Chao Song Start from ACE1.x, DOAISE is added to AC timing control register bit 5, it combines with DOAIS to get effective timing, and has the default value 1. The current code fills DOAIS, DACTQE and DODS bits to a variable initialized to zero, and updates the variable to AC timing control register. With this operation, We change DOAISE to 0, and force a much more aggressive timing. The timing is even unable to form a working waveform on SDA pin on Meteorlake. This patch uses read-modify-write operation for the AC timing control register access, thus makes sure those bits not supposed and intended to change are not touched. Signed-off-by: Chao Song Reviewed-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao --- drivers/soundwire/intel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c index 238acf5c97a9..8cd2c73ac66f 100644 --- a/drivers/soundwire/intel.c +++ b/drivers/soundwire/intel.c @@ -260,7 +260,7 @@ static void intel_shim_init(struct sdw_intel *sdw) { void __iomem *shim = sdw->link_res->shim; unsigned int link_id = sdw->instance; - u16 ioctl = 0, act = 0; + u16 ioctl = 0, act; /* Initialize Shim */ ioctl |= SDW_SHIM_IOCTL_BKE; @@ -281,6 +281,7 @@ static void intel_shim_init(struct sdw_intel *sdw) intel_shim_glue_to_master_ip(sdw); + act = intel_readw(shim, SDW_SHIM_CTMCTL(link_id)); u16p_replace_bits(&act, 0x1, SDW_SHIM_CTMCTL_DOAIS); act |= SDW_SHIM_CTMCTL_DACTQE; act |= SDW_SHIM_CTMCTL_DODS; -- 2.25.1