From patchwork Fri Jan 18 14:03:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 10770325 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 938A114E5 for ; Fri, 18 Jan 2019 14:04:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 802A62DB26 for ; Fri, 18 Jan 2019 14:04:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 744C72DB39; Fri, 18 Jan 2019 14:04:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1927D2DB26 for ; Fri, 18 Jan 2019 14:04:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tdBB0PaxdsdCVtFA8m7oWNL/vtcDrHhbQTvnQZHoQHA=; b=bPAd7yA1zEqRCS BYlNOjjcB7R6Ph52kPx/xaQBE5hMged5pE8oTShqkMn0eOLE2j+297mE/9dEZOtV5P8Qd2ZceewCB 6FTXVZ9tUXsm+mueqgfk5bDu2VkD4g3icZS7B+REnBcB56Lb2f7KbcjA/q5EIgiZj6ZBG8Qgjy64F raBwUW0Z7QNX9WBbER3OewjpCBsBUKjZD8sC6GSu7QuM/fP76XUU+Sb5k5IQQMnHKc7vnqnLNzzuK wg1N9ud2Izlp4HyxcuafxIFw1SMeTb3frN2Nkfaoaeoz0Fy7P+DRKbEkUQcsO/c1TfSZMPpiGDPP1 EeYQR23oRIO4wbgdLUNg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gkUlP-0004pz-Li; Fri, 18 Jan 2019 14:04:51 +0000 Received: from mail-lf1-f68.google.com ([209.85.167.68]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gkUlF-0004eB-KC for linux-riscv@lists.infradead.org; Fri, 18 Jan 2019 14:04:44 +0000 Received: by mail-lf1-f68.google.com with SMTP id y14so10548125lfg.13 for ; Fri, 18 Jan 2019 06:04:38 -0800 (PST) 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:mime-version:content-transfer-encoding; bh=gUE4wXX4TJVPhb5KX9MWt1+d3yl5yS/n/x3TIPSxP/o=; b=mwjRAVxyCt6ZiIXVTWfB4hipEHoR+Ybm6GLiirRf2KiFiSyW2tb01+1lb2mqF6S7Ra /7/WbhS+Y0XdFMhCuxrhyv+BTkUZL8n7pCwuKrYNTEf/MVJOBI2j+y6DYzOxdxLO3jdC ByVcdXVV/NHC2k+N4+INOqmSbYa6mUynTCEOZWnqw0cHiQK9rczpvIUrn8x+L+Y8rut+ rfEITbafBqwoUkQ8yiNQV6Vqg9kbySWuO6Yz2hhSDtRdOQBh5Q2vtO19ragQUekKjzmc Dffc1WgNN1knCIn47evZqR+LTmWC94mKeHV4PPf8sKJ4kF81nVy+rveTQJmF/Dvo7RJm tR2Q== X-Gm-Message-State: AJcUukcVj/VZjD1gBvSD7BkHKRe6GdfA3r3DEjgR6fN7tkpjPcvVh80T kH8cuu+JBt5/YpCFfgfs2CA= X-Google-Smtp-Source: ALg8bN6AvZBFYlhhXRJh6nq08nZfOMzdrlybPlCgKOHtBUEXc9NUoFatW3gzf/Vj9C/jPlTyK6lTdg== X-Received: by 2002:ac2:53bc:: with SMTP id j28mr13296649lfh.86.1547820276569; Fri, 18 Jan 2019 06:04:36 -0800 (PST) Received: from xi.terra (c-74bee655.07-184-6d6c6d4.bbcust.telenor.se. [85.230.190.116]) by smtp.gmail.com with ESMTPSA id q67sm831214lfe.19.2019.01.18.06.04.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Jan 2019 06:04:35 -0800 (PST) Received: from johan by xi.terra with local (Exim 4.91) (envelope-from ) id 1gkUlB-0002Vq-60; Fri, 18 Jan 2019 15:04:37 +0100 From: Johan Hovold To: Palmer Dabbelt Subject: [PATCH 1/5] riscv: add missing newlines to printk messages Date: Fri, 18 Jan 2019 15:03:04 +0100 Message-Id: <20190118140308.9599-2-johan@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190118140308.9599-1-johan@kernel.org> References: <20190118140308.9599-1-johan@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190118_060441_658464_18B1CEC4 X-CRM114-Status: GOOD ( 12.52 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Albert Ou , Andreas Schwab , linux-kernel@vger.kernel.org, Johan Hovold , Atish Patra , Anup Patel , linux-riscv@lists.infradead.org Sender: "linux-riscv" Errors-To: linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add missing newline characters to printk messages. Also replace two pr_warning with the shorter pr_warn, and fix up the tense of one error message while at it. Signed-off-by: Johan Hovold Reviewed-by: Christoph Hellwig --- arch/riscv/kernel/cpu.c | 2 +- arch/riscv/kernel/cpufeature.c | 8 ++++---- arch/riscv/kernel/ftrace.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/riscv/kernel/cpu.c b/arch/riscv/kernel/cpu.c index f8fa2c63aa89..11ba67f010e7 100644 --- a/arch/riscv/kernel/cpu.c +++ b/arch/riscv/kernel/cpu.c @@ -106,7 +106,7 @@ static void print_isa(struct seq_file *f, const char *orig_isa) * a bit of info describing what went wrong. */ if (isa[0] != '\0') - pr_info("unsupported ISA \"%s\" in device tree", orig_isa); + pr_info("unsupported ISA \"%s\" in device tree\n", orig_isa); } static void print_mmu(struct seq_file *f, const char *mmu_type) diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c index a6e369edbbd7..4891fd62b95e 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -50,12 +50,12 @@ void riscv_fill_hwcap(void) if (riscv_of_processor_hartid(node) >= 0) break; if (!node) { - pr_warning("Unable to find \"cpu\" devicetree entry"); + pr_warn("Unable to find \"cpu\" devicetree entry\n"); return; } if (of_property_read_string(node, "riscv,isa", &isa)) { - pr_warning("Unable to find \"riscv,isa\" devicetree entry"); + pr_warn("Unable to find \"riscv,isa\" devicetree entry\n"); of_node_put(node); return; } @@ -67,11 +67,11 @@ void riscv_fill_hwcap(void) /* We don't support systems with F but without D, so mask those out * here. */ if ((elf_hwcap & COMPAT_HWCAP_ISA_F) && !(elf_hwcap & COMPAT_HWCAP_ISA_D)) { - pr_info("This kernel does not support systems with F but not D"); + pr_info("This kernel does not support systems with F but not D\n"); elf_hwcap &= ~COMPAT_HWCAP_ISA_F; } - pr_info("elf_hwcap is 0x%lx", elf_hwcap); + pr_info("elf_hwcap is 0x%lx\n", elf_hwcap); #ifdef CONFIG_FPU if (elf_hwcap & (COMPAT_HWCAP_ISA_F | COMPAT_HWCAP_ISA_D)) diff --git a/arch/riscv/kernel/ftrace.c b/arch/riscv/kernel/ftrace.c index a840b7d074f7..b94d8db5ddcc 100644 --- a/arch/riscv/kernel/ftrace.c +++ b/arch/riscv/kernel/ftrace.c @@ -32,7 +32,7 @@ static int ftrace_check_current_call(unsigned long hook_pos, * return must be -EINVAL on failed comparison */ if (memcmp(expected, replaced, sizeof(replaced))) { - pr_err("%p: expected (%08x %08x) but get (%08x %08x)", + pr_err("%p: expected (%08x %08x) but got (%08x %08x)\n", (void *)hook_pos, expected[0], expected[1], replaced[0], replaced[1]); return -EINVAL; From patchwork Fri Jan 18 14:03:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 10770319 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 90F8314E5 for ; Fri, 18 Jan 2019 14:04:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C16C2DB26 for ; Fri, 18 Jan 2019 14:04:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6F75F2DB36; Fri, 18 Jan 2019 14:04:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2788B2DB26 for ; Fri, 18 Jan 2019 14:04:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yRS5KlBQHHV3zAjcgc32xUBu3pLnREmBmvkUgbwUPyQ=; b=LN+OpDJgL5sFsq 9kH4ZQ+5+WePKgbyn4fhaEKuOqtiqMRRizis+EEfeSqxpoLF/18UwCYQ/E8xZh34+uy9+32dn1QPS Wj8f2spBTYHUmU32MgBmASroIifMBwFA+6gAl1eY6hZMv2rKexRiWt4jGpxlW25aeCrqjnPRPqA/8 7iiqCLM8ksjmcGmxuIYlIzWWohZPZJqoZjRGMrqymOvtaj2mCKgmUtDsf8wSD+KCEsLJNEmqcdHgp 90giQfKR1cYgizBVr/jZzP4qU4rdHCyGyCybJRtXJ5k3TkOB9kI86ebVPks5ZzHuKFhgL+bj9c0Ah aF5/kzR1ID4ws1WVR9XQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gkUlJ-0004ku-8P; Fri, 18 Jan 2019 14:04:45 +0000 Received: from mail-lf1-f68.google.com ([209.85.167.68]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gkUlF-0004dy-KD for linux-riscv@lists.infradead.org; Fri, 18 Jan 2019 14:04:42 +0000 Received: by mail-lf1-f68.google.com with SMTP id a8so10575082lfk.5 for ; Fri, 18 Jan 2019 06:04:38 -0800 (PST) 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:mime-version:content-transfer-encoding; bh=cmUXM58BMaiJjpGLA3Yxvgez8I0gKgtgs8JTbgTggBI=; b=YacGNW4JNhykNGcExqfk0k1S2DSDkd0RwB5tBxfmI9JkJXDMIeIrdR9etTOE41sn3T yHB7r39DrE5ps9mkr3DlKTawTVa74z+/F6zj9MPhAUZA42eL9mgLJl2NMe/G9RACTA52 Xkj6VOFa5HA5UlPExLNczyuR9pikMntslJCl+MyX8RABx+P1QNLT0oTgebgFgcEt6Bj1 k8SD2gQB6uH1FKyRYJw/cQrADRakCekekqI++ILu9EVHcQqMN9++XrqHal1t0dRbgMQK fknfeDir8yyfRvFQT2oiKSkPkFoo6xOVbgs6pZdXNJvnRGP5lOgYMynTDZSyIO5XIMMa HXww== X-Gm-Message-State: AJcUukdg35KlrjsC79zSaklg5U76CMlJud8D5zYIYm5OuP268AvvREz+ alQKKTvVJs8kqQz6d0zh5+4= X-Google-Smtp-Source: ALg8bN6ZyIQtwvoCv4X5xICG4zkSKseDpH/7qfL0DfctUWNjTB5g2KO/0iF3NGF1XRY/SSz28BzQUg== X-Received: by 2002:ac2:4194:: with SMTP id z20mr7107719lfh.74.1547820276099; Fri, 18 Jan 2019 06:04:36 -0800 (PST) Received: from xi.terra (c-74bee655.07-184-6d6c6d4.bbcust.telenor.se. [85.230.190.116]) by smtp.gmail.com with ESMTPSA id g85-v6sm765405lji.17.2019.01.18.06.04.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Jan 2019 06:04:35 -0800 (PST) Received: from johan by xi.terra with local (Exim 4.91) (envelope-from ) id 1gkUlB-0002Vv-8r; Fri, 18 Jan 2019 15:04:37 +0100 From: Johan Hovold To: Palmer Dabbelt Subject: [PATCH 2/5] riscv: use pr_info and friends Date: Fri, 18 Jan 2019 15:03:05 +0100 Message-Id: <20190118140308.9599-3-johan@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190118140308.9599-1-johan@kernel.org> References: <20190118140308.9599-1-johan@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190118_060441_668517_A46A0D98 X-CRM114-Status: GOOD ( 10.13 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Albert Ou , Andreas Schwab , linux-kernel@vger.kernel.org, Johan Hovold , Atish Patra , Anup Patel , linux-riscv@lists.infradead.org Sender: "linux-riscv" Errors-To: linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use the pr_info and pr_err macros instead of printk with explicit log levels. Signed-off-by: Johan Hovold Reviewed-by: Paul Walmsley Reviewed-by: Christoph Hellwig --- arch/riscv/kernel/setup.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c index 6e079e94b638..5c15bb0560ee 100644 --- a/arch/riscv/kernel/setup.c +++ b/arch/riscv/kernel/setup.c @@ -76,11 +76,11 @@ static void __init setup_initrd(void) unsigned long size; if (initrd_start >= initrd_end) { - printk(KERN_INFO "initrd not found or empty"); + pr_info("initrd not found or empty"); goto disable; } if (__pa(initrd_end) > PFN_PHYS(max_low_pfn)) { - printk(KERN_ERR "initrd extends beyond end of memory"); + pr_err("initrd extends beyond end of memory"); goto disable; } @@ -88,7 +88,7 @@ static void __init setup_initrd(void) memblock_reserve(__pa(initrd_start), size); initrd_below_start_ok = 1; - printk(KERN_INFO "Initial ramdisk at: 0x%p (%lu bytes)\n", + pr_info("Initial ramdisk at: 0x%p (%lu bytes)\n", (void *)(initrd_start), size); return; disable: From patchwork Fri Jan 18 14:03:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 10770327 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 69B1214E5 for ; Fri, 18 Jan 2019 14:04:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 56EA02DB26 for ; Fri, 18 Jan 2019 14:04:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4AD5A2DB39; Fri, 18 Jan 2019 14:04:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D42502DB26 for ; Fri, 18 Jan 2019 14:04:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=lpAY7cwKXfaw+S0AmJ+0mSKCUuJGqMG3Djk3uT8j2bM=; b=u8bzkmHG0HmvTO SeouETJpcpTw0IiD4DaKG/Z+wnqwyxVfksOIlke6VHzKaWJqoeTzsCkfgcOixeVrT+a14dFTsLuHM CMAyCmxwkhfX61SiLnocyxQSLn/LThBZbcDEDkN0JaAJmc500aLSkQ7a6C6jRTK6IZe9qc5wxqGBT 01E2KmNWs6T6QeIJeVV5Eb13lh0vBXbzLxG4MvHbzavvv1Tz9zN4C5KS7Fp67h9RRttCzNc2LYRX0 tX6nZULg8kLD6GPbdyxPLEZ7Ul0l6O0C/FaxwPfONIbo88hEamEXieZXUJhi1rLR8NY/5MzbOoU+I qNoiDERvhKpld/nfI76w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gkUlR-0004rY-6k; Fri, 18 Jan 2019 14:04:53 +0000 Received: from mail-lf1-f67.google.com ([209.85.167.67]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gkUlH-0004iu-VZ for linux-riscv@lists.infradead.org; Fri, 18 Jan 2019 14:04:45 +0000 Received: by mail-lf1-f67.google.com with SMTP id e26so10580611lfc.2 for ; Fri, 18 Jan 2019 06:04:43 -0800 (PST) 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:mime-version:content-transfer-encoding; bh=edUxdz3ce3gWnciU4XX+2JLaYdCsYRbrNsJxn6e+a2w=; b=bYtSp8Bcr6ietBdYfrfvJUqfAt9kMCK9ybnmQI6A4hjYQbtfjdlzq+SFWViXPHUwsC AVBuvTPV94x43cF3pJSmQUX6xg+zt0AePUHR5CAHrNRYl9TT6vBx138sUNfa77ZvkfV+ fZRdnUxuuFrQzDpJokyh0GBbALT3s/jHOYC9l7DX5h6oAtFCqF3vvOusIQ6/Nwp2sYeK MbM/Eq3jbrfG0s9G8HyupPZH5HMa8LLVqKxrV1SAUugDCpN7TWyQbRRYLLvBwKnDHFW2 ecVpEDli4RqqLL89DHpBiz7vAi8pqzYp61VUJ2e0+eDcPro5/K5b6hQILQmPC75CSXnj UYAA== X-Gm-Message-State: AJcUukdVhBV3PwLCAFQuMtFqJw7Dq5sf/lyFSHAT7+AwXyFwfHhZ9U1x 5eJygbGoqihDyAdbMWeCiN0= X-Google-Smtp-Source: ALg8bN4Y0esAGk6MK7TV6Wmr5WDkdlU1+vuYa3x5Df7EzCNJYZeGRXCIBufLugzWN9j0rwsKUUrAyw== X-Received: by 2002:a19:4287:: with SMTP id p129mr13239723lfa.135.1547820281776; Fri, 18 Jan 2019 06:04:41 -0800 (PST) Received: from xi.terra (c-74bee655.07-184-6d6c6d4.bbcust.telenor.se. [85.230.190.116]) by smtp.gmail.com with ESMTPSA id z9sm797530lfj.79.2019.01.18.06.04.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Jan 2019 06:04:39 -0800 (PST) Received: from johan by xi.terra with local (Exim 4.91) (envelope-from ) id 1gkUlB-0002W0-BQ; Fri, 18 Jan 2019 15:04:37 +0100 From: Johan Hovold To: Palmer Dabbelt Subject: [PATCH 3/5] riscv: fix riscv_of_processor_hartid() comment Date: Fri, 18 Jan 2019 15:03:06 +0100 Message-Id: <20190118140308.9599-4-johan@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190118140308.9599-1-johan@kernel.org> References: <20190118140308.9599-1-johan@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190118_060444_014573_A114E592 X-CRM114-Status: GOOD ( 10.51 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Albert Ou , Andreas Schwab , linux-kernel@vger.kernel.org, Johan Hovold , Atish Patra , Anup Patel , linux-riscv@lists.infradead.org Sender: "linux-riscv" Errors-To: linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The riscv_of_processor_hartid() helper returns -ENODEV when the specified node isn't an enabled and valid RISC-V hart node. Also drop the unnecessary parenthesis around errno defines. Signed-off-by: Johan Hovold Reviewed-by: Paul Walmsley Reviewed-by: Christoph Hellwig --- arch/riscv/kernel/cpu.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/riscv/kernel/cpu.c b/arch/riscv/kernel/cpu.c index 11ba67f010e7..974d374fd36b 100644 --- a/arch/riscv/kernel/cpu.c +++ b/arch/riscv/kernel/cpu.c @@ -17,8 +17,8 @@ #include /* - * Returns the hart ID of the given device tree node, or -1 if the device tree - * node isn't a RISC-V hart. + * Returns the hart ID of the given device tree node, or -ENODEV if the node + * isn't an enabled and valid RISC-V hart node. */ int riscv_of_processor_hartid(struct device_node *node) { @@ -27,34 +27,34 @@ int riscv_of_processor_hartid(struct device_node *node) if (!of_device_is_compatible(node, "riscv")) { pr_warn("Found incompatible CPU\n"); - return -(ENODEV); + return -ENODEV; } if (of_property_read_u32(node, "reg", &hart)) { pr_warn("Found CPU without hart ID\n"); - return -(ENODEV); + return -ENODEV; } if (hart >= NR_CPUS) { pr_info("Found hart ID %d, which is above NR_CPUs. Disabling this hart\n", hart); - return -(ENODEV); + return -ENODEV; } if (of_property_read_string(node, "status", &status)) { pr_warn("CPU with hartid=%d has no \"status\" property\n", hart); - return -(ENODEV); + return -ENODEV; } if (strcmp(status, "okay")) { pr_info("CPU with hartid=%d has a non-okay status of \"%s\"\n", hart, status); - return -(ENODEV); + return -ENODEV; } if (of_property_read_string(node, "riscv,isa", &isa)) { pr_warn("CPU with hartid=%d has no \"riscv,isa\" property\n", hart); - return -(ENODEV); + return -ENODEV; } if (isa[0] != 'r' || isa[1] != 'v') { pr_warn("CPU with hartid=%d has an invalid ISA of \"%s\"\n", hart, isa); - return -(ENODEV); + return -ENODEV; } return hart; From patchwork Fri Jan 18 14:03:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 10770323 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 286BC6C5 for ; Fri, 18 Jan 2019 14:04:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 158E52DB36 for ; Fri, 18 Jan 2019 14:04:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 08B462DB46; Fri, 18 Jan 2019 14:04:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A4D0A2DB36 for ; Fri, 18 Jan 2019 14:04:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/FuVr3KrF1UZSLSA0Zak7FANasIxL4Omn3/q4RdCw+s=; b=gKnv6Or+rXV9WP CPEk2EHgJIjOdbr1+fBe3/aUI1NxAZe9QqjX4H3d2acjujfBBBsle4tcyzBoThrWS+R+Dnt+T2aSD 8y5fBNrvP0WzCGquprH7S7MiIBKA66E0/kOrB+MnHITWci4L6trP3Qnw2YqsWMKHpubpSKqL1MqPH 3uH098oUvL4oyJ8JLt4rmUjHOIEEMZe8TGNp/EjdFX00zS7Qfqrns0ohH96pwJ6ZP8QNdv98vd5cp hGdP7SN+CkorFrzwwFwB27z7q7xQd51wRP3F91zsB7FvznfYb2FvKRgqa7/OnR8mISBnTXXgXelRQ TdlVfDmlNJ+42mJtPEQQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gkUlN-0004o4-G8; Fri, 18 Jan 2019 14:04:49 +0000 Received: from mail-lj1-f196.google.com ([209.85.208.196]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gkUlF-0004fW-T7 for linux-riscv@lists.infradead.org; Fri, 18 Jan 2019 14:04:44 +0000 Received: by mail-lj1-f196.google.com with SMTP id c19-v6so11739681lja.5 for ; Fri, 18 Jan 2019 06:04:39 -0800 (PST) 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:mime-version:content-transfer-encoding; bh=cftGcUhp2hIXsQQzx8A/AHnCjsMjkAUMb50zkj+yZSs=; b=sMJcERjqMjk277j30KwBYK9SiCMUMN6YSncNf4RdFUkZl3INhIyWBj2PrB8M4DM8CA FbS5qh8SdPKpFIDeWWLYlhAHz1ZnVDcB+gjU7KZEHDbSBFdIlTi8Z+BfUPfq+yEuOUoZ Zea6dhVzyGDm72xoJODzIX+v1XiXlA1FbIzFEHUvEHMqd40muRyCPdoyZxeSZXZu1Y6L xRJYFHSJm89jufkmFykPfNsrCJUenApBNjsmcJAloMYVWQwn1ESqm7cnE9MD7BgEHGbG /gDKvUcziibyytXQ/kal25lm3epguYaCalcU6uhewfS9zn2Vhedh63ZWRGjAG5bEKN/T 9ouw== X-Gm-Message-State: AJcUukfcqH+7M6i7YQujLBDPpZCnTUDXfhb0C/T+rwS5TVDJcjczYciM tn9X2zfrqm72nEuUxKwoRQv6K7gy X-Google-Smtp-Source: ALg8bN5tYIZ/UQG+zxGyHjxBCq4l7Z8pL9JfunFn8k77LKgh4w0vXxESS+zGGhrcpqPtWVyXzoHY3w== X-Received: by 2002:a2e:6595:: with SMTP id e21-v6mr13144023ljf.123.1547820277864; Fri, 18 Jan 2019 06:04:37 -0800 (PST) Received: from xi.terra (c-74bee655.07-184-6d6c6d4.bbcust.telenor.se. [85.230.190.116]) by smtp.gmail.com with ESMTPSA id x21sm809550lfe.6.2019.01.18.06.04.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Jan 2019 06:04:35 -0800 (PST) Received: from johan by xi.terra with local (Exim 4.91) (envelope-from ) id 1gkUlB-0002W5-Dv; Fri, 18 Jan 2019 15:04:37 +0100 From: Johan Hovold To: Palmer Dabbelt Subject: [PATCH 4/5] riscv: treat cpu devicetree nodes without status as enabled Date: Fri, 18 Jan 2019 15:03:07 +0100 Message-Id: <20190118140308.9599-5-johan@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190118140308.9599-1-johan@kernel.org> References: <20190118140308.9599-1-johan@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190118_060441_976872_8019AA0C X-CRM114-Status: UNSURE ( 9.82 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Albert Ou , Andreas Schwab , linux-kernel@vger.kernel.org, Johan Hovold , Atish Patra , Anup Patel , linux-riscv@lists.infradead.org Sender: "linux-riscv" Errors-To: linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Follow the Linux convention and treat devicetree nodes without a status property as enabled rather than disabled, while also allowing "ok" as a shorthand for "okay". Signed-off-by: Johan Hovold Reviewed-by: Paul Walmsley Reviewed-by: Christoph Hellwig --- arch/riscv/kernel/cpu.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/arch/riscv/kernel/cpu.c b/arch/riscv/kernel/cpu.c index 974d374fd36b..d1d9bfd5a89f 100644 --- a/arch/riscv/kernel/cpu.c +++ b/arch/riscv/kernel/cpu.c @@ -22,7 +22,7 @@ */ int riscv_of_processor_hartid(struct device_node *node) { - const char *isa, *status; + const char *isa; u32 hart; if (!of_device_is_compatible(node, "riscv")) { @@ -39,12 +39,8 @@ int riscv_of_processor_hartid(struct device_node *node) return -ENODEV; } - if (of_property_read_string(node, "status", &status)) { - pr_warn("CPU with hartid=%d has no \"status\" property\n", hart); - return -ENODEV; - } - if (strcmp(status, "okay")) { - pr_info("CPU with hartid=%d has a non-okay status of \"%s\"\n", hart, status); + if (!of_device_is_available(node)) { + pr_info("CPU with hartid=%d is not available\n", hart); return -ENODEV; } From patchwork Fri Jan 18 14:03:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 10770329 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B2AEF6C5 for ; Fri, 18 Jan 2019 14:04:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9FE9D2DB26 for ; Fri, 18 Jan 2019 14:04:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 941962DB39; Fri, 18 Jan 2019 14:04:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 36FB72DB26 for ; Fri, 18 Jan 2019 14:04:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8dfJpd83e3FiXZohR/5U4tNgbc101GZZH0v0g01vVP8=; b=sqrUt+ErYm+5b9 rXthA0OvRSZPm/xXN3kWg+ZmYWzpKG35jMxN9kWL+A20pgxRax0pDDE2u5jBKG6VsDzhdDnTj0QSD KfPg77KpM5drkR0GNfN4TB5JaL4CNHkzRiFZu1XGzgWASgAhx1UeUghf0AmtU/X4qfhgM96N/6xh4 xKm6ZCydw4rgujZ6tgUYyg2h+hQA3wvhvVT2MHHu1L0QEZhohFBSek62CfjNGgarBiUE5jFCcBmM/ SnkWuUGZPHjnxjBzpQOdB2JNd7/Xu5VXj6PYKJ2kWwxBnsERoteu5FKxKHvoJtsoSieo4yDIjZ/0J pBVkZbYMLbjjbFbIDwiw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gkUlT-0004tY-Ca; Fri, 18 Jan 2019 14:04:55 +0000 Received: from mail-lf1-f65.google.com ([209.85.167.65]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gkUlI-0004hn-3e for linux-riscv@lists.infradead.org; Fri, 18 Jan 2019 14:04:47 +0000 Received: by mail-lf1-f65.google.com with SMTP id y14so10548337lfg.13 for ; Fri, 18 Jan 2019 06:04:42 -0800 (PST) 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:mime-version:content-transfer-encoding; bh=cVF/+rdzQVmDvcOxbIn7hLVP8/m/t64C/jXS8/amg08=; b=VpxiQbDCyywb6TypVz3rjfaffyt6P98xM3a0GszbiHUxrX4FyB5XWhPbV4jSIxCOY0 vlmm35ls7dpq15tbQrOdCWV5ifWrEv//gLO7far5kuXMpa9+HXJMNY/Sm3g8rfdfoETz ds86Z3EtYl2elMHisqoHFqIlRex03eGRt4LtocvK4XEuJTNATzXAXSbCTBaFQvAc9fUf 59xAtcwanUpZGJc3+9wCkUrtVcppCWZBxCyKxo/vnyUmWAuNqPJ9kT5h0WkzIdmn7nQH oM9AEEgURc+2pig3yNOr0LLoAUvw1nk3S6fbFUb+R0GXvJbXuaYXM01TnvYo7CV7GqB5 kl8Q== X-Gm-Message-State: AJcUukeLpD+p9u48jl7wEl23GCzJZRLWfOljlsBeTEaJ0g+rkz1lYupo gYAw0DUNv7pP7HvGWQGBquI= X-Google-Smtp-Source: ALg8bN5VHtjHufGJDP70XS1DLwgcclDu4iucZkN6BBJ2OgpQrlnqRayI53u2/+HkbgEl4GhkgbfLrw== X-Received: by 2002:a19:a9d2:: with SMTP id s201mr12312768lfe.154.1547820281063; Fri, 18 Jan 2019 06:04:41 -0800 (PST) Received: from xi.terra (c-74bee655.07-184-6d6c6d4.bbcust.telenor.se. [85.230.190.116]) by smtp.gmail.com with ESMTPSA id d10sm816549lfa.71.2019.01.18.06.04.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Jan 2019 06:04:39 -0800 (PST) Received: from johan by xi.terra with local (Exim 4.91) (envelope-from ) id 1gkUlB-0002WA-Gq; Fri, 18 Jan 2019 15:04:37 +0100 From: Johan Hovold To: Palmer Dabbelt Subject: [PATCH 5/5] riscv: use for_each_of_cpu_node iterator Date: Fri, 18 Jan 2019 15:03:08 +0100 Message-Id: <20190118140308.9599-6-johan@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190118140308.9599-1-johan@kernel.org> References: <20190118140308.9599-1-johan@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190118_060444_226721_3B2F8C55 X-CRM114-Status: GOOD ( 11.92 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Albert Ou , Andreas Schwab , linux-kernel@vger.kernel.org, Johan Hovold , Atish Patra , Anup Patel , linux-riscv@lists.infradead.org Sender: "linux-riscv" Errors-To: linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use the new for_each_of_cpu_node() helper to iterate over cpu nodes instead of open coding. Note that this will allow matching also on the node name instead of the (for FDT) deprecated device_type property. Signed-off-by: Johan Hovold Reviewed-by: Christoph Hellwig --- arch/riscv/kernel/cpufeature.c | 5 +++-- arch/riscv/kernel/smpboot.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c index 4891fd62b95e..e7a4701f0256 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -28,7 +28,7 @@ bool has_fpu __read_mostly; void riscv_fill_hwcap(void) { - struct device_node *node = NULL; + struct device_node *node; const char *isa; size_t i; static unsigned long isa2hwcap[256] = {0}; @@ -46,9 +46,10 @@ void riscv_fill_hwcap(void) * We don't support running Linux on hertergenous ISA systems. For * now, we just check the ISA of the first "okay" processor. */ - while ((node = of_find_node_by_type(node, "cpu"))) + for_each_of_cpu_node(node) { if (riscv_of_processor_hartid(node) >= 0) break; + } if (!node) { pr_warn("Unable to find \"cpu\" devicetree entry\n"); return; diff --git a/arch/riscv/kernel/smpboot.c b/arch/riscv/kernel/smpboot.c index 18cda0e8cf94..6e2813257e03 100644 --- a/arch/riscv/kernel/smpboot.c +++ b/arch/riscv/kernel/smpboot.c @@ -50,12 +50,12 @@ void __init smp_prepare_cpus(unsigned int max_cpus) void __init setup_smp(void) { - struct device_node *dn = NULL; + struct device_node *dn; int hart; bool found_boot_cpu = false; int cpuid = 1; - while ((dn = of_find_node_by_type(dn, "cpu"))) { + for_each_of_cpu_node(dn) { hart = riscv_of_processor_hartid(dn); if (hart < 0) continue;