Received: by 10.223.185.116 with SMTP id b49csp688157wrg; Fri, 23 Feb 2018 05:20:19 -0800 (PST) X-Google-Smtp-Source: AH8x225pP3mfahtBBJPbpxylo/g4N4jsdl5Pm8F/23gt3gMxLcaRq3NaBpo/3TyG/9+sZy5dxy4M X-Received: by 10.101.86.73 with SMTP id m9mr1485528pgs.70.1519392019806; Fri, 23 Feb 2018 05:20:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519392019; cv=none; d=google.com; s=arc-20160816; b=Dhr8K7Z9an0F+zwCcMs8Om0tzPsW8JXnyJJHw7VERj5E3qElEBPOFIloamZGlxwv7C eszErlYepOBU3xwQWSfyxm6eBAxNaFuSiYhvoKxqdEVH/Tv0mntVPzDeiP0+ZHw0etwq XNb4QEYeS5+utU9m2EVE1W+jEx1QvLAJe50YF3nL4d4FMlhGzw3Psa6lcM/wcHywCBxx 7v3xFRskzD3TGEJ4dHKUKyqeY7UULvVfuJhaGl6eDhvbEDjH58Hkvcie7NLeDaCtaAAD bmHUylaFt10en2aLjmfue76VAgL/k4LXDzM11hL63T/z8teiOyfLx+OlbKrymvYSUcF/ 6pmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:arc-authentication-results; bh=vKnIXHwup0fLcMw5RBlUcLzmPLFY4YykCavV7nIKEME=; b=enTrWQkHFcE8I/On1ukdNOKltfUY/Qj8IXcRMv9wVp03j90pMOVO3Yww6YTNudE48Q 2OYkcBA+v4qiqdiYWpiFPq1io6ghmk9w+h8MQ5PsiS5ppVVku6aXaIonAeTS6oxcOSmQ aj3qbrRE5yAyVdyIC+rriBBgXsCtaNEd8sZz9tT7ws5g10mm/4woUNa8/1u0dHJakdlL V0ExT3JKtOXfVPPWFtxXudL3kfEQwLKfSwyHEjQ20wnEHLKW8Lp/cbg6mAZ5nsSUAVHq WdjSSgTlIUZWlZEED9oKqpndshI3k9jdGBZYwG5ocyjyVEuggTXK/JXbSwrMJzScLasv 4MVQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s62si1523448pgc.184.2018.02.23.05.20.05; Fri, 23 Feb 2018 05:20:19 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751605AbeBWNTY (ORCPT + 99 others); Fri, 23 Feb 2018 08:19:24 -0500 Received: from mga03.intel.com ([134.134.136.65]:18422 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751410AbeBWNTT (ORCPT ); Fri, 23 Feb 2018 08:19:19 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Feb 2018 05:19:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,383,1515484800"; d="scan'208";a="30125968" Received: from haiyuewa-mobl1.ccr.corp.intel.com (HELO [10.254.208.163]) ([10.254.208.163]) by orsmga003.jf.intel.com with ESMTP; 23 Feb 2018 05:19:16 -0800 Subject: Re: [PATCH arm/aspeed/ast2500 v2] eSPI: add ASPEED AST2500 eSPI driver to boot a host with PCH runs on eSPI To: Andy Shevchenko , joel@jms.id.au, andrew@aj.id.au, arnd@arndb.de, gregkh@linuxfoundation.org, openbmc@lists.ozlabs.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org References: <1519369459-12468-1-git-send-email-haiyue.wang@linux.intel.com> <1519381535.10722.99.camel@linux.intel.com> From: "Wang, Haiyue" Message-ID: Date: Fri, 23 Feb 2018 21:19:16 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1519381535.10722.99.camel@linux.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-02-23 18:25, Andy Shevchenko wrote: > On Fri, 2018-02-23 at 15:04 +0800, Haiyue Wang wrote: >> When PCH works under eSPI mode, the PMC (Power Management Controller) >> in >> PCH is waiting for SUS_ACK from BMC after it alerts SUS_WARN. It is in >> dead loop if no SUS_ACK assert. This is the basic requirement for the >> BMC >> works as eSPI slave. > So, do we have an agreement that the driver should go in this shape w/o > interacting with SPI subsystem? Not sure, I've added the specification of eSPI, hope people don't feel confused with SPI. :-) > Also few comments below. > >> +config ASPEED_ESPI_SLAVE >> + depends on (ARCH_ASPEED || COMPILE_TEST) && REGMAP_MMIO > I would rather split this to two > depends on REGMAP_MMIO > depends on ARCH_ASPEED || COMPILE_TEST OK, it looks clean. I referred to: config ASPEED_LPC_CTRL         depends on (ARCH_ASPEED || COMPILE_TEST) && REGMAP && MFD_SYSCON >> + tristate "Aspeed ast2500 eSPI slave device driver" >> + ---help--- >> + Control Aspeed ast2500 eSPI slave controller to handle >> event >> + which needs the firmware's processing. >> +#include > What exactly requires this header? Oh, I ctrl+c / ctrl+v from other device tree usage module. :-( Remove it now. Thanks for making the code more clean. >> +static int aspeed_espi_slave_probe(struct platform_device *pdev) >> +{ >> + struct aspeed_espi_slave_data *priv; >> + struct device *dev = &pdev->dev; >> + struct resource *res; >> + void __iomem *regs; >> + int rc; >> + >> + dev_set_name(dev, DEVICE_NAME); > Do this after checks and memory allocations. Fixed! >> + >> + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); >> + regs = devm_ioremap_resource(dev, res); >> + if (IS_ERR(regs)) >> + return PTR_ERR(regs); >> + >> + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); >> + if (!priv) >> + return -ENOMEM; >> + >> + priv->map = devm_regmap_init_mmio(dev, regs, >> &espi_slave_regmap_cfg); >> + if (IS_ERR(priv->map)) >> + return PTR_ERR(priv->map); >> + >> +static const struct of_device_id of_espi_slave_match_table[] = { >> + { .compatible = "aspeed,ast2500-espi-slave" }, >> + { } >> +}; >> +MODULE_DEVICE_TABLE(of, of_espi_slave_match_table); > This one should be closer to the struct of_device_id. Fixed.