Received: by 2002:ab2:2994:0:b0:1ef:ca3e:3cd5 with SMTP id n20csp804745lqb; Fri, 15 Mar 2024 07:03:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW3UJOR6T+aKxkCJPsGVToMc3ZLP45RcRRhOnZX/GHW7vdF9uq6Loo5YBonKSBUxiln7HBSqQiMZg/72inm4jsLthXKSbU3P09uZX92kA== X-Google-Smtp-Source: AGHT+IGy7uVus9rRn5iVxUioiqCLEdNWq31v3+moFtzK6kkkFn6rzSaKGJz3lejFzUdMGI4x5Xi+ X-Received: by 2002:a0d:dd95:0:b0:609:eb1f:edfe with SMTP id g143-20020a0ddd95000000b00609eb1fedfemr2714242ywe.26.1710511431393; Fri, 15 Mar 2024 07:03:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710511431; cv=pass; d=google.com; s=arc-20160816; b=yuu9r0MXUvZnr+iK82mamWXRUjvuCeimD3Z04B6InDB26Mq3QoHXb0Eye3b8F46++k Vsyue0LR3RG1JWe7eqa7uMqxZT79vVmK8ajq0c2sONVyUhrSURQoVVOLxNyPceDB1fPa e/jsMMcT3SAnz5AH7z+TDYuwYLkC8TChMGKSnLT03A7Qe39XvXhXpt4vgOFZ3AHDDtSa /T+aFh+I2qRfz6J18TDhgsWuVxGe28yQh4sfL1rEbbRxqPgKf/Gy8/F4MiRlvi8t+rmi DdMl1RNo9w05MRdpJbjBXa6wvozsjMQDmoQmNH2JOGuJvmztRL6Jgc+Prem49CqTuto9 9Ucw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=P6yX7gWMndLY/W6xmQZrlVm61gxAHKpF2JaSkwMhoq0=; fh=WtL5fQT7ZUc/CxFY5ivX7o+R0egHbl7+G/zS94M/DC4=; b=rkH6ha8lJUrAmV+lmR0SeMfbgkbcSwM/GITM1sZD9HCJQvgRDvCnnqB4mmFyM/Z7fz b0k6Qp57XFhfDt+mu1V6bZSMIcJACqx5NayNkHiSPL/aqnkesW0QzOKSmvS7LNJID5an mOKuF6znnSc86Xq1LSlMO7dfw7B8utfCJWHLrcwzi8ci5OsnXdgpYRl3/Orwv6TbRaRx aAQjgx5bfIDkv8PHvEd1Iy7DaZwfa/ducgqRe39JJZWxn4QGUHP1i6Mr6L/cHa7iACtj t4wc7fAWkKxVbEsH8jnhVUJuztA5gngA/Kcq4SChyhWtyOG70EMV5eLDu7NZ63hJAEhI 59Tg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-104477-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-104477-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id y62-20020a0dd641000000b00609f24ef6f2si1741151ywd.402.2024.03.15.07.03.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 07:03:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-104477-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-104477-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-104477-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 1C2871C2187F for ; Fri, 15 Mar 2024 14:03:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C739536AFD; Fri, 15 Mar 2024 14:03:45 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AE39424A1D for ; Fri, 15 Mar 2024 14:03:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710511425; cv=none; b=ogaKdgvaxzWFKhczMoFAuc6D7dOgS6fHrDwff+mNe490SK2bdZH+xesDUNxuO0WX3PjTsa4Ddc/wlZK32FpHFCfFDsNyChi+029k0hmcYOdcLqAvka3rZkF35Ge8K6pemtdpzl51Al8Ni/um60G7GT39qaJ1nkLfaPi10DqhCUg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710511425; c=relaxed/simple; bh=yyfcqlpo5C7f0iWyBlzuaGUA0GESIJDsS4zzva3QJiI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=J6MIg+Nuhgjpv+ipOxkymSpK0bIj/ComO8MZWe6l3KL5IvMSOVjiA0HJQp6EtGeKJ8QcfmfJf7o3vYeaqgGGENevE9Xltw3QC8jEwi01nX3L/oudtN0tMzxBAhT+9QWBgwTSpEuj5KzV4t7WGO5Z0ESi23BOx/7NIabjvdJ742g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1A5BEC15; Fri, 15 Mar 2024 07:04:13 -0700 (PDT) Received: from pluto.fritz.box (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4C75B3F73F; Fri, 15 Mar 2024 07:03:35 -0700 (PDT) From: Cristian Marussi To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: sudeep.holla@arm.com, Cristian Marussi Subject: [PATCH] firmware: arm_scmi: Make raw debugfs entries non-seekable Date: Fri, 15 Mar 2024 14:03:24 +0000 Message-ID: <20240315140324.231830-1-cristian.marussi@arm.com> X-Mailer: git-send-email 2.44.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit SCMI Raw debugfs entries are used to inject and snoop messages out of the SCMI core and, as such, the underlying virtual files have no reason to support seeking. Modify the related file_operations descriptors to be non-seekable. Fixes: 3c3d818a9317 ("firmware: arm_scmi: Add core raw transmission support") Signed-off-by: Cristian Marussi --- drivers/firmware/arm_scmi/raw_mode.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/arm_scmi/raw_mode.c b/drivers/firmware/arm_scmi/raw_mode.c index 350573518503..130d13e9cd6b 100644 --- a/drivers/firmware/arm_scmi/raw_mode.c +++ b/drivers/firmware/arm_scmi/raw_mode.c @@ -921,7 +921,7 @@ static int scmi_dbg_raw_mode_open(struct inode *inode, struct file *filp) rd->raw = raw; filp->private_data = rd; - return 0; + return nonseekable_open(inode, filp); } static int scmi_dbg_raw_mode_release(struct inode *inode, struct file *filp) @@ -950,6 +950,7 @@ static const struct file_operations scmi_dbg_raw_mode_reset_fops = { .open = scmi_dbg_raw_mode_open, .release = scmi_dbg_raw_mode_release, .write = scmi_dbg_raw_mode_reset_write, + .llseek = no_llseek, .owner = THIS_MODULE, }; @@ -959,6 +960,7 @@ static const struct file_operations scmi_dbg_raw_mode_message_fops = { .read = scmi_dbg_raw_mode_message_read, .write = scmi_dbg_raw_mode_message_write, .poll = scmi_dbg_raw_mode_message_poll, + .llseek = no_llseek, .owner = THIS_MODULE, }; @@ -975,6 +977,7 @@ static const struct file_operations scmi_dbg_raw_mode_message_async_fops = { .read = scmi_dbg_raw_mode_message_read, .write = scmi_dbg_raw_mode_message_async_write, .poll = scmi_dbg_raw_mode_message_poll, + .llseek = no_llseek, .owner = THIS_MODULE, }; @@ -998,6 +1001,7 @@ static const struct file_operations scmi_dbg_raw_mode_notification_fops = { .release = scmi_dbg_raw_mode_release, .read = scmi_test_dbg_raw_mode_notif_read, .poll = scmi_test_dbg_raw_mode_notif_poll, + .llseek = no_llseek, .owner = THIS_MODULE, }; @@ -1021,6 +1025,7 @@ static const struct file_operations scmi_dbg_raw_mode_errors_fops = { .release = scmi_dbg_raw_mode_release, .read = scmi_test_dbg_raw_mode_errors_read, .poll = scmi_test_dbg_raw_mode_errors_poll, + .llseek = no_llseek, .owner = THIS_MODULE, }; -- 2.44.0