From patchwork Wed Jan 17 15:15:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Ford X-Patchwork-Id: 10169449 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 DB941601D3 for ; Wed, 17 Jan 2018 15:15:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C8F5227DCD for ; Wed, 17 Jan 2018 15:15:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BD7B228590; Wed, 17 Jan 2018 15:15:21 +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=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 17D1927DCD for ; Wed, 17 Jan 2018 15:15:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: References:In-Reply-To:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OEAHUOvabdWfSwondZHpy7s5F7VVj+I1WEorxgDG52s=; b=Nfz/sBJ+XoM+l6 n9EaoJA0+yUoVhuVpyHCr7j1mPmTWVvJv44Iz34i3xySxL7vHFXvljdKH+rl11kYKtGw0o/DJH8xs jCEbLFwc1AxPeX9qwixdy1nGOcDi0OKy54vQLDcZnZE9DnSql49MTb+ZrtjkMwGHQ9BnKuNff/3mO noQjUJRrb7odUqlYpwOCxZHoMwWcec+6Mq3YmdZWFzlZWWA1NHKFZf8atgi8m+pPoXIej3wcolC+X UqikmAltikOOwMq0O0RqBtPixg6ZqeVh81zLfuW6kHKCzSti4qfIOzmm+nncgxVUm28UwTkhSCGh3 /nWVO4Ad42D2XBs58p0Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1ebpQt-0007dT-Vx; Wed, 17 Jan 2018 15:15:19 +0000 Received: from mail-ua0-x242.google.com ([2607:f8b0:400c:c08::242]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ebpQo-0006in-HJ for linux-arm-kernel@lists.infradead.org; Wed, 17 Jan 2018 15:15:18 +0000 Received: by mail-ua0-x242.google.com with SMTP id n2so12552798uak.9 for ; Wed, 17 Jan 2018 07:15:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=jxL9N6fVKb/X3fPXe5ByRWlwwNVx2bxu4qaftFYL5zE=; b=dz1DYwTj/osf9JZ8R6lKO3yyrFlOhLRuz+AQm122MhsNITaHoj0bIpEsjMnY6VfOFj 6wRBcnXdUcKLCPkEhO5yC7xgk75kShvKv6Zf39DdRE24f8iD+oKuYW4M5eDw1VKmEV82 TVLNJENj2JtR6EhrnPglezyU7xqk6pT6EnJ1qfyEXIMleIFCZFgHSwzpyIaFOOB1rN7q Q6LjuHuYDpi6ky7pzwguZdWMznzJXQWjaVMtEIp10ukn7qcfN6foMumwzRs6cZr6iBKZ nzyXNcddl/ciIerCoXDTHBozlUToRkHRfo8VqmUrEGo7DwVSd56+c1RbOq9yXaf9gbWi OHnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=jxL9N6fVKb/X3fPXe5ByRWlwwNVx2bxu4qaftFYL5zE=; b=AqnAMmbWNPAkf/oICgC7AcuOsmr0VUbgZt/iaB7QtxqLlAdCSrICAl2tWi31okFslz X6EJK8cxoeU0Z+RL2f5fYa6nR/kF/jtJtzalL3CdMZtomcTvhkdhzB8CRm4KoeNFN93R RWggeRZZo39j4nq9rLdyYB2/nOfqrF8MzKx7x2+4zCq+fdJ376fvIzsEacDAzI94hKhm fFBbVKkYnbwrnhk3yw9W9ur6R0FMZPbsCHPotkkVOCyNQXSMRRcEgS5basXyiizfgKda T1ggaqzpJ24YtU8eIS+zIRr4D6HGlVUiCTXmKGti7Sh/fu2umnNfkxn32pXx4XRNPu/5 LRZQ== X-Gm-Message-State: AKwxyteKsD5uW4nbnLuqw6Vh+TGRE7+7PHTsT3mmQFxVUdfk5fuVVnUk 7qeQ0p4JUIPJQ1ELHo80a09gcUNqzJtfWCcCTaA= X-Google-Smtp-Source: ACJfBotakJ+eLmO0615U6InxrVPwlCkxgnUnmSbU2p08XbPOQNGYTiWBx8oVq5roMWZAAXEB7jF1VmIQPRsb15KpgAY= X-Received: by 10.176.80.8 with SMTP id b8mr2277170uaa.63.1516202102557; Wed, 17 Jan 2018 07:15:02 -0800 (PST) MIME-Version: 1.0 Received: by 10.176.66.2 with HTTP; Wed, 17 Jan 2018 07:15:01 -0800 (PST) In-Reply-To: <6b4c5bf2-1260-0e79-0414-9870f21e4a75@ti.com> References: <1489236606-24023-1-git-send-email-t-kristo@ti.com> <1489236606-24023-16-git-send-email-t-kristo@ti.com> <6b4c5bf2-1260-0e79-0414-9870f21e4a75@ti.com> From: Adam Ford Date: Wed, 17 Jan 2018 09:15:01 -0600 Message-ID: Subject: Re: [PATCHv2 15/15] clk: ti: convert to use proper register definition for all accesses To: Tero Kristo X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tony Lindgren , Michael Turquette , Stephen Boyd , linux-omap@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On Wed, Jan 17, 2018 at 8:02 AM, Tero Kristo wrote: > On 17/01/18 15:27, Adam Ford wrote: >> >> On Sat, Mar 11, 2017 at 6:50 AM, Tero Kristo wrote: >>> >>> Currently, TI clock driver uses an encapsulated struct that is cast into >>> a void pointer to store all register addresses. This can be considered >>> as rather nasty hackery, and prevents from expanding the register >>> address field also. Instead, replace all the code to use proper struct >>> in place for this, which contains all the previously used data. >>> >>> This patch is rather large as it is touching multiple files, but this >>> can't be split up as we need to avoid any boot breakage. >>> >> >> I know it's late coming, but according to git bisect, this patch is >> causing some problems with Logic PD Torpedo 37xx Dev kit. > > > Oh reporting bugs is never too late, thanks for posting this out. > >> >> It it is a DM3730 that has a WL1283 chipset attached to the SDIO >> interface on MMC3. The driver seems to load properly, but when >> loading wpa_supplicant to activate the WL1283, we get a giant crash. >> I checked kernel revisions starting at 4.14 and working back to when >> it worked, then used git bisect from there. >> >> I am hoping it might be a simple fix for something that just needs to >> get added or tweaked in the device tree. > > > I don't have access to the specific hw, but can you try to dig out which > hwmod is causing the crash? Just print out the oh->name from the > _wait_softreset_complete. That would help root causing the issue. > With one small patch, I was able to make it work again. This leads me to believe that the omap_test_timeout functions might not be working quite right. Here is the working log with the above patch: # wpa_supplicant -Dnl80211 -iwlan0 -c/etc/wpa_supplicant.conf -B [ 17.992858] _wait_softreset_complete: mmc1 Successfully initialized wpa_supplicant rfkill: Cannot open RFKILL control device [ 18.239746] _wait_softreset_complete: mmc3 [ 18.638580] _wait_softreset_complete: mmc3 [ 18.657562] _wait_softreset_complete: mmc1 [ 18.833374] wlcore: firmware booted (Rev 7.3.10.0.141) [ 18.878326] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready # [ 19.526275] _wait_softreset_complete: mmc3 [ 19.787322] _wait_softreset_complete: mmc3 [ 20.544830] _wait_softreset_complete: mmc3 [ 21.600433] _wait_softreset_complete: mmc1 [ 21.619293] _wait_softreset_complete: i2c1 [ 21.893341] _wait_softreset_complete: mmc3 [ 22.362091] wlan0: authenticate with 70:3a:cb:5e:14:62 [ 22.437713] wlan0: send auth to 70:3a:cb:5e:14:62 (try 1/3) [ 22.455139] wlan0: authenticated [ 22.471710] wlan0: associate with 70:3a:cb:5e:14:62 (try 1/3) [ 22.486206] wlan0: RX AssocResp from 70:3a:cb:5e:14:62 (capab=0x11 status=0 a id=3) [ 22.517303] wlan0: associated [ 22.521728] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready I doubled checked again without the patch and it crashes like shown below, so the debug is definately make something better. I haven't checked the 4.15-RC candidate yet, so I'll see if that's changed, and I'll let you know what I find. > -Tero > adam > >> >> >> >> # wpa_supplicant -Dnl80211 -iwlan0 -c/etc/wpa_supplicant.conf -B >> Successfully initialized wpa_supplicant >> rfkill: Cannot open RFKILL control device >> [ 14.674011] Unhandled fault: external abort on non-linefetch (0x1028) >> at 0xfa >> 0ad014 >> [ 14.682708] pgd = cc2ac000 >> [ 14.685607] [fa0ad014] *pgd=48011452(bad) >> [ 14.689941] Internal error: : 1028 [#1] SMP ARM >> [ 14.694732] Modules linked in: arc4 wl12xx wlcore mac80211 cfg80211 >> evdev joy >> dev snd_soc_omap_twl4030 omapfb cfbfillrect cfbimgblt leds_gpio cpufreq_dt >> cfbco >> pyarea led_class thermal_sys panel_dpi pwm_omap_dmtimer gpio_keys hwmon >> pwm_bl o >> map3_isp videobuf2_dma_contig videobuf2_memops videobuf2_v4l2 >> videobuf2_core v4l >> 2_common snd_soc_omap_mcbsp snd_soc_omap omap_wdt videodev media omap_hdq >> wlcore >> _sdio wire cn phy_twl4030_usb omap2430 musb_hdrc udc_core twl4030_wdt >> rtc_twl sn >> d_soc_twl4030 ehci_omap snd_soc_core snd_pcm_dmaengine snd_pcm ehci_hcd >> snd_time >> r twl4030_pwrbutton ohci_omap3 twl4030_charger pwm_twl_led snd >> twl4030_keypad so >> undcore pwm_twl industrialio matrix_keymap ohci_hcd usbcore usb_common >> at24 tsc2 >> 004 omap_ssi tsc200x_core nvmem_core hsi omapdss >> [ 14.766357] CPU: 0 PID: 174 Comm: wpa_supplicant Not tainted >> 4.11.0-rc1-00015 >> -g6c0afb5 #1 >> [ 14.774993] Hardware name: Generic OMAP36xx (Flattened Device Tree) >> [ 14.781646] task: cc8a8000 task.stack: cc8bc000 >> [ 14.786468] PC is at _wait_softreset_complete+0x70/0x114 >> [ 14.792083] LR is at _enable_sysc+0x30/0x238 >> [ 14.796630] pc : [] lr : [] psr: 40010093 >> [ 14.796630] sp : cc8bdbd0 ip : c01288fc fp : 00000000 >> [ 14.808715] r10: cc8bc000 r9 : c0b0225c r8 : 00002710 >> [ 14.814239] r7 : 000346dc r6 : c0d20644 r5 : c0d202ac r4 : 00000000 >> [ 14.821136] r3 : fa0ad014 r2 : fa0ad000 r1 : 00000000 r0 : c0d202ac >> [ 14.828033] Flags: nZcv IRQs off FIQs on Mode SVC_32 ISA ARM >> Segment non >> e >> [ 14.835662] Control: 10c5387d Table: 8c2ac019 DAC: 00000051 >> [ 14.841735] Process wpa_supplicant (pid: 174, stack limit = 0xcc8bc218) >> >> [snip what appears to be just memory dump or a bunch of numbers] >> >> >> [ 15.147277] [] (_wait_softreset_complete) from [] >> (_enabl >> e_sysc+0x30/0x238) >> [ 15.156463] [] (_enable_sysc) from [] >> (_enable+0x134/0x25 >> 8) >> [ 15.164215] [] (_enable) from [] >> (omap_hwmod_enable+0x28/ >> 0x48) >> [ 15.172210] [] (omap_hwmod_enable) from [] >> (omap_device_e >> nable+0x3c/0x90) >> [ 15.181213] [] (omap_device_enable) from [] >> (_od_runtime_ >> resume+0x10/0x38) >> [ 15.190338] [] (_od_runtime_resume) from [] >> (__rpm_callba >> ck+0xc0/0x214) >> [ 15.199157] [] (__rpm_callback) from [] >> (rpm_callback+0x5 >> 0/0x80) >> [ 15.207366] [] (rpm_callback) from [] >> (rpm_resume+0x4b8/0 >> x738) >> [ 15.215362] [] (rpm_resume) from [] >> (__pm_runtime_resume+ >> 0x4c/0x64) >> [ 15.223846] [] (__pm_runtime_resume) from [] >> (__mmc_claim >> _host+0x174/0x1b8) >> [ 15.233062] [] (__mmc_claim_host) from [] >> (wl12xx_sdio_ra >> w_write+0x34/0x130 [wlcore_sdio]) >> [ 15.243927] [] (wl12xx_sdio_raw_write [wlcore_sdio]) from >> [> 0>] (wlcore_set_partition+0xc4/0x4b0 [wlcore]) >> [ 15.256042] [] (wlcore_set_partition [wlcore]) from >> [] (w >> l12xx_set_power_on+0x80/0x144 [wlcore]) >> [ 15.267517] [] (wl12xx_set_power_on [wlcore]) from >> [] (wl >> 1271_op_add_interface+0x6ac/0x9c0 [wlcore]) >> [ 15.280303] [] (wl1271_op_add_interface [wlcore]) from >> [] >> (drv_add_interface+0x80/0x31c [mac80211]) >> [ 15.293121] [] (drv_add_interface [mac80211]) from >> [] (ie >> ee80211_do_open+0x474/0x8d4 [mac80211]) >> [ 15.304931] [] (ieee80211_do_open [mac80211]) from >> [] (__ >> dev_open+0xa8/0x110) >> [ 15.314300] [] (__dev_open) from [] >> (__dev_change_flags+0 >> x88/0x14c) >> [ 15.322784] [] (__dev_change_flags) from [] >> (dev_change_f >> lags+0x18/0x48) >> [ 15.331695] [] (dev_change_flags) from [] >> (devinet_ioctl+ >> 0x720/0x824) >> [ 15.340362] [] (devinet_ioctl) from [] >> (sock_ioctl+0x160/ >> 0x318) >> [ 15.348449] [] (sock_ioctl) from [] >> (do_vfs_ioctl+0x90/0x >> a10) >> [ 15.356384] [] (do_vfs_ioctl) from [] >> (SyS_ioctl+0x6c/0x7 >> c) >> [ 15.364105] [] (SyS_ioctl) from [] >> (ret_fast_syscall+0x0/ >> 0x1c) >> [ 15.372131] Code: e3120c01 e595205c e6f23073 1affffef (e5933000) >> [ 15.378601] ---[ end trace 6966c05397661217 ]--- >> [ 15.383544] In-band Error seen by MPU at address 0 >> >> [snip] >> >> >> There is much more data to dump after this, but I don't want to dump a >> bunch of noise if it isn't helpful. >> >>> Signed-off-by: Tero Kristo >>> Acked-by: Tony Lindgren >>> --- >>> arch/arm/mach-omap2/clkt2xxx_dpllcore.c | 3 +- >>> arch/arm/mach-omap2/clock.c | 2 +- >>> arch/arm/mach-omap2/clock.h | 2 ++ >>> arch/arm/mach-omap2/cm.h | 5 +-- >>> arch/arm/mach-omap2/cm2xxx.c | 9 ++--- >>> arch/arm/mach-omap2/cm3xxx.c | 10 ++---- >>> arch/arm/mach-omap2/cm_common.c | 2 +- >>> drivers/clk/ti/apll.c | 47 ++++++++++++------------- >>> drivers/clk/ti/autoidle.c | 18 +++++----- >>> drivers/clk/ti/clk-3xxx.c | 55 >>> +++++++++++++++-------------- >>> drivers/clk/ti/clk.c | 47 ++++++++++++------------- >>> drivers/clk/ti/clkt_dflt.c | 61 >>> ++++++++++++--------------------- >>> drivers/clk/ti/clkt_dpll.c | 6 ++-- >>> drivers/clk/ti/clkt_iclk.c | 29 ++++++++-------- >>> drivers/clk/ti/clock.h | 11 +++--- >>> drivers/clk/ti/clockdomain.c | 8 ----- >>> drivers/clk/ti/divider.c | 24 +++++++------ >>> drivers/clk/ti/dpll.c | 48 ++++++++++---------------- >>> drivers/clk/ti/dpll3xxx.c | 38 ++++++++++---------- >>> drivers/clk/ti/dpll44xx.c | 14 ++++---- >>> drivers/clk/ti/gate.c | 32 ++++++++--------- >>> drivers/clk/ti/interface.c | 22 ++++++------ >>> drivers/clk/ti/mux.c | 41 +++++++++------------- >>> include/linux/clk/ti.h | 46 +++++++++++++------------ >>> 24 files changed, 264 insertions(+), 316 deletions(-) >>> >> >> [ snip] >> >> >>> + s16 *prcm_inst, u8 >>> *idlest_reg_id); >>> }; >>> >>> #define to_clk_hw_omap(_hw) container_of(_hw, struct clk_hw_omap, hw) >>> -- >>> 1.9.1 >>> >>> -- >>> To unsubscribe from this list: send the line "unsubscribe linux-omap" in >>> the body of a message to majordomo@vger.kernel.org >>> More majordomo info at http://vger.kernel.org/majordomo-info.html > > > -- > Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. > Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 2dbd632..ed1f625 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -477,7 +477,7 @@ static int _wait_softreset_complete(struct omap_hwmod *oh) int c = 0; sysc = oh->class->sysc; - +pr_warn("_wait_softreset_complete: %s\n", oh->name); if (sysc->sysc_flags & SYSS_HAS_RESET_STATUS) omap_test_timeout((omap_hwmod_read(oh, sysc->syss_offs) & SYSS_RESETDONE_MASK),