Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp994763imm; Fri, 5 Oct 2018 15:57:27 -0700 (PDT) X-Google-Smtp-Source: ACcGV624fY45I8hOU2z2nxpxWRcPTUxR8tkeh9bPPr71cfsAAyzO8cyXbOIz5yUe8cZI9wU5kal4 X-Received: by 2002:a63:f110:: with SMTP id f16-v6mr12054686pgi.236.1538780247620; Fri, 05 Oct 2018 15:57:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538780247; cv=none; d=google.com; s=arc-20160816; b=Q2KQNEOtYIU5iiwkvVnmdfpVX6pm09SQNfjRzh7PQs9zv/mm4bty8kLQ5AxkWVEmU8 BnLaWkV/BISo7JgS/xR6AhBvUPT1B+DW1FHroinevZZ6XuxfUcj0XmyIFuo4qVIFwoDu nbqFrNmdjEDvIghR/qM2MPNVIWXcGzB9qNa9uHyDwgfwjQvou2XraFZn152Ac1WgiFoj JDbD0LNWbAHXDfjQK1mGq/RVSCKy/7dSLYbRjQ+n9DQII0X747Gtr9BEHEwC4IidCeE9 32AeGa04C65J9T8Wc/SYuDAG+6kx66qMsARdiV5/Jj1gRGsJVbOqItJwVXcpPeXJxsGv 4veQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:references:message-id:date :thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=sm7WNuwZW+wGWf8ObyucXivaJVBujEaAAT995i+8VeI=; b=x9v1sFzesO+w/3X+VuoUrSQ7tgYl3iujdTEsApb0fr3T/y96qDwu6hHwoPR3c6+o8d 3j/OkECBn3l5Z4bra7LmhPkimXdCMHNa4WERbSz723xr0EAARLA1HyMjJPysj1B5xddp SN7Yr7TuuUF+6VBFQ1vrSvM22GcJyXU5DT3j3LezEy+nj9D7vGac9i7GQ1DpI0ZGAv48 00ViwkITc6jUq8Tj5+prl70+Ucpvawj79UpZysQwZTXogDVLFfK/iWQdzGjPqEtgGCi+ aA1YNH/2LQSrQcaLmZAvRB8V19IjakLXTCNUMZyzMRCPSC8YAsUHuN1Qqdy3mhtXKq3Z a26g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=gbiIpNlV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y73-v6si10495921pfi.61.2018.10.05.15.57.08; Fri, 05 Oct 2018 15:57:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=gbiIpNlV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726759AbeJFF5z (ORCPT + 99 others); Sat, 6 Oct 2018 01:57:55 -0400 Received: from us01smtprelay-2.synopsys.com ([198.182.47.9]:57870 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725826AbeJFF5z (ORCPT ); Sat, 6 Oct 2018 01:57:55 -0400 Received: from mailhost.synopsys.com (mailhost3.synopsys.com [10.12.238.238]) by smtprelay.synopsys.com (Postfix) with ESMTP id EF1A624E0DE9; Fri, 5 Oct 2018 15:57:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1538780223; bh=/HKoNZVI/dZBAI0pkC4esBXehc/Y5nDz2WhG+I4kpYU=; h=From:To:CC:Subject:Date:References:From; b=gbiIpNlVmfFLW+QPdu6vcNA+Z+Fh6eiU/cS+IspmpR2VPmADVcEbbnDhNtYkS2Ppp drsFB7OLcvQg0hb2G0FYxOO0j7o3TKiyq3eYSvfan9P4BoH3OfMwPT1vlSVe1DzEf/ Fm2v4nefigVahEwaRB2VZpPldYIAhfb8cFpJZgNH1nyw0uO//uRIU+ztkDKeV9rBeK W7ZmXPiLY75PPNv4Rj5w4YQb3FRzh1jCaFwKRM81pI0MJ9I6MNCjBVtKqHSnIRaJcR 59eYupR6AzOroLcrVmfJnxLMmOzoDnyNFAjimvGtM2S16LpYRAFlngiGE0N8HCJ8OV EUU3dk4BgM8xQ== Received: from US01WEHTC2.internal.synopsys.com (us01wehtc2-vip.internal.synopsys.com [10.12.239.238]) by mailhost.synopsys.com (Postfix) with ESMTP id A152D3A42; Fri, 5 Oct 2018 15:57:02 -0700 (PDT) Received: from us01wembx1.internal.synopsys.com ([169.254.1.253]) by US01WEHTC2.internal.synopsys.com ([10.12.239.237]) with mapi id 14.03.0415.000; Fri, 5 Oct 2018 15:56:53 -0700 From: Vineet Gupta To: Eugeniy Paltsev , "linux-snps-arc@lists.infradead.org" CC: "linux-kernel@vger.kernel.org" , "Alexey Brodkin" Subject: Re: [PATCH] ARC: IOC: panic if kernel was started with previously enabled IOC Thread-Topic: [PATCH] ARC: IOC: panic if kernel was started with previously enabled IOC Thread-Index: AQHUW+Pi2l0qN/ga1kOYlHrTlH6D2Q== Date: Fri, 5 Oct 2018 22:56:52 +0000 Message-ID: References: <20181004131212.16405-1-Eugeniy.Paltsev@synopsys.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.144.199.106] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/04/2018 06:12 AM, Eugeniy Paltsev wrote:=0A= > =0A= > diff --git a/arch/arc/mm/cache.c b/arch/arc/mm/cache.c=0A= > index f2701c13a66b..ee7b63e9c5e3 100644=0A= > --- a/arch/arc/mm/cache.c=0A= > +++ b/arch/arc/mm/cache.c=0A= > @@ -1144,6 +1144,25 @@ noinline void __init arc_ioc_setup(void)=0A= > {=0A= > unsigned int ioc_base, mem_sz;=0A= > =0A= > + /*=0A= > + * Disabling and reconfiguring of IOC are quite a tricky actions becaus= e=0A= > + * nobody knows what happens if there're IOC-ahndled tarnsactions in=0A= > + * flight when we're disabling IOC.=0A= > + *=0A= > + * And the problem is external DMA masters [that were initialized and= =0A= > + * set in a bootlaoder that was executed before we got here] might=0A= > + * continue to send data to memory even at this point and we have=0A= > + * no way to prevent that.=0A= > + *=0A= > + * That said it's much safer to not enable IOC at all anywhere before= =0A= > + * Linux kernel.=0A= > + */=0A= > + if (read_aux_reg(ARC_REG_IO_COH_ENABLE) & ARC_IO_COH_ENABLE_BIT)=0A= > + panic("kernel was started with previously enabled IOC!\n");=0A= =0A= While I understand the needs, this seems excessive, should we warm the user= ,=0A= instead of panic ? Did you run into specific issue to warrant this !=0A= =0A= OTOH in recent past more than 1 person ran into some hsdk uboot shenanigans= , where=0A= we had to upgrade the uboot to get it working with prebuit images - is that= what=0A= you are trying to prevent here - panic early instead of random user errors = / hangs=0A= later ?=0A= =0A= -Vineet=0A=