From owner-svn-src-head@FreeBSD.ORG Tue Jun 9 15:51:12 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5EAB223E; Tue, 9 Jun 2015 15:51:12 +0000 (UTC) (envelope-from ambrisko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D4DF1336; Tue, 9 Jun 2015 15:51:12 +0000 (UTC) (envelope-from ambrisko@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t59FpCsC060734; Tue, 9 Jun 2015 15:51:12 GMT (envelope-from ambrisko@FreeBSD.org) Received: (from ambrisko@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t59FpCgg060733; Tue, 9 Jun 2015 15:51:12 GMT (envelope-from ambrisko@FreeBSD.org) Message-Id: <201506091551.t59FpCgg060733@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ambrisko set sender to ambrisko@FreeBSD.org using -f From: Doug Ambrisko Date: Tue, 9 Jun 2015 15:51:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284180 - head/sys/dev/mfi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jun 2015 15:51:12 -0000 Author: ambrisko Date: Tue Jun 9 15:51:11 2015 New Revision: 284180 URL: https://svnweb.freebsd.org/changeset/base/284180 Log: Switch from make_dev_alias to make_dev_alias_p since make_dev_alias_p can gracefully fail if the /dev/megaraid_sas_ioctl_node symlink already exists. This can happen if mfi(4) and mrsas(4) are both attached to cards and providing Linux emulation support. Let the first one win. An equivalent change needs to be done to mrsas(4). Extra credit would be to pass the Linux emulation call to the other driver when appropriate. This will probably be a rare case and the user can manually change where the symlink points to. MFC after: 3 days Modified: head/sys/dev/mfi/mfi.c Modified: head/sys/dev/mfi/mfi.c ============================================================================== --- head/sys/dev/mfi/mfi.c Tue Jun 9 14:31:18 2015 (r284179) +++ head/sys/dev/mfi/mfi.c Tue Jun 9 15:51:11 2015 (r284180) @@ -369,6 +369,7 @@ mfi_attach(struct mfi_softc *sc) int error, commsz, framessz, sensesz; int frames, unit, max_fw_sge, max_fw_cmds; uint32_t tb_mem_size = 0; + struct cdev *dev_t; if (sc == NULL) return EINVAL; @@ -763,7 +764,8 @@ mfi_attach(struct mfi_softc *sc) sc->mfi_cdev = make_dev(&mfi_cdevsw, unit, UID_ROOT, GID_OPERATOR, 0640, "mfi%d", unit); if (unit == 0) - make_dev_alias(sc->mfi_cdev, "megaraid_sas_ioctl_node"); + make_dev_alias_p(MAKEDEV_CHECKNAME | MAKEDEV_WAITOK, &dev_t, + sc->mfi_cdev, "%s", "megaraid_sas_ioctl_node"); if (sc->mfi_cdev != NULL) sc->mfi_cdev->si_drv1 = sc; SYSCTL_ADD_INT(device_get_sysctl_ctx(sc->mfi_dev),