Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp387727ima; Wed, 24 Oct 2018 03:03:15 -0700 (PDT) X-Google-Smtp-Source: AJdET5cMsGplVOwfU5bsT07ZIeOUHOMkhWu2b/iU+5T2M15EuhbZnygzZRaPg5MQ6CCCqP25oRCH X-Received: by 2002:a65:5c81:: with SMTP id a1-v6mr1907142pgt.390.1540375395214; Wed, 24 Oct 2018 03:03:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540375395; cv=none; d=google.com; s=arc-20160816; b=yp7Wg0q7ejO41hFb2vFY5Pwkso4RfSB87o94h3IuSVTjuGI4tjbIJRVIwkZIYua60X uidu+SHc674nz7rYiPxqFjNHuqyOMYP9R/XQTJZiX7OrHXm+4t68GoxeXHFPbXpfLwrS tAKzl9zbdmCo3QrQqd66UW01qDhQ1j8ViS8TH9DFj4rRImUOvPVIk2oN9jlaowo+/Bdv z/2amqKG8KSqZCBGVLTv55klb9+eDK/vVPBgPe8mqdzoa4CdCXbYFW+LcIO6iMhNPbV8 dzeFVWILg8b9qQEqHwiiDbPehBWvj5WCw2Acd82XQRXpHCsw0syFF8HnWJPFh+xTj3XT VdvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=WrSKRkczzRxw6PJw/mSnaweUkfNp7yvuyGBRcbktQWU=; b=pv4YnGRJUofyaSmDnUCanbQeHauu8XA9fbJ9w0gGGnt+yVc0Nus1IBFBKXRUTXWQKm cQmkPGbM5xtsro3HLxc8mraXW+RFIKV2UT7ANiLUTV3+5TmvJHr47zoHBuhTliEgrmpR y5O9iyz/+NABwHjOVykHzxGcnez+adyqMApmSkcpUuerDMj5k6KSjr6/gOJthZ8a9Pep KBybUtGKo2R7IWKAUk316kqLLyC3lDiTcgp43shv7qGEwtajqf4dH8AXgWXxR+9ZJKnF f2lRhKWrCpLwtLJd/6aCjXKXAA4uQkPxjizTK9tFbVhxCn505p+R7BoYeB+8HFC3QHqP 3FzQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j12-v6si4315623pfd.222.2018.10.24.03.02.58; Wed, 24 Oct 2018 03:03:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727061AbeJXSaC (ORCPT + 99 others); Wed, 24 Oct 2018 14:30:02 -0400 Received: from mga04.intel.com ([192.55.52.120]:19670 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726301AbeJXSaC (ORCPT ); Wed, 24 Oct 2018 14:30:02 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Oct 2018 03:02:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,420,1534834800"; d="scan'208";a="243918192" Received: from smile.fi.intel.com (HELO smile) ([10.237.72.86]) by orsmga004.jf.intel.com with ESMTP; 24 Oct 2018 03:02:31 -0700 Received: from andy by smile with local (Exim 4.91) (envelope-from ) id 1gFFzi-0003Zb-F8; Wed, 24 Oct 2018 13:02:30 +0300 Date: Wed, 24 Oct 2018 13:02:30 +0300 From: Andy Shevchenko To: Rajat Jain Cc: "Hunter, Adrian" , Ulf Hansson , linux-mmc@vger.kernel.org, Linus Walleij , Rajat Jain , Linux Kernel Mailing List , Mika Westerberg , Dmitry Torokhov , linux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org Subject: Re: [PATCH] mmc: sdhci-pci: Try "cd" for card-detect lookup before using NULL Message-ID: <20181024100230.GQ10650@smile.fi.intel.com> References: <20181018215101.169847-1-rajatja@google.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 User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 22, 2018 at 04:34:55PM -0700, Rajat Jain wrote: > On Fri, Oct 19, 2018 at 2:13 AM Andy Shevchenko > wrote: > > On Fri, Oct 19, 2018 at 12:53 AM Rajat Jain wrote: > > > across other users of this API (other MMC host controller drivers). > > > > > if (slot->cd_idx >= 0) { > > > - ret = mmc_gpiod_request_cd(host->mmc, NULL, slot->cd_idx, > > > + ret = mmc_gpiod_request_cd(host->mmc, "cd", slot->cd_idx, > > > slot->cd_override_level, 0, NULL); > > > > Yes. > > > > > + if (ret && ret != -EPROBE_DEFER) > > > + ret = mmc_gpiod_request_cd(host->mmc, NULL, > > > + slot->cd_idx, > > > + slot->cd_override_level, > > > + 0, NULL); > > > > And no. Instead of this part you need to provide an ACPI GPIO mapping table. > > Sure, I am willing to do so, and I tried earlier too. However, certain > doubts arose in my mind when I tried that and I posted my questions > earlier (https://lkml.org/lkml/2018/9/28/507) but couldn't elicit any > response. Unfortunately I still do not have answers. My primary > questions are: > > 1) - It seems that 1 SDHCI device may support multiple slots (looking > at the code). It is not clear to me if they could share card detect > interrupts, or should have separate ones? This is more likely question to HW engineers of your platform with a caveat that there should be a way to distinguish exact slot in which card is being inserted. > Also, the driver may not > really know? I think in such case the bug in HW design and / or driver. > So should I add 1 or two pins using the > devm_acpi_dev_add_driver_gpios(). This depends on the above, e.g. HW design, ACPI tables. > Is some one familiar with SDHC > driver can answer these questions, it shall be great. Actually above questions better to ask in linux-mmc mailing list, which by the fact is in Cc list already. So, wait for someone to clarify. > 2) I'm not really sure what should I set "active_low" to? Isn't this > something that should be specified by platform / ACPI too, and driver > should just be able to say say choose whatever the ACPI says? > > struct acpi_gpio_params { > unsigned int crs_entry_index; > unsigned int line_index; > bool active_low; > }; ACPI specification misses this property, that's why we have it in the structure. In your case it should be provided by _DSD and thus be consistent with the hardcoded values. > Since I do not understand the above two issues, and thus I chose the > safest path and not disturb the current code so as not to cause any > regressions. As far as I can see in the above it is disturbing the current code more than needed. > > Please let me know, and I'm happy to re-spin my patch. -- With Best Regards, Andy Shevchenko