<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/scsi/ses.c, branch linux-4.4.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.4.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.4.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-10-17T08:04:44Z</updated>
<entry>
<title>scsi: ses: Fix unsigned comparison with less than zero</title>
<updated>2021-10-17T08:04:44Z</updated>
<author>
<name>Jiapeng Chong</name>
</author>
<published>2021-09-24T09:51:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3e354237932ca5581f6eb0e2968af5dfd9e53016'/>
<id>urn:sha1:3e354237932ca5581f6eb0e2968af5dfd9e53016</id>
<content type='text'>
[ Upstream commit dd689ed5aa905daf4ba4c99319a52aad6ea0a796 ]

Fix the following coccicheck warning:

./drivers/scsi/ses.c:137:10-16: WARNING: Unsigned expression compared
with zero: result &gt; 0.

Link: https://lore.kernel.org/r/1632477113-90378-1-git-send-email-jiapeng.chong@linux.alibaba.com
Reported-by: Abaci Robot &lt;abaci@linux.alibaba.com&gt;
Signed-off-by: Jiapeng Chong &lt;jiapeng.chong@linux.alibaba.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>scsi: ses: don't get power status of SES device slot on probe</title>
<updated>2018-03-22T08:23:24Z</updated>
<author>
<name>Mauricio Faria de Oliveira</name>
</author>
<published>2017-04-05T15:18:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=942c3c95ff969813573e755fb017e1f2d12cf461'/>
<id>urn:sha1:942c3c95ff969813573e755fb017e1f2d12cf461</id>
<content type='text'>
[ Upstream commit 75106523f39751390b5789b36ee1d213b3af1945 ]

The commit 08024885a2a3 ("ses: Add power_status to SES device slot")
introduced the 'power_status' attribute to enclosure components and
the associated callbacks.

There are 2 callbacks available to get the power status of a device:
1) ses_get_power_status() for 'struct enclosure_component_callbacks'
2) get_component_power_status() for the sysfs device attribute
(these are available for kernel-space and user-space, respectively.)

However, despite both methods being available to get power status
on demand, that commit also introduced a call to get power status
in ses_enclosure_data_process().

This dramatically increased the total probe time for SCSI devices
on larger configurations, because ses_enclosure_data_process() is
called several times during the SCSI devices probe and loops over
the component devices (but that is another problem, another patch).

That results in a tremendous continuous hammering of SCSI Receive
Diagnostics commands to the enclosure-services device, which does
delay the total probe time for the SCSI devices __significantly__:

  Originally, ~34 minutes on a system attached to ~170 disks:

    [ 9214.490703] mpt3sas version 13.100.00.00 loaded
    ...
    [11256.580231] scsi 17:0:177:0: qdepth(16), tagged(1), simple(0),
                   ordered(0), scsi_level(6), cmd_que(1)

  With this patch, it decreased to ~2.5 minutes -- a 13.6x faster

    [ 1002.992533] mpt3sas version 13.100.00.00 loaded
    ...
    [ 1151.978831] scsi 11:0:177:0: qdepth(16), tagged(1), simple(0),
                   ordered(0), scsi_level(6), cmd_que(1)

Back to the commit discussion.. on the ses_get_power_status() call
introduced in ses_enclosure_data_process(): impact of removing it.

That may possibly be in place to initialize the power status value
on device probe.  However, those 2 functions available to retrieve
that value _do_ automatically refresh/update it.  So the potential
benefit would be a direct access of the 'power_status' field which
does not use the callbacks...

But the only reader of 'struct enclosure_component::power_status'
is the get_component_power_status() callback for sysfs attribute,
and it _does_ check for and call the .get_power_status callback,
(which indeed is defined and implemented by that commit), so the
power status value is, again, automatically updated.

So, the remaining potential for a direct/non-callback access to
the power_status attribute would be out-of-tree modules -- well,
for those, if they are for whatever reason interested in values
that are set during device probe and not up-to-date by the time
they need it.. well, that would be curious.

Well, to handle that more properly, set the initial power state
value to '-1' (i.e., uninitialized) instead of '1' (power 'on'),
and check for it in that callback which may do an direct access
to the field value _if_ a callback function is not defined.

Signed-off-by: Mauricio Faria de Oliveira &lt;mauricfo@linux.vnet.ibm.com&gt;
Fixes: 08024885a2a3 ("ses: Add power_status to SES device slot")
Reviewed-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
Reviewed-by: Song Liu &lt;songliubraving@fb.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>ses: fix additional element traversal bug</title>
<updated>2015-12-11T19:05:57Z</updated>
<author>
<name>James Bottomley</name>
</author>
<published>2015-12-11T17:16:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5e1033561da1152c57b97ee84371dba2b3d64c25'/>
<id>urn:sha1:5e1033561da1152c57b97ee84371dba2b3d64c25</id>
<content type='text'>
KASAN found that our additional element processing scripts drop off
the end of the VPD page into unallocated space.  The reason is that
not every element has additional information but our traversal
routines think they do, leading to them expecting far more additional
information than is present.  Fix this by adding a gate to the
traversal routine so that it only processes elements that are expected
to have additional information (list is in SES-2 section 6.1.13.1:
Additional Element Status diagnostic page overview)

Reported-by: Pavel Tikhomirov &lt;ptikhomirov@virtuozzo.com&gt;
Tested-by: Pavel Tikhomirov &lt;ptikhomirov@virtuozzo.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
</content>
</entry>
<entry>
<title>ses: Fix problems with simple enclosures</title>
<updated>2015-12-10T16:14:03Z</updated>
<author>
<name>James Bottomley</name>
</author>
<published>2015-12-08T17:00:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3417c1b5cb1fdc10261dbed42b05cc93166a78fd'/>
<id>urn:sha1:3417c1b5cb1fdc10261dbed42b05cc93166a78fd</id>
<content type='text'>
Simple enclosure implementations (mostly USB) are allowed to return only
page 8 to every diagnostic query.  That really confuses our
implementation because we assume the return is the page we asked for and
end up doing incorrect offsets based on bogus information leading to
accesses outside of allocated ranges.  Fix that by checking the page
code of the return and giving an error if it isn't the one we asked for.
This should fix reported bugs with USB storage by simply refusing to
attach to enclosures that behave like this.  It's also good defensive
practise now that we're starting to see more USB enclosures.

Reported-by: Andrea Gelmini &lt;andrea.gelmini@gelma.net&gt;
Cc: stable@vger.kernel.org
Reviewed-by: Ewan D. Milne &lt;emilne@redhat.com&gt;
Reviewed-by: Tomas Henzl &lt;thenzl@redhat.com&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
</content>
</entry>
<entry>
<title>ses: Add power_status to SES device slot</title>
<updated>2015-01-09T14:44:19Z</updated>
<author>
<name>Song Liu</name>
</author>
<published>2014-12-30T22:46:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=08024885a2a3ed432716e9d50046a620a5b2df05'/>
<id>urn:sha1:08024885a2a3ed432716e9d50046a620a5b2df05</id>
<content type='text'>
Add power_status to SES device slot, so we can power on/off the
HDDs behind the enclosure.

Check firmware status in ses_set_* before sending control pages to
firmware.

Signed-off-by: Song Liu &lt;songliubraving@fb.com&gt;
Acked-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
Reviewed-by: Jens Axboe &lt;axboe@fb.com&gt;
Cc: Hannes Reinecke &lt;hare@suse.de&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>ses: add reliable slot attribute</title>
<updated>2015-01-09T14:44:19Z</updated>
<author>
<name>Dan Williams</name>
</author>
<published>2014-12-30T22:46:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=921ce7f5786052749a22a75780f5ce1a456bcdc6'/>
<id>urn:sha1:921ce7f5786052749a22a75780f5ce1a456bcdc6</id>
<content type='text'>
The name provided by firmware is in a vendor specific format, publish
the slot number to have a reliable mechanism for identifying slots
across firmware implementations.  If the enclosure does not provide a
slot number fallback to the component number which is guaranteed unique,
and usually mirrors the slot number.

Cleaned up the unused ses_component.desc in the process.

Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
Signed-off-by: Song Liu &lt;songliubraving@fb.com&gt;
Reviewed-by: Jens Axboe &lt;axboe@fb.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.de&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>ses: add enclosure logical id</title>
<updated>2015-01-09T14:44:18Z</updated>
<author>
<name>Dan Williams</name>
</author>
<published>2014-12-30T22:46:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=967f7bab0eaaa74d7d01a56d45aa309f78fb87dd'/>
<id>urn:sha1:967f7bab0eaaa74d7d01a56d45aa309f78fb87dd</id>
<content type='text'>
Export the NAA logical id for the enclosure.  This is optionally
available from the sas_transport_class, but it is really a property of
the enclosure.

Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
Signed-off-by: Song Liu &lt;songliubraving@fb.com&gt;
Reviewed-by: Jens Axboe &lt;axboe@fb.com&gt;
Cc: Hannes Reinecke &lt;hare@suse.de&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>ses: generate KOBJ_CHANGE on enclosure attach</title>
<updated>2015-01-09T14:44:18Z</updated>
<author>
<name>Dan Williams</name>
</author>
<published>2014-12-30T22:46:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=15a0fbbc8e0d4c135b069c34258fbaebad471dd7'/>
<id>urn:sha1:15a0fbbc8e0d4c135b069c34258fbaebad471dd7</id>
<content type='text'>
In support of a /dev/disk/by-slot populated with data from the enclosure
and ses modules udev needs notification when the new interface
files/links are available.  Otherwise, any udev rules specified for the
disk cannot assume that the enclosure topology has settled.

Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
Signed-off-by: Song Liu &lt;songliubraving@fb.com&gt;
Reviewed-by: Jens Axboe &lt;axboe@fb.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.de&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>ses: close potential registration race</title>
<updated>2015-01-09T14:44:17Z</updated>
<author>
<name>Dan Williams</name>
</author>
<published>2014-12-30T22:46:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ed09dcc8bd7fe0991af7737e675996cbd022f38f'/>
<id>urn:sha1:ed09dcc8bd7fe0991af7737e675996cbd022f38f</id>
<content type='text'>
The slot and address fields have a small window of instability when
userspace can read them before initialization. Separate
enclosure_component
allocation from registration.

Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
Signed-off-by: Song Liu &lt;songliubraving@fb.com&gt;
Reviewed-by: Jens Axboe &lt;axboe@fb.com&gt;
Cc: Hannes Reinecke &lt;hare@suse.de&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>scsi: remove scsi_driver owner field</title>
<updated>2014-11-24T19:01:28Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2014-11-12T17:34:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3af6b35261182ff185db1f0fd271254147e2663e'/>
<id>urn:sha1:3af6b35261182ff185db1f0fd271254147e2663e</id>
<content type='text'>
The driver core driver structure has grown an owner field and now
requires it to be set for all modular drivers.  Set it up for
all scsi_driver instances and get rid of the now superflous
scsi_driver owner field.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reported-by: Shane M Seymour &lt;shane.seymour@hp.com&gt;
Reviewed-by: Ewan D. Milne &lt;emilne@redhat.com
Reviewed-by: Hannes Reinecke &lt;hare@suse.de&gt;
</content>
</entry>
</feed>
