From owner-svn-src-all@freebsd.org Fri Nov 1 21:21:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 990A41A364F for ; Fri, 1 Nov 2019 21:21:21 +0000 (UTC) (envelope-from ilya@bakulin.de) Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 474Zr06VJ3z3HQ1 for ; Fri, 1 Nov 2019 21:21:20 +0000 (UTC) (envelope-from ilya@bakulin.de) Received: by mail-lf1-x131.google.com with SMTP id 19so3019003lft.13 for ; Fri, 01 Nov 2019 14:21:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bakulin-de.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ETd2ezv4qQjF568YrqipIdIbrMabjDYsJFoQbAl3TY8=; b=WeYlZ1/NMzZCVqAos5PdqKiRv9xJuCoDcpyYN9SdBz7vsI30EIsM/WvCZwtIRyHmQH 9sJM/Lbf4XHzCNnvwccabWFTlz5VhOVePdKub0pcLH2E9lSoiDWr9wQmem4UwvtJJR0s F4dPgSdEPZlaIfqaS2sABcVJitlqGh3lq2rxyRv7lFiExU0II9OIuozo80mqKsQCgd4I QArn+sCcvb+Weps0uvmC7/CpRPX6WyUKu7pt+2dXEhAhf1tQi8c+Hedqr0vjL5Td5j+0 1VAZt/JcSO8evNZ88YxrccnTUkR+byCeIw4gbiUuCf9nh69koIHchu6Yqj6LpaJfEeQ+ UPiw== 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=ETd2ezv4qQjF568YrqipIdIbrMabjDYsJFoQbAl3TY8=; b=n4ZEDbut4oTbgGWcf9sWJO7SjZ+fVLSkZe6VenTdmrkZVJw9pq6HiCuH/EogdpX/zT TjCDDSMVmpaEsfK11tdtHhtySC8tysjoXRG0KkLbzfBF76sFV7yTmIfoLUWcGGonC0V+ 7zHRdCQ9f7oTur05AHii82hwRyL7lCqwLLsWk60MRvu8NT1Be7hEWDt24z1ggt6NtMBy XdQ1qdwpihWCw0mxKEYYNgb9XxxqqqlW9SuwMMqgItn0SsJvuka0zRzjuBYItt2BbUQd pfpYpgb1r10I4/Evfe+334iuGHsYwHr9SolOGQZN/HK2gaVAFPtDsRyiQFM68cntMm7x X4jg== X-Gm-Message-State: APjAAAWB/EmlN8yFRX0oB54UhWGkVsJTIIzQ8mispgtjvvgwZc2j3r4W yZdk6ZQfC28jpWkhWK3vm8MhRXqXOjPAH/iIZnLpUQ== X-Google-Smtp-Source: APXvYqzMF/dPMiQatg/urqeio05abpIafFxI7OHoYu3/zmexpXaRVA2hRf202j6Rj3SZ3m4c3b1EaCmrC6Us4Dz9mGQ= X-Received: by 2002:a19:6813:: with SMTP id d19mr8867874lfc.144.1572643278573; Fri, 01 Nov 2019 14:21:18 -0700 (PDT) MIME-Version: 1.0 References: <201910302043.x9UKhRth083957@repo.freebsd.org> <20191031135118.4e9222bb05879d1602bf3161@bidouilliste.com> In-Reply-To: <20191031135118.4e9222bb05879d1602bf3161@bidouilliste.com> From: Ilya Bakulin Date: Fri, 1 Nov 2019 22:21:07 +0100 Message-ID: Subject: Re: svn commit: r354206 - head/sys/arm/allwinner To: Emmanuel Vadot Cc: Ilya Bakulin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 474Zr06VJ3z3HQ1 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bakulin-de.20150623.gappssmtp.com header.s=20150623 header.b=WeYlZ1/N; dmarc=none; spf=none (mx1.freebsd.org: domain of ilya@bakulin.de has no SPF policy when checking 2a00:1450:4864:20::131) smtp.mailfrom=ilya@bakulin.de X-Spamd-Result: default: False [-4.03 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_DKIM_ALLOW(-0.20)[bakulin-de.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bakulin.de]; URI_COUNT_ODD(1.00)[9]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bakulin-de.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[1.3.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-2.73)[ip: (-8.77), ipnet: 2a00:1450::/32(-2.78), asn: 15169(-2.04), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Nov 2019 21:21:21 -0000 The first part (cam_sim_alloc -> cam_sim_alloc_dev) is necessary to properly fill cam_sim structure so that sdiob(4) can attach to the SDIO card. See https://svnweb.freebsd.org/base?view=revision&revision=r348800 for the details. The second part (new DEVMETHOD) is needed because now MMC adapter becomes a bus (like, something that has children) and without this change the kernel panics when trying to attach sdiob(4). On Thu, Oct 31, 2019 at 1:51 PM Emmanuel Vadot wrote: > On Wed, 30 Oct 2019 20:43:27 +0000 (UTC) > Ilya Bakulin wrote: > > > Author: kibab > > Date: Wed Oct 30 20:43:27 2019 > > New Revision: 354206 > > URL: https://svnweb.freebsd.org/changeset/base/354206 > > > > Log: > > Use the new cam_sim_alloc_dev function to properly initialize SIM > > > > Using cam_sim_alloc_dev() allows to properly set sim_dev field so that > > sdiob(4) can attach to the CAM device that represents SDIO card. > > The same change for SDHCI driver happened in r348800. > > > > Approved by: imp (mentor) > > Differential Revision: https://reviews.freebsd.org/D22192 > > > > Modified: > > head/sys/arm/allwinner/aw_mmc.c > > > > Modified: head/sys/arm/allwinner/aw_mmc.c > > > ============================================================================== > > --- head/sys/arm/allwinner/aw_mmc.c Wed Oct 30 20:08:10 2019 > (r354205) > > +++ head/sys/arm/allwinner/aw_mmc.c Wed Oct 30 20:43:27 2019 > (r354206) > > @@ -526,8 +526,8 @@ aw_mmc_attach(device_t dev) > > } > > > > mtx_init(&sc->sim_mtx, "awmmcsim", NULL, MTX_DEF); > > - sc->sim = cam_sim_alloc(aw_mmc_cam_action, aw_mmc_cam_poll, > > - "aw_mmc_sim", sc, device_get_unit(dev), > > + sc->sim = cam_sim_alloc_dev(aw_mmc_cam_action, aw_mmc_cam_poll, > > + "aw_mmc_sim", sc, dev, > > &sc->sim_mtx, 1, 1, sc->devq); > > > > if (sc->sim == NULL) { > > @@ -1514,6 +1514,7 @@ static device_method_t aw_mmc_methods[] = { > > /* Bus interface */ > > DEVMETHOD(bus_read_ivar, aw_mmc_read_ivar), > > DEVMETHOD(bus_write_ivar, aw_mmc_write_ivar), > > + DEVMETHOD(bus_add_child, bus_generic_add_child), > > Why is this change needed ? > > > > > /* MMC bridge interface */ > > DEVMETHOD(mmcbr_update_ios, aw_mmc_update_ios), > > > -- > Emmanuel Vadot >