From patchwork Mon Dec 2 10:30:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 180588 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp5011986ile; Mon, 2 Dec 2019 02:31:06 -0800 (PST) X-Google-Smtp-Source: APXvYqwxNVZEqbSvo3Ka/cOHf2y5zCrRfuOBNKlloXJlq/SNMKmCFOdagfeV243WzGk7O708r6cS X-Received: by 2002:a50:dacd:: with SMTP id s13mr5358536edj.194.1575282665833; Mon, 02 Dec 2019 02:31:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575282665; cv=none; d=google.com; s=arc-20160816; b=lzR8lvEBHM4SdEVnmiuoA4vPZI32U3aHnSdQJuqVrdCC/w3kf635Jlsjrs2MMvOEaR ZMrfpLJxU7g538OmQDtfl5bJL/Ye94EHpbCRHt/b84QZZdKMNC9VxaixlSOmClvH17tK IQQtyj+6mBemAltA6vFWpZH+GbZ56I62930k3ryBGQ0ioG/LadEKs3eQHA2BBZ+iLpr2 eUHzRvAq4OPBib3kyR2PZ3SesUzB6sTi6LxGnGzDOYlLMNvUYFpzS1jghgCQcSFIXX5f c0dnLFme5w6TVnYLeLa4M6/kAcJZxqvVgUwPsthyHAVNlp8trXRtvPL7F+ZZXYXgmJh8 oMuA== 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 :message-id:date:subject:to:from:dkim-signature; bh=hCYfmL1/wCJrAvT+ACq87WMwGG7+rMaHvrzSdRlqSHM=; b=GWpy7cFkPZDpxdCj+xCIUts1e2421KfASATYA3N9DGqNhrvkKOQS0PLolC+JCupthC XNoTJvu6lrqnrb4fSlFG6qvsY4W8Z6FNtWB8QPkwlFnrqjboFWPUv9jlWGf8c+iXOj5L pScb/gbeb2KedJ+Okhm/vJs1E4E48QFkyZ+08Btk8tNdLThLZhvQr2U8JgDM4KgHYxNB HegOcNDmS3EnFAALJCxWDFKw4yIphQS09r5m8oYX52Uv23M6d20QV8Ik5IGb2xBt6eS5 /iID69i8TMZyPUazfcLKamitelEximz3Ez9iVz++M6GehA+KeoXw9sdqiu3ZRiNfadGS n0+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="mD1bHEp/"; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 e21si4015152edq.191.2019.12.02.02.31.05; Mon, 02 Dec 2019 02:31:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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="mD1bHEp/"; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 S1727298AbfLBKbF (ORCPT + 15 others); Mon, 2 Dec 2019 05:31:05 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:51830 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726678AbfLBKbE (ORCPT ); Mon, 2 Dec 2019 05:31:04 -0500 Received: by mail-wm1-f67.google.com with SMTP id g206so21195963wme.1 for ; Mon, 02 Dec 2019 02:31:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=hCYfmL1/wCJrAvT+ACq87WMwGG7+rMaHvrzSdRlqSHM=; b=mD1bHEp/B8H6GN9AeiZIX5POlpTSpygz9avrY37hOfgPDxtmJcCUNT+CxdsiehAsu7 Bb9ltFeUR2qIG3sDitfpJ24oxFMolgOlQhen7R+m/9mOpvkdZRskty5Be+KHmUh3HuFd EQkzye6DGgLZPpstHBeT4vOkyiKPRRX8v6lAYOGqGsxm7O4gnW9YmndI49Jr0GRAiX4d YavfxdSBbuQG7C8U6Wn6tsHsN2tFKqCuy7kL7ktugJmio/7up83D4TqtVBhZrK/eufug o/mAc0nWtedg9NbGabK/8SU+bfEclnxshsE/WyJGX1+iRWxgestj65JHzaka6Mdv/j6U jDwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=hCYfmL1/wCJrAvT+ACq87WMwGG7+rMaHvrzSdRlqSHM=; b=FVOCujS0SvKvVUVH88kGN6Zx8S6WUppWhhZNmnFT1SbGxSNulQ4BdDf9RJjMoZ0lU7 R1o6HEpGkhXJRlma4zIp/TQalLvEF1FaWxHAk65+Voiw03wqDYDBqT1tYvvQ4Xenmizc MnFkAY/7GE20Qp478Se0x0kiaDA6oWDryBitNjR+g1lO+W698B1JmwxF00mWpGe3Rqv7 hgFetNoWSz9l07qJgp+KogjtrU3dqeXIRtCJK6q49b/IlRt6ts19hS0pZpG75Sdy9rAn QHE2gCv5t5s/X/195oQ8YvEMyNMr+QifBI5NSq7rcI607D991DG2TYE9BuJy3+XXHaP/ GLhA== X-Gm-Message-State: APjAAAVJMErVMgScRjq08/iosOmjjfs4ncSIEuo3V5VXFM3U3ma+GJ4j Db59v11Lst6KpDuU7koQYrOkicTBtg0= X-Received: by 2002:a1c:e90b:: with SMTP id q11mr27102637wmc.125.1575282661938; Mon, 02 Dec 2019 02:31:01 -0800 (PST) Received: from localhost.localdomain ([2.27.35.155]) by smtp.gmail.com with ESMTPSA id r6sm26402860wrq.92.2019.12.02.02.31.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 02:31:01 -0800 (PST) From: Lee Jones To: stable@vger.kernel.org Subject: [PATCH 4.19 01/15] clk: at91: fix update bit maps on CFG_MOR write Date: Mon, 2 Dec 2019 10:30:36 +0000 Message-Id: <20191202103050.2668-1-lee.jones@linaro.org> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Eugen Hristev [ Upstream commit 263eaf8f172d9f44e15d6aca85fe40ec18d2c477 ] The regmap update bits call was not selecting the proper mask, considering the bits which was updating. Update the mask from call to also include OSCBYPASS. Removed MOSCEN which was not updated. Fixes: 1bdf02326b71 ("clk: at91: make use of syscon/regmap internally") Signed-off-by: Eugen Hristev Link: https://lkml.kernel.org/r/1568042692-11784-1-git-send-email-eugen.hristev@microchip.com Acked-by: Alexandre Belloni Reviewed-by: Claudiu Beznea Signed-off-by: Stephen Boyd Signed-off-by: Lee Jones --- drivers/clk/at91/clk-main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.24.0 diff --git a/drivers/clk/at91/clk-main.c b/drivers/clk/at91/clk-main.c index 2f97a843d6d6..b29bc7ec2ef9 100644 --- a/drivers/clk/at91/clk-main.c +++ b/drivers/clk/at91/clk-main.c @@ -162,7 +162,7 @@ at91_clk_register_main_osc(struct regmap *regmap, if (bypass) regmap_update_bits(regmap, AT91_CKGR_MOR, MOR_KEY_MASK | - AT91_PMC_MOSCEN, + AT91_PMC_OSCBYPASS, AT91_PMC_OSCBYPASS | AT91_PMC_KEY); hw = &osc->hw; From patchwork Mon Dec 2 10:30:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 180589 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp5011994ile; Mon, 2 Dec 2019 02:31:06 -0800 (PST) X-Google-Smtp-Source: APXvYqwaLhacDz+wlViUf+9FEW9ajNxCCy6Wf+hjYQV7PLrkEnzGtOX11WWoUFxAWxfRx8fDkytR X-Received: by 2002:a17:906:f245:: with SMTP id gy5mr33946232ejb.225.1575282666630; Mon, 02 Dec 2019 02:31:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575282666; cv=none; d=google.com; s=arc-20160816; b=InjAguiRk+8czqIRcXByrD6SHP5A0vQAYL01i65ma7N2prnHY/6SZMtWEoOaXgcGNL /s4SjVvI1bxH1RQSAjo2TGWw9IKlVZsG1/Apbxe2lnIcmzQT+LMVQGsvCovGZBAxtK5c MSuuTAWzrIACV8AOp8f0u5DdA2bFH3FVHsN8hsSv5xWVxQyvKN51POHaqXty9/yDk8e9 Rhwx0w9nMNxLRdqjfwZ61dYbNcnFhyRnL5F0AmJSemMwWLqZCkMUOOOqSk5CNu8wS3V9 kImAgHrVTAEcSggo5jSbD+Oaux0hVFxfVYp3k6caBJVzR+wpl73B8jlEYmV6YGLGtVve B8Og== 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:to:from :dkim-signature; bh=zr96crpOCB+hjaopjnY9IA7TtFLCsfoyTiLDSqWQNJg=; b=ldglPsJBh82xU9S3EfFBonOyFRi8OiZp/8K9RCftFiKc8rrNBIqrT3a6qlPjrl8Vrd jqtvkzRqfY+0ECp0SgrP/kC+y5OrSSdT9nl79LEUjI88HEM+TT/4fgQjqVRRP/LV+nHD Pa24qcp4XW/FTsqVAtm4w8vEQwicnYlOn/R+Uo861C4vZ/ulKHp+SdGWv1asrSr3rXEh 2tbrXLACliBMbRkbwhUaU/mVnHvD6pEWVOPwR+HcodCKfEXvr9WJo2iMyrhOwk3xHBAt Y6zv6lsJ22dQ95xzt6E6mAKxWTmEPDoEE7srvglQWI82AkUtRFXFpIleM0dSZJKve3WH kP9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Aw3QF6HO; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 e21si4015152edq.191.2019.12.02.02.31.06; Mon, 02 Dec 2019 02:31:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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=Aw3QF6HO; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 S1726678AbfLBKbG (ORCPT + 15 others); Mon, 2 Dec 2019 05:31:06 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:32887 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727049AbfLBKbF (ORCPT ); Mon, 2 Dec 2019 05:31:05 -0500 Received: by mail-wr1-f66.google.com with SMTP id b6so13899130wrq.0 for ; Mon, 02 Dec 2019 02:31:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=zr96crpOCB+hjaopjnY9IA7TtFLCsfoyTiLDSqWQNJg=; b=Aw3QF6HOx+SsIWiQr5Xl6wFB7jA+iNUAyGUkJxS+gRXwEY9969iYx56wYgECkhtAI1 He4wl/brIOVkuzGmKRGNWrJPLfQ2kH22pGZrSj4xxILirRZH3cG5/a3R07FxMYrpKUh+ z413P2ahOsqK2FvBDKSN/F7x3ktlkate51PQTHaelgU0yQLHps2RWzeo14/kwNbIV57+ xxWD/8XWWZYcfUO+e7Ujep6MPkP3Y6+JCoHqf9NHY5Ean95+3CHmiuSKOj6MGJijnHYH 0HYjb8KHtXoug5L5/Ul36psvpxNxNbQG6oRVA2UJ8kg5vOj9LLdthtWIkUw2WYvK+JSM 4gMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zr96crpOCB+hjaopjnY9IA7TtFLCsfoyTiLDSqWQNJg=; b=nIFYg7NmQarLOBCUdxYFG6j++55hJutSKhDh+JooDKDwzFre8vqNrbtGR5ibE1MpSs HSleXQFSR6oz0bFkv+IkqbgItQW5M8om14auSs4BT0ez28QeevXmKuRQNgIwWny4YLqu rJbpbsLhMJysBRHVlsM4MO8tMBbbtOIBHSkqps+urQU8Gr+PQv583FdI9fG20pfx8iSF tbWx2D/GTKsA72ystpX1pZ5k3W1/NQjCn307bC29bpFjteyjBsw+VGPpe20R2YTjNZnw Oy10N6GlXh25A/QKm93UWjPmcvC9xay2taHYBk6CcJ3IIYpyIfqMdbnM+6Pih4A35A2A Ebtw== X-Gm-Message-State: APjAAAUqmcRXdPxbpd80auFXTgmTBufz/9IFm7rhz6dFVRgzNHJTumZl lo0ocexbin9ApUMcr7x0OywKizuFxcU= X-Received: by 2002:a5d:5403:: with SMTP id g3mr16765783wrv.302.1575282663783; Mon, 02 Dec 2019 02:31:03 -0800 (PST) Received: from localhost.localdomain ([2.27.35.155]) by smtp.gmail.com with ESMTPSA id r6sm26402860wrq.92.2019.12.02.02.31.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 02:31:03 -0800 (PST) From: Lee Jones To: stable@vger.kernel.org Subject: [PATCH 4.19 02/15] arm: add missing include platform-data/atmel.h Date: Mon, 2 Dec 2019 10:30:37 +0000 Message-Id: <20191202103050.2668-2-lee.jones@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191202103050.2668-1-lee.jones@linaro.org> References: <20191202103050.2668-1-lee.jones@linaro.org> MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Philippe Mazenauer [ Upstream commit 95701b1c3c8fe36368361394e3950094eece4723 ] Include corresponding headerfile for function at91_suspend_entering_slow_clock(). ../arch/arm/mach-at91/pm.c:279:5: warning: no previous prototype for ‘at91_suspend_entering_slow_clock’ [-Wmissing-prototypes] int at91_suspend_entering_slow_clock(void) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Philippe Mazenauer Signed-off-by: Alexandre Belloni Signed-off-by: Lee Jones --- arch/arm/mach-at91/pm.c | 1 + 1 file changed, 1 insertion(+) -- 2.24.0 diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c index e2e4df3d11e5..b4a9ac3061b4 100644 --- a/arch/arm/mach-at91/pm.c +++ b/arch/arm/mach-at91/pm.c @@ -19,6 +19,7 @@ #include #include +#include #include #include From patchwork Mon Dec 2 10:30:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 180590 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp5012037ile; Mon, 2 Dec 2019 02:31:09 -0800 (PST) X-Google-Smtp-Source: APXvYqzhZFaQX0DLYCxftPpv4oNSzk0rw7gELvBYu1EuDUQmz4tSeoEKPVTyu3sGTjAdSp7g2vl5 X-Received: by 2002:a1c:2383:: with SMTP id j125mr22442332wmj.87.1575282669162; Mon, 02 Dec 2019 02:31:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575282669; cv=none; d=google.com; s=arc-20160816; b=wp/DuMIATJ6TKiiyrlv+mG+4jd6BSWwtGMXA+ruJtOR00hSZtPw55KDcpDyAyMKjhr mcIoPXFTUlzUAnpIHsN4uaIDxHAutzrPpiK9ndK8GBQ6rQXw6vaeCJwXNWw8/zGkCRQS v3adjWintZI6hk05UPDQUFghubJVasquOlP366X4x1+XcjO3FZzE/F3m86srng+ng/FT rhqxqF7DnTZj2gf5gpTiG2RDSQSdboFe+X2f3d/RzGT7+9vL+Kl9lIBSpSRZpYKhl/zz 9/3JoZTQnRYYcQsP48KvOpShZL3zjH/oogGFUoHdJRqNS6eeXylv0Kmk5MyeuHX1D3Du ddBg== 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:to:from :dkim-signature; bh=BVWjviiOfMrA2E5Cbz2YP4jWsTNfITZ1DLy7ZHFYwdc=; b=AfX+wXsh1ZwLiYFe+c5h92WDFk2Y9Yy4t9ZpeKKoI/D/c2ZeTXVR6c6FcerMJIyZkM cQx0eNyVD2hB/M7C6czGO7Q9p423gzO2fuf0jYW8aIgtJyxPmr1qgvcXLomvfIYJhKJX jTZiN/VM3LGFfMEYvtkaqH0uF11qxIpk2169gMBovgoXVzVEhfhlKX6rHTHWnGGn16EK 1sP7VLb29gEh6l+dgUZCujLFLfm7uyY+TRDNw9qLA29c5vUfRZUoJvp3gYED+lYXBtis MU5FqorKSQlBrZHVwaOLcayHF/+ZIVcX6gZqwGFsekMwY1CuxB/uh1d8u0CMQtVgAD2q Lg5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=i5e9Ou6I; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 e21si4015152edq.191.2019.12.02.02.31.08; Mon, 02 Dec 2019 02:31:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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=i5e9Ou6I; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 S1727385AbfLBKbI (ORCPT + 15 others); Mon, 2 Dec 2019 05:31:08 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:36402 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727049AbfLBKbI (ORCPT ); Mon, 2 Dec 2019 05:31:08 -0500 Received: by mail-wm1-f68.google.com with SMTP id p17so16691997wma.1 for ; Mon, 02 Dec 2019 02:31:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=BVWjviiOfMrA2E5Cbz2YP4jWsTNfITZ1DLy7ZHFYwdc=; b=i5e9Ou6IzjKBJly4mAbQ5nR+a7LhRa+MC8FRy/8TrhJ7Aw33IdKR04qCVdTuR7F2t7 s7meJ8o4MupZhe1Edlzq+tmgwdo9CPocpCN/zCXyE+9+cf8B1unJSOQLrJKrfSh1Bhms Rti+d5QHHkrZyjQRTMmIKgMSdP0oBevFriLW5IuSAahd6hlwH9xcWvuGe9Ut8RJrSdwU UxXqXGsL8S96qh9Ysvnxweae2c6Fof2OATd/HJIgUJFERdQE5yV0Oed46tk1+BcUKqdZ OfoBz0EIb+ynorqaXVyBbIGzQwIXphpyHcA9JTmBr9w7jvNcgIyFzj1+Tioz88tTgELc sacQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BVWjviiOfMrA2E5Cbz2YP4jWsTNfITZ1DLy7ZHFYwdc=; b=SYbjWW2ub/SYSpIERguz4xsqLt9YBXgoNNbdPigy7GMTYyCuzyzPtldVU/vPA42laF UAWQs3MM8/gPotvCAKeEd/iVji2uWEQ0K2LW/QS3v7c6WoxOw2dzRfS1BiR/8cQswmr7 q3UthsG6WzjBDrl0Me+HWFbpMiCHHZujoiUOW1iHoDgJfhP3mAcjb+eSD/trj0flfv4u MqdqkSqDxbbhJFQbt0o2LGlOOj8FZJVSKyoYS/dV8qik6UFMpWeMkf3ZsqJx2t/UyjVS 40krxCXZqVvV/9FaJSWuwDtarHcAY1itObUCrxw0F3kwhcmR+Ci4tAksL96UmBWpKvaf 3IVA== X-Gm-Message-State: APjAAAWHulJ9cURGrBe4/It1AbkaJ2E5Q1oIzyFU5z4xdrzJywxR7Fws cmaAD7Xb9Kbcve/Z2EMlQif0KYXrxZw= X-Received: by 2002:a05:600c:290e:: with SMTP id i14mr27114833wmd.126.1575282665634; Mon, 02 Dec 2019 02:31:05 -0800 (PST) Received: from localhost.localdomain ([2.27.35.155]) by smtp.gmail.com with ESMTPSA id r6sm26402860wrq.92.2019.12.02.02.31.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 02:31:05 -0800 (PST) From: Lee Jones To: stable@vger.kernel.org Subject: [PATCH 4.19 03/15] watchdog: sama5d4: fix WDD value to be always set to max Date: Mon, 2 Dec 2019 10:30:38 +0000 Message-Id: <20191202103050.2668-3-lee.jones@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191202103050.2668-1-lee.jones@linaro.org> References: <20191202103050.2668-1-lee.jones@linaro.org> MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Eugen Hristev [ Upstream commit 8632944841d41a36d77dd1fa88d4201b5291100f ] WDD value must be always set to max (0xFFF) otherwise the hardware block will reset the board on the first ping of the watchdog. Signed-off-by: Eugen Hristev Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck Signed-off-by: Lee Jones --- drivers/watchdog/sama5d4_wdt.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- 2.24.0 diff --git a/drivers/watchdog/sama5d4_wdt.c b/drivers/watchdog/sama5d4_wdt.c index 1e93c1b0e3cf..d4953365dd9a 100644 --- a/drivers/watchdog/sama5d4_wdt.c +++ b/drivers/watchdog/sama5d4_wdt.c @@ -111,9 +111,7 @@ static int sama5d4_wdt_set_timeout(struct watchdog_device *wdd, u32 value = WDT_SEC2TICKS(timeout); wdt->mr &= ~AT91_WDT_WDV; - wdt->mr &= ~AT91_WDT_WDD; wdt->mr |= AT91_WDT_SET_WDV(value); - wdt->mr |= AT91_WDT_SET_WDD(value); /* * WDDIS has to be 0 when updating WDD/WDV. The datasheet states: When @@ -251,7 +249,7 @@ static int sama5d4_wdt_probe(struct platform_device *pdev) timeout = WDT_SEC2TICKS(wdd->timeout); - wdt->mr |= AT91_WDT_SET_WDD(timeout); + wdt->mr |= AT91_WDT_SET_WDD(WDT_SEC2TICKS(MAX_WDT_TIMEOUT)); wdt->mr |= AT91_WDT_SET_WDV(timeout); ret = sama5d4_wdt_init(wdt); From patchwork Mon Dec 2 10:30:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 180591 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp5012054ile; Mon, 2 Dec 2019 02:31:10 -0800 (PST) X-Google-Smtp-Source: APXvYqzPlC+KzgXqqpJHCaH8XZVtJkP3XhYDR2pOLAzy9jHT3jRNNgn6YV8M3y3m8sV2m7R9ZlwE X-Received: by 2002:aa7:d48d:: with SMTP id b13mr22489166edr.246.1575282670135; Mon, 02 Dec 2019 02:31:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575282670; cv=none; d=google.com; s=arc-20160816; b=GriMnYErtdZRkZ2nsfcBNNRpK1HtgARkGXDPvojZxhuLaafDjWoS0bSfCf4T/KJ+0O NjO3MKYur+UZUXSjUyQsiTBFgs5QULzKP0M2PjpqqvdkSOWF2UyiIHCsdcH6Yu60daA/ bdSHj2RgIpPa0fWQyHFMwUkyByI0mwYya7r4o9sbWbjcLZ4PGfOCh0f8MbhC28XoOsrG P6EeJMVJLn9KaCxbGGTI0h0QLLbuYj4f1h8NOJbIrmlR1ZMevcqSSRGHSTIVr9ra0y5R mxkkYHIgqInoycKxqrLKf3w3qHb7cOzMycXDgktt6rCPwr6BMphRfWxTILeLv+Dr1vcT KUng== 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:to:from :dkim-signature; bh=u3Ch75wUUvhwXD3EeMuBMicQ6oTRlT4EyUjisae7FTo=; b=QvE64sqq2zFNm0Exu4IK2BeGvd1ZKVHtJOpppiIJev1PHqB5FaNOwQzTTe2PDoE1gf GOq0939S3bu7AjbweSsHaKGxC7iFoUh5mb5iFPqCkdt+bXBIuJLJx842DL+PaM+yncWA VtQuu99mqbujs3cRRjjbZKuAse7E2Uijfd0pvN5AbNKzKI3fObxPMG8/weAedh4ohRXE 9EaRXk9I3Dfq8D7nmjFhVOHJqFbD8XX+/g9PQBqpXfNzzvCynVpNfW/SgOBO9JS/Cnts vVswagyvdWwUlcvA0Uw+VGF8BxXDAG5ZTtnZvSopiVQRpz60PbQ55PGcAgKoM3pKcfs2 J7ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="sWn/wz7g"; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 e21si4015152edq.191.2019.12.02.02.31.09; Mon, 02 Dec 2019 02:31:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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="sWn/wz7g"; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 S1727049AbfLBKbJ (ORCPT + 15 others); Mon, 2 Dec 2019 05:31:09 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:35732 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727366AbfLBKbJ (ORCPT ); Mon, 2 Dec 2019 05:31:09 -0500 Received: by mail-wr1-f68.google.com with SMTP id g17so11474732wro.2 for ; Mon, 02 Dec 2019 02:31:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=u3Ch75wUUvhwXD3EeMuBMicQ6oTRlT4EyUjisae7FTo=; b=sWn/wz7gXCkWA6ZW52w4XXPfmqi7tUX6NPd0Bww9Gi4bdk8d1CKRCp2q1RcdIFGLNP Z798RoSpCXj/FQZJy5kC7hc3RyFIRHCMYYvu1rL9fq6ONvSmX8achhpguE8QF2SAskVC eWPA67O+OxVZ9+mjK2JTfPCGxJUN7pOvI/VTrJ/Ly1sUPWd90cKad+wc6rhLegasuTPv s1pmddKrlhGnZ7z8mE0eAiqEjRUHAwvzUhfKR4sSwddYZ9BwoUW/DWH6JHOuvfyk8gdl vsI8tTWNMqlPAHyhTMPtzqxfoGYBBGzt0ArRdsGo93bj2DAOmao++mVdR1JEpbHOLllT SqYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=u3Ch75wUUvhwXD3EeMuBMicQ6oTRlT4EyUjisae7FTo=; b=TmL/0oxbIlGRVBIz9mFzsizQ3mwAIBEIB63me7IDPlgStDfu8jua0XnBB2lcMCd437 XNvCNd0jlKaai2gFrPrVJGuDscOI3mpSYmCfXmxtXYooaI/Tkhqd1L+BUs+OVzCorgr+ 5DrjUHmJJZvvB87uC4Pu+P9a8JlvhObenDRlJ+yKKBlhzK/mXIgM55TAJ8lEyGUXlru7 l0yIXxxiNKWCFI6+QJ3lFY7fataNxQx4tlN1J7eX6q5hKbKEEg+RZeBxhBi0UgvnHqBH rS8AX4HR6a7EuTsdWksyPKTDd6xakuq3eWHIF7Rb6PVRX0W1KA4ntmHi9xN6ot4I3wUf qYDQ== X-Gm-Message-State: APjAAAWn+dRG1Mvzino5zSott618++YFhJYY+GP8YSqEly35RSQQA7K1 8OArZzwJCooS8VuRdBJtBG6m4U7ztpc= X-Received: by 2002:a05:6000:1047:: with SMTP id c7mr15716708wrx.341.1575282666772; Mon, 02 Dec 2019 02:31:06 -0800 (PST) Received: from localhost.localdomain ([2.27.35.155]) by smtp.gmail.com with ESMTPSA id r6sm26402860wrq.92.2019.12.02.02.31.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 02:31:06 -0800 (PST) From: Lee Jones To: stable@vger.kernel.org Subject: [PATCH 4.19 04/15] drm/atmel-hlcdc: revert shift by 8 Date: Mon, 2 Dec 2019 10:30:39 +0000 Message-Id: <20191202103050.2668-4-lee.jones@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191202103050.2668-1-lee.jones@linaro.org> References: <20191202103050.2668-1-lee.jones@linaro.org> MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Claudiu Beznea [ Upstream commit cbb32079149dbf557fa3f7bab8fa3c5fec857da7 ] Revert shift by 8 of state->base.alpha. This introduced a regression on planes. Fixes: 7f73c10b256b ("drm/atmel-hclcdc: Convert to the new generic alpha property") Cc: Maxime Ripard Signed-off-by: Claudiu Beznea Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/1556195748-11106-7-git-send-email-claudiu.beznea@microchip.com Signed-off-by: Lee Jones --- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.24.0 diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c index 04440064b9b7..e5b3ba73e661 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c @@ -382,7 +382,7 @@ atmel_hlcdc_plane_update_general_settings(struct atmel_hlcdc_plane *plane, cfg |= ATMEL_HLCDC_LAYER_LAEN; else cfg |= ATMEL_HLCDC_LAYER_GAEN | - ATMEL_HLCDC_LAYER_GA(state->base.alpha >> 8); + ATMEL_HLCDC_LAYER_GA(state->base.alpha); } if (state->disc_h && state->disc_w) From patchwork Mon Dec 2 10:30:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 180592 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp5012094ile; Mon, 2 Dec 2019 02:31:12 -0800 (PST) X-Google-Smtp-Source: APXvYqw1mEoba+5yzn/vNp+zLW5aEaT89cvLCAhCZ8/BhdVLRbyOxvZuYlllGFUkoS3yvhDuE0d3 X-Received: by 2002:aa7:d48d:: with SMTP id b13mr22489365edr.246.1575282672443; Mon, 02 Dec 2019 02:31:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575282672; cv=none; d=google.com; s=arc-20160816; b=ZthKh2GIetSEJ3igHZEV9CQWwUigO6buNioCiUZtnFWW15oiZpA8oZ1Z6Zs8Hn//s5 Cu8kwOy3q7d1OB9hDgGxvgPHUlphg5PohYSfgbLSIDkSllikYmS4tUVxQzuA2F7rH/nd 0mUE+YFu7nw4ZoxDRZ6U0oCUqmKLPqN5oGwY7mJvH4E20zKpvoRuWwLwF1gWpUJcVww3 Kqvox3Nfa7UF260RKqgIOCYHdggdKYoxCSsr6w0WFncP/iGy0Zr+BQAst5nYrzSChuG+ wJDaqLRW9pvOfR8xkdNJ0K8oyCk5+lhB5ilYZoJqPN/TvZqgKlNdI7KZClSC5irEUQMc RQ9g== 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:to:from :dkim-signature; bh=g1aRXdZIL7DyaMdVPCxZFmg5TXh5yLg89o9u2qBK/18=; b=bNfupquXHWbU5nhrRsnaoy748N08aRSxfXuoOLjqelqmqf8HV3bU1Pj4mY6vypGzkB XLj+mmWVTqjhrvuFlXBspaHbiqxyJpPPE9UtLKm5bhblcrqpS50lvmDNh60DZohOR23t asEofQHo2hKy/yQ7eRt842vv4/FbZPJKwW2vQ1Bd75dUPFzIiVY4LEBKz2cHaSe6mtGg bMZXILqeWq9hg/wwu/LJRbURF+quyDUID8VsFUaApqTKUo3qzPnwC5JfUXihgxK08Zbz ArX1ffcr6M7884KcBS6vRPt6Qw00AWMp4ZRkSTotQlpZWKyOmBaOxLiz6TphWbE7Ub8n Rfww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="M/LUdfYX"; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 e21si4015152edq.191.2019.12.02.02.31.12; Mon, 02 Dec 2019 02:31:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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="M/LUdfYX"; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 S1726469AbfLBKbL (ORCPT + 15 others); Mon, 2 Dec 2019 05:31:11 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:33238 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727366AbfLBKbL (ORCPT ); Mon, 2 Dec 2019 05:31:11 -0500 Received: by mail-wm1-f68.google.com with SMTP id y23so10390822wma.0 for ; Mon, 02 Dec 2019 02:31:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=g1aRXdZIL7DyaMdVPCxZFmg5TXh5yLg89o9u2qBK/18=; b=M/LUdfYXDFOh+XWQ9Rid95XqG8HePYh04/nxkU3XAUPvAuFwwGmgoLU5b53xU6nLr0 DhunGG5IXWEzdT3cvCyC0/RcaycOyy6ZsMyAJCmem6ZQkXLMMcYsSuzezVR9jePR2LOO T+BiIIb9JfisxP0zSXTIBZeEVUBMrDEyWiVtYM2RBqL8tZpFQ4GhIQpdFGGijRMHCyNL nciSJ1vOxoUdR4XC1Js7PQLgQvjz89edO+QsPYRqrSXeZBf7PqQfh4HKO1cs0zytCEZF DtjT41hnHzuRnkan42rRHCHJFhAed5P/hKUCZxDDxF1JUTaof+Vp5i8Olylj3W9h7So6 dtsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=g1aRXdZIL7DyaMdVPCxZFmg5TXh5yLg89o9u2qBK/18=; b=iit6GvCHvCOapXNXE7IPfmjVOvR6llasOmlaE9rlwMpButuqHHdMjzYF3R51khTvV2 sWF0Tt6urPvEcYUM9rD5Mq3S5Z7PDCGay7thKPCaIRvyZdJ1WokHlLFcY8L2PsQaUzPu VL5C8TvDzAuj79kSDYbWFBG9FhQqMGJg6Kpw9XqDMYWODetc6mQ3Iy7rlaF0Ha2m7NrW jGOB9KUqBv/BA9sKugBttWpa5NRfrmm47MiSSg9XGrHx4PIUA02T91+r7Kb7jQeH62XS gczMTXCtoaQFySdPbTCWauBc1tTbRvqYOeKeXAL4MXeIh50xJZ/ZZncda0IVg7aQs0Lg 5v2A== X-Gm-Message-State: APjAAAUxFrDZyWEFxhROnV/+Az7UgKSqVpfnIO85qw+aZLWya4Xk/jcb cjWr02VJG62RM09osaDJjWGtpdOqMgI= X-Received: by 2002:a1c:7d92:: with SMTP id y140mr26772766wmc.145.1575282668811; Mon, 02 Dec 2019 02:31:08 -0800 (PST) Received: from localhost.localdomain ([2.27.35.155]) by smtp.gmail.com with ESMTPSA id r6sm26402860wrq.92.2019.12.02.02.31.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 02:31:08 -0800 (PST) From: Lee Jones To: stable@vger.kernel.org Subject: [PATCH 4.19 05/15] net: macb: Fix SUBNS increment and increase resolution Date: Mon, 2 Dec 2019 10:30:40 +0000 Message-Id: <20191202103050.2668-5-lee.jones@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191202103050.2668-1-lee.jones@linaro.org> References: <20191202103050.2668-1-lee.jones@linaro.org> MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Harini Katakam [ Upstream commit 7ad342bc58cc5197cd2f12a3c30b3949528c6d83 ] The subns increment register has 24 bits as follows: RegBit[15:0] = Subns[23:8]; RegBit[31:24] = Subns[7:0] Fix the same in the driver and increase sub ns resolution to the best capable, 24 bits. This should be the case on all GEM versions that this PTP driver supports. Signed-off-by: Harini Katakam Signed-off-by: David S. Miller Signed-off-by: Lee Jones --- drivers/net/ethernet/cadence/macb.h | 6 +++++- drivers/net/ethernet/cadence/macb_ptp.c | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) -- 2.24.0 diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index 9bbaad9f3d63..efb44d5ab021 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -499,7 +499,11 @@ /* Bitfields in TISUBN */ #define GEM_SUBNSINCR_OFFSET 0 -#define GEM_SUBNSINCR_SIZE 16 +#define GEM_SUBNSINCRL_OFFSET 24 +#define GEM_SUBNSINCRL_SIZE 8 +#define GEM_SUBNSINCRH_OFFSET 0 +#define GEM_SUBNSINCRH_SIZE 16 +#define GEM_SUBNSINCR_SIZE 24 /* Bitfields in TI */ #define GEM_NSINCR_OFFSET 0 diff --git a/drivers/net/ethernet/cadence/macb_ptp.c b/drivers/net/ethernet/cadence/macb_ptp.c index a6dc47edc4cf..8f912de44def 100644 --- a/drivers/net/ethernet/cadence/macb_ptp.c +++ b/drivers/net/ethernet/cadence/macb_ptp.c @@ -115,7 +115,10 @@ static int gem_tsu_incr_set(struct macb *bp, struct tsu_incr *incr_spec) * to take effect. */ spin_lock_irqsave(&bp->tsu_clk_lock, flags); - gem_writel(bp, TISUBN, GEM_BF(SUBNSINCR, incr_spec->sub_ns)); + /* RegBit[15:0] = Subns[23:8]; RegBit[31:24] = Subns[7:0] */ + gem_writel(bp, TISUBN, GEM_BF(SUBNSINCRL, incr_spec->sub_ns) | + GEM_BF(SUBNSINCRH, (incr_spec->sub_ns >> + GEM_SUBNSINCRL_SIZE))); gem_writel(bp, TI, GEM_BF(NSINCR, incr_spec->ns)); spin_unlock_irqrestore(&bp->tsu_clk_lock, flags); From patchwork Mon Dec 2 10:30:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 180593 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp5012147ile; Mon, 2 Dec 2019 02:31:14 -0800 (PST) X-Google-Smtp-Source: APXvYqy0saLgfDLPlpPJ+h7L5Z0/nq1FLZmYDNNO0LzqwilLIY/QL/tc6k8xnsFR4eFz0B+gV/BT X-Received: by 2002:a1c:1b15:: with SMTP id b21mr19857342wmb.104.1575282674696; Mon, 02 Dec 2019 02:31:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575282674; cv=none; d=google.com; s=arc-20160816; b=Y9WFgW+fiYmp81dpsr15ViC+5Ct7IH3dwuXTOqX9ZUHA6DQP9cB4Pp2Lebkifxqd7m l7PAT5Lp8YUFzPapVUBj8QOvxAlu0aCCos2WBESjEflvjO6UNaQcMF+Djf69BCiZB4qn y4UZ6Udj0+H/1Qu183F+IB7ya6A1gjt0qriZYQU31mJPsYafyvsBYtlOHK2kiiQ1M4C+ yKypx3ulWusWcpF1d0a0nYd9X3K81pVwhWghBiJIMzRFwTV7mpfahYDaR5K0plk5s9F6 ElWTSUq9VOI4MCgMrz42K+ehgkddYIwhO+ITbiKHWhidmV5pDgvsQ2SdQ0un7i3XlSkp bLOw== 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:to:from :dkim-signature; bh=mwGk83ys5wzg6iRWDi8s7AoiHaTu4B4X10LSHfqyk8w=; b=As3eCaua8JdmA3iWGqmD3Sa2ltF/nNzmmrWV3aYwhSuMqh/pymfDTQ3ARYHSTttcL9 LsSvObSeG1i8+EO+EDdqI3xukC5ltXjVLXKmylp35cBcbMYRGtnwtnWYAxY/6lq6bP+g 3p6uk92XffqwbV1XWPXL9oAUPmPkf4iNRZHqt8N5vhLDlG/AhydB96TASHLwqhymnlQS OUgMuBXh7Nt3D4yu4ySPw2MZZYbOL+gJkwz1WWmttaXfDvdlqP5tiCPCWoWqaE/8J/Y0 bCvPOCnd78WkaHyl0HZMbH4COGWkyQ2vTbKXR+kkuaATSQKuvu1yfDCb2u15PkSB23PJ fufg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Xbzty9L/"; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 e21si4015152edq.191.2019.12.02.02.31.14; Mon, 02 Dec 2019 02:31:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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="Xbzty9L/"; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 S1727416AbfLBKbO (ORCPT + 15 others); Mon, 2 Dec 2019 05:31:14 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:40070 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727366AbfLBKbN (ORCPT ); Mon, 2 Dec 2019 05:31:13 -0500 Received: by mail-wm1-f66.google.com with SMTP id t14so5034423wmi.5 for ; Mon, 02 Dec 2019 02:31:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=mwGk83ys5wzg6iRWDi8s7AoiHaTu4B4X10LSHfqyk8w=; b=Xbzty9L/X10yLpFPquKRyqRToOCooiNpWeoN2NgszE+xNlP5yTprOUlElPuc4oDgV/ OC7KYkBj8VuhrLYeBVSe93WnDA1EYPC0/dA+bHdACYnLrlEnzaPTb8bVQQQKpwZXIB6R NlmoG52MvfePxweymljb7ACZ/iqjNynRBp+vEfHigWhYLWn3Ak6RFeOcXNpr7BFCSzXS Gf7JdhMsL/WByFDgqHNUBzk+Qmdj6tTHTxfp1N52v0oHad6K3ebxvscpOYi6CH0ng61r JJ1T0S5y8WJzVkGDs8iWH9sQCnVooc0djduRd+jW+sjYAi6pRmM+kE+HpzqXKU8Q8ioI SkFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mwGk83ys5wzg6iRWDi8s7AoiHaTu4B4X10LSHfqyk8w=; b=hk7N5wBnX3UYqFK1R4EkZE3H8FfbeYCg430EqNKY0XCD7sJyelY/1ob5tK7T27iUVC XlRvPNpNePHyOHsvYLLI7Fgq2LDgQuf67NJQ6ADWRUuQAlZAvDseHGfjRKiIKvg5j5zo z7s4T8UcJ3tqCoqJL+YqAiCV3hHjV5J5waSJ45sCRHhUxcvXO9YEgiRtu7HXLo4Xx0jl iQgU9HRPD8m7wzewWRQKppluq5ciBSif3/bKcA0VyQpKbn7c3oIodZOutD5aMtOT4v0v QJlDGoB5VW8bYTVT/EBDi48nA+etxd6tV0Bb8I8GdHW7ArofD3uRHSvmruoaPBAk69xU WLlQ== X-Gm-Message-State: APjAAAUvLaMKXj1kSsvynkI0VFFABdlpjWQYGsJGcdh4xw8Xk+341jkZ +4P05adnX6vzCcRAZyo6pLEMjpi71NA= X-Received: by 2002:a7b:c947:: with SMTP id i7mr8328577wml.71.1575282671726; Mon, 02 Dec 2019 02:31:11 -0800 (PST) Received: from localhost.localdomain ([2.27.35.155]) by smtp.gmail.com with ESMTPSA id r6sm26402860wrq.92.2019.12.02.02.31.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 02:31:11 -0800 (PST) From: Lee Jones To: stable@vger.kernel.org Subject: [PATCH 4.19 06/15] media: v4l2-ctrl: fix flags for DO_WHITE_BALANCE Date: Mon, 2 Dec 2019 10:30:41 +0000 Message-Id: <20191202103050.2668-6-lee.jones@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191202103050.2668-1-lee.jones@linaro.org> References: <20191202103050.2668-1-lee.jones@linaro.org> MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Eugen Hristev [ Upstream commit a0816e5088baab82aa738d61a55513114a673c8e ] Control DO_WHITE_BALANCE is a button, with read only and execute-on-write flags. Adding this control in the proper list in the fill function. After adding it here, we can see output of v4l2-ctl -L do_white_balance 0x0098090d (button) : flags=write-only, execute-on-write Signed-off-by: Eugen Hristev Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Lee Jones --- drivers/media/v4l2-core/v4l2-ctrls.c | 1 + 1 file changed, 1 insertion(+) -- 2.24.0 diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c index 0986572bbe88..f4ebff347d7a 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls.c +++ b/drivers/media/v4l2-core/v4l2-ctrls.c @@ -1145,6 +1145,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, case V4L2_CID_FLASH_STROBE_STOP: case V4L2_CID_AUTO_FOCUS_START: case V4L2_CID_AUTO_FOCUS_STOP: + case V4L2_CID_DO_WHITE_BALANCE: *type = V4L2_CTRL_TYPE_BUTTON; *flags |= V4L2_CTRL_FLAG_WRITE_ONLY | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE; From patchwork Mon Dec 2 10:30:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 180594 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp5012160ile; Mon, 2 Dec 2019 02:31:15 -0800 (PST) X-Google-Smtp-Source: APXvYqx4d9LqNY2OLBgOTAEgCoSLQEJNsMljTUMmu1dZtCxGDLeVUypbIQzrjRCm8h/SllFYgk67 X-Received: by 2002:a17:906:2296:: with SMTP id p22mr37307472eja.269.1575282675648; Mon, 02 Dec 2019 02:31:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575282675; cv=none; d=google.com; s=arc-20160816; b=TT0RBDgoz9uaVHbNozDNKEBap7Zk70acyLwolTPZWl8y7yTQ3YV7ftR5eqfZJ8sxaO MTcZnsSEOdnfW+nIVac/ndJdvj4hozPl5+pBfTsRol2U2d7/wIlnlvvOB5utLIMeINrJ dd3Q7S8SSeDYY9YPE1BViXxCs/nOxqKxSdaF8DWDPnwVDMfCq29geWmsiRdEr4cPbf6O y4d1OSG/a4BIhPsL44H0BRuoJkaZilG80LZAfTtYNXQh8wUPUX9KHkWsyL92lztx1SUX K69S260TwuVY0QlnrpjfDfcDaDy2KzxLNKlIMweZXud6nsbtLBDwZA62V7EF2iPxpkD3 +1/Q== 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:to:from :dkim-signature; bh=CdaQIaHNfuGDVRU1iZt8C3kZ2l5NffXqnrKltL5Qaa8=; b=J92qoEI75GVh+b5OkoVp2Y90EGSeQp0PDX3y6X2Qe7EziS7DQHsyqSrGPEllOwmtZA tRTXyvlzkyygfyGKNSYzBqKWEHvq2NDOCSh6w0EU8uxWPfkJiBChiFXAIw63EF3SgObp E31i9io736K3udRYh7bzAM5DlVP7vWHPFDadsoNZYzktHUxMQyIW8Is8U06eZkOQrxRc zsOocmNPhTNmfxM77R9ZbT6pujOIhGltQBDLxXRNMRRt/wOVgr59zmw47/7+j4+Cn4co VPpGw1kjAWMHaIXSVTyNXnQz64PDkhBAU70gcMidYR7N02ErhfZ2/0tpfdE3W2snSUf8 VdHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vYKuB40L; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 e21si4015152edq.191.2019.12.02.02.31.15; Mon, 02 Dec 2019 02:31:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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=vYKuB40L; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 S1727457AbfLBKbP (ORCPT + 15 others); Mon, 2 Dec 2019 05:31:15 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:54521 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727388AbfLBKbO (ORCPT ); Mon, 2 Dec 2019 05:31:14 -0500 Received: by mail-wm1-f67.google.com with SMTP id b11so21128594wmj.4 for ; Mon, 02 Dec 2019 02:31:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=CdaQIaHNfuGDVRU1iZt8C3kZ2l5NffXqnrKltL5Qaa8=; b=vYKuB40L99AVLE9Btij+3E6z7rjYJ1EM1VyOZbaxWdz+nUm1h/wGsQrglsDxXFfexb brOuMceoFyVHXwve4Ldm7imcheAq75h5DD7zIjZSMkUWTik0U4ig7HexLpQnWi+GKALO CMoJuTXZN+GEJZ2Ofbtrzevh6ciX5i+AL7Vf7BbbxVe9DhdYNE2Op3LE4pbUQ2acgfIO QM0hMIr42Hp+hl+QNzakGRp5g0Hm211SaOoL/wF6dX9VVorHyb4XrlHNtk+kHQ97v8Ai qP3VLsCeKnri+LvQRCMWNcR3xvkZzDdyZSjh9LuINfJAfCeNPLYhkyNi+YSVWYoYeOHZ WDfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CdaQIaHNfuGDVRU1iZt8C3kZ2l5NffXqnrKltL5Qaa8=; b=SHlopr2kvGcPw9Z8s3G8eLUV6rzPUuwBNb89+D+HiUcaav/M/9Y1pZ6hwo1m9cYkv9 +KJnGpRHPEs9bZvxHI6VLQqp8VDoe1l6FSlHc6QQi51IKrGhb29+M9XGFw2z/P8IDH7O cdxwJynwHFqCzn/SUium8Yt+JX9NyAKFAOF6IbtG5J3MGX/Edzc1PNrsouiF9bfcYxOS ap88b8qbNafBdN3lewWsRLXucavYWgu7Jkke3xjtz/8Dt2PDmC3Bs7edxJDhJ/LB4HNr 65GAJrc5X1/K1CrL1C/wRufal3OP/cwTEnffTLd/7tBu26q9cL0CJZfZsaKa3ccsz3+E qocQ== X-Gm-Message-State: APjAAAWzwfHO/NvzXO6ss2HONRWSuWm1uLUsu3cge1aNOFWpVu3b99c0 +cH5sf7nS0MxMTs0RlOQ6ENMbRHhk10= X-Received: by 2002:a1c:e90b:: with SMTP id q11mr27103651wmc.125.1575282672746; Mon, 02 Dec 2019 02:31:12 -0800 (PST) Received: from localhost.localdomain ([2.27.35.155]) by smtp.gmail.com with ESMTPSA id r6sm26402860wrq.92.2019.12.02.02.31.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 02:31:12 -0800 (PST) From: Lee Jones To: stable@vger.kernel.org Subject: [PATCH 4.19 07/15] net: macb: fix error format in dev_err() Date: Mon, 2 Dec 2019 10:30:42 +0000 Message-Id: <20191202103050.2668-7-lee.jones@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191202103050.2668-1-lee.jones@linaro.org> References: <20191202103050.2668-1-lee.jones@linaro.org> MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Luca Ceresoli [ Upstream commit f413cbb332a0b5251a790f396d0eb4ebcade5dec ] Errors are negative numbers. Using %u shows them as very large positive numbers such as 4294967277 that don't make sense. Use the %d format instead, and get a much nicer -19. Signed-off-by: Luca Ceresoli Fixes: b48e0bab142f ("net: macb: Migrate to devm clock interface") Fixes: 93b31f48b3ba ("net/macb: unify clock management") Fixes: 421d9df0628b ("net/macb: merge at91_ether driver into macb driver") Fixes: aead88bd0e99 ("net: ethernet: macb: Add support for rx_clk") Fixes: f5473d1d44e4 ("net: macb: Support clock management for tsu_clk") Acked-by: Nicolas Ferre Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller Signed-off-by: Lee Jones --- drivers/net/ethernet/cadence/macb_main.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) -- 2.24.0 diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index f175b20ac510..d98077ab306b 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -3328,7 +3328,7 @@ static int macb_clk_init(struct platform_device *pdev, struct clk **pclk, if (!err) err = -ENODEV; - dev_err(&pdev->dev, "failed to get macb_clk (%u)\n", err); + dev_err(&pdev->dev, "failed to get macb_clk (%d)\n", err); return err; } @@ -3337,7 +3337,7 @@ static int macb_clk_init(struct platform_device *pdev, struct clk **pclk, if (!err) err = -ENODEV; - dev_err(&pdev->dev, "failed to get hclk (%u)\n", err); + dev_err(&pdev->dev, "failed to get hclk (%d)\n", err); return err; } @@ -3351,25 +3351,25 @@ static int macb_clk_init(struct platform_device *pdev, struct clk **pclk, err = clk_prepare_enable(*pclk); if (err) { - dev_err(&pdev->dev, "failed to enable pclk (%u)\n", err); + dev_err(&pdev->dev, "failed to enable pclk (%d)\n", err); return err; } err = clk_prepare_enable(*hclk); if (err) { - dev_err(&pdev->dev, "failed to enable hclk (%u)\n", err); + dev_err(&pdev->dev, "failed to enable hclk (%d)\n", err); goto err_disable_pclk; } err = clk_prepare_enable(*tx_clk); if (err) { - dev_err(&pdev->dev, "failed to enable tx_clk (%u)\n", err); + dev_err(&pdev->dev, "failed to enable tx_clk (%d)\n", err); goto err_disable_hclk; } err = clk_prepare_enable(*rx_clk); if (err) { - dev_err(&pdev->dev, "failed to enable rx_clk (%u)\n", err); + dev_err(&pdev->dev, "failed to enable rx_clk (%d)\n", err); goto err_disable_txclk; } @@ -3839,7 +3839,7 @@ static int at91ether_clk_init(struct platform_device *pdev, struct clk **pclk, err = clk_prepare_enable(*pclk); if (err) { - dev_err(&pdev->dev, "failed to enable pclk (%u)\n", err); + dev_err(&pdev->dev, "failed to enable pclk (%d)\n", err); return err; } From patchwork Mon Dec 2 10:30:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 180595 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp5012181ile; Mon, 2 Dec 2019 02:31:17 -0800 (PST) X-Google-Smtp-Source: APXvYqxGIYR108J0TT9c/9YZJGlkFumQbs45fCVGbUxvTgiAOlVFSM70IdqZ9NVSQcERxxqVK6lr X-Received: by 2002:a17:906:1d50:: with SMTP id o16mr14944479ejh.111.1575282676855; Mon, 02 Dec 2019 02:31:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575282676; cv=none; d=google.com; s=arc-20160816; b=0eXjcXm+IMkCyKhwIEdJR2HJGXxHo9lyOrb3RUYVKbCgxNgnq3CFnRAvpFKseGUKj1 ly7gcc0usQ9DMBB/lZl2CW6tzksp8i5kEhVIGUUCZhk49SgW+yOFZcmXjQQA7g0C8Q2j 2af4+Aq3t7QS33j4B7D8T5tczRZLgE9cesHvf9U/Q19rVqV5zulteuklxd5srwbi6Hsf UtCNzg3In/Hf9N+qocoY5JUpRKpxS4/o8qm0q/hwoyD2V9KSihAcEbAYT5MeqRXq2J0Y GWua8Tg84DeCnIWR+9eTUMNy/AF/4k6B4wTCU6yRloVv6zegxf54YMBV3AqjkFjAPygB cqsQ== 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:to:from :dkim-signature; bh=eFBFGv//5UKtfgO4bFKkyNYQ6cGLJVbXdL6jceejJm8=; b=rplXNYV+j31jrJgLritL4wAJYg9xL0excrFDmYCvq9gF0oLqvA/5FTbe5qW5s7TV2R TykvBAdjWvClasXQSPqCrP2koUOAz48i97myJLGsZYCwcA8hwn4cBcxthtvsvxRvCA5U BbCImT7hPwoDfIEf5OifuJW1swGILZi0mUZwAGit3HQM2udK2xhMmjBxkHn1/mETX+a1 1BO3J00jjQ6VfSufRSY1uyC7pceC/cKDTDEoFujTlr1toZcBE38VfbxXwDftGTcxaoJf za0v55y6XVodtw9QnqSSJRL1CylOrozcN3W2r1Dy0d7mF7zZM8jvG19OghPF4xpSZuM0 yQdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lW8yAxXH; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 e21si4015152edq.191.2019.12.02.02.31.16; Mon, 02 Dec 2019 02:31:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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=lW8yAxXH; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 S1727465AbfLBKbQ (ORCPT + 15 others); Mon, 2 Dec 2019 05:31:16 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:52481 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727366AbfLBKbQ (ORCPT ); Mon, 2 Dec 2019 05:31:16 -0500 Received: by mail-wm1-f67.google.com with SMTP id p9so6157311wmc.2 for ; Mon, 02 Dec 2019 02:31:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=eFBFGv//5UKtfgO4bFKkyNYQ6cGLJVbXdL6jceejJm8=; b=lW8yAxXH4zi4M/hvk9KeDdBoZMCYUOMLZIdhW7BvUuXAttcVTc/RPkPZIZe76elInO gbcnrMAO5EgV0B+TkTcUnHeTGbonQ1auQYWunEKlX/dqnEmG+kXKzpiWQ4eNchncjTKU scvpe4avMcGDklJzTNcAsnEXL3hpkHrOAzmiD43rwfzLcpopCjwWpjMCXvKn/p9aR0Xr 7EkiBie9VrunVBM382X5iIQrnXseCDkKTu5BffhCI0o4xib5XHQn4+PPSo63D4iq1yBV oJSRL9YRruSv6CJV4/XDodnufkAxmt1QCALMKuMGI4wPS7dl/5chm5tYQaQm/JAGjSHT irEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eFBFGv//5UKtfgO4bFKkyNYQ6cGLJVbXdL6jceejJm8=; b=UrzSieaQypd/i5+XJn8yt5urLjzhQfJCDBiuft0sUDuRfBnczTT3Emda5nhl5mqrn5 YUKeIhRXY5cttas2VdKA6dfhgi5eAh3QiNVDiu1tLmgv0CZiEf3YtoeZsGh8a8es72pf VOOhODY5s+tGlQFUxgUrQHrn9QzLNMw0zGhX+Ay1jXbu9I/bMktjxglqlaIHOt0QePAK oWMina0p3+Ut4qqJp3HLUTVU5UkT52yATPcq85O9yOVbGHqH/I5KF2qjFRwfMgbyiMKK DgcWf0LiW6RzamFV9gqGGewAei1Lx2VCBz6rpasY1++wjuO9xFvqODo1B18i1P43xUzg RZYg== X-Gm-Message-State: APjAAAVkQUgIPagJJQqAnBpX+u0O4x2xpa5cGt2pGmRaoQbCMEV5K3MK whHgjg7HkhuJF30SsUQLdzzETSFOcZ4= X-Received: by 2002:a1c:5451:: with SMTP id p17mr17281456wmi.57.1575282673781; Mon, 02 Dec 2019 02:31:13 -0800 (PST) Received: from localhost.localdomain ([2.27.35.155]) by smtp.gmail.com with ESMTPSA id r6sm26402860wrq.92.2019.12.02.02.31.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 02:31:13 -0800 (PST) From: Lee Jones To: stable@vger.kernel.org Subject: [PATCH 4.19 08/15] media: atmel: atmel-isc: fix asd memory allocation Date: Mon, 2 Dec 2019 10:30:43 +0000 Message-Id: <20191202103050.2668-8-lee.jones@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191202103050.2668-1-lee.jones@linaro.org> References: <20191202103050.2668-1-lee.jones@linaro.org> MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Eugen Hristev [ Upstream commit 1e4e25c4959c10728fbfcc6a286f9503d32dfe02 ] The subsystem will free the asd memory on notifier cleanup, if the asd is added to the notifier. However the memory is freed using kfree. Thus, we cannot allocate the asd using devm_* This can lead to crashes and problems. To test this issue, just return an error at probe, but cleanup the notifier beforehand. Fixes: 106267444f ("[media] atmel-isc: add the Image Sensor Controller code") Signed-off-by: Eugen Hristev Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Lee Jones --- drivers/media/platform/atmel/atmel-isc.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) -- 2.24.0 diff --git a/drivers/media/platform/atmel/atmel-isc.c b/drivers/media/platform/atmel/atmel-isc.c index d89e14524d42..f2b09ea107b1 100644 --- a/drivers/media/platform/atmel/atmel-isc.c +++ b/drivers/media/platform/atmel/atmel-isc.c @@ -2062,8 +2062,11 @@ static int isc_parse_dt(struct device *dev, struct isc_device *isc) break; } - subdev_entity->asd = devm_kzalloc(dev, - sizeof(*subdev_entity->asd), GFP_KERNEL); + /* asd will be freed by the subsystem once it's added to the + * notifier list + */ + subdev_entity->asd = kzalloc(sizeof(*subdev_entity->asd), + GFP_KERNEL); if (!subdev_entity->asd) { of_node_put(rem); ret = -ENOMEM; @@ -2209,6 +2212,7 @@ static int atmel_isc_probe(struct platform_device *pdev) &subdev_entity->notifier); if (ret) { dev_err(dev, "fail to register async notifier\n"); + kfree(subdev_entity->asd); goto cleanup_subdev; } From patchwork Mon Dec 2 10:30:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 180596 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp5012207ile; Mon, 2 Dec 2019 02:31:17 -0800 (PST) X-Google-Smtp-Source: APXvYqw5iWPlpOD3XVt+J5p+KMOrd7lr8af5SHYWw6i5lCaawN3skEFnXqPraO9Abu6RtyrMGR0T X-Received: by 2002:a17:906:3107:: with SMTP id 7mr58868859ejx.125.1575282677748; Mon, 02 Dec 2019 02:31:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575282677; cv=none; d=google.com; s=arc-20160816; b=uBKjhGH1TpWUhIwhpJm+HgU2bct5+jI96S3dw5yiM0lLUgg1B0dPd/AN4nhX79xQ5k rGR/lRyw3WnEU/3WVcoqUi7aU22fIoIdG51orOiInduTxQC2/railt1UMhg5URJEn+JR PLhA/a6RdaUGoBPT5NMjT/Tt3PVV+/cJhtVUcAYzT3ne/2dkkplhKhr2u43iwMn9iIYZ Piasj1/G2K1Adv1h+n7qdmd8/VORBHuDDBJAIn+BzjlDHv9FqpAXF/6OraPrNzRb6gEm 6byEDx4EC1I9orvxgE+C55CE3B0Z/US1oonumSDiIt31cH43SKjgIQJcLin+v0R5UEUR Cygg== 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:to:from :dkim-signature; bh=R8AAvwaj+CXQP64zDDHz2NkHRoMaj2Fuj9qQc9YxRqk=; b=JhHQHpTn+DzVC3QXVr31YGyDzC6pdhQ7PuHigqAV97cUaE6NEGbbB8qzxcsfAym0tn 0Z86GCC9GE/YpYa2P6J8Ah2glNbqT6h18QHWj/jNnnKcZXD3gF8nhL+cE54SAkMnkYJy zHRYFLy/DciPXv0Kk7+YHXXifVVwtksAWbcesZnTN55oKKbOngah0/TE6XPDP3WYs2Of kQIWrgnqZ+yKPPq6Ihu+E3gjoOfgT8Kr+bf1a5zy4mTRyP94EXG984U0hkGK6e5AgPlz yHeybbMC3pZtgK4dIC6QTTsvDdcPAA0exELdy4UNfmbIuqBF/K0oSe0aVIsZ5Ntkrd55 a6nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ogc8ONl5; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 e21si4015152edq.191.2019.12.02.02.31.17; Mon, 02 Dec 2019 02:31:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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=ogc8ONl5; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 S1727366AbfLBKbR (ORCPT + 15 others); Mon, 2 Dec 2019 05:31:17 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:39499 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727388AbfLBKbQ (ORCPT ); Mon, 2 Dec 2019 05:31:16 -0500 Received: by mail-wm1-f67.google.com with SMTP id s14so15818655wmh.4 for ; Mon, 02 Dec 2019 02:31:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=R8AAvwaj+CXQP64zDDHz2NkHRoMaj2Fuj9qQc9YxRqk=; b=ogc8ONl5ioZV7aVelcXGrPpSCvjgc3g2Ooy9Pt4SC4ciKp43/jpvMIW4q8HsK5HF9z 5iFF6eN+6mjxPWOwlS5sH2FeQZLrcUPdvABC5u9fvqe6uQRct89CNjck4NVIX40UPkQU adeTW4UrBoV9Ci5v5AG8Ztat70aly8cuuOyjv55BJK66qjmpQzucTrCzB+wA48WxfkG2 roCZ/HwVA6l5Av4rHcI50FuqQchC8vNlEuo0T5Ujfq/L8O3VbdgDO1MCMqqTxsp0LAT6 yXs+d0U90uffrweyt6VdJvVy7pL5fsT3XIffkMNbD2f8RHw87zj6L0rEXt2+sn7DHp1i Rxtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=R8AAvwaj+CXQP64zDDHz2NkHRoMaj2Fuj9qQc9YxRqk=; b=iapdwLuT1yyDyNAdxA6XOoO4EMAc0X3ts7JyBtVJQqinimHEcwJorVedA2ov1nNqj6 DXddjHZW7ZN5Y/6KhdT05jj92b07+NxOiFyhsY8ATrKzrJnn2c+NStgiJhkwiqYbdLdf PMIqpe5l0xNZkjur6CkVFD5yWMEOhgGe5uhfdVq7EmQgJm8mhmGQJ/e5F8uutQ+Wabtt fmU4eK3Uk5OUayum4oHav3nSP3CJgZ5pyJ+xFwPao7h+KIvD+nByzjuz36yXpyygI9g6 fzHB9Ggtl5d10Ul8FT8/9m8iITOTYVdXgZ/NggvfjdVrUIRHhtE8rvRCkUugozFxUHw7 jkEA== X-Gm-Message-State: APjAAAV/SpjeR+LtJC+FHPNdXC+/TAmfC2PtkR9v8W+oXdM6lyX1Vetf 4hcwj8Xzmuk0YISptbijYjrV3sH3sM8= X-Received: by 2002:a05:600c:290e:: with SMTP id i14mr27115656wmd.126.1575282674377; Mon, 02 Dec 2019 02:31:14 -0800 (PST) Received: from localhost.localdomain ([2.27.35.155]) by smtp.gmail.com with ESMTPSA id r6sm26402860wrq.92.2019.12.02.02.31.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 02:31:13 -0800 (PST) From: Lee Jones To: stable@vger.kernel.org Subject: [PATCH 4.19 09/15] media: atmel: atmel-isc: fix INIT_WORK misplacement Date: Mon, 2 Dec 2019 10:30:44 +0000 Message-Id: <20191202103050.2668-9-lee.jones@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191202103050.2668-1-lee.jones@linaro.org> References: <20191202103050.2668-1-lee.jones@linaro.org> MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Eugen Hristev [ Upstream commit 79199002db5c571e335131856b3ff057ffd9f3c0 ] In case the completion function failes, unbind will be called which will call cancel_work for awb_work. This will trigger a WARN message from the workqueue. To avoid this, move the INIT_WORK call at the start of the completion function. This way the work is always initialized, which corresponds to the 'always canceled' unbind code. Fixes: 93d4a26c3d ("[media] atmel-isc: add the isc pipeline function") Signed-off-by: Eugen Hristev Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Lee Jones --- drivers/media/platform/atmel/atmel-isc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.24.0 diff --git a/drivers/media/platform/atmel/atmel-isc.c b/drivers/media/platform/atmel/atmel-isc.c index f2b09ea107b1..1fd078257670 100644 --- a/drivers/media/platform/atmel/atmel-isc.c +++ b/drivers/media/platform/atmel/atmel-isc.c @@ -1895,6 +1895,8 @@ static int isc_async_complete(struct v4l2_async_notifier *notifier) struct vb2_queue *q = &isc->vb2_vidq; int ret; + INIT_WORK(&isc->awb_work, isc_awb_work); + ret = v4l2_device_register_subdev_nodes(&isc->v4l2_dev); if (ret < 0) { v4l2_err(&isc->v4l2_dev, "Failed to register subdev nodes\n"); @@ -1948,8 +1950,6 @@ static int isc_async_complete(struct v4l2_async_notifier *notifier) return ret; } - INIT_WORK(&isc->awb_work, isc_awb_work); - /* Register video device */ strlcpy(vdev->name, ATMEL_ISC_NAME, sizeof(vdev->name)); vdev->release = video_device_release_empty; From patchwork Mon Dec 2 10:30:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 180597 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp5012258ile; Mon, 2 Dec 2019 02:31:19 -0800 (PST) X-Google-Smtp-Source: APXvYqxHi8Hxi2KFxWnlV+996eEfiz9/6hSRO6axlpIGnF5/3pTPQrw0hA/V3aZbXKrhBcjeXGol X-Received: by 2002:a17:906:7806:: with SMTP id u6mr7221599ejm.200.1575282679809; Mon, 02 Dec 2019 02:31:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575282679; cv=none; d=google.com; s=arc-20160816; b=sm4fc6A5JwpmF1qr1yp1J06v/sS/ZYXvRyYd29yzWlKRGyhtmJFajIfb0RwX8UK+ae XwZT3RAXc5BiO3M2KSrCUGyYrMPdUwSalabKwD0GW90svzo6zVztAgWj85/XII95YLw5 ccRqxULSCKBXQUYh4oXAOk8fkXvCNHdWyRYdkj3TvL/dqOcQh9SF6R1QKn64ESoOnSIJ kqYHz4ITtoKnnOhkDS0m4bGvl3os9tw9seEIDxxAUa1z3c6pxsF6LtVl/Wmd3yK8Qpdy DABaCRWqO2N3dnQx+lerpwuVP0mTowlP3DehZTtCVJYz4aPP8d3JhXaSi+pcr1ylXxcB 3gsw== 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:to:from :dkim-signature; bh=+T3I2qcXZZl5cdoe8/t6jX4UHeNDaQgtBVsOUTonFpo=; b=XQod7RepzsWBSSUihjdS4pHBgYkLgxxi1mJtezEUklsXwGwTNJz1lWt9mWOrRrqxlB 9B7QgthtSGgrLPZANwgKa4k8FvY0iE3gRreqMFPhFXQZE5us8GWfwLq2zxdEM046A6Ac mGp9yek+FJWjuDTQp6NLjAilU+GHeaWqWbtPT3gR/OEf+WIgz//EIB48uGGZyLbyg0lF J5Yaijl8FaJcawBICd2IOYo+nV1tk6Ebugvv7K5/vAoLZVEhsAJMpkohvL3vkjy8qSbA g4nvm/3GU8XLFGcsfxlzvvw4ofpEkxMl3JZGgHagrXvJr+h+38q0ceojn29z774LIr3a thVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tlchkpn2; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 e21si4015152edq.191.2019.12.02.02.31.19; Mon, 02 Dec 2019 02:31:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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=tlchkpn2; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 S1727567AbfLBKbT (ORCPT + 15 others); Mon, 2 Dec 2019 05:31:19 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:38330 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727388AbfLBKbT (ORCPT ); Mon, 2 Dec 2019 05:31:19 -0500 Received: by mail-wm1-f68.google.com with SMTP id p17so9723342wmi.3 for ; Mon, 02 Dec 2019 02:31:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=+T3I2qcXZZl5cdoe8/t6jX4UHeNDaQgtBVsOUTonFpo=; b=tlchkpn2BAImgn+XwjY40TIhXaScx9O5JrzCGF8HjHWv4zecZkeDxQmqcjJPjOmPqP 2ty7/jEbC3iqM+x0wVLEjvHqjMS4KKsqlzOt7xmOa0PYgwap0a98win/COR8t/DfzcKN KtIoFIuZre2vSMURhN/bOTNpxUCYw93woqy204BwxgQXLCdQ1OV9ouSk425Cy52dWXfi 5MFKkOGn4t/pU3pVOe2sxmKk3jZEVIqnGftRlZy+37lEmiYfV45Ej0OhKq1F2mJWjHqS tNc7Vv6yTs7iD+NlHqagiR8w6wEpK1Ig49Goz9AQc+fqHEln5OBMhvigolpAwHqfMiXh dF1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+T3I2qcXZZl5cdoe8/t6jX4UHeNDaQgtBVsOUTonFpo=; b=sx2YYt/p0ZoaT6Fl1TZpQgjog34r6uLf6pxDYTxPO4fo5g/afGDVAyB2DjTH+CO8am xvJFk7g5MJxn6/NI2AUvh9P64ak/CmUYVxqUTllQ0ZbhsyvXku0DA/nEsMcDctYaiiFv eQtzUBrWvtYvYHuzY3kCtqX68egr0iP4huBzb8fYaR5aDuH0RVYdD05Feot6fdp7XERh 8H7oBWSGxDY8BL92SfIrdYOscLJL9N+hfkGUrP++AD8E1I+OnycEcWF31cMq5/ZH8v6D KcAyi8IfxEEjqJNXDIbZ6Kd7aaZ8Z8H9y2bmcFa7/Oalwh1rF7kRWf+srPLQ0/1PuTig aVnQ== X-Gm-Message-State: APjAAAVTvo6VQk85wlMtGe6gH5oketKGOpI7wmG32rV4zOIZQmbV+ht8 Q5nVt+txfDUO95yEMwaFWysqbCqbriY= X-Received: by 2002:a05:600c:28c:: with SMTP id 12mr26902759wmk.25.1575282676681; Mon, 02 Dec 2019 02:31:16 -0800 (PST) Received: from localhost.localdomain ([2.27.35.155]) by smtp.gmail.com with ESMTPSA id r6sm26402860wrq.92.2019.12.02.02.31.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 02:31:16 -0800 (PST) From: Lee Jones To: stable@vger.kernel.org Subject: [PATCH 4.19 10/15] mtd: rawnand: atmel: Fix spelling mistake in error message Date: Mon, 2 Dec 2019 10:30:45 +0000 Message-Id: <20191202103050.2668-10-lee.jones@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191202103050.2668-1-lee.jones@linaro.org> References: <20191202103050.2668-1-lee.jones@linaro.org> MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Miquel Raynal [ Upstream commit e39bb786816453788836c367caefd72eceea380c ] Wrong copy/paste from the previous block, the error message should refer to #size-cells instead of #address-cells. Fixes: f88fc122cc34 ("mtd: nand: Cleanup/rework the atmel_nand driver") Signed-off-by: Miquel Raynal Reviewed-by: Tudor Ambarus Signed-off-by: Lee Jones --- drivers/mtd/nand/raw/atmel/nand-controller.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.24.0 diff --git a/drivers/mtd/nand/raw/atmel/nand-controller.c b/drivers/mtd/nand/raw/atmel/nand-controller.c index 32e95af486a2..ea022712edee 100644 --- a/drivers/mtd/nand/raw/atmel/nand-controller.c +++ b/drivers/mtd/nand/raw/atmel/nand-controller.c @@ -1826,7 +1826,7 @@ static int atmel_nand_controller_add_nands(struct atmel_nand_controller *nc) ret = of_property_read_u32(np, "#size-cells", &val); if (ret) { - dev_err(dev, "missing #address-cells property\n"); + dev_err(dev, "missing #size-cells property\n"); return ret; } From patchwork Mon Dec 2 10:30:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 180598 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp5012294ile; Mon, 2 Dec 2019 02:31:21 -0800 (PST) X-Google-Smtp-Source: APXvYqzSN1Rdvvy8lB6CoqKcHEOk6zRRnW+IN1rP/U6oZQF73QlRDRKYv/u+Bzfpdc9iwCQviOxn X-Received: by 2002:a17:906:958e:: with SMTP id r14mr53289166ejx.228.1575282681274; Mon, 02 Dec 2019 02:31:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575282681; cv=none; d=google.com; s=arc-20160816; b=MDJKtL/ELsHK7F5qQLCb5Rld+SbQ8vQv/1durGuh1nNOHAiDY7lQkxb0VH7VdXS4gr SPeAs9dQ9abjukkdorsGC5ItZDF71hKcKodhctQ14k1MsroNprNnN/dJ5XWj0/z1xG6p oDqzKZe+j+N/Jfg3m1joayEp2EKeV5/9Ndyw4VgDA4gsVJYBCDGd5M8yajb8sLDSYWOo o1VPRjILNWdfEYWtMhEIQt1GARV/dBZ7a1VPEyh3zqBH7DDCj5DJtyziI7KDLkeQIE1z 7hURMlx2K88LuBpzg9SxYz1zltioXPoEMq3ltCGoqEMkptnWPcL8iL/8mv0jxrFUbiTZ hgcg== 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:to:from :dkim-signature; bh=Xu8o3osAJau1uC8uDV0Lekp3SIB/QsqNl5IGgTFKaew=; b=WraVEAtg5cMCRb0mE/nkuaeKEpSXchKXVctMdveLh3Q92PTv1K/1hIkyxWKAU4UhUG /VC4pxtts8okInZiI89GONeaxo4/tgiFMCIIWO9i54gmOz+PSKLTn99GqhGf3vQHsaTY r13e1CJapJQaqGn9z1b/iSOUtE+11lXM17vJG7bTrDkQUqZrKxuQgtlFYdhPtMuVZFkt DAyizJHEqiyxFPvAcE/a42z/tz8g420wxo8+S5HXOPaazoEhNAufm3CgkKZX5eix5aPY bUxNRU3RAV5+jlzDKxvbVa57nmSYVdbj5tBdOetQyXzDD6IlrUVYON1V4f9S67J7vSM8 60ZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="o1/BVIrw"; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 e21si4015152edq.191.2019.12.02.02.31.21; Mon, 02 Dec 2019 02:31:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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="o1/BVIrw"; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 S1727574AbfLBKbU (ORCPT + 15 others); Mon, 2 Dec 2019 05:31:20 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:37680 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727388AbfLBKbU (ORCPT ); Mon, 2 Dec 2019 05:31:20 -0500 Received: by mail-wm1-f68.google.com with SMTP id f129so22598898wmf.2 for ; Mon, 02 Dec 2019 02:31:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=Xu8o3osAJau1uC8uDV0Lekp3SIB/QsqNl5IGgTFKaew=; b=o1/BVIrw0mQOb7BDYxrHYVuonvD2LXKai3wADGz7eqgkaUOvOU9ZKMXBaS25Hg5iT3 TUGuxna/ceRcAbe1jf/QQfABA9opeIQOyn+KBQ3RvaDiZwfXtNotw6A/PMct5E3bHQR8 redW5xCGPbLt1vqFEz7VjBATdtghKCQZOnRTu5Xe6MZlWplfJmkTtRbXcTB/lRPsbzaK 4s1ohUeJNSSHQTtOnQAsL4ii6MRTpr/17Q3qaUUatdE2ghCA9WIWEjBv7Edsh7VfZCLa n2xgBQOLClXLYPPsqLR6yEjpI1jUNlv1WwfvTLxiAG9fCqzTkPP/ukG/D2hX678tcViq PDJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Xu8o3osAJau1uC8uDV0Lekp3SIB/QsqNl5IGgTFKaew=; b=JVGnFOeV31oyfTq28fQOE/Q6WIC8hASfAfaEGazjhBBSVRVUkHS51LbzspUXiJ4Si9 6Y/LvW4zzjRlkbmlsYXUORqkpJUyAHXpYPNP4XnGWWaaaIbIh6GZeK3iAFCDIfhNiNqm jEUd18nWFk6pEO7IW/78f7QdjgfrPqdMtOCOE4VsYGsmH+VV4Wyt/+mHS7Y31m56B3ay 4NUgTbfRkgph1eXBPb9s1nWR+bqAViG6P6iF3j0f/Y3Jxea+rNj1keAYfPKJOdvahvF8 dyClEPhuGhC+7Rt8XuMXsKNamJIf2hz2tLXJ1aU2OriCemC+qaGXiRkF9woq2vkeu6gl x2Bw== X-Gm-Message-State: APjAAAUoyIco7CSkuiO7gLrIq8FJ3710m+6BbdXBVgDjhva7HVsRfpXJ kUt6GPUOy1aBojgi79cgFCGRNxEOyWA= X-Received: by 2002:a1c:4483:: with SMTP id r125mr14991717wma.97.1575282678676; Mon, 02 Dec 2019 02:31:18 -0800 (PST) Received: from localhost.localdomain ([2.27.35.155]) by smtp.gmail.com with ESMTPSA id r6sm26402860wrq.92.2019.12.02.02.31.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 02:31:18 -0800 (PST) From: Lee Jones To: stable@vger.kernel.org Subject: [PATCH 4.19 11/15] pwm: Clear chip_data in pwm_put() Date: Mon, 2 Dec 2019 10:30:46 +0000 Message-Id: <20191202103050.2668-11-lee.jones@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191202103050.2668-1-lee.jones@linaro.org> References: <20191202103050.2668-1-lee.jones@linaro.org> MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Uwe Kleine-König [ Upstream commit e926b12c611c2095c7976e2ed31753ad6eb5ff1a ] After a PWM is disposed by its user the per chip data becomes invalid. Clear the data in common code instead of the device drivers to get consistent behaviour. Before this patch only three of nine drivers cleaned up here. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding Signed-off-by: Lee Jones --- drivers/pwm/core.c | 1 + drivers/pwm/pwm-berlin.c | 1 - drivers/pwm/pwm-pca9685.c | 1 - drivers/pwm/pwm-samsung.c | 1 - 4 files changed, 1 insertion(+), 3 deletions(-) -- 2.24.0 diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c index c45e5719ba17..b1b74cfb1571 100644 --- a/drivers/pwm/core.c +++ b/drivers/pwm/core.c @@ -874,6 +874,7 @@ void pwm_put(struct pwm_device *pwm) if (pwm->chip->ops->free) pwm->chip->ops->free(pwm->chip, pwm); + pwm_set_chip_data(pwm, NULL); pwm->label = NULL; module_put(pwm->chip->ops->owner); diff --git a/drivers/pwm/pwm-berlin.c b/drivers/pwm/pwm-berlin.c index 7c8d6a168ceb..b91c477cc84b 100644 --- a/drivers/pwm/pwm-berlin.c +++ b/drivers/pwm/pwm-berlin.c @@ -84,7 +84,6 @@ static void berlin_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm) { struct berlin_pwm_channel *channel = pwm_get_chip_data(pwm); - pwm_set_chip_data(pwm, NULL); kfree(channel); } diff --git a/drivers/pwm/pwm-pca9685.c b/drivers/pwm/pwm-pca9685.c index a7eaf962a95b..567f5e2771c4 100644 --- a/drivers/pwm/pwm-pca9685.c +++ b/drivers/pwm/pwm-pca9685.c @@ -176,7 +176,6 @@ static void pca9685_pwm_gpio_free(struct gpio_chip *gpio, unsigned int offset) pm_runtime_put(pca->chip.dev); mutex_lock(&pca->lock); pwm = &pca->chip.pwms[offset]; - pwm_set_chip_data(pwm, NULL); mutex_unlock(&pca->lock); } diff --git a/drivers/pwm/pwm-samsung.c b/drivers/pwm/pwm-samsung.c index 062f2cfc45ec..3762432dd6a7 100644 --- a/drivers/pwm/pwm-samsung.c +++ b/drivers/pwm/pwm-samsung.c @@ -238,7 +238,6 @@ static int pwm_samsung_request(struct pwm_chip *chip, struct pwm_device *pwm) static void pwm_samsung_free(struct pwm_chip *chip, struct pwm_device *pwm) { devm_kfree(chip->dev, pwm_get_chip_data(pwm)); - pwm_set_chip_data(pwm, NULL); } static int pwm_samsung_enable(struct pwm_chip *chip, struct pwm_device *pwm) From patchwork Mon Dec 2 10:30:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 180599 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp5012346ile; Mon, 2 Dec 2019 02:31:23 -0800 (PST) X-Google-Smtp-Source: APXvYqwEsfUxwlrRDAvZnnXjnbhrsB4T0TbIj5wdBtl8Jm7eY9XcHxFqLmBXNmdr1btvN1J4efRj X-Received: by 2002:a17:906:3413:: with SMTP id c19mr31107732ejb.44.1575282683668; Mon, 02 Dec 2019 02:31:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575282683; cv=none; d=google.com; s=arc-20160816; b=aJhlQw6+SEFrDcKJ3Bn+IiTKD1fSrRQl6lIkDtTI8cHjoU65M+qIp8dHnpBdihMsvu 1wwj3su0a1If7zBfVVdzHyG0L4BqW5KIOTVLbE7E1+nHZ08wuUz8RQYy/dqQpafnsppE uY7T2EyApBgpIyaxLFpM7r5AoXpC9+kGU9hqfjaZaDseS9uiK14YTSwvv4i+unD2+sY+ 8RfE31BzVvplZe789J+NOZ41V84FPQpU35eOOn5xu8dZvrl54sHXxaiSd80ELHBgsI13 DKG0xCJ+sxqfNiVLrkQYOh/VJc/SgqVWu+qRJV7I51ohedN6T+7R0Ve3l2zjefhZAf6I FKGg== 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:to:from :dkim-signature; bh=Iqx8Ht1ZGNVIIH/KCqKXiFs77tmuv1VNOT/G4PBiB98=; b=eaJ2/JduR1XaGH/rGyTYGvk0mFED0gFs5z/U8moCXFQ2x4s+UrcCEOEtrTYFu0c6dP gzd1LG6U40Lw4JssEobAn7Tljqobizkd5PR150M7d1/gweqdYl3epzMYmdJC4NyBwSwm V1c2GtXMBEIO6i0oDjyO3gMCIf48MeAThKYh259gdvd9RgM65Ic3SmjtfFTjd7oyIsQw elZVurlQZsMAlDq8TliACzSZmsg6Uz23g3d5N2ehg70ZfcHQcMyJtHzK++m+AqX/ZnXz 2n2M9oGPp+TLCW2l9mVtEZ0WhCeBCOzvpguo/YzPJ87Z4m+lTWns6zXugMzQqznqMUdF V/lQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AYCVz9Mj; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 e21si4015152edq.191.2019.12.02.02.31.23; Mon, 02 Dec 2019 02:31:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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=AYCVz9Mj; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 S1727576AbfLBKbX (ORCPT + 15 others); Mon, 2 Dec 2019 05:31:23 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:39042 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727388AbfLBKbW (ORCPT ); Mon, 2 Dec 2019 05:31:22 -0500 Received: by mail-wr1-f66.google.com with SMTP id y11so40393564wrt.6 for ; Mon, 02 Dec 2019 02:31:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=Iqx8Ht1ZGNVIIH/KCqKXiFs77tmuv1VNOT/G4PBiB98=; b=AYCVz9Mj70QL0XbsrsU/JZy34sTyR0ekP5Owc8uPqLyT+CYPQasAotsQWiaT/fX6I9 hAD6QOIx1piv6xTI9FEJ2JIaKoEo4W4VeLK1HARFUAzJlmBAlb+n4yXeJPIA1OiE0KKx 1yYdP5/K5WRk19VajM3TAKH2aJljY2hJS4J5WWVAiwISc8L03WXsKYAor/to6gpYXC1b 7260MTEmcZWR9EBHsxfb0Ps3y7OosFoy9JyUmqynwGGtVIG3gJOTYhD4TBziQB1nt8qR vWxGJ4oPUZBKbkpJ2PZYiOHYgrC6y92KjhrkSeK8UbIuS/5QYM4KWDxxhahItsxV5fDI Nd1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Iqx8Ht1ZGNVIIH/KCqKXiFs77tmuv1VNOT/G4PBiB98=; b=sqlIvjZJjvOvdmnPLTkwi01asNbKBWwN4IbGGyjzsXgOHxEFaHzzWQJ4SZCFsRjMp2 WStIQR+8xLliUvSeHsgAK7Srw7EvFQtOduhsCp1EixUB6I3/qOIAyFmuIypLGNq6fN7f Clr2/Gbt0PvtM3DzChJd/TDqxzSC+ubDm2+rceP7w0+pCLQwkcBTTJg5jZbCLOwvyysm gFUtN5+WFxMcXOz/sXBpC7+SsHV3ZgVTRXUeZbBAPgWiZjncaq4Exn32l3OweQ12k5Df yLbP6Srb7eVWsZLlEwPvTylJQ4zYD8+CqJTF8YZ3IpdwfhdB5WDcknbOKaopSU2IC4fs qNcw== X-Gm-Message-State: APjAAAWrl5AfZn0uh0Yp/JaXygTCjdGKDT68CSOmGoNmzBtDY5IiO9ay 2bZNNFPCFTMPcQo1VLp0KepRvLxqvwo= X-Received: by 2002:a5d:4d8d:: with SMTP id b13mr24599819wru.6.1575282680736; Mon, 02 Dec 2019 02:31:20 -0800 (PST) Received: from localhost.localdomain ([2.27.35.155]) by smtp.gmail.com with ESMTPSA id r6sm26402860wrq.92.2019.12.02.02.31.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 02:31:20 -0800 (PST) From: Lee Jones To: stable@vger.kernel.org Subject: [PATCH 4.19 12/15] net: macb driver, check for SKBTX_HW_TSTAMP Date: Mon, 2 Dec 2019 10:30:47 +0000 Message-Id: <20191202103050.2668-12-lee.jones@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191202103050.2668-1-lee.jones@linaro.org> References: <20191202103050.2668-1-lee.jones@linaro.org> MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Paul Thomas [ Upstream commit a62520473f15750cd1432d36b377a06cd7cff8d2 ] Make sure SKBTX_HW_TSTAMP (i.e. SOF_TIMESTAMPING_TX_HARDWARE) has been enabled for this skb. It does fix the issue where normal socks that aren't expecting a timestamp will not wake up on select, but when a user does want a SOF_TIMESTAMPING_TX_HARDWARE it does work. Signed-off-by: Paul Thomas Signed-off-by: David S. Miller Signed-off-by: Lee Jones --- drivers/net/ethernet/cadence/macb_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.24.0 diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index d98077ab306b..005fee2dd0e6 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -860,7 +860,9 @@ static void macb_tx_interrupt(struct macb_queue *queue) /* First, update TX stats if needed */ if (skb) { - if (gem_ptp_do_txstamp(queue, skb, desc) == 0) { + if (unlikely(skb_shinfo(skb)->tx_flags & + SKBTX_HW_TSTAMP) && + gem_ptp_do_txstamp(queue, skb, desc) == 0) { /* skb now belongs to timestamp buffer * and will be removed later */ From patchwork Mon Dec 2 10:30:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 180600 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp5012364ile; Mon, 2 Dec 2019 02:31:24 -0800 (PST) X-Google-Smtp-Source: APXvYqxl8x/Z3nE2tFokkA8zGh+8CqBTN9ZDHVrSndp7WnamYVK3akHZ9l8irtXLPeUFC/+ELpj8 X-Received: by 2002:a17:906:1354:: with SMTP id x20mr30644053ejb.279.1575282684248; Mon, 02 Dec 2019 02:31:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575282684; cv=none; d=google.com; s=arc-20160816; b=Zj8ZIfXng/NrAq6CkcL+WSxHyiwQCZSjtj5E23Mwm1oW0DHcLg1jwQhTHFP9m5At7i yzAnp3i7ncC9AlxxCkomNm9XSqxf8aWAgPmKPd5yjH/dpdkl3QZx1id22aOMjT2seZy/ jKAEUWkrdgYBLe5PUtxKMpoNhpaHzpCeNnHWyAmwu0ia8XNPDjHPvzs32npbN6eX3gKN H5GE0pdyu7sV3nYDBU1LqTMhjwBQvDcqXO+By/VmKVMiVcpl1eHMMd127X9fDe5ZisVR kWfcayyGm1S/xOPO0V0i6IoKmTFd+HBbACLvjfXfRwgCL0dER3A0Wt5P3P0g+Ork4BwA /H/w== 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:to:from :dkim-signature; bh=SLTAktNqJAQh6GulSxLAW//F9vtP2hMwMcX3jpbTse4=; b=fPTcd0f7VCZdXG4Pvd+8GeFDFJVE0cYFJG470JDGGP088UtVzwjEa0sgy48kZ+20l9 t069hefeJVKv/46e6jUE9pGjzkgE6MR6mz0a3z+1u6tp6GVwjjNyPKHiWGeon+EtCd2H whGeVJ++sm8CaI5GoYGGhjQd3UDLAVrqmouOX/pjFvOJ9mcMMPkz9QoJrRVO5FkeuzD1 QtAFWQxhelZxDY5zPvgA3hjuHe1XOmsXWVPXExczO7lfWV/DizwIH8VpKmNQGK78N4cf 8TwXnMHp92kM1zXJUeAV13dGBMsGBJyceYPePPaAb21ExFuwYl7qaphvLlu6I0ZSe8tA eXpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UkZbcSi6; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 e21si4015152edq.191.2019.12.02.02.31.24; Mon, 02 Dec 2019 02:31:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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=UkZbcSi6; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 S1727388AbfLBKbX (ORCPT + 15 others); Mon, 2 Dec 2019 05:31:23 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:41766 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727575AbfLBKbX (ORCPT ); Mon, 2 Dec 2019 05:31:23 -0500 Received: by mail-wr1-f65.google.com with SMTP id b18so43525198wrj.8 for ; Mon, 02 Dec 2019 02:31:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=SLTAktNqJAQh6GulSxLAW//F9vtP2hMwMcX3jpbTse4=; b=UkZbcSi6Lcdqyraq6F9a5xkKfpr+sLTLgB7Nnfe70/RU73xqNCwJk1vIbls2U/g9Od Wtcf/U67Li7ibBpteEfopiR5ASjR0VT31jdwyRUBqrewZLDAvVufgwRHn8SWUBobnyIM 46qNA/Mx8MzLFrvGoFKXvhvUBAI95u1FcAD/7FOHRrxkEySY/lsNJnXZ3lgeoq+TD6qP sJwwPDdhT7xldJN7p7+uL/zTlARWW9gPkhI1coaOSJkEP8gAa4ZrbppDWQe2ODIDvjeG SwXdIzfXzwyXMUB8eK7+e/a/QuqK0pw281kOm6/bj88B2FIJYuD5TORerXD6cNd6JckC h94A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SLTAktNqJAQh6GulSxLAW//F9vtP2hMwMcX3jpbTse4=; b=mcfhwbtuWiVhjxpEiWE5l930hET/ogURQE+Wj/dzzw+8Icdbt6xop8al++XIlBCcIq dEgEJkjH0RChEEM1Xsrf3Y2P6f7IZP7ji/rm95pvcnStc4duH2yMc+kMt6JL2WQgVg4A 2uag038XpZ76Re908mxxEu0oJavuwzN7FyuWpifjCQlXQmf3qZipYeITztkOjrLu5mix Mq/NJ7YXlAZEDC/vv9OI5flKDwd8oCwbCeod3ago/e8xsBOGfXqPyhjZ+LNIPuxO8pJm KLLU0LJcvhB0X7NJpkKnRTdTXCSzYoy2r45j6zKumWrf/j389ndfQV9zPFEzpFeIoCz4 s79A== X-Gm-Message-State: APjAAAVKvTclF+ws+dEKiZ1uOOMQ6St+pXuQiVZYYJbBw3ZAdRe67MHQ +w1suugjhnmEsoTtFlDgRDCdBB5GYNY= X-Received: by 2002:a5d:4dc9:: with SMTP id f9mr17191227wru.297.1575282681360; Mon, 02 Dec 2019 02:31:21 -0800 (PST) Received: from localhost.localdomain ([2.27.35.155]) by smtp.gmail.com with ESMTPSA id r6sm26402860wrq.92.2019.12.02.02.31.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 02:31:20 -0800 (PST) From: Lee Jones To: stable@vger.kernel.org Subject: [PATCH 4.19 13/15] mtd: rawnand: atmel: fix possible object reference leak Date: Mon, 2 Dec 2019 10:30:48 +0000 Message-Id: <20191202103050.2668-13-lee.jones@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191202103050.2668-1-lee.jones@linaro.org> References: <20191202103050.2668-1-lee.jones@linaro.org> MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Wen Yang [ Upstream commit a12085d13997ed15f745f33a0e01002541160179 ] of_find_device_by_node() takes a reference to the struct device when it finds a match via get_device, there is no need to call get_device() twice. We also should make sure to drop the reference to the device taken by of_find_device_by_node() on driver unbind. Fixes: f88fc122cc34 ("mtd: nand: Cleanup/rework the atmel_nand driver") Signed-off-by: Wen Yang Suggested-by: Boris Brezillon Reviewed-by: Boris Brezillon Reviewed-by: Miquel Raynal Acked-by: Miquel Raynal Cc: Tudor Ambarus Cc: Boris Brezillon Cc: Miquel Raynal Cc: Richard Weinberger Cc: David Woodhouse Cc: Brian Norris Cc: Marek Vasut Cc: Nicolas Ferre Cc: Alexandre Belloni Cc: Ludovic Desroches Cc: linux-mtd@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Miquel Raynal Signed-off-by: Lee Jones --- drivers/mtd/nand/raw/atmel/pmecc.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) -- 2.24.0 diff --git a/drivers/mtd/nand/raw/atmel/pmecc.c b/drivers/mtd/nand/raw/atmel/pmecc.c index 555a74e15269..9d3997840889 100644 --- a/drivers/mtd/nand/raw/atmel/pmecc.c +++ b/drivers/mtd/nand/raw/atmel/pmecc.c @@ -876,23 +876,32 @@ static struct atmel_pmecc *atmel_pmecc_get_by_node(struct device *userdev, { struct platform_device *pdev; struct atmel_pmecc *pmecc, **ptr; + int ret; pdev = of_find_device_by_node(np); - if (!pdev || !platform_get_drvdata(pdev)) + if (!pdev) return ERR_PTR(-EPROBE_DEFER); + pmecc = platform_get_drvdata(pdev); + if (!pmecc) { + ret = -EPROBE_DEFER; + goto err_put_device; + } ptr = devres_alloc(devm_atmel_pmecc_put, sizeof(*ptr), GFP_KERNEL); - if (!ptr) - return ERR_PTR(-ENOMEM); - - get_device(&pdev->dev); - pmecc = platform_get_drvdata(pdev); + if (!ptr) { + ret = -ENOMEM; + goto err_put_device; + } *ptr = pmecc; devres_add(userdev, ptr); return pmecc; + +err_put_device: + put_device(&pdev->dev); + return ERR_PTR(ret); } static const int atmel_pmecc_strengths[] = { 2, 4, 8, 12, 24, 32 }; From patchwork Mon Dec 2 10:30:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 180601 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp5012424ile; Mon, 2 Dec 2019 02:31:26 -0800 (PST) X-Google-Smtp-Source: APXvYqzoNcCq1KYZiALPpmhoq+swH5QOCEtuaRLwoW3mrDHI7Ik/vX54V1qpy9eFSkE6Ewap+BSp X-Received: by 2002:a5d:49c3:: with SMTP id t3mr15081447wrs.113.1575282686453; Mon, 02 Dec 2019 02:31:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575282686; cv=none; d=google.com; s=arc-20160816; b=f24Vx1xPlVdsOu4lfr/D3yrEHupyh/qt4ZojhfOTgrHs5bW8MVoycy7i5T7CInqQQr jiaW4RtIJQycYqV2CRN800vtAcmDYDVLzTSakMsd3w7YJiYJiUc3P7oFjczg+taLN65b QinTy6z2if+uSjympXXb9VUb48Qc4apSClkB4xcGICZVUhToJd59ljdv0a4lMbpZF9hX 7PsdmLH44Bw8iye4TlrmQNlLQGRI+OpR4gpUpCp45lHWTeDJnephMhDzv5nrd+WxxIrp kCSoG+00nhBC8yKxOLdMh60+yuKRwOslVH2D/WrJkyhSxGBzYB985We98gqzFnBAzlla uetg== 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:to:from :dkim-signature; bh=ZgOVOUxciAvJcn32lc/Nhslk8imEa0i2gZFv1Qv8b9A=; b=Dt+sKVkgSbB6CgZiK4Ffl9ICABS2U+rb8GR6J127iMCeOiOFboKGPNtIVhzytqZT/m 0wDq9QIjFE68eHGd1c1g19Bd68+vQGmuQj6uxDaxDjFubveWDFAxnwRW1j9KA1Qqvftw S16Ywdu7Pf2kiR5gQrdn6JOZp4rHok1lw77olK6KCsbIZEmiEeMMdn11gMxgbEH4yaAK iAEB0FWuk3xPJazM0O3Itaz06oLG9sDY2V/ezjiEYzywu0F3hdr3NRO/YDtx7bLl9MOG AUUFnsT5blniae0l4qZubQ1Jxz1RFtEgF6YUxObCNGgB3PHk6NhNzuxCR6qgFbrXifSM WCiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=drtuQ2ps; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 e21si4015152edq.191.2019.12.02.02.31.26; Mon, 02 Dec 2019 02:31:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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=drtuQ2ps; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 S1727577AbfLBKbZ (ORCPT + 15 others); Mon, 2 Dec 2019 05:31:25 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:32927 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727575AbfLBKbZ (ORCPT ); Mon, 2 Dec 2019 05:31:25 -0500 Received: by mail-wr1-f66.google.com with SMTP id b6so13900568wrq.0 for ; Mon, 02 Dec 2019 02:31:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=ZgOVOUxciAvJcn32lc/Nhslk8imEa0i2gZFv1Qv8b9A=; b=drtuQ2ps/fJpXBdQG48oENHMFLL4ok05/xwAlGFrSD4RGZ+v93a5nj2pzS7+BEJsV3 3G+FRQYKBDPgfMcScXvsNARNw203y1YE4ALeatNDaYL3dmBCx1neo25cePA/TDUgl3f8 kkDPYqGADhToIU5KYpHgIJCx2n4f5+WWtehmvdGpHbNRuflXe0l5pKI5aCmoY0etbi7h U0esPWBdfiyPdeXDZ+/NwfVd+OAygmXc/z8sy2bfib1nTzdBp+xBONV1KiM94Wts1OBE WJGUJKp/0bd0op7rmhNbA7D2hHCfiDMHfZj4s9J9t26hp80cu6bEAqlgPvx0x7C4XHhc gp6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZgOVOUxciAvJcn32lc/Nhslk8imEa0i2gZFv1Qv8b9A=; b=GdZHnPxzcwHX+TFq5Ww4jWtC5ENKpr+iNNF+99dstgeIO7lXIdlM2irdwzQ5toYSp0 tBSm2q4wc8zxlnojrsoTOQ2vC2Xg8P+/K4NT0Cc1LO1ZUHVVpnpfMCZ1XBE+yAx8OFE8 XQJ5JaCcyNeFCU31Rx+5N84i4ooIqH9CaVxAxenbI1C8LeMKHl6NIkheY3kklHjSDfwC s9/jUt8YT1EEMl+9Nss9M4BgVNbq37AcUS8bfEyy++EG/J0oUzATUu/MFlPkwtftdioz zWIGSFaw28I02aeVg2/b9ZrRCyZJ8mljhEi1dKQJ3zCrIv/JunBzJHv1LvDrL69cFp6t 74+w== X-Gm-Message-State: APjAAAVM0fjrf9vQ7tbH63FVK2bPxHzOO4vIFyWEj/mcMh12zToHXBhh 8gfP/Ccqsx5itydI5zEmnVCHq6tuiA8= X-Received: by 2002:adf:90e7:: with SMTP id i94mr2513688wri.47.1575282683601; Mon, 02 Dec 2019 02:31:23 -0800 (PST) Received: from localhost.localdomain ([2.27.35.155]) by smtp.gmail.com with ESMTPSA id r6sm26402860wrq.92.2019.12.02.02.31.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 02:31:23 -0800 (PST) From: Lee Jones To: stable@vger.kernel.org Subject: [PATCH 4.19 14/15] mtd: spi-nor: cast to u64 to avoid uint overflows Date: Mon, 2 Dec 2019 10:30:49 +0000 Message-Id: <20191202103050.2668-14-lee.jones@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191202103050.2668-1-lee.jones@linaro.org> References: <20191202103050.2668-1-lee.jones@linaro.org> MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: "huijin.park" [ Upstream commit 84a1c2109d23df3543d96231c4fee1757299bb1a ] The "params->size" is defined as "u64". And "info->sector_size" and "info->n_sectors" are defined as unsigned int and u16. Thus, u64 data might have strange data(loss data) if the result overflows an unsigned int. This patch casts "info->sector_size" to an u64. Signed-off-by: huijin.park Reviewed-by: Geert Uytterhoeven Signed-off-by: Boris Brezillon Signed-off-by: Lee Jones --- drivers/mtd/spi-nor/spi-nor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.24.0 diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c index f028277fb1ce..2e183425facd 100644 --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c @@ -2459,7 +2459,7 @@ static int spi_nor_init_params(struct spi_nor *nor, memset(params, 0, sizeof(*params)); /* Set SPI NOR sizes. */ - params->size = info->sector_size * info->n_sectors; + params->size = (u64)info->sector_size * info->n_sectors; params->page_size = info->page_size; /* (Fast) Read settings. */ From patchwork Mon Dec 2 10:30:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 180602 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp5012485ile; Mon, 2 Dec 2019 02:31:30 -0800 (PST) X-Google-Smtp-Source: APXvYqzgy1/88QDvHx+OmEtDATkxG3bfFDOh7e2cVofB04mezdM37Q+lOrbpIVk5LVpM3/vee8rx X-Received: by 2002:a05:6402:1484:: with SMTP id e4mr15652997edv.286.1575282689893; Mon, 02 Dec 2019 02:31:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575282689; cv=none; d=google.com; s=arc-20160816; b=OM60kld5aYIlps+sICNKxFq+ubA+uedOLqbgECYAHVVGZ11OohFy7mDTcTtVvSMMEs seDsSpxM1dpS/kbd+RfdDlePPYPluKsumziIkVhCIaMB2Cu3Qr2iQJRa/Ti6w6ZefocV JgNNWg/QGwvRs61fKbuJlhtlG3yYH7Nxhzxa3bHDL5Kh43WsQTAfakQR5sfU8GeVaKhE +2PtWRiutVPGHvExX1qrD+7SEzoCTEljWBmIPW63RBdOrFc3mAPbWiPtuTM5QxHI1YVV rLmAodaR3MlkrGbxDJ1v/efQdM0dG4mJePBxyZkU9ucupQRwawW/g8pRlSm3Q65ODcBM 7XUg== 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:to:from :dkim-signature; bh=sHiG2NnNDoK8S4KpbBXz2iGAVpRQXWcAfC+CtzhYGHc=; b=T2zcG7Haem/lXpzf62qq3UipAjCD48II9tllFxU/1h7d/xsD1Ei+YQ/82Ud9D1NR91 ozXDRrycRdCoQ4HrahT/vmVRTkmmq8vEohCBrWkQx4weXnfObu12/ZQLEnmZgFPylm/t Ravg0ZcMGycBlJhWD3fdVSJdWiH4IQE86M9a/8TprmnAnaRWsRt/6DTyyEW9f+H+Vvk4 G8YPvSXq57IgnbocoT7ZV/caw1bLuC5em9g9vklDS9rbOVy2mm7MURBZ+d2WsQer4hYY 9rFaOJ6wZ3D0szFenaCKNV69drRdz9mLgdA+Tl7oYan6I/yBfqX1678aDFXXtVv8dIxU oQpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qwgg7SpE; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 e21si4015152edq.191.2019.12.02.02.31.29; Mon, 02 Dec 2019 02:31:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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=qwgg7SpE; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 S1727578AbfLBKb3 (ORCPT + 15 others); Mon, 2 Dec 2019 05:31:29 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:35775 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727575AbfLBKb3 (ORCPT ); Mon, 2 Dec 2019 05:31:29 -0500 Received: by mail-wr1-f66.google.com with SMTP id g17so11476307wro.2 for ; Mon, 02 Dec 2019 02:31:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=sHiG2NnNDoK8S4KpbBXz2iGAVpRQXWcAfC+CtzhYGHc=; b=qwgg7SpE0CxpHU52JDXD7aDWpVQDyvgCuH++pa1kweEa86elQzOPHc+dJUjYh8Yx4q dfs26w0hNQ0MzXCUA5AZr0OMJHSKbSBrgI3cSaXLnYC8K8OR9sf2/QkB+4P/nfSY9I4a 06FBb92X1UhfBB8eNOe0ezW/hp2VXWfoT7pXubR1CjLooNInVE3OErMHe41LpayUlIdY j8Bbc+GqS/lSNBq9Yx5KrqwOxSoJeA4UKV7z+cM7QxeLpRVpbwndpUg0oULYozD1cdlG m8ggrhLSQ2MvqyJk4AmnuQvdtQw+1yo/1kiWCmiPlUM8Dj9f+7OcMEAWTq7hXaV2IWdX Mwmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sHiG2NnNDoK8S4KpbBXz2iGAVpRQXWcAfC+CtzhYGHc=; b=AP3KA+18HuNJ70VaFRLNi0+nVljRFQmEHka7PRqRjtWQbBCnmC/Mv3uFpNn5z6w+D6 ewGDU7QONy3UvnICgGq8lHlhdBIxdXpYX/qiHMYc1zqrmVcNf/SkH8fRLKoIqrFGv5Qz pa5P5cdahaYosawCAXYneLX7ZQOSVAQ7hfx3Jy8r6vEHjxR/rPdEI0TfET9wemME/TtK YVdiHoOXgdHSLfFpU9R9F+5olQXYVtc5pSmOVAFsXXus7FVDsU9YkgYFU7F5u1APBAWT q8BcaKuveLomGsvicSuuCa0+k0ldH+iSijF/goSU+FuJpghjtojIKEKD6tYhYHSk/6+/ owqg== X-Gm-Message-State: APjAAAXBrW1L2yrU6N6J4NW+uCj2TzOwnmFGURx9UQTDF461hM/r/plE BhXqBH19ZJQvxTawLizPVsqRnyooXP4= X-Received: by 2002:a05:6000:1047:: with SMTP id c7mr15718917wrx.341.1575282686728; Mon, 02 Dec 2019 02:31:26 -0800 (PST) Received: from localhost.localdomain ([2.27.35.155]) by smtp.gmail.com with ESMTPSA id r6sm26402860wrq.92.2019.12.02.02.31.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 02:31:26 -0800 (PST) From: Lee Jones To: stable@vger.kernel.org Subject: [PATCH 4.19 15/15] clk: at91: generated: set audio_pll_allowed in at91_clk_register_generated() Date: Mon, 2 Dec 2019 10:30:50 +0000 Message-Id: <20191202103050.2668-15-lee.jones@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191202103050.2668-1-lee.jones@linaro.org> References: <20191202103050.2668-1-lee.jones@linaro.org> MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Alexandre Belloni [ Upstream commit c1e4580a1d0ff510d56268c1fc7fcfeec366fe70 ] Set gck->audio_pll_allowed in at91_clk_register_generated. This makes it easier to do it from code that is not parsing device tree. Also, this fixes an issue where the resulting clk_hw can be dereferenced before being tested for error. Fixes: 1a1a36d72e3d ("clk: at91: clk-generated: make gclk determine audio_pll rate") Signed-off-by: Alexandre Belloni Signed-off-by: Stephen Boyd Signed-off-by: Lee Jones --- drivers/clk/at91/clk-generated.c | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) -- 2.24.0 diff --git a/drivers/clk/at91/clk-generated.c b/drivers/clk/at91/clk-generated.c index 113152425a95..ea23002be4de 100644 --- a/drivers/clk/at91/clk-generated.c +++ b/drivers/clk/at91/clk-generated.c @@ -284,7 +284,7 @@ static void clk_generated_startup(struct clk_generated *gck) static struct clk_hw * __init at91_clk_register_generated(struct regmap *regmap, spinlock_t *lock, const char *name, const char **parent_names, - u8 num_parents, u8 id, + u8 num_parents, u8 id, bool pll_audio, const struct clk_range *range) { struct clk_generated *gck; @@ -308,6 +308,7 @@ at91_clk_register_generated(struct regmap *regmap, spinlock_t *lock, gck->regmap = regmap; gck->lock = lock; gck->range = *range; + gck->audio_pll_allowed = pll_audio; clk_generated_startup(gck); hw = &gck->hw; @@ -333,7 +334,6 @@ static void __init of_sama5d2_clk_generated_setup(struct device_node *np) struct device_node *gcknp; struct clk_range range = CLK_RANGE(0, 0); struct regmap *regmap; - struct clk_generated *gck; num_parents = of_clk_get_parent_count(np); if (num_parents == 0 || num_parents > GENERATED_SOURCE_MAX) @@ -350,6 +350,8 @@ static void __init of_sama5d2_clk_generated_setup(struct device_node *np) return; for_each_child_of_node(np, gcknp) { + bool pll_audio = false; + if (of_property_read_u32(gcknp, "reg", &id)) continue; @@ -362,24 +364,14 @@ static void __init of_sama5d2_clk_generated_setup(struct device_node *np) of_at91_get_clk_range(gcknp, "atmel,clk-output-range", &range); + if (of_device_is_compatible(np, "atmel,sama5d2-clk-generated") && + (id == GCK_ID_I2S0 || id == GCK_ID_I2S1 || + id == GCK_ID_CLASSD)) + pll_audio = true; + hw = at91_clk_register_generated(regmap, &pmc_pcr_lock, name, parent_names, num_parents, - id, &range); - - gck = to_clk_generated(hw); - - if (of_device_is_compatible(np, - "atmel,sama5d2-clk-generated")) { - if (gck->id == GCK_ID_SSC0 || gck->id == GCK_ID_SSC1 || - gck->id == GCK_ID_I2S0 || gck->id == GCK_ID_I2S1 || - gck->id == GCK_ID_CLASSD) - gck->audio_pll_allowed = true; - else - gck->audio_pll_allowed = false; - } else { - gck->audio_pll_allowed = false; - } - + id, pll_audio, &range); if (IS_ERR(hw)) continue;