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 981F2C3A59E for ; Mon, 7 Feb 2022 12:03:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1391586AbiBGMCX (ORCPT ); Mon, 7 Feb 2022 07:02:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1388275AbiBGLnV (ORCPT ); Mon, 7 Feb 2022 06:43:21 -0500 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D52E8C043181 for ; Mon, 7 Feb 2022 03:43:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644234200; x=1675770200; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=w6w2ccADFu4cgHqYIRIYRuBh3hLMbxfmsazq1+C6hWg=; b=JX14QN5VjuHXYw9U3PEm5T7eJ8eEXg6Ul7wY1wFcOl7IlUvE+eZt03KZ kDSZq2JTsFsTng/oqK5RnC+0Ysql+xqGuyim+KFkHKN/gdltUXA8NiDJw E81Ytshbk3mU+moYbSLfE7juyeYaatY5nQF3VtlHXGDbKD/yhWgvSnOWB Bs+qE57bTwxgKE67R0HD9JT/tyaAwO890hmI9rI0/3Xe9YlDEy9Y14nll Kwylp2VnwdhWEu6LJbZXQI8P1uDq2xaR64CsMihfFJTajOL4Q8sdC2eFd Q2JppkRJSt/7cpWiBYCz4nc+UXvJiPMFNzYKaabNtjYgKWVQ9sAlG46v1 g==; X-IronPort-AV: E=McAfee;i="6200,9189,10250"; a="246287263" X-IronPort-AV: E=Sophos;i="5.88,349,1635231600"; d="scan'208";a="246287263" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Feb 2022 03:42:15 -0800 X-IronPort-AV: E=Sophos;i="5.88,349,1635231600"; d="scan'208";a="700436349" Received: from smile.fi.intel.com ([10.237.72.61]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Feb 2022 03:42:12 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1nH2OO-001ss2-Lg; Mon, 07 Feb 2022 13:41:12 +0200 Date: Mon, 7 Feb 2022 13:41:12 +0200 From: Andy Shevchenko To: Jan =?utf-8?B?RMSFYnJvxZs=?= Cc: Linux Kernel Mailing List , linux-i2c , Jarkko Nikula , Mika Westerberg , Hans de Goede , Wolfram Sang , Raul E Rangel , Marcin Wojtas , Grzegorz Jaszczyk , upstream@semihalf.com, Tom Lendacky , "Deucher, Alexander" , "Easow, Nimesh" , "Limonciello, Mario" Subject: Re: [PATCH v3 2/2] i2c: designware: Add AMD PSP I2C bus support Message-ID: References: <20220120001621.705352-2-jsd@semihalf.com> <20220202144302.1438303-1-jsd@semihalf.com> <20220202144302.1438303-2-jsd@semihalf.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 07, 2022 at 09:27:12AM +0100, Jan Dąbroś wrote: > śr., 2 lut 2022 o 17:16 Andy Shevchenko > napisał(a): > > On Wed, Feb 02, 2022 at 03:43:02PM +0100, Jan Dabros wrote: ... > > > +struct psp_i2c_req { > > > + struct psp_req_buffer_hdr hdr; > > > + enum psp_i2c_req_type type; > > > +} __aligned(32); > > > > I forgot if this alignment is requirement due to DMA or so? > > We may use ____cacheline_aligned in such case. > > I used some old code as a reference - this structure is mapped by PSP, > thus alignment applied here. I'm checking this with AMD whether it is > really needed or at least can be somehow limited - still waiting for > their response. > I propose to left this as is right now and eventually remove or make > more liberal in the future. Would be nice to clarify sooner than later. In either case it needs a good comment. ... > > > + return readl_poll_timeout(&mbox->cmd_fields, tmp, (tmp == expected), > > > + 0, 1000 * PSP_CMD_TIMEOUT_MS); > > > > 0?! > > Yes, we are checking for readiness of PSP mailbox in a tight loop. We > would like to proceed further quickly as soon as this bit is set. > Actually checking this twice per every ACQUIRE&RELEASE - once before > sending command (to check whether PSP is ready to accept requests) and > second time after sending it. Do you think we should increase > @sleep_us value? It depends on what you have in mind about hardware. I'm fine with either way, but 0 has to be explained (in the comment). -- With Best Regards, Andy Shevchenko