Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp70647imm; Tue, 28 Aug 2018 16:21:10 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbT0Ec6e/hTIpeqTN9n6iaOFXeO6QpCY34GYm+8lbc/IuWwBiGMMxEh5dUq97mtt1C52iYd X-Received: by 2002:a63:f60:: with SMTP id 32-v6mr3439217pgp.399.1535498470903; Tue, 28 Aug 2018 16:21:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535498470; cv=none; d=google.com; s=arc-20160816; b=kXuZG5caq0p+EegRMGg0E01R+El8jebJPMWPoqG9YYmqUX/+6StbwlS13bKr2L61KT tZyUhXq+XkCFEA0ujHd9Re0MuLro17QH4typIeYz4zVZYldJUlMag5K7wYSAadeNPw3Z AHauHxhg4cUvWL5HFkOJOLYSbB6mSgcwnEizdjgPMhmGJxVR7YCoqWdCHBbiAiF4CvCA U2TT1NYNR5o+0wXYKj8bDVncizovuKDr6UNQ7dEDgAc8ehI3/EQGT9vQL8lu8Rw8dyyN tbg84mzAuow8iTh7sIwyqd8CsiyyhwImyrZNMgPcgs9ladUhG12D92XXJHT7dJXmAaKO G6bQ== 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:arc-authentication-results; bh=qL7z73fKeOxfx9ihsofhTALxcpvN7NS+XjNXNUVEJqQ=; b=JaRfhAjEOLO2sHEOFsRAprjG64Ui/ILtiGBdc3nxrwyswmAUovbL9C6wjP3T7ZtfAP 9JsfojyHv0WGczmjCzmIAYYH2sYWp2hk51HPfOVjADUdGE4XYAIrMyaOM74XjNCVMvC/ bjkaEYcLGh0HOUxjHj0f57kMmw6Tr3lL2FJSdxZkJFdTE91oGIz4nJzT8ual6q4KOpok 5WBtfBRZYJKzevMfWa8azv+NT12P7yjvfV7Z9KJih+po5LcdkXyfUCLV/j2z1HsYIyGt 4OSg+FmI+yuQUFVEEVtaCa2++49YXEbDg3RGCuQ/gr8YsMLRJrvX1M6dLZZfvuw1LuPf oWbA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b79-v6si2185709pfc.156.2018.08.28.16.20.55; Tue, 28 Aug 2018 16:21:10 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727759AbeH2Cn1 (ORCPT + 99 others); Tue, 28 Aug 2018 22:43:27 -0400 Received: from mail-it0-f66.google.com ([209.85.214.66]:36033 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727727AbeH2Cn1 (ORCPT ); Tue, 28 Aug 2018 22:43:27 -0400 Received: by mail-it0-f66.google.com with SMTP id u13-v6so4742872iti.1 for ; Tue, 28 Aug 2018 15:49:38 -0700 (PDT) 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=qL7z73fKeOxfx9ihsofhTALxcpvN7NS+XjNXNUVEJqQ=; b=WWGsGGcLyYIvZE+5PwYERU6WA7Y9R2CqdxX5Rh7PaFvDKgdYRnaakYQLEmqC3DNbho Ad9vImXtczyC+mzBEwL1fJumwXyOpK1sbr7tPKALIdApH3C89qeDezMff7stX8WbIXwy vdJXkj8WdbRg2zsEP36U5VyZ6XPN/q6n4S7fA3L10yaK5U6qbUnrbIYhJGKAYOy55yt8 70XXEzINyO16qNjQEpUKtKi+1G1W2kwL8DJUEoVPbOm+nzNceDfGpP6Sh9M+POoH+fQV iZfKbBCTcuNLWLOfv+el71lxQdCUlyFiUwmkCEYuDPO/nrd7/ozD7GaOB2UYdGAgV6Sr ND0A== X-Gm-Message-State: APzg51BBACAeDzGnlpgAR+4W8fK/KzgSpyYLoTnlaMOVt63O2OCST06k N/VH10HQM4bBl73Es8/HAibl5f0Czjs= X-Received: by 2002:a02:9962:: with SMTP id d31-v6mr3321232jak.1.1535496577874; Tue, 28 Aug 2018 15:49:37 -0700 (PDT) Received: from mail-it0-f48.google.com (mail-it0-f48.google.com. [209.85.214.48]) by smtp.gmail.com with ESMTPSA id 65-v6sm1912071itw.44.2018.08.28.15.49.37 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Aug 2018 15:49:37 -0700 (PDT) Received: by mail-it0-f48.google.com with SMTP id h20-v6so4737585itf.2 for ; Tue, 28 Aug 2018 15:49:37 -0700 (PDT) X-Received: by 2002:a24:21c4:: with SMTP id e187-v6mr3337680ita.5.1535496576935; Tue, 28 Aug 2018 15:49:36 -0700 (PDT) MIME-Version: 1.0 References: <20180823213600.23426-1-alexandre.belloni@bootlin.com> In-Reply-To: From: Li Yang Date: Tue, 28 Aug 2018 17:49:25 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] soc: fsl: qbman: qman_portal: defer probing when qman is not available To: Roy Pledge Cc: alexandre.belloni@bootlin.com, linuxppc-dev , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , lkml 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 Fri, Aug 24, 2018 at 9:54 AM Roy Pledge wrote: > > On 8/23/2018 5:36 PM, Alexandre Belloni wrote: > > If the qman driver (qman_ccsr) doesn't probe or fail to probe before > > qman_portal, qm_ccsr_start will be either NULL or a stale pointer to an > > unmapped page. > > > > This leads to a crash when probing qman_portal as the init_pcfg function > > calls qman_liodn_fixup that tries to read qman registers. > > > > Assume that qman didn't probe when the pool mask is 0. > > > > Signed-off-by: Alexandre Belloni Series applied to the fix branch of soc/fsl. > > --- > > drivers/soc/fsl/qbman/qman_portal.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/drivers/soc/fsl/qbman/qman_portal.c b/drivers/soc/fsl/qbman/qman_portal.c > > index a120002b630e..4fc80d2c8feb 100644 > > --- a/drivers/soc/fsl/qbman/qman_portal.c > > +++ b/drivers/soc/fsl/qbman/qman_portal.c > > @@ -277,6 +277,8 @@ static int qman_portal_probe(struct platform_device *pdev) > > } > > > > pcfg->pools = qm_get_pools_sdqcr(); > > + if (pcfg->pools == 0) > > + return -EPROBE_DEFER; > > > > spin_lock(&qman_lock); > > cpu = cpumask_next_zero(-1, &portal_cpus); > > Reviewed-by: Roy Pledge > >