Received: by 10.223.164.202 with SMTP id h10csp108185wrb; Wed, 29 Nov 2017 18:04:43 -0800 (PST) X-Google-Smtp-Source: AGs4zMb4Tn7WfNSOla18LFHy6jns9cGG0NyOEs7Egst843VsGimNQRrM3CPi5exO5X6Sqx0ivr4z X-Received: by 10.101.82.8 with SMTP id o8mr900403pgp.42.1512007483225; Wed, 29 Nov 2017 18:04:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512007483; cv=none; d=google.com; s=arc-20160816; b=vsOwECBVT/1M8xs36vBQKRjbNQS9PkL8OJRGlXIVhY/ICPr93FTwv1vI8bAqEmSFEG DSVGjtj3uxcqb8Vs2gnHpnvZEpDhQvA/JtUO44x7IJLxO3MHe9glSrMw0MAQRP7ViJkU iJXT1Sb8oVczTrJ0Hk7Cg1Az40YarZ2kvgntVk8M3aGxdS+BQVF5ols3h3KQmpY0IHWx ZAl0Wa1MI4fIUk/E8XJ7NTOYQr3XWVwwJaD0Qvg2KgpIL0N8E8iHpOyx4gCR358PwLY0 7hPyhNtEJo9C/Q9626es8XTB+GP7mM4ivsiARsUWf5dwOrGX3nIj5AoRkpOCBj6Ns9S9 jFQw== 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=AAxMEpHSyWpsLnLfoWYa9u/2jXdCM+FUAbcEVQ3AKvs=; b=ImYP0owy9868LyA+56I6pzMSqvz02zaBYsmtc37AF9hQQFjWbCdVnG2xjBDiZIVFYC cH/tmtgvWLRK3ZW4eloBvmXt+aBZb0Hr+4jfxxAW/0GlwFKmSMjRenHZAEl8XO7CL6+l eHB6omZck560jOm145I7ZFFFFn+pD07uSIZdU5z8e1CRwDe8mou10EEk/CyavFJ0eVmy 1NYcDVx7W6b0kRoPzJi8V8vbceqXm01BhrSaxsA/s2HHZOB9H/UGLl73DOGHJhL3/pRP V7ZeAGYfspi7H0Qe1osnBrcMN4kCroh1StjGoWydBgB6aQWd659XpjeLHk+D0E19upyf zq2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RVoPlys4; 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 e4si2207899plb.216.2017.11.29.18.04.29; Wed, 29 Nov 2017 18:04:43 -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=RVoPlys4; 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 S1753030AbdK3CER (ORCPT + 99 others); Wed, 29 Nov 2017 21:04:17 -0500 Received: from mail-oi0-f66.google.com ([209.85.218.66]:33368 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752908AbdK3CEO (ORCPT ); Wed, 29 Nov 2017 21:04:14 -0500 Received: by mail-oi0-f66.google.com with SMTP id w131so3874813oiw.0 for ; Wed, 29 Nov 2017 18:04:14 -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=AAxMEpHSyWpsLnLfoWYa9u/2jXdCM+FUAbcEVQ3AKvs=; b=RVoPlys4lQfUh9wmibV1O6XUmT/vMG/JH6UKNankv56J20WfPd2NctcR3QOXFVMSq7 8oNslrLgFPI2oH7n020AEZwSAGDN/+kUgXE64NcLZS2opTnlKrFX/qgiYg8LF+Qe4fzi CQuZJR16hux+blPqqg6AlciuGuSLdePHO4hWU= 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=AAxMEpHSyWpsLnLfoWYa9u/2jXdCM+FUAbcEVQ3AKvs=; b=AdH7PqgM1275UEolXQGQYCUcmLgtkr7/FHC1AZyrarTW2sRP1XzCtYvpmjD8w30mUo WbmczyEx4P84x0cSqDcqheFJtDnea52FA+OMEU8dTaLNDYRpYUk/6RZRy2b4/1iUDE0V FtVYmxAQXUDidBkX0+g1D1YCxLfKPV0CMW8cr+qEK05m+RQ9zCaQ/5M/7V36n1XKFdWO 0UNG2SegDuIDlIu5HUtIVmLA2nbsYR5s3UoRJ9ZbH1JRq7W9VkJyG2G8ggkulgrtxA4+ wBW/j8E1qVSEANhYxDQ/7bvzsTzoDjqHbalfivErFIyKzzrYUmCRrqfcovi6e+H/2sGC Z04Q== X-Gm-Message-State: AJaThX42qXgCXWhbMRBNyZNBeYGWqXuErKcxyRS1JA31QJfKbhgHti3Z 5QKcw3v+x2viE2DXuC2VFD2wBZfdZc0+z71Z8XA2cffm X-Received: by 10.202.104.143 with SMTP id o15mr3396981oik.16.1512007454359; Wed, 29 Nov 2017 18:04:14 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.7.132 with HTTP; Wed, 29 Nov 2017 18:04:13 -0800 (PST) In-Reply-To: References: From: Baolin Wang Date: Thu, 30 Nov 2017 10:04:13 +0800 Message-ID: Subject: Re: [PATCH v3] mfd: syscon: Add hardware spinlock support To: Arnd Bergmann Cc: Lee Jones , Rob Herring , Mark Rutland , Mark Brown , Linux Kernel Mailing List , 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 Hi Arnd, On 29 November 2017 at 18:07, Arnd Bergmann wrote: > On Mon, Nov 20, 2017 at 7:54 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. >> > >> @@ -87,6 +88,12 @@ 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; >> + } > > Hi Baolin, > > The error handling here seems insufficient, I think we have to treat > the following cases separately: > > - ret>0 (this is fine) > - no spinlock in DT: of_hwspin_lock_get_id currently returns -EINVAL, > we probably want to use a different return code (maybe -ESRCH ?) > here so we can tell the difference beween no spinlock, and an > invalid spinlock > - deferred probing: if the spinlock is there but the driver is not > yet available, we may need to propagate the -EPROBE_DEFER > here > - other error: this would probably be a fatal condition here, and > we should print a warning and clean up. You are correct and I will add some error handling. Thanks for your comments. -- Baolin.wang Best Regards From 1585404966762263701@xxx Wed Nov 29 12:53:17 +0000 2017 X-GM-THRID: 1584567099391769753 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread