Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933031AbdCWJ2s (ORCPT ); Thu, 23 Mar 2017 05:28:48 -0400 Received: from mail-vk0-f47.google.com ([209.85.213.47]:34570 "EHLO mail-vk0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752516AbdCWJ2q (ORCPT ); Thu, 23 Mar 2017 05:28:46 -0400 MIME-Version: 1.0 In-Reply-To: <20170323085812.GA2250@hardcore> References: <20170310132507.32025-1-jglauber@cavium.com> <20170310132507.32025-7-jglauber@cavium.com> <20170323085812.GA2250@hardcore> From: Ulf Hansson Date: Thu, 23 Mar 2017 10:28:44 +0100 Message-ID: Subject: Re: [PATCH v12 6/9] mmc: cavium: Add MMC PCI driver for ThunderX SOCs To: Jan Glauber Cc: "linux-mmc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , David Daney , "Steven J . Hill" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2664 Lines: 67 On 23 March 2017 at 09:58, Jan Glauber wrote: > On Fri, Mar 17, 2017 at 03:58:26PM +0100, Ulf Hansson wrote: >> On 10 March 2017 at 14:25, Jan Glauber wrote: >> > Add a platform driver for ThunderX ARM SOCs. >> > >> > Signed-off-by: Jan Glauber >> > --- >> > drivers/mmc/host/Kconfig | 10 ++ >> > drivers/mmc/host/Makefile | 2 + >> > drivers/mmc/host/cavium-mmc.h | 10 +- >> > drivers/mmc/host/cavium-pci-thunderx.c | 198 +++++++++++++++++++++++++++++++++ >> > 4 files changed, 218 insertions(+), 2 deletions(-) >> > create mode 100644 drivers/mmc/host/cavium-pci-thunderx.c >> > >> > diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig >> > index 68cc811..3983dee 100644 >> > --- a/drivers/mmc/host/Kconfig >> > +++ b/drivers/mmc/host/Kconfig >> > @@ -632,6 +632,16 @@ config MMC_CAVIUM_OCTEON >> > >> > If unsure, say N. >> > >> > +config MMC_CAVIUM_THUNDERX >> > + tristate "Cavium ThunderX SD/MMC Card Interface support" >> > + depends on PCI && 64BIT && (ARM64 || COMPILE_TEST) >> > + select GPIO_THUNDERX >> >> Do you really need to select GPIO_THUNDERX? What is the relationship? > > I don't know much about gpio, but in the end despite all these layers > there must be a gpio set function called doing the writeq on our SOC > to enable/disable the power gpio, right? > > GPIO_THUNDERX implements this gpio set function for Cavium's SOC. Got it. However using "select" should be avoided. Please use "depends on GPIOLIB" instead. The select of "GPIO_THUNDERX" should be done part of the defconfig or via an SoC specifc Kconfig file. [...] > >> > + * Create a dummy device per slot and set the node pointer to >> > + * the slot. The easiest way to get this is using >> > + * of_platform_device_create. >> > + */ >> > + if (!slot_pdev[i]) >> > + slot_pdev[i] = of_platform_device_create(child_node, NULL, >> > + &pdev->dev); >> >> Seems like we should verify that this is a slot node, by checking the >> compatible, before creating a platform device for it. No? > > Not sure I understand you correctly. Before creating the platform device > I don't have a device for the slot. Looking at functions I could use to > check the compatible all of these need a device, which I'm just going to > create. Can you point me to a function I can use here? if (of_device_is_compatible(child_node, "mmc-slot")) ->create device [...] Kind regards Uffe