From patchwork Mon Jan 20 11:20:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 312503 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 426F42C0090 for ; Mon, 20 Jan 2014 22:20:50 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751301AbaATLUs (ORCPT ); Mon, 20 Jan 2014 06:20:48 -0500 Received: from top.free-electrons.com ([176.31.233.9]:35418 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750797AbaATLUs (ORCPT ); Mon, 20 Jan 2014 06:20:48 -0500 Received: by mail.free-electrons.com (Postfix, from userid 106) id 54C507E0; Mon, 20 Jan 2014 12:20:53 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.3.2 Received: from [192.168.0.19] (tra42-5-83-152-246-54.fbx.proxad.net [83.152.246.54]) by mail.free-electrons.com (Postfix) with ESMTPA id B6205F; Mon, 20 Jan 2014 12:20:52 +0100 (CET) Message-ID: <52DD0688.1080802@free-electrons.com> Date: Mon, 20 Jan 2014 12:20:40 +0100 From: Gregory CLEMENT User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Jason Cooper CC: Thomas Petazzoni , Andrew Lunn , Arnd Bergmann , Wolfram Sang , stable@vger.kernel.org, linux-i2c@vger.kernel.org, Ezequiel Garcia , linux-arm-kernel@lists.infradead.org, Sebastian Hesselbarth Subject: Re: [PATCH v5 0/4] Fix i2c bus hang on A0 version of the Armada XP SoCs References: <1389193589-18485-1-git-send-email-gregory.clement@free-electrons.com> <20140114021421.GK19878@titan.lakedaemon.net> <52D4F966.6060200@free-electrons.com> In-Reply-To: <52D4F966.6060200@free-electrons.com> X-Enigmail-Version: 1.6 Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org On 14/01/2014 09:46, Gregory CLEMENT wrote: > On 14/01/2014 03:14, Jason Cooper wrote: >> Gregory, >> >> On Wed, Jan 08, 2014 at 04:06:25PM +0100, Gregory CLEMENT wrote: >>> Hi, >>> >>> Here come the 5th version of the series fixing the i2c bus hang on A0 >>> version of the Armada XP SoCs. It occurred on the early release of the >>> OpenBlocks AX3-4 boards. Indeed the first variants of Armada XP SoCs >>> (A0 stepping) have issues related to the i2c controller which prevent >>> to use the offload mechanism and lead to a kernel hang during boot. >>> >>> The main change are the use of marvell,mv78230-a0-i2c and that the >>> function mvebu_get_soc_id() is now local to mach-mvebu. >>> >>> The first patch add a mean to detect the SoCs version at run-time and >>> the second one use this feature in the driver. >>> >>> The 3 first patches should be applied on 3.13-rc and on stable kernel >>> 3.12 as it fixes a regression introduce by the commit 930ab3d403ae >>> "i2c: mv64xxx: Add I2C Transaction Generator support". >> >> Ok, I've pulled this in by cherrypicking the commits. I needed to add >> the 'Fixes: ...' and 'Cc: stable ...' language, so the commit ids were >> going to change anyhow. I also added the note to the binding as we >> discussed. I've also based this against v3.13-rc1 as there doesn't >> appear to be any need to drag in everything up to -rc6. >> >> I've pushed this to mvebu/fixes. Please take a look. If it all looks >> good I'll send the pull request off tomorrow. > Hi Jason, > > Everything looks perfect! > > Thanks for having improved it, > > Gregory > Hi Jason, Eventually we didn't finish with it! Ezequiel found an issue when we try to access pci_base if it have not been properly mapped, in this case the kernel hang. Indeed the check of the return of of_iomap was wrong. The fix would be something like: -o<---o<---o<---o<---o<---o<---o<---o<---o<---o<---o<-- -o<---o<---o<---o<---o<---o<---o<---o<---o<---o<---o<-- How do you want we handle it? Do you want a proper patch to amend? A new series? Something else? Thanks, Gregory >> >> thx, >> >> Jason. >> >> _______________________________________________ >> linux-arm-kernel mailing list >> linux-arm-kernel@lists.infradead.org >> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel >> > > --- a/arch/arm/mach-mvebu/mvebu-soc-id.c +++ b/arch/arm/mach-mvebu/mvebu-soc-id.c @@ -88,7 +88,7 @@ static int __init mvebu_soc_id_init(void) } pci_base = of_iomap(child, 0); - if (IS_ERR(pci_base)) { + if (pci_base == NULL) { pr_err("cannot map registers\n"); ret = -ENOMEM; goto res_ioremap;