From patchwork Fri Aug 11 14:17:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 109877 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp975751qge; Fri, 11 Aug 2017 07:18:45 -0700 (PDT) X-Received: by 10.101.88.130 with SMTP id d2mr15957367pgu.131.1502461125367; Fri, 11 Aug 2017 07:18:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502461125; cv=none; d=google.com; s=arc-20160816; b=uRPLm3xTsDSGQ8tKwSfC+4eE1dTnuWNM3X9l5vWCIVJzVR42L1LseAg39pwf27T4Sc C2R9wpJ/Kl79lm6VLNl+UYK9Mc/thpe+V/iffV4t9Ra0is7MKJm1fNbcHcusnI1JpJGs EwjvPB3dwcjI5lA4++x2Br/LF7oWHzWCaKKpEcFilu87jcgb9+8yqYZq1slVjhyKWcrP xk0fH86JX0QmmDPhzvzhPIcxckMvfO7e2eR+QWH0qMt5DrHMQVaeUZTfSEm5Q/fPQY6y /xyFd1U3Ij297jq1PP6Xz/bh97yz+rP8QDoJQ3QKKghFhfd6RGRPmUeClOAAw3OgWj4z Nm2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=ZEBSzxresO3yCQPbIls58geWaHdWCqoKlghrtZ/IdQ4=; b=ABiE9JsIeG5j/svFjVHh9QwXqkzPWgrgbDy5GhRpDyFdXTeDF6xBJOiPCDu0A2PNOT alOJ2NAY8Eh7PO/cLVEjEHPeVeIGFGiTRp1WVlhz4Yv+QWuOdyHO+T4PIqrX02/5l3zN 3YjN6aCbTOO+G+bugRW6rM5Wl0gRDu36wkuGAoGdbzW2HXHy1wSDvSeLipVymPUZ2SdH kYNpZJyqpttvvBuhMZ77TAI1akeuxtcrBXYyruCR/eyLPYEYprEbIZ5ynB8ENxv8CHMy e9VijZzkKyvRPYv4gjZ4YDDtx51PS9mmUiIj4BzrIYbbj1vPuK22BMNHSaHcbmZbu4PQ /DCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QgpuB5MK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q5si593288pfb.4.2017.08.11.07.18.45; Fri, 11 Aug 2017 07:18:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QgpuB5MK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752939AbdHKOSm (ORCPT + 25 others); Fri, 11 Aug 2017 10:18:42 -0400 Received: from mail-wr0-f180.google.com ([209.85.128.180]:36065 "EHLO mail-wr0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752723AbdHKOSk (ORCPT ); Fri, 11 Aug 2017 10:18:40 -0400 Received: by mail-wr0-f180.google.com with SMTP id y43so13957665wrd.3 for ; Fri, 11 Aug 2017 07:18:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ZEBSzxresO3yCQPbIls58geWaHdWCqoKlghrtZ/IdQ4=; b=QgpuB5MKCyJxx+Aak6EDjTl9DS55oPpALLSK/ohe4OMbbS/HrgCy1BdzxA5EBGDH5+ ZzdT5W0rN+WnNkii7HNeCR4dpUyvi9Y/oknf6ML4E3QE7WcuOw8bKRvcvY82PaMHMYOh tBV+cfz2PZnwkyC/n48/YvQfBmEVfPLb/bUfo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ZEBSzxresO3yCQPbIls58geWaHdWCqoKlghrtZ/IdQ4=; b=a+fDVd4wGTrh2mCYQnTBNkeClyq5/XfJquPopCnNALX4wVWBE91Z4XOlpoV1KQT7Sp m2zbusC3Gbp/XfBWb2cY6kSmaJYeekV215eod3Bqe8olr/myKE2JfFZRzKVGjwPnFgtj BLOxsRP911H30nZa9S99dK84pZh5Io9hoCsJtoASIrIBAPBu7rLyvHN5J9FqVIn6Ux5B 1MKzk9P4MVXeAsbuYsTX1wzvGA4r1qW74cEJM4ZxPin1FF3/7Pks62/cUE+TTJD6A9pp kh045bObLDGeJupeFRgXjSRbzYizSdBn9YYU2bR2jr5xk0l6E9imJXsdox3tscChD6zY /GkQ== X-Gm-Message-State: AHYfb5jNxRU3hdaoG2lODcIcEaUdoW16q7hfMyFVB3aF3gpOiJahFV1T cxnMwMi46P1seapI X-Received: by 10.223.138.167 with SMTP id y36mr11983135wry.176.1502461119447; Fri, 11 Aug 2017 07:18:39 -0700 (PDT) Received: from localhost.localdomain ([2a01:e35:879a:6cd0:e0e8:7a5e:bd6d:f842]) by smtp.gmail.com with ESMTPSA id v22sm868383wra.70.2017.08.11.07.18.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 11 Aug 2017 07:18:38 -0700 (PDT) From: Daniel Lezcano To: tglx@linutronix.de, mingo@kernel.org Cc: dingtianhong@huawei.com, matt.redfearn@imgtec.com, dan.carpenter@oracle.com, garsilva@embeddedor.com, mka@chromium.org, linux-kernel@vger.kernel.org, Mark Rutland , Ard Biesheuvel , Marc Zyngier , linux-arm-kernel@lists.infradead.org (moderated list:ARM ARCHITECTED TIMER DRIVER) Subject: [PATCH 1/5] clocksource/drivers/arm_arch_timer: Fix mem frame loop initialization Date: Fri, 11 Aug 2017 16:17:37 +0200 Message-Id: <1502461061-28065-1-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <20170811141520.GA795@mai> References: <20170811141520.GA795@mai> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Matthias Kaehlcke The loop to find the best memory frame in arch_timer_mem_acpi_init() initializes the loop counter with itself ('i = i'), which is suspicious in the first place and pointed out by clang. The loop condition is 'i < timer_count' and a prior for loop exits when 'i' reaches 'timer_count', therefore the second loop is never executed. Initialize the loop counter with 0 to iterate over all timers, which supposedly was the intention before the typo monster attacked. Fixes: c2743a36765d3 ("clocksource: arm_arch_timer: add GTDT support for memory-mapped timer") Signed-off-by: Matthias Kaehlcke Reported-by: Ard Biesheuvel Acked-by: Mark Rutland Signed-off-by: Daniel Lezcano --- drivers/clocksource/arm_arch_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c index aae87c4..72bbfcc 100644 --- a/drivers/clocksource/arm_arch_timer.c +++ b/drivers/clocksource/arm_arch_timer.c @@ -1440,7 +1440,7 @@ static int __init arch_timer_mem_acpi_init(int platform_timer_count) * While unlikely, it's theoretically possible that none of the frames * in a timer expose the combination of feature we want. */ - for (i = i; i < timer_count; i++) { + for (i = 0; i < timer_count; i++) { timer = &timers[i]; frame = arch_timer_mem_find_best_frame(timer); From patchwork Fri Aug 11 14:17:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 109878 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp975798qge; Fri, 11 Aug 2017 07:18:48 -0700 (PDT) X-Received: by 10.99.1.2 with SMTP id 2mr15733254pgb.213.1502461128270; Fri, 11 Aug 2017 07:18:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502461128; cv=none; d=google.com; s=arc-20160816; b=t5I+SG5ShFXYHo7/jq4Vnq5AJwzOPOxYQqk44RchGrLAMcpYBNyXl0osh6k/q4ytK3 PRBFic6WwNC1b8v44Kf+/euXGh23DPDSPE3XraByd/MqvK0bAQZgVcuRM3dGffIuweH7 uTPw0IyHK0UCkVWvCtpjeRtXmQKSlD49gZlj8tQ7kInWjkGY56nAVv3aC8Ct5li7jB5i tBk+UA3xvNi8qwRUtaFZ6ttJOmjeWLn9aOAkhoykcOBuNiWg8TDzaU079qBwGAmy4KNW d4+XuzZv92mzarGsm4Gl3VNJWpnLEkGO1GokFkaKcHPzdyNJK+HBk3Qy9FyTvTp9d+0g 5SoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=BvllxgGg/BQVmcg0MM4vNDHCydKPOW8jJFcTFjsK5Rk=; b=nG1TGp9yAKasrDBxm1xvG2l98QlnEw9BiB0lrV15OQC32FMrE4ZTzwqQXXllvQ7nyx /IbAbjEVakGuy9uM7nzugZDNC40quARAQcfdAZZTxCgzbRSZ7R6FaycMs40sWsWmu2fq 4KjdBe6A+FKzOKXPo0nrKKPl9UV5FvkvNP9OLHHWDirKXQfva+Qo5O7pQqr4Ua7nQWSH EutdJVcoXclFiPe/Ingw2N/EwpaMbOF5sYf07WQgsMtdbKsgQSRV3yITQ/RJEujvzDYH Z4PiK6I2nxEr0vCjsE+0FNlYv8XwM9xknU6G5dmrvpOKZVJu7raahVwIO5nbcbL4WAvv UJtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OaKGpbD8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q5si593288pfb.4.2017.08.11.07.18.47; Fri, 11 Aug 2017 07:18:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OaKGpbD8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753053AbdHKOSp (ORCPT + 25 others); Fri, 11 Aug 2017 10:18:45 -0400 Received: from mail-wm0-f44.google.com ([74.125.82.44]:37858 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752850AbdHKOSm (ORCPT ); Fri, 11 Aug 2017 10:18:42 -0400 Received: by mail-wm0-f44.google.com with SMTP id i66so48676181wmg.0 for ; Fri, 11 Aug 2017 07:18:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=BvllxgGg/BQVmcg0MM4vNDHCydKPOW8jJFcTFjsK5Rk=; b=OaKGpbD8e6GFTsXcUU7BFrqSdtIFnRy2HXUAz6CwOndhsUSMwRv2E0eP2NKGJoxBj1 Zs1kHls6c6XVvEHEOq9VFL7mNDGrzNySQKDCq/z8rOLtpu8hpXCZ2cpUf4chSvvxSIrE 2Hgmu9aq3VCv0z8ncRtH7No9wMB0JXsJrkTHI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=BvllxgGg/BQVmcg0MM4vNDHCydKPOW8jJFcTFjsK5Rk=; b=BocKJeMaYNTKzioudMwv3EiOnp/SiFHA104LAzNWnjsOnLq8cDP0+9qh3nv89YhgRX rJp8Prx9BycFrRSs/lMp3wymL6VPbpbFCTr8Pz9DCGpr14I02vjspc23Dy2t/3Idkhb7 6Lhzm7Z52aJpQwcdWNw+7sCY0zKlFpT9knTnwnl4QJUH2P/Sex9d0w/ktVIhlZ2+T2z3 61RDhmpcWySiusAD76LBivEQ1ghi7wopyBShoYPQscXe1+24u0K89opq3OVQ8jqf8KbS k3e2nSVg3U9x0kTaW9Ec7PwKfaZbe+KY24rcbE+zLkHdVLGAnWgJk0iuu+82aL/YCSpa MEIA== X-Gm-Message-State: AHYfb5jOjEmUgEwWb2HpWxDGG3tOoLQju+AgRSPLmuQPYu6hLF6nFZp+ JTo8Brifz6MSi4hW X-Received: by 10.28.113.221 with SMTP id d90mr11817829wmi.49.1502461121068; Fri, 11 Aug 2017 07:18:41 -0700 (PDT) Received: from localhost.localdomain ([2a01:e35:879a:6cd0:e0e8:7a5e:bd6d:f842]) by smtp.gmail.com with ESMTPSA id v22sm868383wra.70.2017.08.11.07.18.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 11 Aug 2017 07:18:40 -0700 (PDT) From: Daniel Lezcano To: tglx@linutronix.de, mingo@kernel.org Cc: dingtianhong@huawei.com, matt.redfearn@imgtec.com, dan.carpenter@oracle.com, garsilva@embeddedor.com, mka@chromium.org, linux-kernel@vger.kernel.org, Frans Klaver Subject: [PATCH 2/5] clocksource/drivers/em_sti: Fix error return codes in em_sti_probe() Date: Fri, 11 Aug 2017 16:17:38 +0200 Message-Id: <1502461061-28065-2-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1502461061-28065-1-git-send-email-daniel.lezcano@linaro.org> References: <20170811141520.GA795@mai> <1502461061-28065-1-git-send-email-daniel.lezcano@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Gustavo A. R. Silva" Propagate the return values of platform_get_irq and devm_request_irq on failure. Cc: Frans Klaver Signed-off-by: Gustavo A. R. Silva Signed-off-by: Daniel Lezcano --- drivers/clocksource/em_sti.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) -- 2.7.4 diff --git a/drivers/clocksource/em_sti.c b/drivers/clocksource/em_sti.c index bc48cbf..269db74 100644 --- a/drivers/clocksource/em_sti.c +++ b/drivers/clocksource/em_sti.c @@ -305,7 +305,7 @@ static int em_sti_probe(struct platform_device *pdev) irq = platform_get_irq(pdev, 0); if (irq < 0) { dev_err(&pdev->dev, "failed to get irq\n"); - return -EINVAL; + return irq; } /* map memory, let base point to the STI instance */ @@ -314,11 +314,12 @@ static int em_sti_probe(struct platform_device *pdev) if (IS_ERR(p->base)) return PTR_ERR(p->base); - if (devm_request_irq(&pdev->dev, irq, em_sti_interrupt, - IRQF_TIMER | IRQF_IRQPOLL | IRQF_NOBALANCING, - dev_name(&pdev->dev), p)) { + ret = devm_request_irq(&pdev->dev, irq, em_sti_interrupt, + IRQF_TIMER | IRQF_IRQPOLL | IRQF_NOBALANCING, + dev_name(&pdev->dev), p); + if (ret) { dev_err(&pdev->dev, "failed to request low IRQ\n"); - return -ENOENT; + return ret; } /* get hold of clock */ From patchwork Fri Aug 11 14:17:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 109881 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp976555qge; Fri, 11 Aug 2017 07:19:26 -0700 (PDT) X-Received: by 10.98.103.11 with SMTP id b11mr16119640pfc.211.1502461166113; Fri, 11 Aug 2017 07:19:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502461166; cv=none; d=google.com; s=arc-20160816; b=Mwv8dRJkFwuvvb67BaMJL/+CFmXOYXrss+76oiDNZF0ZYDmJU6KnL66HT5wCmt/VPd R55/kGvWdHo5M1mxDJrq+civo+gtvegRQWFxnmdoGT3gP48Z9klRKeyqSmeK/QHGglSg CB10e5BX01Pu6vH4L9jHUzqObSdWLCh3pKq1L0aSz6j2v+Wd8q+UDd4eaZOuhWP8v2Xy 2tH/a4HerJiixYPk3Myp2j5mO2+XFlMnxk0gjgqQTYLVrYw0Kk6j/wA7OpIblzAslDnU nAD92nCcAFn6istGTbfJfE6F7NNdJYiIwbXMe3biyWpKB3XhT65/YIExfqVRwH4VHIQZ Of9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=UoAL8i8yiSRA5MuO33W6BzTWoa37g6HIv+MaxLFZShg=; b=TpdraezUi7pH24t7nMYskGzuJpHiMYDwAT594lQfLEpbZcyTuICzYVJtGus7y+yrBc MyMXaxrBNVvEzOQ+njHVJwdBwF84G8XxXnsUzYzNn2a0IjhNNR0KoosdugbfGqJftoeq vF+UI5OW/9/HGBRXuTbTXuGMNgWYa5bESjQSacH14trjPdhe0gXNkXBuh4TuqGYogL+4 xWe02z/6D9050vJKgfeB7srnubVyVkSDa3USYCKlubuRGP9FLZkSRBdI0DJ3mdWfkbBN KcZYzMzg1ayn9yfuCis3JWkTR2+tXZ07bdCkS6ExfbISjMrKAesUSMX7c7tY0+2bBGhl x49A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ERMN7xdI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 186si558763pgi.183.2017.08.11.07.19.25; Fri, 11 Aug 2017 07:19:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ERMN7xdI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753271AbdHKOTX (ORCPT + 25 others); Fri, 11 Aug 2017 10:19:23 -0400 Received: from mail-wm0-f44.google.com ([74.125.82.44]:35979 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752723AbdHKOSn (ORCPT ); Fri, 11 Aug 2017 10:18:43 -0400 Received: by mail-wm0-f44.google.com with SMTP id t201so42917748wmt.1 for ; Fri, 11 Aug 2017 07:18:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=UoAL8i8yiSRA5MuO33W6BzTWoa37g6HIv+MaxLFZShg=; b=ERMN7xdIKedctF0PGNI08mMaR/s8oFciXPa+rnLZ33D0oMrtcmhsIWKVYNV1jzq5fV GpC/gHbfP8Ks4/n04M975MpIYM4aPD3nrJOsEukhmuQaKb3PZSK2R6DLXUbwexzhmYoc c8EMQmwkshdkyVNvgOO/8mXfEniniNo6snJKc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=UoAL8i8yiSRA5MuO33W6BzTWoa37g6HIv+MaxLFZShg=; b=XYRyzt5uIrkAeUXfh74JoYSgOQXgVKLBqWBRO2CYi6PucuddOte0AbunIakGemLLb3 UgB40PlUzyt1+WtD1/ZPS++tAHX44jLNGhCK+ogt8yJLqBJ8oRTpfQXaJ6RM5FuxrDLw lFM9LB4bAdoNl9D09d5OJ0iQJJ4LZqkhCfgXI0Om/d/PbBmlKEKVcrmvsIbTa7VAEoke GoFURxu9OlBEWUh6yFTcBUQypZMtfBMAtY7fCNmZQroTZxBe1q7jvUYIcSoSp543xvN9 aAdoJLRC5mE7ic077/MI36AH9M4B3lR96HjXDY6McM56PDkO5gBzdz1MJPiUH2LZwhfh ZgDQ== X-Gm-Message-State: AHYfb5jXE357RhpmLUN8GnKr1+sHsKJ0vRiorbgwDcwPvae79WqRc0mN xCsWnQr97hammUes X-Received: by 10.28.32.208 with SMTP id g199mr9064119wmg.180.1502461122632; Fri, 11 Aug 2017 07:18:42 -0700 (PDT) Received: from localhost.localdomain ([2a01:e35:879a:6cd0:e0e8:7a5e:bd6d:f842]) by smtp.gmail.com with ESMTPSA id v22sm868383wra.70.2017.08.11.07.18.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 11 Aug 2017 07:18:42 -0700 (PDT) From: Daniel Lezcano To: tglx@linutronix.de, mingo@kernel.org Cc: dingtianhong@huawei.com, matt.redfearn@imgtec.com, dan.carpenter@oracle.com, garsilva@embeddedor.com, mka@chromium.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/5] clocksource/drivers/timer-of: Checking for IS_ERR() instead of NULL Date: Fri, 11 Aug 2017 16:17:39 +0200 Message-Id: <1502461061-28065-3-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1502461061-28065-1-git-send-email-daniel.lezcano@linaro.org> References: <20170811141520.GA795@mai> <1502461061-28065-1-git-send-email-daniel.lezcano@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter The current code checks the return value of the of_io_request_and_map() function as it was returning a NULL pointer in case of error. However, it returns an error code encoded in the pointer return value, not a NULL value. Fix this by checking the returned pointer against IS_ERR() and return the error with PTR_ERR(). Signed-off-by: Dan Carpenter Signed-off-by: Daniel Lezcano --- drivers/clocksource/timer-of.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/drivers/clocksource/timer-of.c b/drivers/clocksource/timer-of.c index d509b50..4d7aef9 100644 --- a/drivers/clocksource/timer-of.c +++ b/drivers/clocksource/timer-of.c @@ -128,9 +128,9 @@ static __init int timer_base_init(struct device_node *np, const char *name = of_base->name ? of_base->name : np->full_name; of_base->base = of_io_request_and_map(np, of_base->index, name); - if (!of_base->base) { + if (IS_ERR(of_base->base)) { pr_err("Failed to iomap (%s)\n", name); - return -ENXIO; + return PTR_ERR(of_base->base); } return 0; From patchwork Fri Aug 11 14:17:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 109880 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp976142qge; Fri, 11 Aug 2017 07:19:06 -0700 (PDT) X-Received: by 10.84.178.131 with SMTP id z3mr17724277plb.127.1502461146354; Fri, 11 Aug 2017 07:19:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502461146; cv=none; d=google.com; s=arc-20160816; b=gwLa8RWhIb+d96vYUawp1wSO0cfCorFyP8sc21U8OeIQUZA4u1o5pY8wckhQYNNwO1 L8I6kUUESTZYXfvH3qIuRvdnAxMzrAyHlaDo/5fHnVMPhFhprIjuCVu4EGH7dsuu+S3s b4JB0/gdVBC/U6CXxP9kwgP8M3UKABJFELYTJSkuhr8Bq1kMowffCUlGjCDk128idsvi lCTerTsfVqAdh0gC8RX4UZRWu4H2ViRxYhRBk5SC1IBCEUQDFXe2QP0S2+kRsHfzpMbd 3P+YSFBrQFAlJYnqkj2LhOPRfFzaFe0DsUbw4pLwAk3McjHzMTWTjRyTTqOhNTP9bSNr W0YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=nQfnPQ0fmvteH2g3VNnSJSxd/NfPSYTFH6zue6wa2wQ=; b=F7d/W4Bph5QyNHlSsY7dhT61m7Ym0hr5AZi5WWG2AuFd7ZjyxfGbpLZ2y94/r+MeB6 Ekp4xmIEHd07CKs00dnmlM8R8w0sstCvcl3tgevCSrINvD1piHpxBV4ye9UNDVcLm2j1 +RaRoVgF82NP/fdTlyL2DQ4QnA4ITQUJbn3iGOoP1Gb4ArU7tCs+S0yOyxa4wOBhIHWE OZxNybfyQ1L/NfTRfOg9122at2itworx1HWiI/TkjFHShVocPdG9LDmP0Cexn1abTRO6 V4kXNUA1EA+71LnE9LobC59LHLxwUHPI8hTdROkCdXZVWV3Drs2eocIKwJXmReq3X9yq DtzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iXbbCEYE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r63si564703pfg.653.2017.08.11.07.19.06; Fri, 11 Aug 2017 07:19:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iXbbCEYE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753171AbdHKOSt (ORCPT + 25 others); Fri, 11 Aug 2017 10:18:49 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:35994 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752850AbdHKOSp (ORCPT ); Fri, 11 Aug 2017 10:18:45 -0400 Received: by mail-wm0-f54.google.com with SMTP id t201so42918491wmt.1 for ; Fri, 11 Aug 2017 07:18:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=nQfnPQ0fmvteH2g3VNnSJSxd/NfPSYTFH6zue6wa2wQ=; b=iXbbCEYEMCEU36FMtC1HvYV8QhqrWB6awA9fzSUI4DFuS6xEPttVRh2fq6d3Unx1Zy kog7ttIawAgFgZz9HVuf9M1tK7T/Go36aOvUyB/eezVFo8ms1uFIK/ky2F6XAxh0qLb0 KIF/xSc6tQGRjPGG99VEHAczPWYqlm6DUHoEM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=nQfnPQ0fmvteH2g3VNnSJSxd/NfPSYTFH6zue6wa2wQ=; b=QY0F/mI0l4bzfqoqSYSwMpCTaQgVP4V1OMqDT4xcXshnlR5BGYIWmv7lzgq76ZH4jq 81JdV31gYoxoYMPlx+VmuK3Nm/LtxZqr+tY7zSe7cuojb3drdbp44IxyUTxdEL2qI54m wwosBkbrBRkDTyqLVRHIn7CnvhMGiTyIuLqkNCZLYi5T8xwHDfpML8GqMWRq4rgSR1Yu JyiW2GFR0mCj4qgi4Ha+Pe4otGFqYMtirkLJCOutUMuhKnp6gZH1FudLsAV6Fxu9THpw IzgxWRkU+SPcb4SAoXXcZARNrS8aU7KBhfwu3WB6uwE7hjdLWPeFIxQUuk6pV3BIK6cB la8A== X-Gm-Message-State: AHYfb5gLVYF1IwGNMQ33dfw9iaoVbzcYAWTFFp0LI6RexSYG2M9Nr8jq z+T4Ek9W62Rd47Lp X-Received: by 10.28.58.138 with SMTP id h132mr9149339wma.64.1502461124242; Fri, 11 Aug 2017 07:18:44 -0700 (PDT) Received: from localhost.localdomain ([2a01:e35:879a:6cd0:e0e8:7a5e:bd6d:f842]) by smtp.gmail.com with ESMTPSA id v22sm868383wra.70.2017.08.11.07.18.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 11 Aug 2017 07:18:43 -0700 (PDT) From: Daniel Lezcano To: tglx@linutronix.de, mingo@kernel.org Cc: dingtianhong@huawei.com, matt.redfearn@imgtec.com, dan.carpenter@oracle.com, garsilva@embeddedor.com, mka@chromium.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/5] clocksource/drivers/Kconfig: Fix CLKSRC_PISTACHIO dependencies Date: Fri, 11 Aug 2017 16:17:40 +0200 Message-Id: <1502461061-28065-4-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1502461061-28065-1-git-send-email-daniel.lezcano@linaro.org> References: <20170811141520.GA795@mai> <1502461061-28065-1-git-send-email-daniel.lezcano@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Matt Redfearn In v4.13, CLKSRC_PISTACHIO can select TIMER_OF on architectures without GENERIC_CLOCKEVENTS, resulting in a struct clock_event_device missing some required features and build breakage compiling timer_of.c. One of the symbols selecting TIMER_OF is CLKSRC_PISTACHIO, so add the dependency on GENERIC_CLOCKEVENTS. Thanks to kbuild test robot for finding this error (https://lkml.org/lkml/2017/7/16/249) Signed-off-by: Matt Redfearn Suggested-by: Ian Abbott Signed-off-by: Daniel Lezcano --- drivers/clocksource/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index fcae5ca..54a67f8 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig @@ -262,7 +262,7 @@ config CLKSRC_LPC32XX config CLKSRC_PISTACHIO bool "Clocksource for Pistachio SoC" if COMPILE_TEST - depends on HAS_IOMEM + depends on GENERIC_CLOCKEVENTS && HAS_IOMEM select TIMER_OF help Enables the clocksource for the Pistachio SoC. From patchwork Fri Aug 11 14:17:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 109879 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp975957qge; Fri, 11 Aug 2017 07:18:56 -0700 (PDT) X-Received: by 10.98.40.5 with SMTP id o5mr16699804pfo.203.1502461135936; Fri, 11 Aug 2017 07:18:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502461135; cv=none; d=google.com; s=arc-20160816; b=1JhvdHqyBiOwlU2SPgxA+F7DL/wJ6lQePo5BgDQuOY16XMQlCRSp5T5XJx9v2sJnr0 VGEpE+C7LRiC39oPfrpNoaVqacWIhGRVVngEKNcPgPw1FwlBEqGGNOLs7C1Bpu3od/dO Y3I55ocg8gwPSRmzGogP2XT46dghhlvvriiLPRDtt7d9e3xr319agAWF5fmEdI4kTCcd aikCS5HUZllImtCURzMn8sOCHhAMqUnb4kxnsCnBydZWxVXBmFxPan8iTT5pMgC1Q5Ti R+7KCt7DPVVAd+DJYF68jPXE1mHYvVkRFVJKyr3oJoSI5aAwU1ufUgptXwXAvOvUceW+ cpgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=nDqlsJhUAk3IfHV4KCdccVXblqleBeW/0mVFD/7+on0=; b=VigKfSaBpAl5wkpv3K6a9aGU35E53JspwQI/YM85IwvE+Gy7equ/xgd9+YUhrPOQpN QP0Lh7oRtQ8RULCvWUrhWN532vPv/4JrGriEIQvJSzG2LHZpbxP07LpprFWlY5J0pC+D PM+zeGrKoRCrT+6IU7QpTvvfaHSnpd/6+fdvSyM5yoVYwfr0OiQRAalPNu96aQMdbn6l puKe8c2ZipXoUlqsY0iFeu9aZ0QDg90K4xg9b8lAC5i9jL9oATlZFxyneqJpITUM4lpH Pc+Tp6mI/5f+ibkiwYR8DrWUVaQ5Ma8JUzqxwAVgkHFbMcWX0d5LdFo313DDJJ6G4gOI G1EA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VYD2oQdh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r63si564703pfg.653.2017.08.11.07.18.55; Fri, 11 Aug 2017 07:18:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VYD2oQdh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753218AbdHKOSv (ORCPT + 25 others); Fri, 11 Aug 2017 10:18:51 -0400 Received: from mail-wr0-f178.google.com ([209.85.128.178]:38054 "EHLO mail-wr0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753080AbdHKOSr (ORCPT ); Fri, 11 Aug 2017 10:18:47 -0400 Received: by mail-wr0-f178.google.com with SMTP id f21so13852018wrf.5 for ; Fri, 11 Aug 2017 07:18:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=nDqlsJhUAk3IfHV4KCdccVXblqleBeW/0mVFD/7+on0=; b=VYD2oQdh9fa4LRzLJr1At+IQufQZVtUxvvauMcnFU6LWLQ5Skp8CqKYjUUdtoLPrAi E10b2AJcHepMEUMWtFGZHUUZWH45t9xE4QTwREikrC2iyqtNafwU4oRz2lCOZMbHju03 5YE/UoaasO9LbxrxLgySlLXVO7DXlryFr4N10= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=nDqlsJhUAk3IfHV4KCdccVXblqleBeW/0mVFD/7+on0=; b=nFHxdWzwxUV+NWPsBaJeMpfdXKHV5ZEBRZMN1Mj4Ej5G8LuVPLAWkLfVsYzq/SI/Ah dfquOU8rH+C7vmNOC1IA/bghL6xGGYSKtgmKz4smz+Z02JrrOb/NSrYB2bWWumrbo2Ez KxICJK1so7dQrByegfH4kSBzWIykKZxdNPrtxsTtoodtx862qd5T7Uz75+Cdnu3uSpn2 7BHEn2cz+VD04Uvsw+yoGvaa+/KjiO5jlExqxR1Atf0phHqYZysJNXGKBmSM3IwpL327 lcrwlD2xH7rJbPq/a+etPU8bT8sJ4IY98G95TQtie1Gb8ptz1/lUK53Y4EZGfyFnfd13 8ErA== X-Gm-Message-State: AHYfb5g6rFhEzEsEeFTSarwDzf2dHaHqssVUdt+EtUk0sCXIOwAhD+Tv twCEv399E3W+R+RE X-Received: by 10.223.171.17 with SMTP id q17mr12110724wrc.12.1502461125940; Fri, 11 Aug 2017 07:18:45 -0700 (PDT) Received: from localhost.localdomain ([2a01:e35:879a:6cd0:e0e8:7a5e:bd6d:f842]) by smtp.gmail.com with ESMTPSA id v22sm868383wra.70.2017.08.11.07.18.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 11 Aug 2017 07:18:45 -0700 (PDT) From: Daniel Lezcano To: tglx@linutronix.de, mingo@kernel.org Cc: dingtianhong@huawei.com, matt.redfearn@imgtec.com, dan.carpenter@oracle.com, garsilva@embeddedor.com, mka@chromium.org, linux-kernel@vger.kernel.org, Mark Rutland , Marc Zyngier , Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org (moderated list:ARM ARCHITECTED TIMER DRIVER) Subject: [PATCH 5/5] clocksource/drivers/arm_arch_timer: Avoid infinite recursion when ftrace is enabled Date: Fri, 11 Aug 2017 16:17:41 +0200 Message-Id: <1502461061-28065-5-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1502461061-28065-1-git-send-email-daniel.lezcano@linaro.org> References: <20170811141520.GA795@mai> <1502461061-28065-1-git-send-email-daniel.lezcano@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ding Tianhong On platforms with an arch timer erratum workaround, it's possible for arch_timer_reg_read_stable() to recurse into itself when certain tracing options are enabled, leading to stack overflows and related problems. For example, when PREEMPT_TRACER and FUNCTION_GRAPH_TRACER are selected, it's possible to trigger this with: $ mount -t debugfs nodev /sys/kernel/debug/ $ echo function_graph > /sys/kernel/debug/tracing/current_tracer The problem is that in such cases, preempt_disable() instrumentation attempts to acquire a timestamp via trace_clock(), resulting in a call back to arch_timer_reg_read_stable(), and hence recursion. This patch changes arch_timer_reg_read_stable() to use preempt_{disable,enable}_notrace(), which avoids this. This problem is similar to the fixed by upstream commit 96b3d28bf4 ("sched/clock: Prevent tracing recursion in sched_clock_cpu()"). Fixes: 6acc71ccac71 ("arm64: arch_timer: Allows a CPU-specific erratum to only affect a subset of CPUs") Signed-off-by: Ding Tianhong Acked-by: Mark Rutland Acked-by: Marc Zyngier Signed-off-by: Daniel Lezcano --- arch/arm64/include/asm/arch_timer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/arch/arm64/include/asm/arch_timer.h b/arch/arm64/include/asm/arch_timer.h index 74d08e4..a652ce0 100644 --- a/arch/arm64/include/asm/arch_timer.h +++ b/arch/arm64/include/asm/arch_timer.h @@ -65,13 +65,13 @@ DECLARE_PER_CPU(const struct arch_timer_erratum_workaround *, u64 _val; \ if (needs_unstable_timer_counter_workaround()) { \ const struct arch_timer_erratum_workaround *wa; \ - preempt_disable(); \ + preempt_disable_notrace(); \ wa = __this_cpu_read(timer_unstable_counter_workaround); \ if (wa && wa->read_##reg) \ _val = wa->read_##reg(); \ else \ _val = read_sysreg(reg); \ - preempt_enable(); \ + preempt_enable_notrace(); \ } else { \ _val = read_sysreg(reg); \ } \