Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp813001rwi; Wed, 19 Oct 2022 03:20:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4rtYvXHqSmT22koMdxB8SvwNIZCp7YRL47fCaHEklLil5KtcUKW/gtmAC2Ja+MajeRKDpp X-Received: by 2002:a63:1b0e:0:b0:44b:97e8:1020 with SMTP id b14-20020a631b0e000000b0044b97e81020mr6557649pgb.519.1666174858650; Wed, 19 Oct 2022 03:20:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666174858; cv=none; d=google.com; s=arc-20160816; b=SsDsPIonzmZPiebz4UOVaiwflNuqAf9EhvzRJ8ZqG1ZwHKa4F0WDHSP6lcSqrZc8fU SclxZt/PQmi5ZLZYtRsuP0zOd30CIvrISxfoDBt53CLq+TNmlTGqNPn+uBySlHp0IqqV ZejP8017qi26P7pWtJ0fDEA/Pk0X/CS7wzbN9mC/wrPObzV1i2f+AwCAURpy5X/NN7iW wxtGcDG0XyU6fXPk6ZVMnDI+zmqBs0J34VetZTzTtclbXlYVoZg0aUGp5+NNfUgXxH1H +pYZdY/OQfft1wWvIDEaz8Btdx1cq9v2DbJy/sBeyYbKTPQbVPGbiBDmTu47YOiZ0/Lv ioJg== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r7-20020a056a00216700b0053e15843f1fsi17030932pff.131.2022.10.19.03.20.46; Wed, 19 Oct 2022 03:20:58 -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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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); -- 2.35.1