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 X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85FD0C433B4 for ; Thu, 6 May 2021 14:16:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 650D261029 for ; Thu, 6 May 2021 14:16:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234357AbhEFORh (ORCPT ); Thu, 6 May 2021 10:17:37 -0400 Received: from mga03.intel.com ([134.134.136.65]:18867 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233737AbhEFORh (ORCPT ); Thu, 6 May 2021 10:17:37 -0400 IronPort-SDR: tIHcckKhxi6xhy9SAJOFrYCDzq3gSQH0lZwMyq2m0VYI4z1DmFl8pVLxxuM+swc2DFvC8r9/ey GOqKQOdVEgOQ== X-IronPort-AV: E=McAfee;i="6200,9189,9976"; a="198536516" X-IronPort-AV: E=Sophos;i="5.82,277,1613462400"; d="scan'208";a="198536516" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2021 07:16:38 -0700 IronPort-SDR: C08k1Vj8W6Wbrnez5hI9zY1XwHuNPXAyiYQN/YyvAha3A4DEInpjcmB7QJbyOHsK2ev02YCGZT WhprMdX40PUg== X-IronPort-AV: E=Sophos;i="5.82,277,1613462400"; d="scan'208";a="407025263" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2021 07:16:36 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1leeno-00A4IM-P7; Thu, 06 May 2021 17:16:32 +0300 Date: Thu, 6 May 2021 17:16:32 +0300 From: Andy Shevchenko To: Linus Walleij Cc: bier@b-x3vxmd6m-2058.local, Mark Brown , Sven Van Asbroeck , linux-spi Subject: Re: [PATCH v1] spi: fix client driver can't register success when use GPIO as CS Message-ID: References: <424d37007b7e298cf9bca5ac38d45a723e0976ee.1620301297.git.xhao@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org On Thu, May 06, 2021 at 02:30:01PM +0200, Linus Walleij wrote: > On Thu, May 6, 2021 at 1:45 PM Xin Hao wrote: > > From: Xin Hao > > > > When i was testing the TPM2 device, I found that the driver > > always failed to register which used SPI bus and GPIO as CS > > signal, i found that the reason for the error was that CS could > > not be set correctly, so there fixed it. > > > > Fixes: 766c6b63aa044e ("spi: fix client driver breakages when using > > GPIO descriptors") > > Signed-off-by: Xin Hao > > (...) > > /* polarity handled by gpiolib */ > > gpiod_set_value_cansleep(spi->cs_gpiod, > > - enable1); > > + !enable); > > We have been over this code a lot of times, can you > help us to investigate the root cause here and check > how the interrupts are provided on this platform. > > TPM2 makes me think that this is an Intel platform > and maybe ACPI of some kind so you need to run > it by Andy, who is working on some related fixes. The above is exactly what my quirk [1] for ACPI does in case the controller gets GPIOs from the ACPI. [1]: https://gitlab.com/andy-shev/next/-/commit/5ccbdbb4787d871722f361d77c5f3cb806811c48 -- With Best Regards, Andy Shevchenko