Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751528AbdLDPUq (ORCPT ); Mon, 4 Dec 2017 10:20:46 -0500 Received: from mailout.micron.com ([137.201.242.129]:30271 "EHLO mailout.micron.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750961AbdLDPUk (ORCPT ); Mon, 4 Dec 2017 10:20:40 -0500 From: "Bean Huo (beanhuo)" To: Bart Van Assche , "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: "gregkh@linuxfoundation.org" , "vinholikatti@gmail.com" Subject: RE: [EXT] Re: UFS utilities Thread-Topic: [EXT] Re: UFS utilities Thread-Index: AdNncYPG0gyd+whNRcGnlm6+vqOoMgARVo6AAVP14tA= Date: Mon, 4 Dec 2017 15:20:34 +0000 Message-ID: References: <1511811323.2993.13.camel@wdc.com> In-Reply-To: <1511811323.2993.13.camel@wdc.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.160.29.124] X-TM-AS-Product-Ver: SMEX-12.0.0.1464-8.100.1062-23508.005 X-TM-AS-Result: No--10.427600-0.000000-31 X-TM-AS-MatchedID: 150567-700949-139010-106230-700817-706290-707788-701021-7 02898-700648-703786-702118-862883-121297-121624-862894-112001-709584-703712 -702358-701461-707451-700942-710207-709859-700756-187067-703157-863828-7001 07-702020-851106-148004-148046-148133-148980-10013-42000-42003-29961 X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No x-mt-checkinternalsenderrule: True Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id vB4FKqmW013861 Content-Length: 1814 Lines: 37 Hi, Bart Sorry for later! > >Hello Bean, > >Please be more specific. What is inconvenient about sg3_utils on embedded >ARM systems? > Exactly, I don't know how to compile sg3_utils with static library, instead of sharing library. I used following configuration Parameter: ./configure --enable-static=yes --build=x86_64-unknown-linux-gnu --host=aarch64-linux-gnu --prefix=$PWD/out/ CC=aarch64-linux-gnu-g cc --target=aarch64-linux-gnu LD=aarch64-linux-gnu-ld AS=aarch64-linux-gnu-as CFLAGS=-static LDFLAGS=-static But the object files are still dynamically linked. ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, BuildID[sha1]=4f01b4c9f1ff47bc00aef93950c02734b4cc8e57, not stripped. I want it to be statically linked. Otherwise, I should copy its library to my lib folder, and sometimes for the embedded, Need to re-build rootfs. Meanwhile, for the UFS, there are totally 27 scsi commands being used based on UFS2.1. For the most case, we just use several sg3_utils object files, don't need to copy all object files to the ending product. >> And also it doesn't support several UFS special command. > >Are you referring to SCSI commands or rather to UFS commands that fall >outside the SCSI spec? Anyway, an approach that is used by many SCSI drivers >to export information to user space that falls outside the SCSI spec is to >create additional sysfs attributes. See also the sdev_attrs and shost_attrs >members of struct scsi_host_template. > Yes, for the UFS information, I can use these interface/approach to easily get. I am thinking how about some testing case and configuration operation. Also, is it possible bypass SCSI stacks and go into directly UFS stack? Thanks for your inputs. >Bart. //Bean Huo