Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp713430yba; Thu, 16 May 2019 07:49:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqzD7iyZisV7idZDd9qhuwdMf51eipK4693oDVuqDgA1r/yZlx6rbfz+ZLdTMWOcnA/0gMjG X-Received: by 2002:a17:902:e9:: with SMTP id a96mr24323786pla.37.1558018152056; Thu, 16 May 2019 07:49:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558018152; cv=none; d=google.com; s=arc-20160816; b=tmpuiKK9qhln4I+kvTXSpYedvrgvnndDLK9nUwpPwNcBhzp2NijpH9HohN+MIKW2cP 7IcDuu3bncpv93YLkWm9PhXYc21lLfxnnhTLNEQ5DbFgnEXHrDT1F50Pe2J5wpi4t51y iDJdShq8ntt2nWHzPxGlhKfmIA5IlgTvu+6V0pdfosaEv9gzb0N/a8XUsSTwryOv+nXe Ky92Ny9fduJpTUpOFheeskco2Jo+2MsgzUyJpI9EZQPV47ezXEPsuj314eHd9FoI4J8Y 2MGfg5FNdFcUWiuL69+tBwz9Dmztb/7HNfLu9Y3yR3mu53XJAf7momjTKlSh8UJGoLGS T/Cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=f+AY9FGToF7XfqxomfQs9FiHIqAX8dYewdybhmeUoTA=; b=mVwGwr3/OWNejze5mua/3WnxZ2xCkkT91CmN+Tjqg1jIyyY7dslsPuChCiY6otbYQo VEqu/1qBiS826g+97+1xxpXouZTFM/S67z0vSV9AqI/kpBbXSP9av7r6+Ri6qOQwYfHN r41Epq8PRVZDPvhoooR3nsc1+f8trfGl9lzrO4E2nxESu74BuvfGr3x6yhjFITmNMh0k avhb94FEfO98d0V2IUXPKnr5HWVpZ7GQT+pECUUBYbfJPHazKxkRS752+iEiOMGRTKRh fbEX1nSsuwVWq2DL9OkhKzd5HdnMnj8S5RvP9gSCB2ixK+1qnPGKbavUr6oVaANJUAUG BIrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=RbjLMkPZ; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o23si4711708pgm.595.2019.05.16.07.48.56; Thu, 16 May 2019 07:49:12 -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=@broadcom.com header.s=google header.b=RbjLMkPZ; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726864AbfEPOrq (ORCPT + 99 others); Thu, 16 May 2019 10:47:46 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:35200 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726692AbfEPOrq (ORCPT ); Thu, 16 May 2019 10:47:46 -0400 Received: by mail-lj1-f195.google.com with SMTP id h11so2011645ljb.2 for ; Thu, 16 May 2019 07:47:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=f+AY9FGToF7XfqxomfQs9FiHIqAX8dYewdybhmeUoTA=; b=RbjLMkPZ/l16ccEaNtAkER7DjD5jYPDaLczLmzyh01O3rbUJDI7XLPByf3snj4wnW0 /76OSaLm1g6x/DBvxSOlNwwxYL1ULO2QwoRV3hEsQvtaG4B19CEMo20TWT9wgsS8rgum BScXFRwbSRFVEFH1JXOuePQxZsiabMWvw784Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=f+AY9FGToF7XfqxomfQs9FiHIqAX8dYewdybhmeUoTA=; b=mm+oLZ/tlx99ZrcVCueNaTCEEEH2sQfeAZpz6wvdsIKtni8OZBGWRrXg5C7TW/F5vs 7KakG916ZyXSabn1UchPlTmEZf4eyqrDsgkHHLLF3+qI38kk/fqjZAtKcvBS1qbkoQox 2TXJpbJYNntcqY97EwzJArC4fDT+J5BbDs0p86NgsPQKAFXX71mlZYzbeL/t9h5NxDSD 6tqtt2sXZYeUN/SVOcgtrvvlEW3cgNOrMyaIzJXvP1MhTGIop4zTlXcT9gqONXq2HEJj 1kAQdOtySKs1xnwCxAA9j00L9YCO0NmOkM6XEf62tCGqOZd3oFlkLeo/etOl9NdsJFl8 /ejQ== X-Gm-Message-State: APjAAAVFa9F3a3hdRZeqMUmE0Rw4mEBWBNC0G/sgHpS1tIOnd/X9hABj Hwyp1HYi+aLvoTtHec18DbJmLaFKieyk45ym8KopYw== X-Received: by 2002:a2e:9bd2:: with SMTP id w18mr554571ljj.120.1558018064453; Thu, 16 May 2019 07:47:44 -0700 (PDT) MIME-Version: 1.0 References: <1556733121-20133-1-git-send-email-kdasu.kdev@gmail.com> In-Reply-To: From: Kamal Dasu Date: Thu, 16 May 2019 10:47:07 -0400 Message-ID: Subject: Re: [PATCH] mtd: nand: raw: brcmnand: When oops in progress use pio and interrupt polling To: Richard Weinberger Cc: Kamal Dasu , MTD Maling List , Boris Brezillon , Richard Weinberger , LKML , Marek Vasut , bcm-kernel-feedback-list@broadcom.com, Miquel Raynal , Brian Norris , David Woodhouse Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 6, 2019 at 12:01 PM Richard Weinberger wrote: > > On Wed, May 1, 2019 at 7:52 PM Kamal Dasu wrote: > > > > If mtd_oops is in progress switch to polling for nand command completion > > interrupts and use PIO mode wihtout DMA so that the mtd_oops buffer can > > be completely written in the assinged nand partition. This is needed in > > cases where the panic does not happen on cpu0 and there is only one online > > CPU and the panic is not on cpu0. > > This optimization is highly specific to your hardware and AFAIK cannot > be applied > in general to brcmnand. > > So the problem you see is that depending on the oops you can no longer use dma > or interrupts in the driver? > > How about adding a new flag to panic_nand_write() which tells the nand > driver that > this is a panic write? > That way you can fall back to pio and polling mode without checking cpu numbers > and oops_in_progress. > Thanks for your review Richard. Will add flag to let low level controller drivers know that that its a panic_write and make brcmnand code more generic and simply fallback to pio and polling in such a case. Will send a V2 patch with these recommended changes. Thanks Kamal > -- > Thanks, > //richard