From patchwork Thu Apr 26 18:48:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Dasu X-Patchwork-Id: 10366685 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 95019602DC for ; Thu, 26 Apr 2018 18:48:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 87E0128AFB for ; Thu, 26 Apr 2018 18:48:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7CC0B28B7A; Thu, 26 Apr 2018 18:48:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 38B9D28AFB for ; Thu, 26 Apr 2018 18:48:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753587AbeDZSsk (ORCPT ); Thu, 26 Apr 2018 14:48:40 -0400 Received: from mail-qk0-f193.google.com ([209.85.220.193]:40278 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755422AbeDZSs2 (ORCPT ); Thu, 26 Apr 2018 14:48:28 -0400 Received: by mail-qk0-f193.google.com with SMTP id o64so26412921qkl.7; Thu, 26 Apr 2018 11:48:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=13wU9RyBdwowVAI7NX9HkCiAgURteyjJtqX0uA3mySE=; b=CczVLIxzkYRzL2r6/gqnviJ4teqd907tTIBLrzl4QFljPSwhaBZkOVW0UPaxtRm3Up OFVxoToCwH6H85AvI529GWhBHvySP93SydaFAxC8aoNOwam7BTAzH8RAu3jbAXbpkszg GWK+fwz8rNVxWHJJsREg4jXDuXeVYTYmUKBtjyTMnG7v4Htd4JkyBPaSlYYOpitpdvmt L0DtVM2ESmP9GRoYIiamlzSjNetyb/c9VKzv70PSrM+l7YPit86LQco3WN5i6ry5fi+b VPHTJQK3F8dqEMaOKCEsfytKFt34efpKfO1UqNeUyCqFZwPvQIGgII9zGzV58vEtDrrT ws1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=13wU9RyBdwowVAI7NX9HkCiAgURteyjJtqX0uA3mySE=; b=eZVDzRWP+mQfh6IIGkPq1RFaifKV7bylr5HcMctsx0dm98QG4LQVtYt3MS8PPubIXE iy+J5WBXIKxPrG6a+UQNCwoQpjfwwHBKSl99KeyXG1VUOWWGvsOJsQf9Gh0s2mbBY2ry poBk4EPVPSZz2lPx5MrzzIiDHRRLA0kEzURTyRns9uQDXNDfAkctC5lyipbsveZcqzfo QvdxNdAgwG2340j1IonfCfCbop4VGQJSaWjuj7IGrPlCpnySkvle/E/CVPvsgYCptjey ZdDY5HmMd23Q3JVHcMeLWTavThVVZScQRaqJvcnITi/rS26zDd8KMLaAIwLhDCHYAHrb /3sw== X-Gm-Message-State: ALQs6tBIcBQQSWVC/DloJxIm6VLkTy8O3FM9CKew1YNUlBepjpTWx2Ys R1u9sf9KUBUkeUPmKspNEyHdug== X-Google-Smtp-Source: AB8JxZro2I0LsGYkjYizGcUPC7GGuENGOJvCpmHA3p309zH13VSXq7mBTDjgO6SXUHRyqaWXHppdpQ== X-Received: by 10.55.43.153 with SMTP id r25mr35697504qkr.422.1524768507471; Thu, 26 Apr 2018 11:48:27 -0700 (PDT) Received: from mail.broadcom.com ([192.19.231.250]) by smtp.gmail.com with ESMTPSA id k43-v6sm17970058qtc.5.2018.04.26.11.48.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Apr 2018 11:48:27 -0700 (PDT) From: Kamal Dasu To: broonie@kernel.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: f.fainelli@gmail.com, bcm-kernel-feedback-list@broadcom.com, jon.mason@broadcom.com, yendapally.reddy@broadcom.com, Kamal Dasu Subject: [PATCH v2 2/2] spi: bcm-qspi: Always read and set BSPI_MAST_N_BOOT_CTRL Date: Thu, 26 Apr 2018 14:48:01 -0400 Message-Id: <1524768481-16347-3-git-send-email-kdasu.kdev@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524768481-16347-1-git-send-email-kdasu.kdev@gmail.com> References: <1524768481-16347-1-git-send-email-kdasu.kdev@gmail.com> Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Always confirm the BSPI_MAST_N_BOOT_CTRL bit when enabling or disabling BSPI transfers. Fixes: 4e3b2d236fe00 ("spi: bcm-qspi: Add BSPI spi-nor flash controller driver") Signed-off-by: Kamal Dasu --- drivers/spi/spi-bcm-qspi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-bcm-qspi.c b/drivers/spi/spi-bcm-qspi.c index 2946989..6573152 100644 --- a/drivers/spi/spi-bcm-qspi.c +++ b/drivers/spi/spi-bcm-qspi.c @@ -490,7 +490,7 @@ static int bcm_qspi_bspi_set_mode(struct bcm_qspi *qspi, static void bcm_qspi_enable_bspi(struct bcm_qspi *qspi) { - if (!has_bspi(qspi) || (qspi->bspi_enabled)) + if (!has_bspi(qspi)) return; qspi->bspi_enabled = 1; @@ -505,7 +505,7 @@ static void bcm_qspi_enable_bspi(struct bcm_qspi *qspi) static void bcm_qspi_disable_bspi(struct bcm_qspi *qspi) { - if (!has_bspi(qspi) || (!qspi->bspi_enabled)) + if (!has_bspi(qspi)) return; qspi->bspi_enabled = 0;