From patchwork Thu Jan 26 16:37:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 48798 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp368038wrn; Thu, 26 Jan 2023 08:39:32 -0800 (PST) X-Google-Smtp-Source: AK7set8Mh6T6Fj7TTSyliaczM6X2vSLB3gzYl18QXIuRYj2wyuD3YnvhQehu9TCrgpjsUF3CeJVS X-Received: by 2002:a17:906:4b13:b0:878:5e84:e1da with SMTP id y19-20020a1709064b1300b008785e84e1damr3152523eju.27.1674751172141; Thu, 26 Jan 2023 08:39:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674751172; cv=none; d=google.com; s=arc-20160816; b=C5mzfLBYUQ1Ezz1Wbp0ZqrAvJYhsk7/YDpSMlZQZCwbX9nV7IqcLpug5jyJLeMlicJ 6ZeyRz1eqj5VTZe7BnN7g0U3Yb7NfiHIQeI3tZ6hLPOdORXZQxS7kB2ePJX8KGvG26eR zxATBPMpCrrdp/qXnFP1g2lRaJ2q0KFsGvkESvUCtZA9n11gK/piTd3LQbI62O+HUFk+ RJQ+BOKsql5DKdzINNAGHYhenTn2Rs35ITUg/BV5sZT/ws/QzT5KUnscb7tzFdciqC07 0YKFyQTstkYEmwDwDsHMhAVC4DVGOdpzOpOwfxkyjkNLjIUtnnpDGsBggSeGFQech+a0 5AkA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=S4qlngV87uSXoJSXkP0CEQU1gC5bfEc0xfIRDkJNooc=; b=WHWL/JYzWvEIzqztetXhwGwdjjiHYuWELiHdEij6CY7sXX2kEb+Lv+FHkCRkfocjPn A+smRSVljp6XW2FWu5IweG8XWYR+ovz6SOadS7SA9gCnFOD8FkouPnXgRTWA8FhbBKui dudQpE6CIrNZ/2kTcQ/0umazRP3NJrWcefwB5fQsinIzEnjOzMTys4T5o7qhRArd4O7L kCSIYE/jhpTq1m38QLYFIZVk06BaJpDqRQak9oJ6V23n6flwJyH92uQVxit+tOIo6FXB Yn4N/ZYaIWx+1DUbwKNv/MSEtLD8W2NXZwAshb3oYkNMu7+a/xPg9DeJLzNs8fgMaCmC ABuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lBO7N2TD; 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=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n2-20020a17090673c200b0084c7b0977b6si1638735ejl.852.2023.01.26.08.39.08; Thu, 26 Jan 2023 08:39:32 -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=@kernel.org header.s=k20201202 header.b=lBO7N2TD; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231873AbjAZQiR (ORCPT + 99 others); Thu, 26 Jan 2023 11:38:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231853AbjAZQiP (ORCPT ); Thu, 26 Jan 2023 11:38:15 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9A5F4F349 for ; Thu, 26 Jan 2023 08:38:09 -0800 (PST) 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 0311B618CF for ; Thu, 26 Jan 2023 16:38:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 41FA0C433D2; Thu, 26 Jan 2023 16:38:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674751088; bh=3vj1R34J3j8Pc5/LOGIfCqLcGuFCvDvGSh8Z3HJ+s4E=; h=From:To:Cc:Subject:Date:From; b=lBO7N2TDt3W3KT5KyeYvvNup5GJnczyXzWBV9gKnF0oFNaHCsGGXN4Mt6tmrOH8vV K7Pu3QO28yMkOWdk8cpn/eWcPLd3eqalthVV8O2mQ6PF0tKkSzdtf7/oqZIoMiEkbl JjBSPqAShXQVgjYOQgEpJiSadZqrIYNEFaMg7PJPCZDJ/R3QigCWSGNMObJ+Ih0Q14 P86DUzKdh88PudL8oS/wQDHo1GlDQMN76kt80EdydIWGJhGOVkZwU9OKp1/NrckA4s fds/ziezLUuekw0PHsukGllTIKTr+DUxH1pXhSOA7SKXTofyMyyq1cfKepwJmcVWp+ qobPbHVCHnYIQ== From: Arnd Bergmann To: Jacek Lawrynowicz , Stanislaw Gruszka , Oded Gabbay , Krystian Pradzynski , Jeffrey Hugo , Daniel Vetter Cc: Arnd Bergmann , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] accep/ivpu: PM: remove broken ivpu_dbg() statements Date: Thu, 26 Jan 2023 17:37:54 +0100 Message-Id: <20230126163804.3648051-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 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?1756103885069349185?= X-GMAIL-MSGID: =?utf-8?q?1756103885069349185?= From: Arnd Bergmann When CONFIG_PM is disabled, the driver fails to build: drivers/accel/ivpu/ivpu_pm.c: In function 'ivpu_rpm_get': drivers/accel/ivpu/ivpu_pm.c:240:84: error: 'struct dev_pm_info' has no member named 'usage_count' 240 | ivpu_dbg(vdev, RPM, "rpm_get count %d\n", atomic_read(&vdev->drm.dev->power.usage_count)); | ^ include/linux/dynamic_debug.h:223:29: note: in definition of macro '__dynamic_func_call_cls' 223 | func(&id, ##__VA_ARGS__); \ | ^~~~~~~~~~~ include/linux/dynamic_debug.h:249:9: note: in expansion of macro '_dynamic_func_call_cls' 249 | _dynamic_func_call_cls(_DPRINTK_CLASS_DFLT, fmt, func, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~~~~~~~ include/linux/dynamic_debug.h:272:9: note: in expansion of macro '_dynamic_func_call' 272 | _dynamic_func_call(fmt, __dynamic_dev_dbg, \ | ^~~~~~~~~~~~~~~~~~ include/linux/dev_printk.h:155:9: note: in expansion of macro 'dynamic_dev_dbg' 155 | dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__) | ^~~~~~~~~~~~~~~ drivers/accel/ivpu/ivpu_drv.h:65:17: note: in expansion of macro 'dev_dbg' 65 | dev_dbg((vdev)->drm.dev, "[%s] " fmt, #type, ##args); \ | ^~~~~~~ drivers/accel/ivpu/ivpu_pm.c:240:9: note: in expansion of macro 'ivpu_dbg' 240 | ivpu_dbg(vdev, RPM, "rpm_get count %d\n", atomic_read(&vdev->drm.dev->power.usage_count)); | ^~~~~~~~ It would be possible to rework these statements to only conditionally print the reference counter, or to make the driver depend on CONFIG_PM, but my impression is that these are not actually needed at all if the driver generally works, or they could be put back when required. Just remove all four of these to make the driver build in all configurations. Fixes: 852be13f3bd3 ("accel/ivpu: Add PM support") Signed-off-by: Arnd Bergmann Reviewed-by: Stanislaw Gruszka --- drivers/accel/ivpu/ivpu_pm.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/drivers/accel/ivpu/ivpu_pm.c b/drivers/accel/ivpu/ivpu_pm.c index 553bcbd787b3..a880f1dd857e 100644 --- a/drivers/accel/ivpu/ivpu_pm.c +++ b/drivers/accel/ivpu/ivpu_pm.c @@ -237,8 +237,6 @@ int ivpu_rpm_get(struct ivpu_device *vdev) { int ret; - ivpu_dbg(vdev, RPM, "rpm_get count %d\n", atomic_read(&vdev->drm.dev->power.usage_count)); - ret = pm_runtime_resume_and_get(vdev->drm.dev); if (!drm_WARN_ON(&vdev->drm, ret < 0)) vdev->pm->suspend_reschedule_counter = PM_RESCHEDULE_LIMIT; @@ -248,8 +246,6 @@ int ivpu_rpm_get(struct ivpu_device *vdev) void ivpu_rpm_put(struct ivpu_device *vdev) { - ivpu_dbg(vdev, RPM, "rpm_put count %d\n", atomic_read(&vdev->drm.dev->power.usage_count)); - pm_runtime_mark_last_busy(vdev->drm.dev); pm_runtime_put_autosuspend(vdev->drm.dev); } @@ -314,16 +310,10 @@ void ivpu_pm_enable(struct ivpu_device *vdev) pm_runtime_allow(dev); pm_runtime_mark_last_busy(dev); pm_runtime_put_autosuspend(dev); - - ivpu_dbg(vdev, RPM, "Enable RPM count %d\n", atomic_read(&dev->power.usage_count)); } void ivpu_pm_disable(struct ivpu_device *vdev) { - struct device *dev = vdev->drm.dev; - - ivpu_dbg(vdev, RPM, "Disable RPM count %d\n", atomic_read(&dev->power.usage_count)); - pm_runtime_get_noresume(vdev->drm.dev); pm_runtime_forbid(vdev->drm.dev); } From patchwork Thu Jan 26 16:37:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 48799 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp368169wrn; Thu, 26 Jan 2023 08:39:52 -0800 (PST) X-Google-Smtp-Source: AMrXdXvz0z7jC2ptT+sGpfl4NuI0c9VQGAPUs2Dxk3nl2Nxw1feM4yoRtnaKN3InLSS6WtPsd+Q+ X-Received: by 2002:a17:906:c1c6:b0:819:2756:e090 with SMTP id bw6-20020a170906c1c600b008192756e090mr37068952ejb.50.1674751192070; Thu, 26 Jan 2023 08:39:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674751192; cv=none; d=google.com; s=arc-20160816; b=F1wGo+LVJc+LU8AKr/qS8GgQyzWYKOPnSPjiLaZIRkRnjNQLwKD3VcCOkTTwqnrnWe Jp3RwbrFrT1HNymswORslDw69qsmgpcJ0t32R3uWf0GBaHXW3woSj0dOztywqtAbK7cz YBx5LmihPoYdDgprEng6QQiEtM46MhVyuYqKMJXYgeNlMcKQb7HzL7KCIIPkUkMCQpPa ITtgESW/joqJ4XoPtyPjAdZp4VwpVhsREWK+JMaekareOy3Z8OSCZxJtCMIvz+GYxRtO P034qMQ/sWlxHkl7CRRX6hhOZvdPvqHjG7Ub3ugMR/+55otUgQAAtOn9HFVCmYRGF4aH plmg== 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=+tHytWDRTAmBa90yQ4LxPz/sk/NlyKQz3BRCbNvtqq0=; b=0ITkTPGBt52v/UX1E23QWiGFSAoAczrhXit8ZGZ1oFBIJpd1W2RkRcozjTYA/Cccpb 9Dg6l1NcS070gPlO7PpOAmu7YLanNZOU8W03iVDUYkagB/1Uy3jvZ1F6YGSF9QCqfXXJ SFqT08WYrZ+AFTOk/CsHmpPYQr452a7CqQ0DlTtwczvGqAxSQZo4JPrAK1hYn86GWV16 r2mmU4imQQYHIcjnMDKLrRXl71fY2mB1UzB1vBDOCO/Ul1XUNvP+XqUMlRarPmo9V8xj MOm2HR9Kly4jpi5DUpXajlWB6dPlVGgkq25ynokEkHxKou6ZK6jyx1CGJsttkQ9iuyZm FvYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GDHMo0oZ; 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=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fd7-20020a1709072a0700b008787d3c8c2dsi736385ejc.495.2023.01.26.08.39.29; Thu, 26 Jan 2023 08:39:52 -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=@kernel.org header.s=k20201202 header.b=GDHMo0oZ; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231893AbjAZQi3 (ORCPT + 99 others); Thu, 26 Jan 2023 11:38:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231853AbjAZQi1 (ORCPT ); Thu, 26 Jan 2023 11:38:27 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F09CB4AA62 for ; Thu, 26 Jan 2023 08:38:17 -0800 (PST) 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 8CCB4618E8 for ; Thu, 26 Jan 2023 16:38:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB66FC433D2; Thu, 26 Jan 2023 16:38:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674751097; bh=6qtgNxbECemucjlcZnysho52hl61i0+xb+1L04Nx6II=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GDHMo0oZscx3hvSa024f66iPJ8KgOweUrlORbRbz4kuAV3jGG03zI0+Rh7a9uh2eK 2snSerZvJ/fwoQTAP1ZIkxcXe67XQc10Ba4YA3WjK/zdncb8TuMTTtzkK1gcCfr7BN GXcUX5N/xLoi/tCDUAD7/8W7bcxaL7OPD2XuJkNyMaI/c1nPYSuFyG4nanzJLgxJyk R03PHKS/sF1Yq2GLeCRE1XCI5YlVJrmRJqQWkkDj78WxWAzwtWDTmC7wSqhuiYnYv7 acpJD2iIggHlvEUWeXbeEvK2GBMMT50jJ8VNvAF/reJaU2Eg2m8RRIdpKnzSpLF64h 1w/ob8zWBSKqw== From: Arnd Bergmann To: Jacek Lawrynowicz , Stanislaw Gruszka , Oded Gabbay , Jeffrey Hugo Cc: Arnd Bergmann , Daniel Vetter , Krystian Pradzynski , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] accel/ivpu: avoid duplciate assignment Date: Thu, 26 Jan 2023 17:37:55 +0100 Message-Id: <20230126163804.3648051-2-arnd@kernel.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230126163804.3648051-1-arnd@kernel.org> References: <20230126163804.3648051-1-arnd@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 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?1756103905839210482?= X-GMAIL-MSGID: =?utf-8?q?1756103905839210482?= From: Arnd Bergmann With extra warnings enabled, gcc warns about two assignments of the same .mmap callback: In file included from drivers/accel/ivpu/ivpu_drv.c:10: include/drm/drm_accel.h:31:27: error: initialized field overwritten [-Werror=override-init] 31 | .mmap = drm_gem_mmap | ^~~~~~~~~~~~ drivers/accel/ivpu/ivpu_drv.c:360:9: note: in expansion of macro 'DRM_ACCEL_FOPS' 360 | DRM_ACCEL_FOPS, | ^~~~~~~~~~~~~~ Remove the unused local assignment. Fixes: 20709aa9435b ("accel: Add .mmap to DRM_ACCEL_FOPS") Signed-off-by: Arnd Bergmann Reviewed-by: Jeffrey Hugo --- drivers/accel/ivpu/ivpu_drv.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/accel/ivpu/ivpu_drv.c b/drivers/accel/ivpu/ivpu_drv.c index 2bc2f1b90671..a29e8ee0dce6 100644 --- a/drivers/accel/ivpu/ivpu_drv.c +++ b/drivers/accel/ivpu/ivpu_drv.c @@ -356,7 +356,6 @@ int ivpu_shutdown(struct ivpu_device *vdev) static const struct file_operations ivpu_fops = { .owner = THIS_MODULE, - .mmap = drm_gem_mmap, DRM_ACCEL_FOPS, };