Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2622621yba; Mon, 8 Apr 2019 00:42:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqzj3Sxm/8WC0tQCXYBhkkTeac6Q66EP4ull4BngpGN86rjzlojPkIXy13Zh73tP9+hY0RGW X-Received: by 2002:a63:be02:: with SMTP id l2mr25530939pgf.48.1554709346933; Mon, 08 Apr 2019 00:42:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554709346; cv=none; d=google.com; s=arc-20160816; b=jEqyExfzrOIOLVl/oZ4MujESEaWSiJvKtzU5jwOLZBQudZFNmvWNNWLXnSNIhSMhWt uW7Y2102ysq+mehgxnyu/bAQAAHUlnPchMunaRnOclhTXLwU43IfDpbDmgPdR8T92tJ4 jHpR+AxtXbWbA87Zd6ZpJt6LMPLQCGq/hMq0LMBi+Dl3jCE3z0Bugx5357+hoK/8CqRW MVh6zeJknZMbV76CdDYCeSytLeU2ToiIUO49kb3WfVsVNBRKuU5td48hzwAXUvuq1Tj+ 9cGKFDRLfmUVo8NZDQsG8mPQhxNlSqu3drS7jKTSikTm7qz7MBSoVjPAOLbxCFcggvTI KmBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=F3NhSLn3az5jkaZew7XbynbTN+tUvuz5X4NPtVQ9wE8=; b=vqJAow7oCpQlgvXMV3pDf4qbMPGauW23pX5WLFPMZVOie/H3ik0kGrvvWA7GuWyrJp 9gswQSGnSlr1fWVspX2wirm6XuQvViuN4pT/NY8hf2tlaj8czzYGExsw2e1LNcLB0GfU 0iUQw1CeShrGnRmxIlBqvCNPL0H/a1T+qc78d69/kdeSIS8F1b9A+AGAOQ23SRngB7Cl 0yND+N6Lem6yBf5qZtTbu/y3E/jF2WgWTTAgOwwecJucr12jK/53eZXDzXfGgkqVBm0o IJ4nX06PQO70QN00UE3hMWLfng7kMaTuSlaXVM9cLzCUcYxxkivm5zuR/s0BICtygeRU IeVg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r190si28310550pfc.14.2019.04.08.00.42.11; Mon, 08 Apr 2019 00:42:26 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726582AbfDHHlL (ORCPT + 99 others); Mon, 8 Apr 2019 03:41:11 -0400 Received: from mga12.intel.com ([192.55.52.136]:39198 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725881AbfDHHlL (ORCPT ); Mon, 8 Apr 2019 03:41:11 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Apr 2019 00:41:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,324,1549958400"; d="scan'208";a="159658647" Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.157]) by fmsmga004.fm.intel.com with SMTP; 08 Apr 2019 00:41:07 -0700 Received: by lahna (sSMTP sendmail emulation); Mon, 08 Apr 2019 10:41:06 +0300 Date: Mon, 8 Apr 2019 10:41:06 +0300 From: Mika Westerberg To: Chris Chiu Cc: andriy.shevchenko@intel.com, heikki.krogerus@linux.intel.com, drake@endlessm.com, linus.walleij@linaro.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux@endlessm.com Subject: Re: [PATCH] pinctrl:intel: Retain HOSTSW_OWN for requested gpio pin Message-ID: <20190408074106.GC3622@lahna.fi.intel.com> References: <20190408042103.3804-1-chiu@endlessm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190408042103.3804-1-chiu@endlessm.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 08, 2019 at 12:21:03PM +0800, Chris Chiu wrote: > +static void > +intel_gpio_update_pad_mode(void __iomem *hostown, u32 mask, u32 value) > +{ > + u32 curr = readl(hostown); > + u32 updated = (curr & ~mask) | (value & mask); I think here we should first complain if the expected ownership is not correct. Warning or info level probably enough. > + > + return writel(updated, hostown); Also if the pin is not requested and not changed we should not touch the register. Otherwise this looks good to me.