From patchwork Mon Dec 9 22:27:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 3313441 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 73F7D9F1F0 for ; Mon, 9 Dec 2013 22:28:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C2FBC202EA for ; Mon, 9 Dec 2013 22:28:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 80EB5202E5 for ; Mon, 9 Dec 2013 22:28:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756021Ab3LIW2C (ORCPT ); Mon, 9 Dec 2013 17:28:02 -0500 Received: from mail-qe0-f49.google.com ([209.85.128.49]:35393 "EHLO mail-qe0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751474Ab3LIW2A (ORCPT ); Mon, 9 Dec 2013 17:28:00 -0500 Received: by mail-qe0-f49.google.com with SMTP id w7so3377101qeb.36 for ; Mon, 09 Dec 2013 14:28:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=iCCZV0Bv51ZRzqSzl1//pElJT66EjyIRGtSRnOvgE4M=; b=c1qJceccSl/jecJsu7Fj9WhCkVbAvePAqpEK8mygSxU6EgD5NkqSm4SM01OAJ+KwTn J+mkuX94xAQlSVS69U7WqQSwAAvlkBVFRMovo6IgF4CZuSZOepWCnyEJ8QNR7lc8FdYk UQJw6Duxp9YN+DAnSwyVX0c+JMtlQwhMmEJZchQkKkXBg3hAwKNVMtbqrPjkVD5iR+6J SsCu+AOIFGoGBjE68h624BCiypLKktYvXcFWStOqWgdjpV2Osk2JNpeLCNwvoOAN37uR 2bg1zvraU9yD5crUnG4/n1pPbo4P9zJzajQwrDjyme1nJw0gMPdAfsY8UmaGjyZaKSdv KnDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=iCCZV0Bv51ZRzqSzl1//pElJT66EjyIRGtSRnOvgE4M=; b=kkv1qrpEnkz7cEQujzkuqVDzm3nK/AKtP/q1qeo131CmO3jaMAVlmcZb1fwYyFE9gP oSpN7FmU+zDMFrfPnDSIHe24TNUphNBWMc8tNkvXiFOqYH+2RWHmPysxq1lIMVoRvafy VO/Xf1duAMXu2BTUiMiVeP9seh0imxygPIJxhS4kqhLpcqbggex0R975asVDvK3yBRUw fFfUKYvtoQjFofYfSAWGiBJh1mIfqKzHPH/qYrMOktiorgECzzmyKZeUTWJ1DAOiSBVq TuMcdDXGfBdt/hMV8DXIVR5cyM3draYdKep1vxbGGGcpr3GkpCJZXCOEhLe44ynQPwJO YSWQ== X-Gm-Message-State: ALoCoQmwWbGXft9tPSmun7xyaV8XCOc/+WYuIGW3oYcOg0/u9eRFQC6ijkWakN+6fYCUSJg34WEPQ28KQRGcv9IT00iKJrIByThCBNKyO6DMDcPxGfID2o9N6jz2cKOr+4jZ2lVW5r6eyglDW23+e5e292ubrjp+UKpu9cebjft0e8KxMCm5oOH7X5T1cPJoaAkraK8yxGPVlBK0LH/gvWYHpOgnBx+S+w== X-Received: by 10.49.98.35 with SMTP id ef3mr37745846qeb.30.1386628080169; Mon, 09 Dec 2013 14:28:00 -0800 (PST) Received: from google.com ([172.26.42.80]) by mx.google.com with ESMTPSA id c1sm210845qad.1.2013.12.09.14.27.57 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 09 Dec 2013 14:27:59 -0800 (PST) Date: Mon, 9 Dec 2013 15:27:54 -0700 From: Bjorn Helgaas To: =?iso-8859-1?Q?Bj=F8rn?= Erik Nilsen Cc: "jg1.han@samsung.com" , "marex@denx.de" , "pratyush.anand@gmail.com" , "linux-pci@vger.kernel.org" , "kishon@ti.com" , "Mohit.KUMAR@st.com" , "ajay.khandelwal@st.com" , "tharvey@gateworks.com" , "Eric.Nelson@boundarydevices.com" , "troy.kisky@boundarydevices.com" Subject: Re: [PATCH v5 0/2] Kernel oops from pci_disable_msi Message-ID: <20131209222754.GC2135@google.com> References: <003101ceecd5$dd4e79e0$97eb6da0$%han@samsung.com> <1385732125-28630-1-git-send-email-ben@datarespons.no> <20131209204349.GA2135@google.com> <52a632f0.e42c980a.3d86.ffff8faeSMTPIN_ADDED_MISSING@mx.google.com> <52a63678.4902980a.6fd7.ffffa2b9SMTPIN_ADDED_MISSING@mx.google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <52a63678.4902980a.6fd7.ffffa2b9SMTPIN_ADDED_MISSING@mx.google.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FSL_HELO_FAKE, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Mon, Dec 09, 2013 at 10:30:17PM +0100, Bjørn Erik Nilsen wrote: > > 9. des. 2013 kl. 22:21 skrev Bjorn Helgaas : > > > On Mon, Dec 9, 2013 at 2:15 PM, Bjørn Erik Nilsen wrote: > >> Hi Bjorn, > >> > >> 9. des. 2013 kl. 21:43 skrev Bjorn Helgaas : > >> > >>> On Fri, Nov 29, 2013 at 02:35:23PM +0100, Bjørn Erik Nilsen wrote: > >>>> This patchset address Marek Vasut's comments on the previous > >>>> patches. I decided to split into two separate commits as they are > >>>> unrelated. > >>>> > >>>> Bjørn Erik Nilsen (2): > >>>> PCI: designware: Fix crash in dw_msi_teardown_irq > >>>> PCI: designware: Remove redundant call to pci_write_config > >>> > >>> Hi Bjørn, > >>> > >>> There's been a fair amount of discussion about the first patch, so I'm > >>> ignoring these for now. Please repost these (again) when that all settles > >>> down. > >> > >> I'm under the impression that all concerns have been addressed and that the discussion has settled down. > >> > >> What are the outstanding issues to be solved regarding these patches? > >> > >> I'm asking because these patches are acked-by Marek Vasut and Jingoo Han as well as tested-by Mohit Kumar (and obviously myself). > >> > >> Jingoo Han confirms he can reproduce the crash on Exynos and that the first patch fixes the problem. > > > > I didn't trace through the discussion closely enough to follow > > complaints and their resolution or retraction. Can you post the > > current version including the acks, just so I make sure I get the > > latest stuff? > > I'm not able to repost right now, but I can do it tomorrow morning if needed. > > v5 (as posted) is the latest however, and the amendment is: > > Acked-by: Marek Vasut > Acked-by: Jingoo Han > Tested-by: Mohit Kumar OK, I added these and applied to a pci/host-designware branch for v3.14. I also added the following cleanup patch as suggested by Marek: commit 0b8cfb6aa3aabc96177b1e68ef13d2eb5c686606 Author: Bjorn Helgaas Date: Mon Dec 9 15:11:25 2013 -0700 PCI: designware: Use typical "for" loop idiom It's conventional to use "for" rather than "while" for simple iteration. No functional change. Signed-off-by: Bjorn Helgaas --- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c index 5274085ecd4b..1c92833a4ed3 100644 --- a/drivers/pci/host/pcie-designware.c +++ b/drivers/pci/host/pcie-designware.c @@ -214,8 +214,7 @@ static void clear_irq_range(struct pcie_port *pp, unsigned int irq_base, { unsigned int i, res, bit, val; - i = 0; - while (i < nvec) { + for (i = 0; i < nvec; i++) { irq_set_msi_desc_off(irq_base, i, NULL); clear_bit(pos + i, pp->msi_irq_in_use); /* Disable corresponding interrupt on MSI interrupt controller */ @@ -224,7 +223,6 @@ static void clear_irq_range(struct pcie_port *pp, unsigned int irq_base, dw_pcie_rd_own_conf(pp, PCIE_MSI_INTR0_ENABLE + res, 4, &val); val &= ~(1 << bit); dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_ENABLE + res, 4, val); - ++i; } } @@ -268,8 +266,7 @@ static int assign_irq(int no_irqs, struct msi_desc *desc, int *pos) * descs are also successfully allocated. */ - i = 0; - while (i < no_irqs) { + for (i = 0; i < no_irqs; i++) { if (irq_set_msi_desc_off(irq, i, desc) != 0) { clear_irq_range(pp, irq, i, pos0); goto no_valid_irq; @@ -281,7 +278,6 @@ static int assign_irq(int no_irqs, struct msi_desc *desc, int *pos) dw_pcie_rd_own_conf(pp, PCIE_MSI_INTR0_ENABLE + res, 4, &val); val |= 1 << bit; dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_ENABLE + res, 4, val); - i++; } *pos = pos0;