Received: by 10.223.164.202 with SMTP id h10csp490966wrb; Thu, 30 Nov 2017 02:46:14 -0800 (PST) X-Google-Smtp-Source: AGs4zMb7HDAXinFi0eKbjBPL00bmGbcwEkRCR2FgmusyJyjeV342RszeysFqBbrUWp8+WzkOcB4f X-Received: by 10.98.163.200 with SMTP id q69mr6059537pfl.21.1512038774279; Thu, 30 Nov 2017 02:46:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512038774; cv=none; d=google.com; s=arc-20160816; b=Ui/7mKa+yp4Jld2hcr31rBuPYVEiNRfM5gU8szx8f2vZlGeQNwTapxw52gzhf/0tUs 6F5yNmoegthdhGye+cicrPq6M+8alQ74Q+nH9QT5jAC8nSOpJ4imvLqHIuvfurNgw2zw GYIxeQV2k+QKQJsq/P0ZYuM62zPoIxONZULF6yo6MUUJV5uY0cnDzxy5cGiGBehuy64E nFj6wMYAamzb6RxmWNqv8t0OEj0xEKVIogHhcuYYD88zPILTEprKF5dsqKTEjbd6pD+z aPv+83mrN695H2acQ34Jtw4uD2bwUv4Jg0rdzLij+ksKB/aplKAr4230KHgDHY02fBL0 7ofQ== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=9grxlaCqDp86/ZptyA4ULZw1Dvd0kWlLCirYHYJynes=; b=wCWlL5VmyA0UHaEnlHOIS9UV97YHUsGcezGVSf+K8yQRxck4xFnAAJFWfPRZtfwlJ/ HLGZJ0QewLdxt2PlFtnb/gfgh1ayqOBsNJylHKREJ7kVf2g2bK6dgkAOs3hBwHWLTQ1z WMY7lGaEMQattnMcwy1f+D8zEFrR2dg1a87Oq/a3fH6Uyz2ntxXK4oaATvgW16iUj8Af NPycYtQKkYm+o2bzmGeN1KNHez7JEqmoPNkMK1GKC+YGNgg24Jyyq8jozWCGMssFmnxr Yu6Xr773JJhBB0Ld4DVFUWSLZfPVIm+YrXje9lWBLM6vl4gtU6QTuYzWIOAHETQm7NMT qlag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=T61HhA5A; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u186si2843012pgc.434.2017.11.30.02.46.00; Thu, 30 Nov 2017 02:46:14 -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=@linaro.org header.s=google header.b=T61HhA5A; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752040AbdK3Kpi (ORCPT + 99 others); Thu, 30 Nov 2017 05:45:38 -0500 Received: from mail-ot0-f195.google.com ([74.125.82.195]:44406 "EHLO mail-ot0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750918AbdK3Kpg (ORCPT ); Thu, 30 Nov 2017 05:45:36 -0500 Received: by mail-ot0-f195.google.com with SMTP id d27so5714510ote.11 for ; Thu, 30 Nov 2017 02:45:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=9grxlaCqDp86/ZptyA4ULZw1Dvd0kWlLCirYHYJynes=; b=T61HhA5ArLZ7kGy7jWdXFeoFeGIt61oJzBNoAKvvsRqadbz2mWebol7NUoFPqDBl4E P2yInlLo5ARHefnbkNBDSt5q01Ftj75djbFCfeUkjZo3ATllvUCF7Dexb5tEiGyqbvOk jmEpFXbjwwNHI/EdmE0F/5WZI2ZgvpONdwEeE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=9grxlaCqDp86/ZptyA4ULZw1Dvd0kWlLCirYHYJynes=; b=DOKv3PChgXFdqwtshBzXIFA3GR4QB9szAjq7r5tJhJ3jULualTb3DR3cjMFcpKrlWW HmTkK07BbASn/cimJrwEnDXu8zBixVr9oqomTSwifRad50PUxj+iA+5hr5xRoYGIKujw yWoGBiSZwTudYBPpst0D0CPYAjVLWn1RBO2PFxx8wn8ihcDW17xQ16KVsE8HGqFxac+h BZmaCNVPHjdhzKipjdbq2M+TgkCQKJG9gKxtldllbu9SB60orvsF120o2RwvNqqI4S9M dtNXBd5VvmZGHyC/6h4rYsUPVUaAoiaCj782YmK/tVyNF2wg0aFAAvP46q5p2oeKHUs3 ZyJg== X-Gm-Message-State: AJaThX6wkmjn2JRAQ3wMQ/oJnwRZhaAaT3ffgyfnZqQJbV5qsm3SDSDD T+7+AJCAjZkYWdU3lNB58Dw5PtWqcECHGN6zsP9aYPgi X-Received: by 10.157.46.65 with SMTP id c1mr4854910otd.26.1512038735912; Thu, 30 Nov 2017 02:45:35 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.7.132 with HTTP; Thu, 30 Nov 2017 02:45:35 -0800 (PST) In-Reply-To: <78c06786-8bfc-3f15-fdb5-061691010509@mentor.com> References: <9bd0bfdaf4e869e6216a0ef032b52cd28b33ab16.1512032962.git.baolin.wang@linaro.org> <78c06786-8bfc-3f15-fdb5-061691010509@mentor.com> From: Baolin Wang Date: Thu, 30 Nov 2017 18:45:35 +0800 Message-ID: Subject: Re: [PATCH v5] mfd: syscon: Add hardware spinlock support To: Vladimir Zapolskiy Cc: Lee Jones , Arnd Bergmann , Rob Herring , Mark Rutland , Mark Brown , LKML , DTML 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 30 November 2017 at 18:38, Vladimir Zapolskiy wrote: > On 11/30/2017 11:10 AM, Baolin Wang wrote: >> Some system control registers need hardware spinlock to synchronize >> between the multiple subsystems, so we should add hardware spinlock >> support for syscon. >> >> Signed-off-by: Baolin Wang >> Acked-by: Rob Herring >> --- >> Changes since v4: >> - Add one exapmle to show how to add hwlock. >> - Fix the coding style issue. >> >> Changes since v3: >> - Add error handling for of_hwspin_lock_get_id() >> >> Changes since v2: >> - Add acked tag from Rob. >> >> Changes since v1: >> - Remove timeout configuration. >> - Modify the binding file to add hwlocks. >> --- >> Documentation/devicetree/bindings/mfd/syscon.txt | 8 ++++++++ >> drivers/mfd/syscon.c | 21 +++++++++++++++++++++ >> 2 files changed, 29 insertions(+) >> >> diff --git a/Documentation/devicetree/bindings/mfd/syscon.txt b/Documentation/devicetree/bindings/mfd/syscon.txt >> index 8b92d45..25d9e9c 100644 >> --- a/Documentation/devicetree/bindings/mfd/syscon.txt >> +++ b/Documentation/devicetree/bindings/mfd/syscon.txt >> @@ -16,9 +16,17 @@ Required properties: >> Optional property: >> - reg-io-width: the size (in bytes) of the IO accesses that should be >> performed on the device. >> +- hwlocks: reference to a phandle of a hardware spinlock provider node. >> >> Examples: >> gpr: iomuxc-gpr@20e0000 { >> compatible = "fsl,imx6q-iomuxc-gpr", "syscon"; >> reg = <0x020e0000 0x38>; >> + hwlocks = <&hwlock1 1>; >> +}; >> + >> +hwlock1: hwspinlock@40500000 { >> + ... >> + reg = <0x40500000 0x1000>; >> + #hwlock-cells = <1>; >> }; >> diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c >> index b93fe4c..5b67dbc 100644 >> --- a/drivers/mfd/syscon.c >> +++ b/drivers/mfd/syscon.c >> @@ -13,6 +13,7 @@ >> */ >> >> #include >> +#include >> #include >> #include >> #include >> @@ -87,6 +88,26 @@ static struct syscon *of_syscon_register(struct device_node *np) >> if (ret) >> reg_io_width = 4; >> >> + ret = of_hwspin_lock_get_id(np, 0); >> + if (ret > 0) { >> + syscon_config.hwlock_id = ret; >> + syscon_config.hwlock_mode = HWLOCK_IRQSTATE; >> + } else { >> + switch (ret) { >> + case -ENOENT: >> + /* Ignore missing hwlock, it's optional. */ >> + break; >> + case 0: >> + ret = -EINVAL; >> + /* fall-through */ > > It breaks the execution on all kernels without CONFIG_HWSPINLOCK enabled. Ah, your are correct. Sorry, I missed this case. I will fix this in next version. Thanks. -- Baolin.wang Best Regards From 1585487109508960756@xxx Thu Nov 30 10:38:55 +0000 2017 X-GM-THRID: 1584567099391769753 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread