Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5558660pxu; Tue, 22 Dec 2020 22:36:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJzp+Z0mh2BCHnkmThd2cKQZ0Cj84RoDS6WpOSXQyynSknKBbZ8eOadUAQ+40ZRQEhmI5GzO X-Received: by 2002:a17:906:3ac8:: with SMTP id z8mr9557635ejd.273.1608705384216; Tue, 22 Dec 2020 22:36:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608705384; cv=none; d=google.com; s=arc-20160816; b=QlC47T35VQwAuoNGdTJCfmpJv6JCqPlVnBy8N+wzOron9AWpHg8JkYGufsL0x4KkYY aQrxGHno44eccwQlNwKofCesgvQiz8C2uG7l1rZOT1E8LtX0ALbLCL0EHKAkfnS9Y62O 7Q6cQMigoS85bqz90UgdJD0PMvntFApmJ52QBdnhlJjQoUO5eHrKKFrSQF5ZxeOzhYVb K1JecUK+ntUhHyuKQSE9yAoad2vvlj0lwYrnkIUVVeauJSQMY6xXN3HP/XMsCb0Sxi/p adtUT51Z/3nE9YR/XwsGR6bEsYE5dOyPPB57K/KAf3EfArMdIST5Y9wf2+3VGWWF8E3v kBkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature:dkim-filter; bh=wn59jeOCTy7mMAcAiQw9aRHlYpJopLoesfRO+zLZGnY=; b=KcPInfeQhuMcivmZbSqF3gF/oXC7NIxggZnmNP54e7R2IQioLvL7DYWM8T857QaP2e Zfa8oS1dIRTgT7msRXJ9fKmcaT5xIkEZIRwR35SBmJ1eufJn9v7oxl8Mjjv2KOZs/SrI 7VtvcnDsQ4IBx15ZSSU1LNed7HDqKR0XCLVkRKjDLTyw/8WwiRcnM4ry04vI2wmVsueO 0FC+rVg0r/VWHSidpzu2GiRmvksz5SPlV79t1GoaEYu15ZvXISIr7SPH76LzfmOv4rM/ uNOTkbHo/yz6r6V5OQxEtiLB5Ig9RL7xupvwt4hTe2H2/PWNtY8eo8CDQuQlDXve9afp J1vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=gMak6dDK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q4si12805423eji.447.2020.12.22.22.36.02; Tue, 22 Dec 2020 22:36:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=gMak6dDK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727114AbgLWGfJ (ORCPT + 99 others); Wed, 23 Dec 2020 01:35:09 -0500 Received: from conssluserg-06.nifty.com ([210.131.2.91]:18466 "EHLO conssluserg-06.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727046AbgLWGfJ (ORCPT ); Wed, 23 Dec 2020 01:35:09 -0500 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (authenticated) by conssluserg-06.nifty.com with ESMTP id 0BN6YEvV020406; Wed, 23 Dec 2020 15:34:14 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-06.nifty.com 0BN6YEvV020406 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1608705254; bh=wn59jeOCTy7mMAcAiQw9aRHlYpJopLoesfRO+zLZGnY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=gMak6dDKLKahNXbVW6rctA05eQ/6TleikJCSXd/ecjZGevmvf/EcTwD5Ot08/6+8/ zcFFe/0l/gQGuprromwWi+t9b40fXyjbLvBGKanNIv95e4OYTfHap/2OsPWuTEql9H qj6DP2hLVe/1msYsGioltctco3ct58aqhpu6RM6A0VbTo6NyVf2RTpHJQ+2NjODD4I jsFFcVXASzSwoUbf5zDAYlUdknu0hxH0cfCKc7Mkz4WyVU5IxZfGJzd1a1EuQifHz4 tcvO3zNJhoWiZIEdg4bm93SsJYyF8/sudfvm6PT5jE7JBKINMgI5fvH/KO3h0I/S7X ZUbAQ/rDhkyqA== X-Nifty-SrcIP: [209.85.214.171] Received: by mail-pl1-f171.google.com with SMTP id s15so4216344plr.9; Tue, 22 Dec 2020 22:34:14 -0800 (PST) X-Gm-Message-State: AOAM532Z3rrsxSrgZYW7A+oDkunUYxgGnn4lrs0XGT9bWbOiS8itRWZh XE9BhqUqwZwWq5KXA4S1jTkExDh+d/0p9HnPD2w= X-Received: by 2002:a17:902:521:b029:dc:2836:ec17 with SMTP id 30-20020a1709020521b02900dc2836ec17mr1426470plf.47.1608705253707; Tue, 22 Dec 2020 22:34:13 -0800 (PST) MIME-Version: 1.0 References: <20201212161831.GA28098@roeck-us.net> <20201222205402.2269377-1-ndesaulniers@google.com> In-Reply-To: <20201222205402.2269377-1-ndesaulniers@google.com> From: Masahiro Yamada Date: Wed, 23 Dec 2020 15:33:36 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] sh: check return code of request_irq To: Nick Desaulniers Cc: Yoshinori Sato , Rich Felker , Miguel Ojeda , Paul Mundt , Guenter Roeck , Linux-sh list , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 23, 2020 at 5:54 AM Nick Desaulniers wrote: > > request_irq is marked __must_check, but the call in shx3_prepare_cpus > has a void return type, so it can't propagate failure to the caller. > Follow cues from hexagon and just print an error. > > Fixes: c7936b9abcf5 ("sh: smp: Hook in to the generic IPI handler for SH-X3 SMP.") > Cc: Miguel Ojeda > Cc: Paul Mundt > Reported-by: Guenter Roeck > Signed-off-by: Nick Desaulniers Thanks for the patch, Nick. I just wondered if there was a better error handling than printing the message. I have no idea if the system will boot up correctly when the request_irq() fails here. I hope the maintainers will suggest something, if any. > --- > arch/sh/kernel/cpu/sh4a/smp-shx3.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/arch/sh/kernel/cpu/sh4a/smp-shx3.c b/arch/sh/kernel/cpu/sh4a/smp-shx3.c > index f8a2bec0f260..1261dc7b84e8 100644 > --- a/arch/sh/kernel/cpu/sh4a/smp-shx3.c > +++ b/arch/sh/kernel/cpu/sh4a/smp-shx3.c > @@ -73,8 +73,9 @@ static void shx3_prepare_cpus(unsigned int max_cpus) > BUILD_BUG_ON(SMP_MSG_NR >= 8); > > for (i = 0; i < SMP_MSG_NR; i++) > - request_irq(104 + i, ipi_interrupt_handler, > - IRQF_PERCPU, "IPI", (void *)(long)i); > + if (request_irq(104 + i, ipi_interrupt_handler, > + IRQF_PERCPU, "IPI", (void *)(long)i)) > + pr_err("Failed to request irq %d\n", i); > > for (i = 0; i < max_cpus; i++) > set_cpu_present(i, true); > -- > 2.29.2.729.g45daf8777d-goog > -- Best Regards Masahiro Yamada