Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp384024ybv; Wed, 19 Feb 2020 01:29:27 -0800 (PST) X-Google-Smtp-Source: APXvYqyu7U4jJ4lHvFf2ouqf7ALux3VXWTAA1AetowXHE5481J5JGpOIOEXlV8OOhoaWx0Q+lEAy X-Received: by 2002:aca:fcd4:: with SMTP id a203mr3810620oii.167.1582104567485; Wed, 19 Feb 2020 01:29:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582104567; cv=none; d=google.com; s=arc-20160816; b=TOfDYwaC8mMTO043FmYJiEgnk+8QQG95c2UV9OQOskyeOXIAPDGVw1dd8vZCXYoJpV mTiGi7GQrPAkH26D5MFTJPFas7zNd278TIYqcIyHgtvev2QKOujqsO71AbBdUZkFBTBd E5IoNLkgiOdoOoRy+H2rZ24Ai6IV8wdvLYWAjFaQx1cO0BFyCzAKQwMvKO5IyycsOhvB bXIlaAqEtCXVfgfQ2lUf8VGQNK9O0FWFDcgvya8+jge3zA1QQhHaLRzZakNuTR3wDvQK 2hNI2pdssguFp3b7EUKCjj8ThVQIGxrzyuD6t/0tlorHWEBx4VLMSOxRiOapyMb55Vgs GULg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=tGZFHykmacRws9g1ibYcZy4WBII6dR0ReLzZflarpww=; b=IwRgbmpceaNfimPJ5bf3IKrQQY8e1EXbmAdS3IMjRpTSmdaMAc17MkkFy5DaO8cFao Jkps0DITqEg+W+odek9nWIXtp0cPS/UZbml/sgMrlv1AWLv+eYmfrDyCgs7Gt8gXufL9 Eg0jWsD1wt58Gp4bfLVJqiYk+GXBZXQ3ku3JJM/L5+jTVxYBiF5dtqX/Tvwtkr/EOS5o VJZJju01aq9a2mj3NoLkZKzZRhFmLaI3I6rucnxKfSqYn2SPlTMwUQ7LC/EnrH5PE56u LOyXeBCnBJM0xeAr1It5rcwz8G8BjXGknBTEKqzwP1eW6yu8eJCzuvnIzJ+csKex8u+l jeag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iHwOhxWn; 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 j16si910982otq.23.2020.02.19.01.29.14; Wed, 19 Feb 2020 01:29:27 -0800 (PST) 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=iHwOhxWn; 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 S1726512AbgBSJ3G (ORCPT + 99 others); Wed, 19 Feb 2020 04:29:06 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:40891 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726195AbgBSJ3G (ORCPT ); Wed, 19 Feb 2020 04:29:06 -0500 Received: by mail-pl1-f196.google.com with SMTP id y1so9316942plp.7; Wed, 19 Feb 2020 01:29:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tGZFHykmacRws9g1ibYcZy4WBII6dR0ReLzZflarpww=; b=iHwOhxWnv23qjancjEwQgMRD415ItyxCW7wjeOb+M/owCxhLY1Lsr2zu9SRiOdx8m8 0RMcGKXlKDSgsCzrJtjC3ARD0J8OfI23G0l+1SnnMff7PqtMHBpMnyhtS907tDE15u+x L2gFf5iciDXv9HUTyeFz+aHGbFO0W87NW4xORvdHoo4XtNWXgVBuUawE9ktnKp7lga8D H2HmN36oM4xmrYt92QuBlneU8vdF5gaXNaP2dGcMxNa5XcIzB0h1uLQGnt5kUfD5AQu3 cOgC+0yqPHp/QcqHgTWkljjiiPSeLBo+qvDhGf/BXXrwB4F4LkRYO9jqdAVBr6pl3Vwz 2MCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tGZFHykmacRws9g1ibYcZy4WBII6dR0ReLzZflarpww=; b=NrcojZQl3eUVD82t+OIDWXlR3tJVUN91Vgg8mbvVrwXMTn+8QnvCADLKSBz+L1NYrY 3+PW4q4g9M5zTsVtz/NuzDSyaKZConwSTNUbTrz3v7f2XAZz4YwRioUpHB8lNHAyX3/W HkQyTi0ieLGfOvGiH63AuZDR2hZpFm0PxuLY0KsM1/VPOSlE6Twi5UZwjCb7fAPIwhpX C0ehy78Vg8wqWUhSFQWxXqGO7VAPfAfGFcCmfMQION+uvT1v/wc8k9vE+L+SUQrT9Cx+ RzA8krS4TILhGg2GlQYD616VUmjoLL5+90UVpQ2fqfYLxlm8YPdhDMGaxo9CWhZfstKT XUOQ== X-Gm-Message-State: APjAAAU6Q6sQmBT8Dkps7gYdWErmhMHzm2fQsyMXPZ8GARIbGrunZ2f6 AikrFLoSKjpTNfA7Lk47zdU= X-Received: by 2002:a17:902:7603:: with SMTP id k3mr24884354pll.240.1582104545897; Wed, 19 Feb 2020 01:29:05 -0800 (PST) Received: from gli-arch.genesyslogic.com.tw (60-251-58-169.HINET-IP.hinet.net. [60.251.58.169]) by smtp.gmail.com with ESMTPSA id m18sm1839461pgd.39.2020.02.19.01.29.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Feb 2020 01:29:05 -0800 (PST) From: Ben Chuang To: adrian.hunter@intel.com, ulf.hansson@linaro.org Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, ben.chuang@genesyslogic.com.tw, Ben Chuang Subject: [PATCH] mmc: sdhci-pci-gli: Enable MSI interrupt for GL975x Date: Wed, 19 Feb 2020 17:29:00 +0800 Message-Id: <20200219092900.9151-1-benchuanggli@gmail.com> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ben Chuang Enable MSI interrupt for GL9750/GL9755. Some platforms do not support PCI INTx and devices can not work without interrupt. Like messages below: [ 4.487132] sdhci-pci 0000:01:00.0: SDHCI controller found [17a0:9755] (rev 0) [ 4.487198] ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.PBR2._PRT.APS2], AE_NOT_FOUND (20190816/psargs-330) [ 4.487397] ACPI Error: Aborting method \_SB.PCI0.PBR2._PRT due to previous error (AE_NOT_FOUND) (20190816/psparse-529) [ 4.487707] pcieport 0000:00:01.3: can't derive routing for PCI INT A [ 4.487709] sdhci-pci 0000:01:00.0: PCI INT A: no GSI Signed-off-by: Ben Chuang --- drivers/mmc/host/sdhci-pci-gli.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/mmc/host/sdhci-pci-gli.c b/drivers/mmc/host/sdhci-pci-gli.c index 5eea8d70a85d..ce15a05f23d4 100644 --- a/drivers/mmc/host/sdhci-pci-gli.c +++ b/drivers/mmc/host/sdhci-pci-gli.c @@ -262,10 +262,26 @@ static int gl9750_execute_tuning(struct sdhci_host *host, u32 opcode) return 0; } +static void gli_pcie_enable_msi(struct sdhci_pci_slot *slot) +{ + int ret; + + ret = pci_alloc_irq_vectors(slot->chip->pdev, 1, 1, + PCI_IRQ_MSI | PCI_IRQ_MSIX); + if (ret < 0) { + pr_warn("%s: enable PCI MSI failed, error=%d\n", + mmc_hostname(slot->host->mmc), ret); + return; + } + + slot->host->irq = pci_irq_vector(slot->chip->pdev, 0); +} + static int gli_probe_slot_gl9750(struct sdhci_pci_slot *slot) { struct sdhci_host *host = slot->host; + gli_pcie_enable_msi(slot); slot->host->mmc->caps2 |= MMC_CAP2_NO_SDIO; sdhci_enable_v4_mode(host); @@ -276,6 +292,7 @@ static int gli_probe_slot_gl9755(struct sdhci_pci_slot *slot) { struct sdhci_host *host = slot->host; + gli_pcie_enable_msi(slot); slot->host->mmc->caps2 |= MMC_CAP2_NO_SDIO; sdhci_enable_v4_mode(host); -- 2.25.0