From patchwork Sun Jan 6 08:37:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 154843 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2355826ljp; Sun, 6 Jan 2019 00:39:18 -0800 (PST) X-Google-Smtp-Source: ALg8bN4JLj38oAMWPjE14JcqNcvrfvyKtC+dJXL0MPhLduz34oEpJKOz7ebvBB6B6pAWs1/oTCtW X-Received: by 2002:a65:4784:: with SMTP id e4mr6986053pgs.12.1546763958276; Sun, 06 Jan 2019 00:39:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546763958; cv=none; d=google.com; s=arc-20160816; b=AaY+JE14wcNS8FrMFgqiqxmZpu+QqhF5VIaf9RDfdEtlyGl8mk/s2XHwvMEeOoxHeh WQ2yifshpQduvuzkH7we9ECNRhyYHFeVoJaijEYp83dO271hqd0zURljxCGglFXHdTRc UEgyYKB+EXsGEEtWBDd/qRsXu9fO4gkmo6jJeEl/IbEwEt2nGyrPhf6ilPzdljMgPXzV OGdFVdg6jLUkAGHQmJP0i69pkv883UmNha95Cn14GnvydOft/87c82bNIYr4sohPVZNB BVRjHbHLz+xkqv41y/sCPZXvBl0BowymDYE1Usd5QX8q6hqLDIMX+LRMpCAZOgFoDBoo QEmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=V3boBg1mIoonUDiKHH/hfwf8ePu+BUGNkxhLC1Rv7YM=; b=yf4GRBm2Ssh/D4pjTsc+AcOkW1P3ooxXIIGsN7jb79jlgOVztOv0yqmXmD8nw1NjaZ ijNFfvf/ml/ufFqdaOpUyT32nup6EXaDUQ9wxqOe9sehROFHKlnWMeE4V+lbYaDd+wTo 4brMNZYQeMkD/uWkWuIAptA2uWHZQiFFR0RXAhURKok3bppIGcEr1guHw6nhWBBMPmAS rG1NwaTed1Bv2RV7xIOU0TRWdkvc1dzgRu4qwY0BNwNXUUVIu0whPDs6JgnioJt14k/z 9V+3LPx7z57UFs3mhhOBqu1N+OLtq08t770Z82TZdTlmAE57b5YMWIMlQs9VmqUnl6f9 leJA== 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 38si2095549pln.313.2019.01.06.00.39.18; Sun, 06 Jan 2019 00:39:18 -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 S1726762AbfAFIjR (ORCPT + 31 others); Sun, 6 Jan 2019 03:39:17 -0500 Received: from mx2.suse.de ([195.135.220.15]:57184 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726438AbfAFIiE (ORCPT ); Sun, 6 Jan 2019 03:38:04 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 04EB1ACAE; Sun, 6 Jan 2019 08:38:03 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-lpwan@lists.infradead.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Andrea?= =?utf-8?b?cyBGw6RyYmVy?= , "David S. Miller" Subject: [PATCH lora-next 02/11] net: lora: sx130x: Fix error codes Date: Sun, 6 Jan 2019 09:37:45 +0100 Message-Id: <20190106083754.6004-3-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190106083754.6004-1-afaerber@suse.de> References: <20190106083754.6004-1-afaerber@suse.de> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use of -ENXIO results in a misleading error message from ip command: RTNETLINK answers: No such device or address Switch to -EIO for more accurate description: RTNETLINK answers: Input/output error Signed-off-by: Andreas Färber --- drivers/net/lora/sx130x.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.16.4 diff --git a/drivers/net/lora/sx130x.c b/drivers/net/lora/sx130x.c index 88d4ce1aabcf..21db0ddb101f 100644 --- a/drivers/net/lora/sx130x.c +++ b/drivers/net/lora/sx130x.c @@ -353,7 +353,7 @@ static int sx130x_agc_calibrate(struct sx130x_priv *priv) if (val != SX1301_MCU_AGC_CAL_FW_VERSION) { dev_err(priv->dev, "unexpected firmware version, expecting %u\n", SX1301_MCU_AGC_CAL_FW_VERSION); - return -ENXIO; + return -EIO; } ret = sx130x_field_write(priv, F_EMERGENCY_FORCE_HOST_CTRL, 0); @@ -380,7 +380,7 @@ static int sx130x_agc_calibrate(struct sx130x_priv *priv) dev_info(priv->dev, "AGC status: %02x\n", (unsigned)val); if ((val & (BIT(7) | BIT(0))) != (BIT(7) | BIT(0))) { dev_err(priv->dev, "AGC calibration failed\n"); - return -ENXIO; + return -EIO; } return 0; @@ -453,7 +453,7 @@ static int sx130x_load_all_firmware(struct sx130x_priv *priv) if (val != SX1301_MCU_AGC_FW_VERSION) { dev_err(priv->dev, "unexpected firmware version, expecting %u\n", SX1301_MCU_AGC_FW_VERSION); - return -ENXIO; + return -EIO; } ret = sx130x_arb_ram_read(priv, 0x20, &val); @@ -467,7 +467,7 @@ static int sx130x_load_all_firmware(struct sx130x_priv *priv) if (val != SX1301_MCU_ARB_FW_VERSION) { dev_err(priv->dev, "unexpected firmware version, expecting %u\n", SX1301_MCU_ARB_FW_VERSION); - return -ENXIO; + return -EIO; } return 0; @@ -636,7 +636,7 @@ int sx130x_probe(struct device *dev) if (ver != SX1301_CHIP_VERSION) { dev_err(dev, "unexpected version: %u\n", ver); - return -ENXIO; + return -EIO; } ret = regmap_write(priv->regmap, SX1301_PAGE, 0); From patchwork Sun Jan 6 08:37:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 154834 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2355232ljp; Sun, 6 Jan 2019 00:38:14 -0800 (PST) X-Google-Smtp-Source: ALg8bN4FuCJIBNQ30coEu+gWM10QmUMREEkyOBK7fHsbOieAJQ1T4xhrRXi48RArNfZivc4lY0Qq X-Received: by 2002:a17:902:bb05:: with SMTP id l5mr58118464pls.230.1546763894150; Sun, 06 Jan 2019 00:38:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546763894; cv=none; d=google.com; s=arc-20160816; b=cm3ZULcGkd+itiPCOKuvsiZWX7lTFmfRvDAUCRizD29eSapLL5flkYR+ruZQbR4Y0m Q7IiDxnTjlHPLpW+Km5B1YeCOyWZn5bomUa17vc3Fw93Yi00nvzeV3mJrrDzlmlJJZjB xv/CWdX1Rc+Sf5bc/C6cQJcpEiJr3yYcjCQWRnzDLdJHaJswYoURG+1NJVmNO5TdD8x9 cOz9OSCcv1PE1w6RjBxSlPntofE/u9yWIM3WLIsWHCUHxhpGi+e+s8FbcHXApreSpYf/ aM2aA1zRXz3mUnkNTb4vGB6/qQZz5wD87vX40YcrpHZgzXVeUhEnuaKqYcjjc20S65yt 2/sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=64OZYTuFcBoonqd6t1/+HCakTY7iEILIosGgoo8/AOs=; b=jwjjDb6RT0OiR1G6MdBMrall+5czV81UzRBLcjf0zHyfdqG8nBGJ5YIAVusbE0orUz H3Dy+T5LWyGDrv8psMuphgk7/eY7GRBrQTpWicp5UVnyYdgfAucml//aNY7VqNuslwLG XCAM01Uteb/mOosdpWJdG7vY3VAhJQHz2sV3P9WzE6b9pC6VNbq6qyhxS3tQEaodVk5N IKg2FsIyKNGadgjG5gaA2xhE0hgoiHvKcr7qHHO/Y/pl+Kicqz5Q90UGABFCsQrOD4qJ CZJjvMxggyYdI3B+izvBMFqvGDF32CiNq+RsTY2ELPCC6arF6aRkNoyo8mslDSita8tw pPEA== 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 j20si5654500pgh.224.2019.01.06.00.38.13; Sun, 06 Jan 2019 00:38: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; 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 S1726536AbfAFIiF (ORCPT + 31 others); Sun, 6 Jan 2019 03:38:05 -0500 Received: from mx2.suse.de ([195.135.220.15]:57194 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726477AbfAFIiE (ORCPT ); Sun, 6 Jan 2019 03:38:04 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 61094ACBC; Sun, 6 Jan 2019 08:38:03 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-lpwan@lists.infradead.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Andrea?= =?utf-8?b?cyBGw6RyYmVy?= , Ben Whitten , "David S. Miller" Subject: [PATCH lora-next 03/11] net: lora: sx130x: Revert drop of sx1301_soft_reset() Date: Sun, 6 Jan 2019 09:37:46 +0100 Message-Id: <20190106083754.6004-4-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190106083754.6004-1-afaerber@suse.de> References: <20190106083754.6004-1-afaerber@suse.de> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ben's regmap field conversion patch silently dropped my sx1301_soft_reset() helper. Soft reset is a special operation, so restore this function as sx130x_soft_reset(). To be squashed. Cc: Ben Whitten Signed-off-by: Andreas Färber --- drivers/net/lora/sx130x.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) -- 2.16.4 diff --git a/drivers/net/lora/sx130x.c b/drivers/net/lora/sx130x.c index 21db0ddb101f..7a387d9a75a0 100644 --- a/drivers/net/lora/sx130x.c +++ b/drivers/net/lora/sx130x.c @@ -180,6 +180,11 @@ static int sx130x_field_write(struct sx130x_priv *priv, return regmap_field_write(priv->regmap_fields[field_id], val); } +static int sx130x_soft_reset(struct sx130x_priv *priv) +{ + return sx130x_field_write(priv, F_SOFT_RESET, 1); +} + static int sx130x_agc_ram_read(struct sx130x_priv *priv, u8 addr, unsigned int *val) { int ret; @@ -645,7 +650,7 @@ int sx130x_probe(struct device *dev) return ret; } - ret = sx130x_field_write(priv, F_SOFT_RESET, 1); + ret = sx130x_soft_reset(priv); if (ret) { dev_err(dev, "soft reset failed (%d)\n", ret); return ret; From patchwork Sun Jan 6 08:37:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 154838 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2355374ljp; Sun, 6 Jan 2019 00:38:28 -0800 (PST) X-Google-Smtp-Source: AFSGD/Wbhm6L95FYHPLLR4B20C+iM84d85E2nHJDp8/V5rSpT20OZzr2UUd/P89nLYrWCabSKIW0 X-Received: by 2002:a62:6e07:: with SMTP id j7mr60242726pfc.135.1546763908384; Sun, 06 Jan 2019 00:38:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546763908; cv=none; d=google.com; s=arc-20160816; b=Bvpr3iDsDjp+a4c3GNrgYt1CAx0Du5ep/kif92/vEbYgg74qdgsoRkVO+6+TBo4/IC AZQcWjbrrSLISAjHdn0smChB0e0Eq5MBktjwYe5KDv+iNng+jgGhumctzZ9vk7ck8LRu Wt0l0A716/oeYlnp8xZb88V3jg485XqKEOfOB9C4yd0wMbv6pSghqgh8lQNP+41AButx RBfcokeSjaB498imw1rPWBQgyJJK7mXhGFDweoi3J16umokS/QC39uYcOu4gyrfpyfxh JYZECOraBDmEfO5NQu0/e53/eloiknp+NMaCx6nQRy+BTJdJ44m7BSfjt9TpKDf56iW9 PigQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=/nBWU2Bza79gex+/xGrOchQGP8ihZ0i37Bu4Uy4QKwg=; b=N6WI1/X5UlJ9V9z2mxMStVn0RUtMTMyC9HpzBS/4EUqPh5jtPqnSVYDQZxDKuwxy44 i+vpWEBTRVytHT9SJavI91nRw95lTq8kiEnUmSQktDNkvNLNJhWEp6MDUPs4bWJYt4yw PQcKzPLagyQZjfe4MHQ4rpyXXCt20iqWLCHrq/bA0Kd+Inw7RhiQTrsDDgsfMLrAYNSU 1FR8p2qqwcrNuA+j+4+V2Zzm09MYYv4nawnSWKsuQKl2s7VU6DeWJmwofRkKDQZOEZM5 l6cxjTRejbLHaAfyaFnwQyuc7OlSsAFxpk2WFpxOhWoiCQAkRPPfLInesPtAVM38Cipl p34A== 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 o3si58411548pgi.388.2019.01.06.00.38.28; Sun, 06 Jan 2019 00:38:28 -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 S1726573AbfAFIiG (ORCPT + 31 others); Sun, 6 Jan 2019 03:38:06 -0500 Received: from mx2.suse.de ([195.135.220.15]:57222 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726508AbfAFIiF (ORCPT ); Sun, 6 Jan 2019 03:38:05 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 1C747ACFA; Sun, 6 Jan 2019 08:38:04 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-lpwan@lists.infradead.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Andrea?= =?utf-8?b?cyBGw6RyYmVy?= , Ben Whitten , "David S. Miller" Subject: [PATCH lora-next 05/11] net: lora: sx130x: Fix regmap field toggles Date: Sun, 6 Jan 2019 09:37:48 +0100 Message-Id: <20190106083754.6004-6-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190106083754.6004-1-afaerber@suse.de> References: <20190106083754.6004-1-afaerber@suse.de> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When toggling the value of a regmap field, such as for F_RADIO_RST or F_EMERGENCY_FORCE_HOST_CTRL, we need to ensure it gets written out. Sadly the timing of the writes got lost in the regmap field conversion. Introduce an sx130x_field_force_write() helper for this. While at it, make trivial sx130x_field_write() static inline, too. Cc: Ben Whitten Signed-off-by: Andreas Färber --- drivers/net/lora/sx130x.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) -- 2.16.4 diff --git a/drivers/net/lora/sx130x.c b/drivers/net/lora/sx130x.c index 4ba02836a35d..457f2396d9ee 100644 --- a/drivers/net/lora/sx130x.c +++ b/drivers/net/lora/sx130x.c @@ -174,12 +174,18 @@ const struct regmap_config sx130x_regmap_config = { }; EXPORT_SYMBOL_GPL(sx130x_regmap_config); -static int sx130x_field_write(struct sx130x_priv *priv, +static inline int sx130x_field_write(struct sx130x_priv *priv, enum sx130x_fields field_id, u8 val) { return regmap_field_write(priv->regmap_fields[field_id], val); } +static inline int sx130x_field_force_write(struct sx130x_priv *priv, + enum sx130x_fields field_id, u8 val) +{ + return regmap_field_force_write(priv->regmap_fields[field_id], val); +} + static int sx130x_soft_reset(struct sx130x_priv *priv) { int ret; @@ -373,7 +379,7 @@ static int sx130x_agc_calibrate(struct sx130x_priv *priv) return -EIO; } - ret = sx130x_field_write(priv, F_EMERGENCY_FORCE_HOST_CTRL, 0); + ret = sx130x_field_force_write(priv, F_EMERGENCY_FORCE_HOST_CTRL, 0); if (ret) { dev_err(priv->dev, "emergency force failed\n"); return ret; @@ -694,7 +700,7 @@ int sx130x_probe(struct device *dev) msleep(500); - ret = sx130x_field_write(priv, F_RADIO_RST, 1); + ret = sx130x_field_force_write(priv, F_RADIO_RST, 1); if (ret) { dev_err(dev, "radio assert reset failed (%d)\n", ret); return ret; From patchwork Sun Jan 6 08:37:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 154835 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2355239ljp; Sun, 6 Jan 2019 00:38:14 -0800 (PST) X-Google-Smtp-Source: ALg8bN4hQxzjhzy1MUdwPaXOC9qshFU9GvV+RgCIB5AhXgAOOE0dNihKPAan99OCL+1cPtBZ1v24 X-Received: by 2002:a17:902:f44:: with SMTP id 62mr16278052ply.38.1546763894520; Sun, 06 Jan 2019 00:38:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546763894; cv=none; d=google.com; s=arc-20160816; b=Da262BQS7lXD/QnPnEPyEm6xP9RbaJmTMh/fYVNGkB38NAPw21ufD4893OMSuLzL/Q hpIaDMjAY3QhqgkipnOD8ikNXIHlo540gJSK66cjPiD+2WuVHW3ShEY7+lCJ/uH+uYEh umJms0BPWclbVhrxKdAzrfzAbhB002y56CwTuKtew9C3XU9J9/kwU9kChytQ5YWYAQ6P qgMoMWMPatj4MysLjlH2vPGNRgULgDY5KqjZoEDb/kl8Z53yoC8AICTUHt48NKFora5P olWbvTBa9JHqzzRpjFNjhtRGXFVqaaXC8Pk8cvO8S3V+54B3IS+x9OwfYtVh3HNz5fo1 VrMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Gcfwah71KjRuJ9Eb6kK7GcNUnd1NIWBmEaAYb94riq8=; b=s7iLMiOisTTEDC7dRpzGz9gfDo2mHtg2t4koTaWPOvBYyXVNvA4cDYJk09WnZK58TA nfBcg0nPvTtnU8ImFwutYO3MHIAJnpI2p+fYnIRllMH8bHqPY12xGwTnK6pIB3WwxssL nZ+WsXTUpyIPGNAvH6VcfUWhp9NH13+XV9w+rgpUSoGstbe8iulQFxV/qi4R8ewwoR68 JzcnQQzVnCBq8ufausqP/4WYPRfQlQCPo3iCncqm+bUc79F/0LIIRo329iz5kosQHOQK DsmeVW2tSwui7ycqahUV26SUhZaaJua5ufwfmzL15769znv6baqu9K/BwhFmvAb0Vqz9 zDUg== 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 j20si5654500pgh.224.2019.01.06.00.38.14; Sun, 06 Jan 2019 00:38: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; 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 S1726592AbfAFIiH (ORCPT + 31 others); Sun, 6 Jan 2019 03:38:07 -0500 Received: from mx2.suse.de ([195.135.220.15]:57230 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726529AbfAFIiF (ORCPT ); Sun, 6 Jan 2019 03:38:05 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 74E53AD17; Sun, 6 Jan 2019 08:38:04 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-lpwan@lists.infradead.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Andrea?= =?utf-8?b?cyBGw6RyYmVy?= , Ben Whitten , "David S. Miller" Subject: [PATCH lora-next 06/11] net: lora: sx130x: Force regmap field write before sleep Date: Sun, 6 Jan 2019 09:37:49 +0100 Message-Id: <20190106083754.6004-7-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190106083754.6004-1-afaerber@suse.de> References: <20190106083754.6004-1-afaerber@suse.de> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ensure timing is as expected by forcing a register write before waiting on its outcome. Cc: Ben Whitten Signed-off-by: Andreas Färber --- drivers/net/lora/sx130x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.16.4 diff --git a/drivers/net/lora/sx130x.c b/drivers/net/lora/sx130x.c index 457f2396d9ee..bc2d4b1165d8 100644 --- a/drivers/net/lora/sx130x.c +++ b/drivers/net/lora/sx130x.c @@ -692,7 +692,7 @@ int sx130x_probe(struct device *dev) return ret; } - ret = sx130x_field_write(priv, F_RADIO_B_EN, 1); + ret = sx130x_field_force_write(priv, F_RADIO_B_EN, 1); if (ret) { dev_err(dev, "radio B enable failed (%d)\n", ret); return ret; From patchwork Sun Jan 6 08:37:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 154841 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2355605ljp; Sun, 6 Jan 2019 00:38:54 -0800 (PST) X-Google-Smtp-Source: ALg8bN6Cja3iEe0jRNX0If2OtGhZF/E9o1ZZ9xsK64hXr7iIpxe65Z4uFh4ePQSyPF4g9Gkc4Mze X-Received: by 2002:a63:ee0e:: with SMTP id e14mr6950288pgi.8.1546763934513; Sun, 06 Jan 2019 00:38:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546763934; cv=none; d=google.com; s=arc-20160816; b=VgYYCPqFrqwwfZTEHrTt7WmsFdisdNris3Yi2XQq7jKyuajIvI6F+h2vE4++pyNNls uMEZkpjd8yf3cxslNEAw9fo67+2IgDfWeyV++V/gxMnvio0ADZXntatie0Nua2rf8dCZ QwL7M+bS6wOcNXKw1pVTICBd8riTIrUCI51nfHWX1R7zQ3Qq34Ughywc1ARxVL6BrZec KrwuISwnlLpR1I7ztZe4cnKGx/H0G6/gG5sSqQFNr9kbFTrJFFHclY9MiMrTHherH+R8 GrjF3MgDNALe0Mbg571McT9IfJG1MLoPpviNS/mJwXvvxnNHkWVd+/z9MfE8eSFec4ou LaBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Qsh2+O8yR38DfJUeWS7s6xOiJeGLQrnh719ELrMve2I=; b=h8VA6EPVppwsmgnTRs/fmDJblS95XvMqh/Ynxz7NcD5to9RICXkzYTghbznUPWrCB8 +2lAcqtdmRB0aEhFZjMfmsS0JIliFw8B73f9f42fuJsjVFO0EePJv4oGxcJbyKvTmlOy 5/7BhHZ4LU2dlW7MbILVlyLBBRDYj/xvJI7TjWewwGk6BKOCHIkZ1SnAZpkx1YFH3h87 p64I8kLs6HCVDgLzmcn4yegUsh5JHt5htD3K9ksqAO2NEpSWer4CxUSWxmAKzaQtsCx4 OEcaH7tXaJj7YegcI6R4qvBLuibi3QESoBrwerWd8cs4jZM6Cjtk3KndQ7QRJSSc8tY4 4h1w== 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 u188si19648615pfb.232.2019.01.06.00.38.54; Sun, 06 Jan 2019 00:38:54 -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 S1726449AbfAFIiw (ORCPT + 31 others); Sun, 6 Jan 2019 03:38:52 -0500 Received: from mx2.suse.de ([195.135.220.15]:57236 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726477AbfAFIiG (ORCPT ); Sun, 6 Jan 2019 03:38:06 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id CA9FAADF2; Sun, 6 Jan 2019 08:38:04 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-lpwan@lists.infradead.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Andrea?= =?utf-8?b?cyBGw6RyYmVy?= , Ben Whitten , "David S. Miller" Subject: [PATCH lora-next 07/11] net: lora: sx130x: Force regmap field writes before function boundaries Date: Sun, 6 Jan 2019 09:37:50 +0100 Message-Id: <20190106083754.6004-8-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190106083754.6004-1-afaerber@suse.de> References: <20190106083754.6004-1-afaerber@suse.de> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As a cautionary step, force writing out registers before calling helpers or returning. Cc: Ben Whitten Signed-off-by: Andreas Färber --- drivers/net/lora/sx130x.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.16.4 diff --git a/drivers/net/lora/sx130x.c b/drivers/net/lora/sx130x.c index bc2d4b1165d8..a0759e277574 100644 --- a/drivers/net/lora/sx130x.c +++ b/drivers/net/lora/sx130x.c @@ -315,7 +315,7 @@ static int sx130x_load_firmware(struct sx130x_priv *priv, int mcu, const struct kfree(buf); - ret = sx130x_field_write(priv, select_mux, 1); + ret = sx130x_field_force_write(priv, select_mux, 1); if (ret) { dev_err(priv->dev, "MCU RAM release mux failed\n"); return ret; @@ -359,7 +359,7 @@ static int sx130x_agc_calibrate(struct sx130x_priv *priv) return ret; } - ret = sx130x_field_write(priv, F_MCU_RST_1, 0); + ret = sx130x_field_force_write(priv, F_MCU_RST_1, 0); if (ret) { dev_err(priv->dev, "MCU 1 reset failed\n"); return ret; @@ -459,7 +459,7 @@ static int sx130x_load_all_firmware(struct sx130x_priv *priv) return ret; } - ret = sx130x_field_write(priv, F_MCU_RST_1, 0); + ret = sx130x_field_force_write(priv, F_MCU_RST_1, 0); if (ret) { dev_err(priv->dev, "MCU 1 release failed\n"); return ret; @@ -542,7 +542,7 @@ static int sx130x_loradev_open(struct net_device *netdev) goto err_reg; } - ret = sx130x_field_write(priv, F_CLK32M_EN, 1); + ret = sx130x_field_force_write(priv, F_CLK32M_EN, 1); if (ret) { dev_err(priv->dev, "enable 32M clock failed (%d)\n", ret); goto err_reg; @@ -708,7 +708,7 @@ int sx130x_probe(struct device *dev) msleep(5); - ret = sx130x_field_write(priv, F_RADIO_RST, 0); + ret = sx130x_field_force_write(priv, F_RADIO_RST, 0); if (ret) { dev_err(dev, "radio deassert reset failed (%d)\n", ret); return ret; From patchwork Sun Jan 6 08:37:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 154839 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2355416ljp; Sun, 6 Jan 2019 00:38:32 -0800 (PST) X-Google-Smtp-Source: ALg8bN6WpDdWtevmux+zDHTxhJS/76GZv/sFiKFeLUtErWlQ6YIo6lDiOQfyTDL91U9gtSYhoy8G X-Received: by 2002:a62:15d5:: with SMTP id 204mr59531752pfv.103.1546763912727; Sun, 06 Jan 2019 00:38:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546763912; cv=none; d=google.com; s=arc-20160816; b=u+47UjpWXk8kfgTPJSq3/nSWz2sl72BlM47DTgMKW5QVVN4qOysEEya9PuBdB+Hrgj prCUyFcKkqgxGATWGULk9v/qYUzL7CW6ZeIoNPXayB/jK08xvvLVQyM3jBdzyv4y9UvU Xlf11UQDBOJ0ISYozuV7g5KIrzEVx1/O2jke9yff0PLC/i7hKj1CmX1YuvEKCfCfB7HK zkMGYOWfriRG68zYMaPAjN5a0EdZE9qWk36CLIJNm9RgzOk7M+uSayxCZK0Y+cBEA6UT L+VUz2L/FcZdno+4qPsjOYYIkUvDeBlv2+nUFuZc1WRLunW4jyg58t7w5qVO9gGx3R29 RMPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=NybqibGkdsL6WToWcWCHBHGEz0mkO5FQpx1ym+GRWsE=; b=wrOLTfH5uPvwgOHeXoXJ+Dematu8OR04rbmIUudA4um03hcX638JMh+eOfV1WZhGpf W/hLXCVdUifluSnKgYdx+0PS1YmEeekbu2nQqx4dthQj7G7jaSGjP8FEfUaY05PC/lQg whcidFrzhPVlbM+bYi9FtLdVWHqJUsYZTWrlziRgIlEtS3VtGuR/g27kBadAHbRjvY4m otY+WFQrppp8h3aknabCJ7ivshkpRETwQk8hyo3svdlD2KU+CU/gEak8+WVlDzvJJYAP B+IsTXVTlZ7T0zGkoooNGLaUVe2KAL02T8eCqhKk59mJQVUq8rLc/PV8mZC2fLvZ7Jr1 qmzw== 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 w189si371857pfb.151.2019.01.06.00.38.32; Sun, 06 Jan 2019 00:38:32 -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 S1726665AbfAFIib (ORCPT + 31 others); Sun, 6 Jan 2019 03:38:31 -0500 Received: from mx2.suse.de ([195.135.220.15]:57222 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726538AbfAFIiG (ORCPT ); Sun, 6 Jan 2019 03:38:06 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 8FBE7AE26; Sun, 6 Jan 2019 08:38:05 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-lpwan@lists.infradead.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Andrea?= =?utf-8?b?cyBGw6RyYmVy?= , Ben Whitten , "David S. Miller" Subject: [PATCH lora-next 09/11] net: lora: sx130x: Mark AGCSTS register as volatile Date: Sun, 6 Jan 2019 09:37:52 +0100 Message-Id: <20190106083754.6004-10-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190106083754.6004-1-afaerber@suse.de> References: <20190106083754.6004-1-afaerber@suse.de> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org AGC status register reads should not be cached. Sort the volatile registers by number while at it. Cc: Ben Whitten Signed-off-by: Andreas Färber --- drivers/net/lora/sx130x.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.16.4 diff --git a/drivers/net/lora/sx130x.c b/drivers/net/lora/sx130x.c index 0a79548a7480..8bdd343a273f 100644 --- a/drivers/net/lora/sx130x.c +++ b/drivers/net/lora/sx130x.c @@ -123,11 +123,13 @@ static const struct regmap_range_cfg sx130x_regmap_ranges[] = { static bool sx130x_volatile_reg(struct device *dev, unsigned int reg) { switch (reg) { - case SX1301_DBG_AGC_MCU_RAM_DATA: - case SX1301_DBG_ARB_MCU_RAM_DATA: case SX1301_MPD: + case SX1301_AGCSTS: + case SX1301_RADIO_A_SPI_DATA_RB: case SX1301_RADIO_B_SPI_DATA_RB: + case SX1301_DBG_ARB_MCU_RAM_DATA: + case SX1301_DBG_AGC_MCU_RAM_DATA: return true; default: return false; From patchwork Sun Jan 6 08:37:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 154837 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2355301ljp; Sun, 6 Jan 2019 00:38:22 -0800 (PST) X-Google-Smtp-Source: ALg8bN6TyQlpB0HfEc/vso0rlS2BhKQHFOOlpyjoXIbTCNgDBvz6BOl/gLAikFpZq5/QlyIspNYp X-Received: by 2002:a63:c904:: with SMTP id o4mr7066774pgg.331.1546763902515; Sun, 06 Jan 2019 00:38:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546763902; cv=none; d=google.com; s=arc-20160816; b=muxwH7ps6FeyOx4TiqNE08FaJfj9HyVY7+D1GbkyNT6A6jkeuRRf/ZIC/RFHYSq1WI 0KOD1QP+WGwfUFdPgEnZC4LkXcCPeD3ALA0fO3zX4WUJIlhv1jfTZiK6qyt6HFHCO5x6 7vGVMGzpvJj/e+d7w0kkugcsdgXOksskynJzxDeUefoEMVCKulCNdmSh40NEZzRbZ/R8 ORXp8EaB98A5C+fmCUDdCDfIMG6YTP1JF3A1k+ObgY1UMNbNT2zY8d3dwz3J/X5o/bhc nWuGNwOeaG+DWYLDzfAuwSq949QWkqVk/R4rU80pSLK2ZUXNcMZIaJ4JYWgPIi6PHD+s 5RYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=mcV13OiDTc1zX2acq/W4J8GnHCqZ2RY46b7wGuH6/NY=; b=giMm5acyGgZqnjmd3Bv5eoC9bOUiSeBxLHfeuzQp3xSepOEPhmhKRYVPaJbOR/PvzV f6fovpyCeHbBQLet4jQREijBpIb992tCikVvwZqadzeSXUH8UmwMv0tPBnDt93OqUIWk WIrwAmzI64u+GfU3oe0Bg5NNrhiIqJi8SAlG/zsvju8Oc6a10yxSlFT/cxWbyNJh3ZCE 8qLs5ZtYl3DpJSwBxTJ0KOzY7qAdUSBLCOLznt24lq2vEuvWLDSxPlvn+f1CRy+bKF/J lunmlrBYmz5/4JBvbCXYyafzWQzgdP5+TPNZPEOWycxhHA/1Hugkf2tpABU92pW6qTVS Iypg== 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 1si58244217plk.296.2019.01.06.00.38.22; Sun, 06 Jan 2019 00:38:22 -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 S1726643AbfAFIiT (ORCPT + 31 others); Sun, 6 Jan 2019 03:38:19 -0500 Received: from mx2.suse.de ([195.135.220.15]:57230 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726548AbfAFIiG (ORCPT ); Sun, 6 Jan 2019 03:38:06 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id E630AAE83; Sun, 6 Jan 2019 08:38:05 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-lpwan@lists.infradead.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Andrea?= =?utf-8?b?cyBGw6RyYmVy?= , Ben Whitten , "David S. Miller" Subject: [PATCH lora-next 10/11] net: lora: sx130x: Mark MCU_CTRL register as volatile Date: Sun, 6 Jan 2019 09:37:53 +0100 Message-Id: <20190106083754.6004-11-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190106083754.6004-1-afaerber@suse.de> References: <20190106083754.6004-1-afaerber@suse.de> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For reasons as of yet unknown, this is necessary to unbreak ARB firmware version check. Cc: Ben Whitten Signed-off-by: Andreas Färber --- drivers/net/lora/sx130x.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.16.4 diff --git a/drivers/net/lora/sx130x.c b/drivers/net/lora/sx130x.c index 8bdd343a273f..76ce072a540a 100644 --- a/drivers/net/lora/sx130x.c +++ b/drivers/net/lora/sx130x.c @@ -126,6 +126,8 @@ static bool sx130x_volatile_reg(struct device *dev, unsigned int reg) case SX1301_MPD: case SX1301_AGCSTS: + case SX1301_MCU_CTRL: + case SX1301_RADIO_A_SPI_DATA_RB: case SX1301_RADIO_B_SPI_DATA_RB: case SX1301_DBG_ARB_MCU_RAM_DATA: From patchwork Sun Jan 6 08:37:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 154836 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2355295ljp; Sun, 6 Jan 2019 00:38:22 -0800 (PST) X-Google-Smtp-Source: ALg8bN6T85SXp5LashuXvx4OiUSrf2dFNg3wXG83oRERyUF7taMyy8fttUnIPzRmCADWmjUIfIAV X-Received: by 2002:a63:c141:: with SMTP id p1mr26168847pgi.424.1546763902157; Sun, 06 Jan 2019 00:38:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546763902; cv=none; d=google.com; s=arc-20160816; b=TNj2CsVz6fJ05Fvk8O1h1WKQm27ChvI3isURp2n93GtbXnDOupP8V6u3nhxEE//Ojs iAM2B/8eS0K9UbSk7C5c28Y/T2F8IdYjS9Lk95T0KEKLz0tqIw56PtWdmJKziM2VFeTm HAJ9ED8t4khdLyOhb9wLo90QeaPwsGrNQao1NG+rfPSVVqDJkmzbLGaKMsf0jNs6Bm55 YLslUHuQ9xJsLTKYkuEbDhzXjZCJuU9THnUM5xR27ItLpfboYvboFupH0f087kBK0b0v 6ccIqZ25r0i490xEMOgC1wNYRP3A4NXnwWobQzaZoMajTnC6b0HdlbI7+GV3KvBeN4j7 OdnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=YBh5THtxYlb3NHsuE4AhncIR1Dw5MQC32Dd3DBSopH8=; b=Qr5YRmQwRBbxuSiWQFABbMtSk/uXYgeJX60/MW5zxhDvSpWtOX3b8eM+vzYMQYuyiK KtEWD8iPcSymQh4NAMesQG6PEPuKvalQoVEJJcm92rHTHz31WKzr2uxK64QGrWRXtYt+ N0wh0uEo04ON6D9jkWZZf6LhqQrKOSuiWeDcY5F1Z9mPsXEmkevbq7QFzruoslVw3BUr JupT7mHjjMaWX6JnbC8XxaUtTi0hfesbYA0OjtG/EhwfYtSJvhoXfZb1Sn/TxqBcBx0O EWUzh0sqKL8+2EBuoGgOl+GLZhy6+jfP89daRfNBeL7EpnotcQyrLCYOLttA7uqvp1va G0KQ== 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 1si58244217plk.296.2019.01.06.00.38.21; Sun, 06 Jan 2019 00:38:22 -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 S1726624AbfAFIiO (ORCPT + 31 others); Sun, 6 Jan 2019 03:38:14 -0500 Received: from mx2.suse.de ([195.135.220.15]:57236 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726568AbfAFIiH (ORCPT ); Sun, 6 Jan 2019 03:38:07 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 4C413AEA3; Sun, 6 Jan 2019 08:38:06 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-lpwan@lists.infradead.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Andrea?= =?utf-8?b?cyBGw6RyYmVy?= , Ben Whitten , "David S. Miller" Subject: [PATCH lora-next 11/11] net: lora: sx130x: Enable regmap caching Date: Sun, 6 Jan 2019 09:37:54 +0100 Message-Id: <20190106083754.6004-12-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190106083754.6004-1-afaerber@suse.de> References: <20190106083754.6004-1-afaerber@suse.de> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org To fix performance penalties compared to pre-regmap field code, enable caching. Note: This has been tested to not regress on spi-gpio, with no improvement on spi-sun6i for clk_prepare() locking issue. Cc: Ben Whitten Signed-off-by: Andreas Färber --- drivers/net/lora/sx130x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.16.4 diff --git a/drivers/net/lora/sx130x.c b/drivers/net/lora/sx130x.c index 76ce072a540a..2fb18d0c9db5 100644 --- a/drivers/net/lora/sx130x.c +++ b/drivers/net/lora/sx130x.c @@ -162,7 +162,7 @@ const struct regmap_config sx130x_regmap_config = { .reg_bits = 8, .val_bits = 8, - .cache_type = REGCACHE_NONE, + .cache_type = REGCACHE_RBTREE, .disable_locking = true, .read_flag_mask = 0,