From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-20.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4E48C43462 for ; Mon, 3 May 2021 20:39:01 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2A493611EE for ; Mon, 3 May 2021 20:39:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2A493611EE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4FYvvl46VHz30Cc for ; Tue, 4 May 2021 06:38:59 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=EY24yN3/; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.ibm.com (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=tyreld@linux.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=EY24yN3/; dkim-atps=neutral Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4FYvv96f6kz2xfn for ; Tue, 4 May 2021 06:38:29 +1000 (AEST) Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 143KXLgg111511 for ; Mon, 3 May 2021 16:38:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=subject : to : references : from : message-id : date : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pp1; bh=3kk9j5wpt4trxfLO6RHLG/PFF8R5gVyRiNcbu9EGeoo=; b=EY24yN3/xg1Ghi8u+QByhj9y/73hmxzBvka5uTVIr7p8d/jVImJCYIYq9sn6Gs6vw0UQ KMFk+netaeGonySccRc0WUMQcUT1obG1jof6BlinsMLiBEW1bBr7Rx4kBOu0q2Rf0L6f lt2f8dGPbV86VJ8kaKnkt67Pf6wMPjwMcHGmi2jy2XKVpdHr/mFDljGEBcaElNYNuP09 GRXzR3kZQ6lS8S7vDAN0n7goRLURmp98jqi+1IS0NNmgAcbOlan1ZRzVDmP0u6xF9ho4 IkaFHmfiwCuV5azxBX9AHguDWwXqv1CrvBBAWD5vWCQQ1T4Q0al6DxCV4Kg07kmcHWSq DQ== Received: from ppma05wdc.us.ibm.com (1b.90.2fa9.ip4.static.sl-reverse.com [169.47.144.27]) by mx0a-001b2d01.pphosted.com with ESMTP id 38apb6b987-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 03 May 2021 16:38:26 -0400 Received: from pps.filterd (ppma05wdc.us.ibm.com [127.0.0.1]) by ppma05wdc.us.ibm.com (8.16.0.43/8.16.0.43) with SMTP id 143KXmJ4006715 for ; Mon, 3 May 2021 20:38:25 GMT Received: from b01cxnp23033.gho.pok.ibm.com (b01cxnp23033.gho.pok.ibm.com [9.57.198.28]) by ppma05wdc.us.ibm.com with ESMTP id 38a9xfmx8w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 03 May 2021 20:38:25 +0000 Received: from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com [9.57.199.107]) by b01cxnp23033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 143KcOSk33227244 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 3 May 2021 20:38:24 GMT Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 892FB124055; Mon, 3 May 2021 20:38:24 +0000 (GMT) Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 130EE124052; Mon, 3 May 2021 20:38:24 +0000 (GMT) Received: from oc6857751186.ibm.com (unknown [9.160.113.121]) by b01ledav002.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 3 May 2021 20:38:23 +0000 (GMT) Subject: Re: [RFC] powerpc/pseries: delete scanlog To: Nathan Lynch , linuxppc-dev@lists.ozlabs.org References: <20210503171820.1514957-1-nathanl@linux.ibm.com> From: Tyrel Datwyler Message-ID: Date: Mon, 3 May 2021 13:38:23 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 In-Reply-To: <20210503171820.1514957-1-nathanl@linux.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: -bLDr3COg6z6YBOdRIwBcbm_02N7E5GE X-Proofpoint-GUID: -bLDr3COg6z6YBOdRIwBcbm_02N7E5GE Content-Transfer-Encoding: 7bit X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.761 definitions=2021-05-03_19:2021-05-03, 2021-05-03 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 phishscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 suspectscore=0 bulkscore=0 priorityscore=1501 clxscore=1015 mlxscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2105030141 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On 5/3/21 10:18 AM, Nathan Lynch wrote: > A commit from 2008 says this driver was relevant only for "older > systems", and currently supported hardware doesn't have this > facility. Get rid of it. The only references I could find to scan log dump support are several Power 4+ systems, in particular the IntelliStation POWER 9114 and pSeries 615, which were released in 2003 at the same time this code was originally introduced. Historical Linux commit form February 2003: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git/commit/?id=f92e361842d5251e50562b09664082dcbd0548bb IntelliStation and pSeries docs: http://ps-2.retropc.se/basil.holloway/ALL%20PDF/380635.pdf http://ps-2.kev009.com/rs6000/manuals/p/p615-6C3-6E3/6C3_and_6E3_Users_Guide_SA38-0629.pdf Current firmware RTAS implementations have no reference to ibm,scan-log-dump, and a long standing developer for that code has no recollection of its existence. This appears to be a straggler from RPA and Power 4 days. Based on my understanding that we dropped support Power 4 in mainline this looks pretty orphaned to me and a solid candidate for removal barring and insight from someone else that knows better. +1 Feel free to add my RB tag to any non-RFC followup. Reviewed-by: Tyrel Datwyler > > Signed-off-by: Nathan Lynch > --- > arch/powerpc/configs/ppc64_defconfig | 1 - > arch/powerpc/configs/pseries_defconfig | 1 - > arch/powerpc/platforms/pseries/Kconfig | 4 - > arch/powerpc/platforms/pseries/Makefile | 1 - > arch/powerpc/platforms/pseries/scanlog.c | 195 ----------------------- > 5 files changed, 202 deletions(-) > delete mode 100644 arch/powerpc/platforms/pseries/scanlog.c > > diff --git a/arch/powerpc/configs/ppc64_defconfig b/arch/powerpc/configs/ppc64_defconfig > index 701811c91a6f..acf13b4917c4 100644 > --- a/arch/powerpc/configs/ppc64_defconfig > +++ b/arch/powerpc/configs/ppc64_defconfig > @@ -26,7 +26,6 @@ CONFIG_PPC64=y > CONFIG_NR_CPUS=2048 > CONFIG_PPC_SPLPAR=y > CONFIG_DTL=y > -CONFIG_SCANLOG=m > CONFIG_PPC_SMLPAR=y > CONFIG_IBMEBUS=y > CONFIG_PPC_SVM=y > diff --git a/arch/powerpc/configs/pseries_defconfig b/arch/powerpc/configs/pseries_defconfig > index 50168dde4ea5..d120321e4eea 100644 > --- a/arch/powerpc/configs/pseries_defconfig > +++ b/arch/powerpc/configs/pseries_defconfig > @@ -38,7 +38,6 @@ CONFIG_MODULE_SRCVERSION_ALL=y > CONFIG_PARTITION_ADVANCED=y > CONFIG_PPC_SPLPAR=y > CONFIG_DTL=y > -CONFIG_SCANLOG=m > CONFIG_PPC_SMLPAR=y > CONFIG_IBMEBUS=y > CONFIG_PAPR_SCM=m > diff --git a/arch/powerpc/platforms/pseries/Kconfig b/arch/powerpc/platforms/pseries/Kconfig > index 5e037df2a3a1..bf9b612a929b 100644 > --- a/arch/powerpc/platforms/pseries/Kconfig > +++ b/arch/powerpc/platforms/pseries/Kconfig > @@ -61,10 +61,6 @@ config PSERIES_ENERGY > Provides: /sys/devices/system/cpu/pseries_(de)activation_hint_list > and /sys/devices/system/cpu/cpuN/pseries_(de)activation_hint > > -config SCANLOG > - tristate "Scanlog dump interface" > - depends on RTAS_PROC && PPC_PSERIES > - > config IO_EVENT_IRQ > bool "IO Event Interrupt support" > depends on PPC_PSERIES > diff --git a/arch/powerpc/platforms/pseries/Makefile b/arch/powerpc/platforms/pseries/Makefile > index c8a2b0b05ac0..754d1102de08 100644 > --- a/arch/powerpc/platforms/pseries/Makefile > +++ b/arch/powerpc/platforms/pseries/Makefile > @@ -8,7 +8,6 @@ obj-y := lpar.o hvCall.o nvram.o reconfig.o \ > firmware.o power.o dlpar.o mobility.o rng.o \ > pci.o pci_dlpar.o eeh_pseries.o msi.o > obj-$(CONFIG_SMP) += smp.o > -obj-$(CONFIG_SCANLOG) += scanlog.o > obj-$(CONFIG_KEXEC_CORE) += kexec.o > obj-$(CONFIG_PSERIES_ENERGY) += pseries_energy.o > > diff --git a/arch/powerpc/platforms/pseries/scanlog.c b/arch/powerpc/platforms/pseries/scanlog.c > deleted file mode 100644 > index 2879c4f0ceb7..000000000000 > --- a/arch/powerpc/platforms/pseries/scanlog.c > +++ /dev/null > @@ -1,195 +0,0 @@ > -// SPDX-License-Identifier: GPL-2.0-or-later > -/* > - * c 2001 PPC 64 Team, IBM Corp > - * > - * scan-log-data driver for PPC64 Todd Inglett > - * > - * When ppc64 hardware fails the service processor dumps internal state > - * of the system. After a reboot the operating system can access a dump > - * of this data using this driver. A dump exists if the device-tree > - * /chosen/ibm,scan-log-data property exists. > - * > - * This driver exports /proc/powerpc/scan-log-dump which can be read. > - * The driver supports only sequential reads. > - * > - * The driver looks at a write to the driver for the single word "reset". > - * If given, the driver will reset the scanlog so the platform can free it. > - */ > - > -#include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > - > -#define MODULE_VERS "1.0" > -#define MODULE_NAME "scanlog" > - > -/* Status returns from ibm,scan-log-dump */ > -#define SCANLOG_COMPLETE 0 > -#define SCANLOG_HWERROR -1 > -#define SCANLOG_CONTINUE 1 > - > - > -static unsigned int ibm_scan_log_dump; /* RTAS token */ > -static unsigned int *scanlog_buffer; /* The data buffer */ > - > -static ssize_t scanlog_read(struct file *file, char __user *buf, > - size_t count, loff_t *ppos) > -{ > - unsigned int *data = scanlog_buffer; > - int status; > - unsigned long len, off; > - unsigned int wait_time; > - > - if (count > RTAS_DATA_BUF_SIZE) > - count = RTAS_DATA_BUF_SIZE; > - > - if (count < 1024) { > - /* This is the min supported by this RTAS call. Rather > - * than do all the buffering we insist the user code handle > - * larger reads. As long as cp works... :) > - */ > - printk(KERN_ERR "scanlog: cannot perform a small read (%ld)\n", count); > - return -EINVAL; > - } > - > - if (!access_ok(buf, count)) > - return -EFAULT; > - > - for (;;) { > - wait_time = 500; /* default wait if no data */ > - spin_lock(&rtas_data_buf_lock); > - memcpy(rtas_data_buf, data, RTAS_DATA_BUF_SIZE); > - status = rtas_call(ibm_scan_log_dump, 2, 1, NULL, > - (u32) __pa(rtas_data_buf), (u32) count); > - memcpy(data, rtas_data_buf, RTAS_DATA_BUF_SIZE); > - spin_unlock(&rtas_data_buf_lock); > - > - pr_debug("scanlog: status=%d, data[0]=%x, data[1]=%x, " \ > - "data[2]=%x\n", status, data[0], data[1], data[2]); > - switch (status) { > - case SCANLOG_COMPLETE: > - pr_debug("scanlog: hit eof\n"); > - return 0; > - case SCANLOG_HWERROR: > - pr_debug("scanlog: hardware error reading data\n"); > - return -EIO; > - case SCANLOG_CONTINUE: > - /* We may or may not have data yet */ > - len = data[1]; > - off = data[2]; > - if (len > 0) { > - if (copy_to_user(buf, ((char *)data)+off, len)) > - return -EFAULT; > - return len; > - } > - /* Break to sleep default time */ > - break; > - default: > - /* Assume extended busy */ > - wait_time = rtas_busy_delay_time(status); > - if (!wait_time) { > - printk(KERN_ERR "scanlog: unknown error " \ > - "from rtas: %d\n", status); > - return -EIO; > - } > - } > - /* Apparently no data yet. Wait and try again. */ > - msleep_interruptible(wait_time); > - } > - /*NOTREACHED*/ > -} > - > -static ssize_t scanlog_write(struct file * file, const char __user * buf, > - size_t count, loff_t *ppos) > -{ > - char stkbuf[20]; > - int status; > - > - if (count > 19) count = 19; > - if (copy_from_user (stkbuf, buf, count)) { > - return -EFAULT; > - } > - stkbuf[count] = 0; > - > - if (buf) { > - if (strncmp(stkbuf, "reset", 5) == 0) { > - pr_debug("scanlog: reset scanlog\n"); > - status = rtas_call(ibm_scan_log_dump, 2, 1, NULL, 0, 0); > - pr_debug("scanlog: rtas returns %d\n", status); > - } > - } > - return count; > -} > - > -static int scanlog_open(struct inode * inode, struct file * file) > -{ > - unsigned int *data = scanlog_buffer; > - > - if (data[0] != 0) { > - /* This imperfect test stops a second copy of the > - * data (or a reset while data is being copied) > - */ > - return -EBUSY; > - } > - > - data[0] = 0; /* re-init so we restart the scan */ > - > - return 0; > -} > - > -static int scanlog_release(struct inode * inode, struct file * file) > -{ > - unsigned int *data = scanlog_buffer; > - > - data[0] = 0; > - return 0; > -} > - > -static const struct proc_ops scanlog_proc_ops = { > - .proc_read = scanlog_read, > - .proc_write = scanlog_write, > - .proc_open = scanlog_open, > - .proc_release = scanlog_release, > - .proc_lseek = noop_llseek, > -}; > - > -static int __init scanlog_init(void) > -{ > - struct proc_dir_entry *ent; > - int err = -ENOMEM; > - > - ibm_scan_log_dump = rtas_token("ibm,scan-log-dump"); > - if (ibm_scan_log_dump == RTAS_UNKNOWN_SERVICE) > - return -ENODEV; > - > - /* Ideally we could allocate a buffer < 4G */ > - scanlog_buffer = kzalloc(RTAS_DATA_BUF_SIZE, GFP_KERNEL); > - if (!scanlog_buffer) > - goto err; > - > - ent = proc_create("powerpc/rtas/scan-log-dump", 0400, NULL, > - &scanlog_proc_ops); > - if (!ent) > - goto err; > - return 0; > -err: > - kfree(scanlog_buffer); > - return err; > -} > - > -static void __exit scanlog_cleanup(void) > -{ > - remove_proc_entry("powerpc/rtas/scan-log-dump", NULL); > - kfree(scanlog_buffer); > -} > - > -module_init(scanlog_init); > -module_exit(scanlog_cleanup); > -MODULE_LICENSE("GPL"); >