From patchwork Tue Nov 8 18:11:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Frayer X-Patchwork-Id: 17157 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2870283wru; Tue, 8 Nov 2022 10:16:16 -0800 (PST) X-Google-Smtp-Source: AMsMyM6nkoL3uNtR4KdGWyVjTMsDvzwy+jPBMw8L+hS8wG0EkJIBVJJQqXW8lFb/blPyWxU/O3SC X-Received: by 2002:a17:90b:3011:b0:213:deb7:d47f with SMTP id hg17-20020a17090b301100b00213deb7d47fmr48996490pjb.136.1667931376180; Tue, 08 Nov 2022 10:16:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667931376; cv=none; d=google.com; s=arc-20160816; b=dik2mCIufLJVZwKrPMTSmE5/TgG06Tbtsg/hEP7ZHCh/cQphQpdqACEV4ejenXn8+y iadfPpu0fEAXv7Z95+oVEii9/sbT4s1dGwVGjIsqhF9isac3q0w1tF8zjlLQdQD+7rkC ihRc9Pn9iluFJTvL+vgP5IjrwM5Znm1Rb802O4o1R0nL4iJbYJa23AgLOXJqFY4AYZX3 T5LTVtX3k6IyFo6XB866SEvu2hbXmAxCoHzRbk+AG7WtTHvOee0ww9swEtWsX4N/C9rD ZFHD1TMBK80kh9PZ+Ih0M8n7bzEV9SCIJyXQJpqCdEqVywq7YSRc8D4GdftFTO6BdcmV WkjA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1o2x75QMXnEx7W9bo3sYlpr0oxVXvlHN3ieGl1S2FPc=; b=E89jrScdhr5i68efDn7/av0dLJNFCMj2Ut9az1YqNAlq+4tcrGFlKyipRAXQqJG4qW Wx6cK+xqZ/ELF4DQrgwHCoNos5CLMWfM8PrtV5RpU3fQZlT9NPxZS5q0WhJ1FkeCxqCW geF9cTL61XkjswHqkRl+t+3ktCxK+ANz6529jPsDdlo0NXtV07oLlzb0XjuP5YLaZjF2 269FNzplKNzzHDyy9695uhcmb7BP9/a/mEWEPNgB7CmGSMl7+anEfw4sZ4w5YOn7EmLn XHNZxKrRil57CHLyVq5eMqr83hvdrqNheicdE0BIwLWy/XbcJJjBmvFp9Gr358YHMBIN y/uQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=ujEcfx2J; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ot3-20020a17090b3b4300b002121890521csi21975819pjb.119.2022.11.08.10.16.02; Tue, 08 Nov 2022 10:16:16 -0800 (PST) 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=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=ujEcfx2J; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234720AbiKHSMN (ORCPT + 99 others); Tue, 8 Nov 2022 13:12:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234238AbiKHSMA (ORCPT ); Tue, 8 Nov 2022 13:12:00 -0500 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78B1F5656F for ; Tue, 8 Nov 2022 10:11:59 -0800 (PST) Received: by mail-wr1-x436.google.com with SMTP id w14so22261166wru.8 for ; Tue, 08 Nov 2022 10:11:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1o2x75QMXnEx7W9bo3sYlpr0oxVXvlHN3ieGl1S2FPc=; b=ujEcfx2JBqa8tGPUt5e3C3LQcP1CU3B5jOJvJRtkbqcSjMkGYHWeqnwOke9HxmmCe8 17cBtyAyhYSgh6EsCEbH8p/X0IcSBkasuJTvONH7Z2EKSF34By622568NRHz8VqyvLDm ZxU4G5j7EgRNhQ+f++AUPlEcdbmgsBV2NnXXHOopQLLH2pDmOF9S7YzN5MxHIoup1FQN zwcmouVS7G/4AODBGfinpB7DZAkops9B5eftWRfjesoDnCJKJQ9DkBdW+zagwH6EhiKQ wftR6OF1Pist9ZCelaDTyx8Wu1nAgo+MNtmLpXrO8bxpdBx9uRsOj3gNuAVX43ZO/oMQ +jsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1o2x75QMXnEx7W9bo3sYlpr0oxVXvlHN3ieGl1S2FPc=; b=3y4car0mFBRQzG7o77W7bg2rdxbIRMUXWVHnHEdHRpuNzxHQzCl76Cy8gChdv7oBfx SeJQX99aZKMGRZYasNCuI2hT0/Wxc6wYyiv8lwTKFf0OoZMFqmhNH8pLcX9+elnLugjN D8M/grKdyx4kmO3KR9YoZ5Yigj9aSU9t26SYqC9BIhg7nhow50e31TfyUrM2+xbt8YYY Pw8Ik31jsKS5mLGjEvWlUFpq9h3vuCF+QXruGdwjfd+huSMFxswIA1PSXA63ic2OoDtY GFM3Edw3CFUFBcPFvRGNV4JFI+rxj9T02olrPEZXqrGzj2uh5ZXi+XH3rftps/0h1yxu lCww== X-Gm-Message-State: ACrzQf1QdnN3REee7560a6O9V1BAk2PA1DnfPgQZb2BzvXS7qls8t3nX /PqsVzkLbJNEAz8BHKOf/z+diQ== X-Received: by 2002:a05:6000:24f:b0:236:76e8:33fd with SMTP id m15-20020a056000024f00b0023676e833fdmr35567148wrz.215.1667931117970; Tue, 08 Nov 2022 10:11:57 -0800 (PST) Received: from nicolas-Precision-3551.home ([2001:861:5180:dcc0:7d10:e9e8:fd9a:2f72]) by smtp.gmail.com with ESMTPSA id q12-20020a5d61cc000000b002238ea5750csm13037109wrv.72.2022.11.08.10.11.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Nov 2022 10:11:57 -0800 (PST) From: Nicolas Frayer To: nm@ti.com, ssantosh@kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, peter.ujfalusi@gmail.com, vkoul@kernel.org, dmaengine@vger.kernel.org, grygorii.strashko@ti.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-omap@vger.kernel.org, netdev@vger.kernel.org Cc: khilman@baylibre.com, glaroque@baylibre.com, nfrayer@baylibre.com Subject: [PATCH v4 1/4] soc: ti: Convert allocations to devm Date: Tue, 8 Nov 2022 19:11:41 +0100 Message-Id: <20221108181144.433087-2-nfrayer@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221108181144.433087-1-nfrayer@baylibre.com> References: <20221108181144.433087-1-nfrayer@baylibre.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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?1748952810684006965?= X-GMAIL-MSGID: =?utf-8?q?1748952810684006965?= Changed the memory and resource allocations in the probe function to devm. Also added a remove callback. Signed-off-by: Nicolas Frayer --- drivers/soc/ti/k3-socinfo.c | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/drivers/soc/ti/k3-socinfo.c b/drivers/soc/ti/k3-socinfo.c index 91f441ee6175..19f3e74f5376 100644 --- a/drivers/soc/ti/k3-socinfo.c +++ b/drivers/soc/ti/k3-socinfo.c @@ -96,21 +96,18 @@ static int k3_chipinfo_probe(struct platform_device *pdev) partno_id = (jtag_id & CTRLMMR_WKUP_JTAGID_PARTNO_MASK) >> CTRLMMR_WKUP_JTAGID_PARTNO_SHIFT; - soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL); + soc_dev_attr = devm_kzalloc(&pdev->dev, sizeof(*soc_dev_attr), GFP_KERNEL); if (!soc_dev_attr) return -ENOMEM; - soc_dev_attr->revision = kasprintf(GFP_KERNEL, "SR%x.0", variant); - if (!soc_dev_attr->revision) { - ret = -ENOMEM; - goto err; - } + soc_dev_attr->revision = devm_kasprintf(&pdev->dev, GFP_KERNEL, "SR%x.0", variant); + if (!soc_dev_attr->revision) + return -ENOMEM; ret = k3_chipinfo_partno_to_names(partno_id, soc_dev_attr); if (ret) { dev_err(dev, "Unknown SoC JTAGID[0x%08X]\n", jtag_id); - ret = -ENODEV; - goto err_free_rev; + return -ENODEV; } node = of_find_node_by_path("/"); @@ -118,22 +115,26 @@ static int k3_chipinfo_probe(struct platform_device *pdev) of_node_put(node); soc_dev = soc_device_register(soc_dev_attr); - if (IS_ERR(soc_dev)) { - ret = PTR_ERR(soc_dev); - goto err_free_rev; - } + if (IS_ERR(soc_dev)) + return PTR_ERR(soc_dev); + + platform_set_drvdata(pdev, soc_dev); dev_info(dev, "Family:%s rev:%s JTAGID[0x%08x] Detected\n", soc_dev_attr->family, soc_dev_attr->revision, jtag_id); return 0; +} + +static int k3_chipinfo_remove(struct platform_device *pdev) +{ + struct soc_device *soc_dev = platform_get_drvdata(pdev); -err_free_rev: - kfree(soc_dev_attr->revision); -err: - kfree(soc_dev_attr); - return ret; + if (soc_dev) + soc_device_unregister(soc_dev); + + return 0; } static const struct of_device_id k3_chipinfo_of_match[] = { @@ -147,6 +148,7 @@ static struct platform_driver k3_chipinfo_driver = { .of_match_table = k3_chipinfo_of_match, }, .probe = k3_chipinfo_probe, + .remove = k3_chipinfo_remove, }; static int __init k3_chipinfo_init(void) From patchwork Tue Nov 8 18:11:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Frayer X-Patchwork-Id: 17156 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2869909wru; Tue, 8 Nov 2022 10:15:30 -0800 (PST) X-Google-Smtp-Source: AA0mqf5qul3dewrSYre1vpOOvkMKtyI0nEvmfT0swF+qYafwohax4rsa6EetR3meEF+gVcHYQH3a X-Received: by 2002:a17:902:8a97:b0:188:8cad:f8ca with SMTP id p23-20020a1709028a9700b001888cadf8camr3056302plo.84.1667931330487; Tue, 08 Nov 2022 10:15:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667931330; cv=none; d=google.com; s=arc-20160816; b=EXgZnlaR2Ea9SB8Td5+bg7ZTssDNuftmyNLvsVqAAgL18MUl9eRbbnqMlkBHi2KvhG MJ1PlRdtemS1VKkRAWK3Pv39JTD6mGDzC5PElTgiiDSZPg5+JyAcJ6K8h+nhd2wRKZKK bnCnEZXBTKuAwNmcQPB6tbkPa+ABYU1TJmRfAt29+zYrNoSXL+Vc0rCkNSG7O6c12pWs oCha4sXHtTKG+nZTdNmGEXWMXrnFECcBZxQB53SzArZMo0OQsRu68UARKcea1Tqn67Fl qBUL3NeuSUoIO/vhJAGLXz0eOSZPPZLYeyxw4JFbityR7rrIt5pZb6u9Hw7GYbF2rWdA HK4Q== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1m1DidO2rzjDMZlrvrKtja69hwcXTFXw0zP1Dxjbaww=; b=wELGrvvXq3Z8+SP6fp1vrC8bb4bBbOMxBl3IOKNWzti01zTXTa/sb819jhfDTqaQFc +7YDxngWV66ga0hdbX/V5Vpyvlq6+p12ENQywsu+wP5pMBdbKsF97FGU3DzTQ0g1IGgE SqbUU9x3Q0mqdEpmLPeHCkTm54l+s+hd7SeLNLPfJYYTLLqz8/ySRseVxE1dTHHSbjMi Jkb74/ABdIWW5i4GE0MjXvHn+sEgGYJ1HKejJkGUfLhEVDlEVil5/igrsS3InbzwOq5M erhhasgMV7oRc+2MPWXonErF2D8mORty0z9dq6NRhsU6fxkyRwigvV/EYqc8tiw+1rNV mmtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=P1bMXtA9; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g12-20020a1709026b4c00b0018862b8c9a2si14133337plt.12.2022.11.08.10.15.17; Tue, 08 Nov 2022 10:15:30 -0800 (PST) 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=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=P1bMXtA9; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234638AbiKHSMY (ORCPT + 99 others); Tue, 8 Nov 2022 13:12:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234430AbiKHSMD (ORCPT ); Tue, 8 Nov 2022 13:12:03 -0500 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CCE458BC0 for ; Tue, 8 Nov 2022 10:12:00 -0800 (PST) Received: by mail-wr1-x433.google.com with SMTP id v1so22248829wrt.11 for ; Tue, 08 Nov 2022 10:12:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1m1DidO2rzjDMZlrvrKtja69hwcXTFXw0zP1Dxjbaww=; b=P1bMXtA9ILahSmDOLipS/vaBF54BtW3he0nIKaV3F1tou04OZJoD1ZlskG63rQ/p/e f5QqCc36wvzp5Wcs+dnGtQ6GV5bmbADV9jb8khubwXHU2YVQd5Xcobtw+ab0rr8bGP5y RF4IoulpEZo6LZt+n9U1NK4OT8LfR+BAZUQjGkcqp0ymrEYTmsCP8bKANJgFFfqIB3ex sSAz9wt9TtxnZks6JtFG/IdC4ncWgjTEWd3/ls8cvd2uTo5/OQV1ffhJatQ/Ru8OXOYE +ZZhB+4M24NZbsexDA2VUToTZAIAw3V3FXgmj8s3ryRuBh8z9DtioUDF+y+VYamqhFEF jMpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1m1DidO2rzjDMZlrvrKtja69hwcXTFXw0zP1Dxjbaww=; b=i+TelVv/fwstYk4JhMg0xBtPq5TnT6HuQV/P2AO1qmmYSmeJVEJzkhMuEmXxdLz9Lh ChU4i1R3rLNFBLlp8wS+CpNJ2BA8uG2EyCdqZ0+L23SLJSnH1ZQGbKWh5cNOcG2qmtRD UI4g5p70UbWTtaA4M4ZhSDzCVDieccxlW1CTFm30m3m90+sPCungx2iO6f3+ncCfh4ls roMQ+RtIe7bBhcpLLIxkkHJyOr7vWmd5vq2qa7bDT0DG1KEBoSAoJ9QzFPov+KMfvoA8 Peq1fmdyoouCbHXfWCFMaPf3FU8gQQO56cDOnBrRgjfGkxo60yTJkXyclILfncJ4p4fr nwiw== X-Gm-Message-State: ACrzQf1qXTL+pj1jK5SGpaG11Er4/rSLPhTHNZW3FhD1Ss9Juko9kbb8 gSlbYEw2m//E3ZBqA9RBVC4DVA== X-Received: by 2002:adf:f943:0:b0:232:ce6b:40d4 with SMTP id q3-20020adff943000000b00232ce6b40d4mr37395557wrr.453.1667931118943; Tue, 08 Nov 2022 10:11:58 -0800 (PST) Received: from nicolas-Precision-3551.home ([2001:861:5180:dcc0:7d10:e9e8:fd9a:2f72]) by smtp.gmail.com with ESMTPSA id q12-20020a5d61cc000000b002238ea5750csm13037109wrv.72.2022.11.08.10.11.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Nov 2022 10:11:58 -0800 (PST) From: Nicolas Frayer To: nm@ti.com, ssantosh@kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, peter.ujfalusi@gmail.com, vkoul@kernel.org, dmaengine@vger.kernel.org, grygorii.strashko@ti.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-omap@vger.kernel.org, netdev@vger.kernel.org Cc: khilman@baylibre.com, glaroque@baylibre.com, nfrayer@baylibre.com Subject: [PATCH v4 2/4] soc: ti: Add module build support Date: Tue, 8 Nov 2022 19:11:42 +0100 Message-Id: <20221108181144.433087-3-nfrayer@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221108181144.433087-1-nfrayer@baylibre.com> References: <20221108181144.433087-1-nfrayer@baylibre.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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?1748952762387085201?= X-GMAIL-MSGID: =?utf-8?q?1748952762387085201?= Added module build support for the TI K3 SoC info driver. Signed-off-by: Nicolas Frayer --- arch/arm64/Kconfig.platforms | 1 - drivers/soc/ti/Kconfig | 3 ++- drivers/soc/ti/k3-socinfo.c | 11 +++++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms index 76580b932e44..4f2f92eb499f 100644 --- a/arch/arm64/Kconfig.platforms +++ b/arch/arm64/Kconfig.platforms @@ -130,7 +130,6 @@ config ARCH_K3 select TI_SCI_PROTOCOL select TI_SCI_INTR_IRQCHIP select TI_SCI_INTA_IRQCHIP - select TI_K3_SOCINFO help This enables support for Texas Instruments' K3 multicore SoC architecture. diff --git a/drivers/soc/ti/Kconfig b/drivers/soc/ti/Kconfig index 7e2fb1c16af1..1a730c057cce 100644 --- a/drivers/soc/ti/Kconfig +++ b/drivers/soc/ti/Kconfig @@ -74,7 +74,8 @@ config TI_K3_RINGACC If unsure, say N. config TI_K3_SOCINFO - bool + tristate "TI K3 SoC info driver" + default y depends on ARCH_K3 || COMPILE_TEST select SOC_BUS select MFD_SYSCON diff --git a/drivers/soc/ti/k3-socinfo.c b/drivers/soc/ti/k3-socinfo.c index 19f3e74f5376..98348f998e0f 100644 --- a/drivers/soc/ti/k3-socinfo.c +++ b/drivers/soc/ti/k3-socinfo.c @@ -13,6 +13,7 @@ #include #include #include +#include #define CTRLMMR_WKUP_JTAGID_REG 0 /* @@ -141,6 +142,7 @@ static const struct of_device_id k3_chipinfo_of_match[] = { { .compatible = "ti,am654-chipid", }, { /* sentinel */ }, }; +MODULE_DEVICE_TABLE(of, k3_chipinfo_of_match); static struct platform_driver k3_chipinfo_driver = { .driver = { @@ -156,3 +158,12 @@ static int __init k3_chipinfo_init(void) return platform_driver_register(&k3_chipinfo_driver); } subsys_initcall(k3_chipinfo_init); + +static void __exit k3_chipinfo_exit(void) +{ + platform_driver_unregister(&k3_chipinfo_driver); +} +module_exit(k3_chipinfo_exit); + +MODULE_DESCRIPTION("TI K3 SoC info driver"); +MODULE_LICENSE("GPL"); From patchwork Tue Nov 8 18:11:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Frayer X-Patchwork-Id: 17158 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2870517wru; Tue, 8 Nov 2022 10:16:38 -0800 (PST) X-Google-Smtp-Source: AMsMyM44dhqtrcAG4NpKsPCA5Hg6/NnL9J2lJR/Mzt+kkvLtvoiPI8cqIVx0KwEx+1NUunRSnVV9 X-Received: by 2002:a50:ee0a:0:b0:463:4055:9db4 with SMTP id g10-20020a50ee0a000000b0046340559db4mr51448584eds.421.1667931398564; Tue, 08 Nov 2022 10:16:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667931398; cv=none; d=google.com; s=arc-20160816; b=kNPUphv8kBHLj+iIM39NGGc44juMfHPdP2QVqxyWWH86skIQXga06dfB9YY/gG1XzY boxhzYLqMP8xb/8wN95pI0cxuviBM1G8bZVFPDFI+hi1j25j6/4zJlmFz0mYNPvTg17Q K+oA8VakeS65y0GDXma9vcyUYSHHnMRhO0uGFZX92W7LnTvDpCDIrbhrWRcCEfo+CtA7 oluo7jRVcitcT+k9R9wQmHP4/KiudbNC9YrbP6wfvE16kVXg2h00L0v12LWbzR94j97M eOopF8Oll8LpObXKR1Elzsapn498JBJj2PX93yYaiyZ/JeQflwsiJo2Iifb4AHBn8bDx ts8Q== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=A8Nn7FR+ibB53QJL8o9ZqwbAccpQC4pR0InqfudyfLs=; b=NlHF+PEODWxpQ4GaMgREAha/4WlSojREx7FfEJm4T2DNwc/UFAHGycFt0eCHorP0VO j2YGF+ijFzxjgs2vzQt8AGERfmAt5UGrNXAvT1+8Oa39r/ap29OA5LO525Jef5pCmLap tDbhIT56lYZqtO/EXiJv9tjUBPqbiFjFjAi52/mTYeOw4AGTpHnXRn+6a7Hn0LGRPq4R eVSy4cXoV633dxCOHJtsKsFowHyJlDvpdKPU8G/aAY19SXg43JpkC4ONvbBeQ205yuA8 OkG1/BpVN1vawE2KTFdCut1dW2Wsog1sugauVERmNDNZN95zkyAh7v6gKCcSrhc/35MQ 0BSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=PBjnfDVm; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hd7-20020a170907968700b007a45e4f4ff2si15448857ejc.853.2022.11.08.10.16.14; Tue, 08 Nov 2022 10:16:38 -0800 (PST) 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=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=PBjnfDVm; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234431AbiKHSMS (ORCPT + 99 others); Tue, 8 Nov 2022 13:12:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234598AbiKHSME (ORCPT ); Tue, 8 Nov 2022 13:12:04 -0500 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FE09554CC for ; Tue, 8 Nov 2022 10:12:01 -0800 (PST) Received: by mail-wm1-x332.google.com with SMTP id v124-20020a1cac82000000b003cf7a4ea2caso12248992wme.5 for ; Tue, 08 Nov 2022 10:12:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=A8Nn7FR+ibB53QJL8o9ZqwbAccpQC4pR0InqfudyfLs=; b=PBjnfDVmggCWMS+XYXPxAz5Am3hcRfWSxmYSECtzCK6iTX7uOwU6CzJYJDkLTML2+m Nv/WVSYdtAY0PKfDxZLJ/LXynJJafnY/stksKFozK4dbIM+iPhPoFwgJwG13aNwBBX3W wvsQ8fGLerysGOXIwc/Gzk2EiWgff6bEd6KWuBAHk0I2l27IkzR/5tsYnbstN66ETAjb HNZXvWvsbMoXfL1z+9BsFcMmvI7AERuBSoeDKZX7b/eGcXSfGiNxEF3UBU2T8Q/suGBr R6TPk5+ryEBj+RhpPICftHvxHnFt9ZzHi2D8pS2z3MQcI3Q5PlC3GjvHIARZZweq5lOx c+GQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=A8Nn7FR+ibB53QJL8o9ZqwbAccpQC4pR0InqfudyfLs=; b=BJebIGTRIb6guDfAFQxRXCKkssQD9xgl9PmADosQKRP9UbfdbIYcUmYXeL3KqUuqju 2NdjT4xlYPcMcF7BM39FFBJPe/gePz6jOHxS/2LBZUxWdN5GcmNdTRGjjsXO7BOLaeWX gMPQfExRGZU+MLqLcr2ft+nyD93Q604VoetMDDHeab5V3sGfcAKP+4n+cRTxL+rG4ygx EKK0RuYEYHyZY1tPm7nXeTlSq0zVX+I28YBJclXsGgUc7G2eIX26OLSwjpph47db9jof lQPvw3Ib8OBW0ObzY8RIidQmqMKcNRKW8dxHR/bs0LoFwy5N9J375S/6T61q48P0fit8 NIJw== X-Gm-Message-State: ANoB5pnA2jYy0fPRv3FDwCFFnza185RVPKz4SpTkq7xcKwK7AwoiBFht P/7CzfFrZtiNBtRHvmxlHmqAZw== X-Received: by 2002:a05:600c:2d44:b0:3cf:aae0:8367 with SMTP id a4-20020a05600c2d4400b003cfaae08367mr8518017wmg.132.1667931119895; Tue, 08 Nov 2022 10:11:59 -0800 (PST) Received: from nicolas-Precision-3551.home ([2001:861:5180:dcc0:7d10:e9e8:fd9a:2f72]) by smtp.gmail.com with ESMTPSA id q12-20020a5d61cc000000b002238ea5750csm13037109wrv.72.2022.11.08.10.11.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Nov 2022 10:11:59 -0800 (PST) From: Nicolas Frayer To: nm@ti.com, ssantosh@kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, peter.ujfalusi@gmail.com, vkoul@kernel.org, dmaengine@vger.kernel.org, grygorii.strashko@ti.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-omap@vger.kernel.org, netdev@vger.kernel.org Cc: khilman@baylibre.com, glaroque@baylibre.com, nfrayer@baylibre.com Subject: [PATCH v4 3/4] dmaengine: ti: k3-udma: Deferring probe when soc_device_match() returns NULL Date: Tue, 8 Nov 2022 19:11:43 +0100 Message-Id: <20221108181144.433087-4-nfrayer@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221108181144.433087-1-nfrayer@baylibre.com> References: <20221108181144.433087-1-nfrayer@baylibre.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,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?1748952833939801449?= X-GMAIL-MSGID: =?utf-8?q?1748952833939801449?= When the k3 socinfo driver is built as a module, there is a possibility that it will probe after the k3 udma driver and the later returns -ENODEV. By deferring the k3 udma probe we allow the k3 socinfo to probe and register the soc_device_attribute structure needed by the k3 udma driver. Signed-off-by: Nicolas Frayer --- drivers/dma/ti/k3-udma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c index 7b5081989b3d..a6bb5077900b 100644 --- a/drivers/dma/ti/k3-udma.c +++ b/drivers/dma/ti/k3-udma.c @@ -5285,7 +5285,7 @@ static int udma_probe(struct platform_device *pdev) soc = soc_device_match(k3_soc_devices); if (!soc) { dev_err(dev, "No compatible SoC found\n"); - return -ENODEV; + return -EPROBE_DEFER; } ud->soc_data = soc->data; From patchwork Tue Nov 8 18:11:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Frayer X-Patchwork-Id: 17155 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2869836wru; Tue, 8 Nov 2022 10:15:24 -0800 (PST) X-Google-Smtp-Source: AA0mqf4qBsdca7qTwRRLFFKGzyHZMQAT7j3e2Rov70jw+pERgUulL7eGT7kTad8Ux8zKBVrDVWo5 X-Received: by 2002:a17:90a:49c9:b0:217:c5f6:4092 with SMTP id l9-20020a17090a49c900b00217c5f64092mr15995650pjm.33.1667931323992; Tue, 08 Nov 2022 10:15:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667931323; cv=none; d=google.com; s=arc-20160816; b=mWUAdNelJR82OgqtNCSzhwQDL8KDdxVb0Tqm7szgGF3zKUArQA1yoZ1cVaVYO0O2UJ PsqRjDupRcjF/AfXqbOM8RS6+FHuXRonEU7aA0G77FvqlUil6bwFJxCpPWHqax/jiJS/ p1jsfLohHMS+TCERy/k3rIJApGd2Nc30uJtnlyJSCHWc28MmEkSQh4Jh155OUaxHCIwu T0+3XuHuW4uXTKJvm5StBal0Spojb9NFeoPeVxX4NgN+RGwzMRNibHyD7BWf3ZXV8iI7 ZWWS7TCE3NcEmh9Rhz4u2EQrr83f0hD1h3TXmKdOO+RS0/B+MTX9ys+mneXBH3KuOh2G xTPw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ZusLhzKKZ9ZvXwH/3HZ+FFn0DEP+Zib5GkEH1QOxmpA=; b=VcOVIHuLX5BKu6NA3oe0vgmU7G5EOzbQ56qWVkrRp76A5e5q4Kx+outdH7zQep0JT9 l8w56MBo3vi7Q4fQZOeIVv570rqYxK4/yxjSHzA7a8evGFLCsZnHc1BXbjSUFl/97B1q h+uc4M1dEJvKDPp8+H+lPA1o8mo0eo8mtZffKtEXg+ENUtbSn0jX6y+a6M0bD1AAAQc9 ktEkTwQfbSGgK3VPkqdDl52VaknxXEdOm0eqoOU54KxoqxzlKOrv7W/4tAmj4296j9NV a8wK46qbiqHhoZHii86fEJnU+JRAHhYAC4DuutYTDoRCALZjgH/vN+Y8n90KjaD8t3qy cuYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=TN4Kwq+G; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d32-20020a634f20000000b00439ce36e9d3si15741256pgb.570.2022.11.08.10.15.10; Tue, 08 Nov 2022 10:15:23 -0800 (PST) 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=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=TN4Kwq+G; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234468AbiKHSMV (ORCPT + 99 others); Tue, 8 Nov 2022 13:12:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234638AbiKHSME (ORCPT ); Tue, 8 Nov 2022 13:12:04 -0500 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3008D554FE for ; Tue, 8 Nov 2022 10:12:02 -0800 (PST) Received: by mail-wr1-x42d.google.com with SMTP id bs21so22291412wrb.4 for ; Tue, 08 Nov 2022 10:12:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZusLhzKKZ9ZvXwH/3HZ+FFn0DEP+Zib5GkEH1QOxmpA=; b=TN4Kwq+GRjs5+zBvs1r+RGwFJlxGXQnDNX2FUczEPoh4sFnBht35WaD3gP66abT6bA 4zwLVWULr58InVVYA+v0eGF9y1tELhTOccAdkikdImsNKMqLEarKsnalnyH2AJXDfJCH /fXnfYwQqbxzbjyJfYJV4tigjgjZajeV0lSH/C54DM9E4vp0IyNqlJ8tTsVju5vNKrzm qoSBuO3tLxLXDKQJwlM+EBW+NbxUd4GBaK+jwdjA9XgjDh0/8hIY3lS2q6hjG+OJs19h msrm5Bf4OQ2lt7alUFdQl+IQd2lXZSSsDKGzG8ennGFtTpgTuC8Qmx0ICnCRK8PLN9mC fM8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZusLhzKKZ9ZvXwH/3HZ+FFn0DEP+Zib5GkEH1QOxmpA=; b=3Og/VX5sNPMefcV1bxC3je8j114VVW/9GvBXou36rLeKM8KIeO5HQenlxbGhEACMHZ aW3RPcu9LOOlhsRiv2Nc+EisZW5cu9Ud30i9ZjSSo7UPhHoy7n4RYnihGzoeLhNkN5jN Qfh3Y67A2w/Wz3oGpuRnZ0cagyvtQbYsTkWoK8N7WDRAnOB+7q5cpVYLJ4hOOhxoaWRt I5cQeZV/gS8NXj+M16BHsxfqZIELytSEIZ+zmICDHlMb5Zv3MDMpw8KYXs2NGM/jBBT4 QF8PTWusJsu+aVhxzEtHxiNQlQhNNC210rTjB03cB9PwaNqyv4ptIb5Yq3C5wUnsjVgY 8dTA== X-Gm-Message-State: ACrzQf2V/EJumvG9vvHLBwObi3JlqHUI6qFr8SH/eIa6MxCn2Gdokdul lu5obvotqhN6xL7IW+W74WwP8w== X-Received: by 2002:adf:dc82:0:b0:236:e2b2:6f01 with SMTP id r2-20020adfdc82000000b00236e2b26f01mr28675227wrj.358.1667931120754; Tue, 08 Nov 2022 10:12:00 -0800 (PST) Received: from nicolas-Precision-3551.home ([2001:861:5180:dcc0:7d10:e9e8:fd9a:2f72]) by smtp.gmail.com with ESMTPSA id q12-20020a5d61cc000000b002238ea5750csm13037109wrv.72.2022.11.08.10.12.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Nov 2022 10:12:00 -0800 (PST) From: Nicolas Frayer To: nm@ti.com, ssantosh@kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, peter.ujfalusi@gmail.com, vkoul@kernel.org, dmaengine@vger.kernel.org, grygorii.strashko@ti.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-omap@vger.kernel.org, netdev@vger.kernel.org Cc: khilman@baylibre.com, glaroque@baylibre.com, nfrayer@baylibre.com Subject: [PATCH v4 4/4] net: ethernet: ti: davinci_mdio: Deferring probe when soc_device_match() returns NULL Date: Tue, 8 Nov 2022 19:11:44 +0100 Message-Id: <20221108181144.433087-5-nfrayer@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221108181144.433087-1-nfrayer@baylibre.com> References: <20221108181144.433087-1-nfrayer@baylibre.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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?1748952756339062138?= X-GMAIL-MSGID: =?utf-8?q?1748952756339062138?= When the k3 socinfo driver is built as a module, there is a possibility that it will probe after the davinci mdio driver. By deferring the mdio probe we allow the k3 socinfo to probe and register the soc_device_attribute structure needed by the mdio driver. Signed-off-by: Nicolas Frayer --- drivers/net/ethernet/ti/davinci_mdio.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/ti/davinci_mdio.c b/drivers/net/ethernet/ti/davinci_mdio.c index 946b9753ccfb..095198b6b7be 100644 --- a/drivers/net/ethernet/ti/davinci_mdio.c +++ b/drivers/net/ethernet/ti/davinci_mdio.c @@ -533,6 +533,10 @@ static int davinci_mdio_probe(struct platform_device *pdev) const struct soc_device_attribute *soc_match_data; soc_match_data = soc_device_match(k3_mdio_socinfo); + + if (!soc_match_data) + return -EPROBE_DEFER; + if (soc_match_data && soc_match_data->data) { const struct k3_mdio_soc_data *socdata = soc_match_data->data;