Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp931985lqb; Wed, 29 May 2024 15:25:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXfXvX8KufpNW0whsk6WckeB+0fkBtg/sXyXnkqj6K1vu/N1KavZ8BKpijEDyEDM4sMmaQZgfU/hkSLnHe4GR8pKZggPbU5+FnzKAH4xg== X-Google-Smtp-Source: AGHT+IEMhdDhHYJ/USbhB5rL32tQUJgPK6zWPEQQkht8qI9SOsH7vFe8NMxvV+92uLgpv/F8/TEA X-Received: by 2002:a05:620a:3948:b0:790:ef5d:25ae with SMTP id af79cd13be357-794e9e1ed0bmr78266585a.56.1717021545454; Wed, 29 May 2024 15:25:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717021545; cv=pass; d=google.com; s=arc-20160816; b=obdFJ9JXWZ5d8oqEiSlsPktZICPadSfpzm1jG78e5hGFA62keqAfsl9lHlM03RfR7X SkS5Ve9t7jtnhRsAJWxPoe1UX4YuUdAKbk2jhS96uAhENtRuO9cdlgNgYRuDnzO00KOB SuGXxhbtoZPIT/0eCMBKnUIssn4q5p2u5YD+2D5wNAwZQZsmfzCZ5/PEeHvGeu0N1x13 mphaOJu+mNzlTgK7V6pYMUAZyO5bf/5oHB+6v0vJsNJaRkivrAGE//1qzuC8cW0SaGbr IcB8ce4jjcSxFcMV/ll5IPL4bCn0Ojd3paA56szpacwx4vRTpzCrSc2g40A7CIutHwK/ 5Nnw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:references:in-reply-to:date:cc :to:from:subject:message-id:dkim-signature; bh=uIEZomHMRB3wbuZeDiOa8bBVRyZ8yJDphhzWZrNxHSI=; fh=XND7ghp5ZU7qhhqPOD4VFxJ+Wnnx8stXzAusVShCdGk=; b=Q3lzUSxrLLXr3d8MT21CZ35vAhE7NOu3DuIpt0W/KWApY/p25Duhpig5OBtvzEHhKY hKwur1QxBySDfYMkeoWgete6DK0RyNjLDeHN6ujYfWLLcRAkc1LBDXMq7kX/42ukyVda 6l2L4TPwc1hMYlHupfocWJtRgM0wCG6XafWKOJ41WMcTFXxSzoA8G3/zg1SO0uIC1q1j 94GJs3gH3ICB8qSDqHx8sJgwEkbUia6To6zRK4KPYL6jFvesNJCRhfMO49a0m6mTUMo6 qY7ApSB2W61L+7LsFVbF+7Wq32RXD3TNoJsxKmdMw/AEBFZ5ZNRl3KT0uSKiqnn8J27u fuxg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=S9i5bAzb; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-194747-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194747-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6ac162b54d3si138626576d6.498.2024.05.29.15.25.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 15:25:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-194747-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=@intel.com header.s=Intel header.b=S9i5bAzb; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-194747-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194747-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 33A421C21B64 for ; Wed, 29 May 2024 22:25:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2804416F0C3; Wed, 29 May 2024 22:25:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="S9i5bAzb" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 84CD315B0E6; Wed, 29 May 2024 22:25:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.20 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717021531; cv=none; b=MuSh1G+sQtP0rF6ezAxl3zSBIHGils4nAdjAskUUJ3TmmruEMg29baWA2M4cTxvAY5qRjAkQcgqNQeKYk2bsqE020J2bmAWmKP9irDfvKi8SqtW4y4NBbJR6NaZMLzOiExjRHo8755r6bWLUl61wXIVq9k/oZ7ovhJVJz4bSNkM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717021531; c=relaxed/simple; bh=AGtL+i/Wng6uW6DDsXTEUWcLV+lXmoKtPV0wTUjC1Jc=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=mFABYtawrBMHXwK2zto4HYYM1wMDxBaVwhPWw1uMvvo0Zr6x1xbJxIPHDDGXkui1bN/ckzfEnqtxNn6niGUTMJBpKkfeK3vEnaS/y97WDCWSFfX/mOr9kMUEhVIWE5OI8BXXZm8r2AVgXfADaUz5YRFWKYW3e6viN6E9kKFdTy4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=S9i5bAzb; arc=none smtp.client-ip=198.175.65.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717021531; x=1748557531; h=message-id:subject:from:to:cc:date:in-reply-to: references:content-transfer-encoding:mime-version; bh=AGtL+i/Wng6uW6DDsXTEUWcLV+lXmoKtPV0wTUjC1Jc=; b=S9i5bAzblpFxHs++p3i2PruTlE83Y+Y+1X30VjZ1H8ws5IspGJ3VnRxq cNwBrX1uyMMLAC/RN7/UkJrymZ6CTNR7l5mHisqYC+qs1gP8yG88NLja6 skv8Yum9uJJbET+lXLQnR/C1yzv5s+Y2Ga8S7Lvdl4lP77TkU3VCdgkXN oJHL508UsMDLR3IoyfRzOapvbUneEZd5+/o0bHyhvWSZcL8xZiMCo8f02 UIK5orNq7nih+x14Yjjm1w51cqKIP/H/ogScBxxhxSrFICu7IjG+diZLt oPXOUlh8h5dzqFGK01jYW5vWL3JfYSxd0l8l3S3WQJRGs9rpDjJcpQRvU A==; X-CSE-ConnectionGUID: D97Dv2OrQRST+LS4s0mzFg== X-CSE-MsgGUID: UYjPMf0FTImecJLbqon1zA== X-IronPort-AV: E=McAfee;i="6600,9927,11087"; a="13307928" X-IronPort-AV: E=Sophos;i="6.08,199,1712646000"; d="scan'208";a="13307928" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 May 2024 15:25:30 -0700 X-CSE-ConnectionGUID: mcormglJS+SLcUoYVa8V+Q== X-CSE-MsgGUID: D6/CoNRWRk61H6Vt4pzFYw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,199,1712646000"; d="scan'208";a="36135896" Received: from mpiske-mobl2.gar.corp.intel.com ([10.213.75.20]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 May 2024 15:25:26 -0700 Message-ID: Subject: Re: [PATCH 1/2] HID: intel-ish-hid: fix cache management mistake From: srinivas pandruvada To: Arnd Bergmann , Lixu Zhang , Arnd Bergmann , Jiri Kosina , Benjamin Tissoires Cc: "linux-input@vger.kernel.org" , "linux-kernel@vger.kernel.org" Date: Wed, 29 May 2024 15:25:22 -0700 In-Reply-To: References: <20240528115802.3122955-1-arnd@kernel.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.0-1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Wed, 2024-05-29 at 09:06 +0200, Arnd Bergmann wrote: > On Wed, May 29, 2024, at 08:46, Zhang, Lixu wrote: > > >=20 > > > -#include > > > #include > > > #include > > > #include > > > @@ -175,10 +174,11 @@ static int prepare_dma_bufs(struct > > > ishtp_device > > > *dev, > > > return -ENOMEM; > > >=20 > > > fragment->fragment_tbl[i].ddr_adrs =3D > > > cpu_to_le64(dma_addr); > > > + > > > + memcpy(dma_bufs[i], ish_fw->data + offset, > > > fragment- > > > > fragment_tbl[i].length); > > fragment->fragment_tbl[i].length was used before assignment. > >=20 > > > + dma_wmb(); > > I tested it on the platform, but it didn't wok. > >=20 >=20 > What behavior do you see instead? If the manual cache > flush works around a bug, that would indicate that the > device itself is not coherent and the dma_alloc_coherent() > in the architecture is broken. Lixu, What happens if you remove manual cache flush in your code? It is possible that boot loader at this time not ready to do fully coherent ops. Thanks, Srinivas >=20 > =C2=A0=C2=A0=C2=A0=C2=A0 Arnd