Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp3810408imd; Mon, 29 Oct 2018 12:44:26 -0700 (PDT) X-Google-Smtp-Source: AJdET5eJeJcMll0/QJYLyvq4YfUnzetZzDVQ/0TTU1aAtiiDpy/hYUF+AEHye6NXrxl7jW14fpja X-Received: by 2002:a63:ef53:: with SMTP id c19-v6mr15101092pgk.386.1540842266478; Mon, 29 Oct 2018 12:44:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540842266; cv=none; d=google.com; s=arc-20160816; b=ivemPWhr3FB5wGj/fwDsmyLRcPK94P7ebeGmJIvKGaajU0DXt77CFRSho+Syt5v4Ta HFOn3n0po7+LFLZmDMXxsE9oisWckOyqqFNW+kDTg/p2hHpi11yoqU+b7s5LI5PLpGfF Qd4PL0kDqAmvYaa+bl78HNI47dMyD/iS7t2W6JwwTDdmAwI9g6uPr61AJ5kJvnIx7zvt prLNEMYcOMmrB+xP4+3PwXtC4wYdH9gNVgFxo/tqFC06PfFT/xkQYnmqOmKus/BgeWxo 28h7sKu7UfknNdtAO4DUXWOY1JmvaMZrgQyFV7Up6jlrUO0Y0mVqW8CAdZub7mCRVya8 Yp4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :reply-to:in-reply-to:references:mime-version:dkim-signature; bh=rBTGGxdiJskMjWrUGdixSbQQERoc8ij0psm8trdkVx4=; b=qadfQco79KX4+j63jT/4g78aYtO4a3reJOXdTRi1GyCxSv486s7KyKBnttiBfd3o1N D8n2wSoE/bIZkxrxzNBHk7l+qboXCwsvxfhkEGONwDp8gl83im7ozxvPNslqPf0qJfaL 2U862eCtDYENtvwQw+G98SneJZ7/Z6b4F4hOXUQq7VtvoXuRi6gpgs90U1bmX8jNEFYz y1w4Yg0Y179clqrwkqhn8u7+l7ZM0KhrljPKkW3nZuuDmC9jUuGQrpLRGyieYvf0ScbI ciJ1HUi33QreVzUYzSTjb+Ha1ZKCHfiYXwr4AzQycFKRQIvAY5iAdTEz0P/itaOCAyko SC/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Jk7VZYlc; 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=pass (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 f39-v6si22054375plb.149.2018.10.29.12.44.11; Mon, 29 Oct 2018 12:44:26 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Jk7VZYlc; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728087AbeJ3Edp (ORCPT + 99 others); Tue, 30 Oct 2018 00:33:45 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:39808 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725911AbeJ3Edo (ORCPT ); Tue, 30 Oct 2018 00:33:44 -0400 Received: by mail-qt1-f196.google.com with SMTP id g10-v6so10734349qtq.6; Mon, 29 Oct 2018 12:43:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=rBTGGxdiJskMjWrUGdixSbQQERoc8ij0psm8trdkVx4=; b=Jk7VZYlcNYSftIydFmQj4MQ7gyaVTmbX6ZpFrqZNRp4JBoyMqjcbFwWKK2EqaYciaU 3/1MrMpgXPK4Z9lLBiYLwy3PUJA7hK3Gzsnx4dcNl7UsV1ABuFKPCzNz9NVaRJz52LhT MuhkDrETlKAi4z3y1p+BV+wrUab85uS3hzQ8p5is42qrTON1eIqu6ycsEZyyO2NBSaOm nb/E8H1ZE6x1qzYXwwEgbbfJaYMkia8rVSN00xN1begAqC5+cVmNAxsug0V2PARgYeYC Uce6EEyXgY2eItQ3V3kDoj5LIulN3v2SiYajVuSJ0prtSml3bfLgQGZlwrbJ9FTS7g6D wMXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=rBTGGxdiJskMjWrUGdixSbQQERoc8ij0psm8trdkVx4=; b=BWMcMftDEAQEtFHVARBVibQBbTkbXrMCM7OWMot+ufGjNaoiP6yEFmg428Ul9uR3/1 V/ISIFcQPrr9kZdJakgXa7L+HqR95LA54QYbwL0BK6iHwxIV3sivpiL0EYcZxpeaufBS hTQveUkn2UWG8knMQcjjP/VQQpea2MYilBBS4tf5KTOR1dnIKlA8/XhU0Y2sqKfZtOm4 Alir2qHjE7r/cshZ4flRGyEmZoiW2P8R7R9f9plOgZ7vfpuPKw5w0JQHDTYdPn+0C1CV 2KrOvqxZIkhUdDEZ/1Fwq9UboUEEfvpN5c02pDVhVtNBVLcCCWsmos5XDLhVbd0R28du IVqw== X-Gm-Message-State: AGRZ1gIVsAM47hBsJnOwttyyp0a1iZnujqpJnWuJ542y2wK9OXkF0xNt atqZZRT7unOYwP6udDovVOpXFtbWfMMsUdxtckI= X-Received: by 2002:ad4:4106:: with SMTP id i6mr14040087qvp.219.1540842216067; Mon, 29 Oct 2018 12:43:36 -0700 (PDT) MIME-Version: 1.0 References: <20181018215101.169847-1-rajatja@google.com> <20181024100230.GQ10650@smile.fi.intel.com> <20181029174356.GR10650@smile.fi.intel.com> In-Reply-To: <20181029174356.GR10650@smile.fi.intel.com> Reply-To: rajatxjain@gmail.com From: Rajat Jain Date: Mon, 29 Oct 2018 12:43:24 -0700 Message-ID: Subject: Re: [PATCH] mmc: sdhci-pci: Try "cd" for card-detect lookup before using NULL To: Andy Shevchenko Cc: Rajat Jain , Dmitry Torokhov , "Hunter, Adrian" , Ulf Hansson , linux-mmc@vger.kernel.org, Linus Walleij , Linux Kernel Mailing List , Mika Westerberg , linux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 29, 2018 at 10:44 AM Andy Shevchenko wrote: > > On Mon, Oct 29, 2018 at 10:22:02AM -0700, Rajat Jain wrote: > > On Mon, Oct 29, 2018 at 8:23 AM Andy Shevchenko > > wrote: > > > On Wed, Oct 24, 2018 at 9:03 PM Dmitry Torokhov wrote: > > > > On Wed, Oct 24, 2018 at 3:02 AM Andy Shevchenko > > > > wrote: > > > > > 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: > > > > > > > Also, the driver may not > > > > > > really know? > > > > > > > > > > I think in such case the bug in HW design and / or driver. > > > > > > > > Why? You can have a shared or dedicated interrupt and the driver does > > > > not really need to know if it can poll the status. > > > > > > Yes, that's my point either we get 1:1 mapping between slot and GPIOs > > > or have a possibility to read back from some register(s) the actual > > > status of all of them, otherwise it's a bad design. > > > > No, AFAIU, the driver only should only be able to read the status of > > *the* interrupt that was fired? (as opposite to the ability to read > > *all of them* when an interrupt fires). > > I can't be sure in the details of this (sdhci) driver, I'm not a maintainer of > that one. So, my above conclusions are purely generic. > > > > > > > 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. > > > > > > > > Again, you think as if the driver was platform specific; it is not. I > > > > have 1000s of systems with different ACPI tables. Let's say half of > > > > them use one polarity, and half another. Which polarity do you propose > > > > to use? > > > > > > Use one table for one half and another for the rest. > > > > But how does driver determine which table to use for which platform? > > (Currently the driver is platform independent). > > Based on vendor and device IDs in any form of it. The vendor ID and device ID here would mean building a table of platforms ids in this (currently platform independent) driver. I'm not sure if my original patch introduces any problems that are worth solving using such a table. I would thus prefer to solve it using my original patch, I would respin it taking care of your other review comments. Thanks and best regards, Rajat > > -- > With Best Regards, > Andy Shevchenko > >