From patchwork Mon Jun 10 14:28:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Davis X-Patchwork-Id: 803171 Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 52D4B824BC; Mon, 10 Jun 2024 14:28:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.23.249 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718029729; cv=none; b=I2tc0v2tOkohu0iagRPqCBd75aepVLZcx68Nd/f9a5aS0uCSRqZdpUtzfYQQH2sl876guBIlEL/oELttHOC3HvVd0dG89JafrDBCJWJdFOvfV+oL15aBl6D4S6XkN/IlfJOUL6sqvCYKisAujzQORBeAGcxJ4sloo2nS9gtEcI8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718029729; c=relaxed/simple; bh=NTVKsVayEu2e/ta57w2zMpupCFS2KPBDy/ecgoDlBzk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Kxnuo7pAqKUUkpv0W0KOqAjsO2BypcJtqZF+Obh5kMo4IclYWMx8Z3uHaT8oGgwK9+5ppH6K7vgyXf08BR3QAMQOCUgSG5UHfeyf+FUMAMcqCho6+IwCJEggdsyCEb493H7STn1i/uk0xBOfXcHy/yRRujdxyHs0bGotpm8LtBU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=kDtyKVVr; arc=none smtp.client-ip=198.47.23.249 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="kDtyKVVr" Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 45AESc6O125310; Mon, 10 Jun 2024 09:28:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1718029718; bh=pvtv1w8mptVyobEHSvk6AkP2PCKKbZqvPVKxMdTdMJs=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=kDtyKVVrbj54kAINAYDqnXhVizPBqg+OqsnzJs4CCIaKYHyoSzdKi9V/IFxbzQB9h T6ixiZ3ZP1truT1tlqkidn5L3zBJmsovZVR7Zca58ZYEFra0J02HehDFgW32ICpFJ8 sSR31JfwoiECVcJObrW4qZzI/B81/v6BItE7Bj3Q= Received: from DFLE115.ent.ti.com (dfle115.ent.ti.com [10.64.6.36]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 45AESciR005779 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 10 Jun 2024 09:28:38 -0500 Received: from DFLE110.ent.ti.com (10.64.6.31) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 10 Jun 2024 09:28:38 -0500 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DFLE110.ent.ti.com (10.64.6.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Mon, 10 Jun 2024 09:28:38 -0500 Received: from fllvsmtp8.itg.ti.com ([10.249.42.149]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 45AESbiJ095574; Mon, 10 Jun 2024 09:28:38 -0500 From: Andrew Davis To: Sebastian Reichel , Florian Fainelli CC: Broadcom internal kernel review list , , , , Andrew Davis Subject: [PATCH 2/5] power: reset: brcmstb: Use device_get_match_data() for matching Date: Mon, 10 Jun 2024 09:28:33 -0500 Message-ID: <20240610142836.168603-2-afd@ti.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240610142836.168603-1-afd@ti.com> References: <20240610142836.168603-1-afd@ti.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Use device_get_match_data() for finding the matching node and fetching the match data all in one. Signed-off-by: Andrew Davis Acked-by: Florian Fainelli --- drivers/power/reset/brcmstb-reboot.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/power/reset/brcmstb-reboot.c b/drivers/power/reset/brcmstb-reboot.c index 797f0079bb590..db5b7120eadd0 100644 --- a/drivers/power/reset/brcmstb-reboot.c +++ b/drivers/power/reset/brcmstb-reboot.c @@ -83,24 +83,16 @@ static const struct reset_reg_mask reset_bits_65nm = { .sw_mstr_rst_mask = BIT(31), }; -static const struct of_device_id of_match[] = { - { .compatible = "brcm,brcmstb-reboot", .data = &reset_bits_40nm }, - { .compatible = "brcm,bcm7038-reboot", .data = &reset_bits_65nm }, - {}, -}; - static int brcmstb_reboot_probe(struct platform_device *pdev) { int rc; struct device_node *np = pdev->dev.of_node; - const struct of_device_id *of_id; - of_id = of_match_node(of_match, np); - if (!of_id) { - pr_err("failed to look up compatible string\n"); + reset_masks = device_get_match_data(&pdev->dev); + if (!reset_masks) { + pr_err("failed to get match data\n"); return -EINVAL; } - reset_masks = of_id->data; regmap = syscon_regmap_lookup_by_phandle(np, "syscon"); if (IS_ERR(regmap)) { @@ -130,6 +122,12 @@ static int brcmstb_reboot_probe(struct platform_device *pdev) return rc; } +static const struct of_device_id of_match[] = { + { .compatible = "brcm,brcmstb-reboot", .data = &reset_bits_40nm }, + { .compatible = "brcm,bcm7038-reboot", .data = &reset_bits_65nm }, + {}, +}; + static struct platform_driver brcmstb_reboot_driver = { .probe = brcmstb_reboot_probe, .driver = { From patchwork Mon Jun 10 14:28:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Davis X-Patchwork-Id: 803170 Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C370084DE7; Mon, 10 Jun 2024 14:28:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.142 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718029730; cv=none; b=ZZwE5xw8DssHowHTB147duB5ys12SUvS0+qjQZkLy2JtFELaWZ7TeW0rSIN5rkTJ4EHYubc7ehdSznqsuyaSqQXjEIpNIT4q0o8EKq+j4US9DbF/PpRxg4efuuVWoJYHn//Et4ZQv2pK/ujlxvcGPgO14PxFToYzI76ap679R4I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718029730; c=relaxed/simple; bh=YfXaRrnltSNLuJxNuUHGYkWLrOOxy9EROV/wAEM8jgo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=LbQpa0GJmCbxL3dQg6Uq16nWX/Myoi5UmEQtoUHKm8VD5KWfryi/x0BUyupU+YKu91Db+8Dvm9N9JEgWpcjL0peWdpSt7KRZ/CIzfIFCi4vY+AJDiPCdIaRY9jmgoSgDLblb/NJZjQQbe1ochd8glWOy0HOlY+Cit62sgQLBSIE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=rbDMBXU+; arc=none smtp.client-ip=198.47.19.142 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="rbDMBXU+" Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 45AESd27130777; Mon, 10 Jun 2024 09:28:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1718029719; bh=nRnslfxi5bzrnUsqzY3ovdKR9xwfCouCPnYfjSIo7CU=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=rbDMBXU+sB7YzSp3H6PZRczP9ei5fcUgu1ZfL8xfWPvsKBn2VHPb5lUpcSXl2lwNJ kWuaC7IsmKyDjL/mMvrruAnJbAHpVXMeVsj4JvqBFFuY5LP9yVKmJDt30vzmUzI9J6 HvK5XQmS08R8680x+N3Ofz47nvwFaT0dSxg9fs10= Received: from DLEE113.ent.ti.com (dlee113.ent.ti.com [157.170.170.24]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 45AESd0G123876 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 10 Jun 2024 09:28:39 -0500 Received: from DLEE105.ent.ti.com (157.170.170.35) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 10 Jun 2024 09:28:39 -0500 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Mon, 10 Jun 2024 09:28:39 -0500 Received: from fllvsmtp8.itg.ti.com ([10.249.42.149]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 45AESbiM095574; Mon, 10 Jun 2024 09:28:39 -0500 From: Andrew Davis To: Sebastian Reichel , Florian Fainelli CC: Broadcom internal kernel review list , , , , Andrew Davis Subject: [PATCH 5/5] power: reset: brcmstb: Do not go into infinite loop if reset fails Date: Mon, 10 Jun 2024 09:28:36 -0500 Message-ID: <20240610142836.168603-5-afd@ti.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240610142836.168603-1-afd@ti.com> References: <20240610142836.168603-1-afd@ti.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 There may be other backup reset methods available, do not halt here so that other reset methods can be tried. Signed-off-by: Andrew Davis --- drivers/power/reset/brcmstb-reboot.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/power/reset/brcmstb-reboot.c b/drivers/power/reset/brcmstb-reboot.c index 59ed1513cfb30..441b44e0a9f29 100644 --- a/drivers/power/reset/brcmstb-reboot.c +++ b/drivers/power/reset/brcmstb-reboot.c @@ -58,9 +58,6 @@ static int brcmstb_restart_handler(struct sys_off_data *data) return NOTIFY_DONE; } - while (1) - ; - return NOTIFY_DONE; }