From patchwork Wed Oct 19 08:30:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 4791 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp216112wrs; Wed, 19 Oct 2022 02:17:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6UEEn2CXm4pJYDqUKzP9zGzv/qIvMoquEm1NxfPWWIRBLuv8jMSrHSkJx5sXExa6uSIqIb X-Received: by 2002:a17:906:58c7:b0:722:f4bf:cb75 with SMTP id e7-20020a17090658c700b00722f4bfcb75mr5877259ejs.450.1666171054035; Wed, 19 Oct 2022 02:17:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666171054; cv=none; d=google.com; s=arc-20160816; b=k0W5oxFZ9n+iLeARMClyXGTmSnbkrrqoAvXGFq9NjV8+qIU/lCAgPGUnFxj8++yyVO DZWRrKXhx129pfvkPQlUT5e2MMPSar5u14NshJOP7IpopT3xVlg35QhAYKG64bF3enGU XQp6qEK0R07bQlN6Dt81SXH8TKXmWdM8BfXqWn3nl1sLP92o0EKNbypY0+QJcooF7pi9 hCrGw3byB3ogpK+EoP/ALNjH99z1xJTOzsnZOEE70xOkAWhImbX9i9f7A3DqlRBFW8uK Y1fm/ZJGuKjWnePMZEuZ287epWSZD/HI+HRuSWvE7s/qJf7KtPUNe84qphpd9IXABtT5 wR2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4KiRceZ59rkklgYNCVVQEjMNIndyAQ4MRWWQ/+sZYg8=; b=n5fOBb9iXFF/qjWgvHqitzo5Yft0EJuDhv37LrlO/i4PWfK8wIXrZUwWaaKSdaVkSr tt39hdJQ4vGLEOU8HPn+6i4U0/UBs9pM7pxQX2le3fICk3wHO94NHaQJGaNuYGRB8fQO xeSJ/vKquEKTs03gvLhIhZkaaIV/q1ZPviXPGK6R5Pq3xIYKF2YzBKYXlJLm9U2kSo0n y7IuX+o2oTw8uE4Yso/eQbaXSDGOqTAJsStWK6cj6Yb0CU2CFXG6ZhugsfT73l1BOckA SDdSKbOqqwpoeVEhiewRFM3dbx0nNZbZAWfp9ZtCQmBz1OXZ8ocX+pgpVTMh1BrFwEAa q+fQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OEJpbvj+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u26-20020aa7d99a000000b0045be16903d0si12522511eds.310.2022.10.19.02.17.08; Wed, 19 Oct 2022 02:17:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OEJpbvj+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233189AbiJSJQb (ORCPT + 99 others); Wed, 19 Oct 2022 05:16:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233083AbiJSJN5 (ORCPT ); Wed, 19 Oct 2022 05:13:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CF5CCA8AA; Wed, 19 Oct 2022 02:03:45 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 42F8061830; Wed, 19 Oct 2022 09:03:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A5B8C433C1; Wed, 19 Oct 2022 09:03:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170185; bh=g5t/hZ0fNgoFIR61nY0PEk2xBx40TJC1T+SjBz4tOpA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OEJpbvj+TINxNMVrA85WD5R1viaRMp4P3hZbmASu233gM7VTHhrzTpBnZxXJ0Kc2F NjWn3k2epMR1TYR+AiUC7783H7dFqOZykD0MCE4xY2tnlwjKRXcv2bp/UAtwE8qidA SfWjvtXCV7z/CfnSlFG0rJe4OJvD17E2MtA8KTjQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Hovold , Vinod Koul , Sasha Levin Subject: [PATCH 6.0 523/862] phy: qcom-qmp-pcie: add pcs_misc sanity check Date: Wed, 19 Oct 2022 10:30:10 +0200 Message-Id: <20221019083313.087411998@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747106978774625459?= X-GMAIL-MSGID: =?utf-8?q?1747106978774625459?= From: Johan Hovold [ Upstream commit ecd5507e72ea03659dc2cc3e4393fbf8f4e2e02a ] Make sure that the (otherwise) optional pcs_misc IO region has been provided in case the configuration specifies a corresponding initialisation table to avoid crashing with malformed device trees. Note that the related debug message is now superfluous as the region is only used when the configuration has a pcs_misc table. Fixes: 421c9a0e9731 ("phy: qcom: qmp: Add SDM845 PCIe QMP PHY support") Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220916102340.11520-2-johan+linaro@kernel.org Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c index 2d65e1f56bfc..0e0f2482827a 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c @@ -2371,8 +2371,10 @@ int qcom_qmp_phy_pcie_create(struct device *dev, struct device_node *np, int id, of_device_is_compatible(dev->of_node, "qcom,ipq6018-qmp-pcie-phy")) qphy->pcs_misc = qphy->pcs + 0x400; - if (!qphy->pcs_misc) - dev_vdbg(dev, "PHY pcs_misc-reg not used\n"); + if (!qphy->pcs_misc) { + if (cfg->pcs_misc_tbl || cfg->pcs_misc_tbl_sec) + return -EINVAL; + } snprintf(prop_name, sizeof(prop_name), "pipe%d", id); qphy->pipe_clk = devm_get_clk_from_child(dev, np, prop_name);