<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lwn.git/drivers/ata/pdc_adma.c, branch v2.6.27.3</title>
<subtitle>Linux kernel documentation tree maintained by Jonathan Corbet</subtitle>
<id>http://mirrors.hust.edu.cn/git/lwn.git/atom?h=v2.6.27.3</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/lwn.git/atom?h=v2.6.27.3'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/'/>
<updated>2008-04-17T19:44:21+00:00</updated>
<entry>
<title>libata: rename SFF functions</title>
<updated>2008-04-17T19:44:21+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>htejun@gmail.com</email>
</author>
<published>2008-04-07T13:47:16+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=9363c3825ea9ad76561eb48a395349dd29211ed6'/>
<id>urn:sha1:9363c3825ea9ad76561eb48a395349dd29211ed6</id>
<content type='text'>
SFF functions have confusing names.  Some have sff prefix, some have
bmdma, some std, some pci and some none.  Unify the naming by...

* SFF functions which are common to both BMDMA and non-BMDMA are
  prefixed with ata_sff_.

* SFF functions which are specific to BMDMA are prefixed with
  ata_bmdma_.

* SFF functions which are specific to PCI but apply to both BMDMA and
  non-BMDMA are prefixed with ata_pci_sff_.

* SFF functions which are specific to PCI and BMDMA are prefixed with
  ata_pci_bmdma_.

* Drop generic prefixes from LLD specific routines.  For example,
  bfin_std_dev_select -&gt; bfin_dev_select.

The following renames are noteworthy.

  ata_qc_issue_prot() -&gt; ata_sff_qc_issue()
  ata_pci_default_filter() -&gt; ata_bmdma_mode_filter()
  ata_dev_try_classify() -&gt; ata_sff_dev_classify()

This rename is in preparation of separating SFF support out of libata
core layer.  This patch strictly renames functions and doesn't
introduce any behavior difference.

Signed-off-by: Tejun Heo &lt;htejun@gmail.com&gt;
</content>
</entry>
<entry>
<title>pdc_adma: kill adma_host_stop()</title>
<updated>2008-04-17T19:44:21+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>htejun@gmail.com</email>
</author>
<published>2008-03-25T12:36:06+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=fc4712d12e332a46f200b9ba641855182df282c0'/>
<id>urn:sha1:fc4712d12e332a46f200b9ba641855182df282c0</id>
<content type='text'>
adma_host_stop() does the same thing that adma_port_stop() does.  Kill
it.

Signed-off-by: Tejun Heo &lt;htejun@gmail.com&gt;
Cc: Mark Lord &lt;liml@rtr.ca&gt;
Signed-off-by: Jeff Garzik &lt;jeff@garzik.org&gt;
</content>
</entry>
<entry>
<title>pdc_adma: inherit ata_sff_port_ops</title>
<updated>2008-04-17T19:44:20+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>htejun@gmail.com</email>
</author>
<published>2008-03-25T12:35:30+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=b0316b15ace0570c87b74c81f1296cf7bf8d459e'/>
<id>urn:sha1:b0316b15ace0570c87b74c81f1296cf7bf8d459e</id>
<content type='text'>
With the previous ops standardization, pdc_adma now can inherit
ata_sff_port_ops instead of ata_base_port_ops.  Make the change.

Signed-off-by: Tejun Heo &lt;htejun@gmail.com&gt;
Cc: Mark Lord &lt;liml@rtr.ca&gt;
Signed-off-by: Jeff Garzik &lt;jeff@garzik.org&gt;
</content>
</entry>
<entry>
<title>libata/pdc_adma: make SFF EH handle non-bmdma SFF drivers and standardize pdc_adma ops</title>
<updated>2008-04-17T19:44:20+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>htejun@gmail.com</email>
</author>
<published>2008-03-25T12:34:39+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=ed82f96425e744dffe62115e46f08eb785c0b2f3'/>
<id>urn:sha1:ed82f96425e744dffe62115e46f08eb785c0b2f3</id>
<content type='text'>
pdc_adma has interface similar to SFF but has its own DMA interface.
It currently implements noop bmdma ops to avoid crashing
ata_bmdma_error_handler() which BTW actually is EH for SFF drivers.

This patch makes ata_bmdma_error_handler() dereference bmdma ops iff
bmdma_addr is initialized as done in ata_bmdma_post_internal_cmd.
This change allows pdc_adma to standardize ops and use SFF
error_handler and post_internal_cmd.

Signed-off-by: Tejun Heo &lt;htejun@gmail.com&gt;
Cc: Mark Lord &lt;liml@rtr.ca&gt;
Signed-off-by: Jeff Garzik &lt;jeff@garzik.org&gt;
</content>
</entry>
<entry>
<title>libata: make reset related methods proper port operations</title>
<updated>2008-04-17T19:44:18+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>htejun@gmail.com</email>
</author>
<published>2008-03-25T03:22:50+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=a1efdaba2dbd6fb89e23a87b66d3f4dd92c9f5af'/>
<id>urn:sha1:a1efdaba2dbd6fb89e23a87b66d3f4dd92c9f5af</id>
<content type='text'>
Currently reset methods are not specified directly in the
ata_port_operations table.  If a LLD wants to use custom reset
methods, it should construct and use a error_handler which uses those
reset methods.  It's done this way for two reasons.

First, the ops table already contained too many methods and adding
four more of them would noticeably increase the amount of necessary
boilerplate code all over low level drivers.

Second, as -&gt;error_handler uses those reset methods, it can get
confusing.  ie. By overriding -&gt;error_handler, those reset ops can be
made useless making layering a bit hazy.

Now that ops table uses inheritance, the first problem doesn't exist
anymore.  The second isn't completely solved but is relieved by
providing default values - most drivers can just override what it has
implemented and don't have to concern itself about higher level
callbacks.  In fact, there currently is no driver which actually
modifies error handling behavior.  Drivers which override
-&gt;error_handler just wraps the standard error handler only to prepare
the controller for EH.  I don't think making ops layering strict has
any noticeable benefit.

This patch makes -&gt;prereset, -&gt;softreset, -&gt;hardreset, -&gt;postreset and
their PMP counterparts propoer ops.  Default ops are provided in the
base ops tables and drivers are converted to override individual reset
methods instead of creating custom error_handler.

* ata_std_error_handler() doesn't use sata_std_hardreset() if SCRs
  aren't accessible.  sata_promise doesn't need to use separate
  error_handlers for PATA and SATA anymore.

* softreset is broken for sata_inic162x and sata_sx4.  As libata now
  always prefers hardreset, this doesn't really matter but the ops are
  forced to NULL using ATA_OP_NULL for documentation purpose.

* pata_hpt374 needs to use different prereset for the first and second
  PCI functions.  This used to be done by branching from
  hpt374_error_handler().  The proper way to do this is to use
  separate ops and port_info tables for each function.  Converted.

Signed-off-by: Tejun Heo &lt;htejun@gmail.com&gt;
</content>
</entry>
<entry>
<title>libata: implement and use ops inheritance</title>
<updated>2008-04-17T19:44:17+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>htejun@gmail.com</email>
</author>
<published>2008-03-25T03:22:49+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=029cfd6b74fc5c517865fad78cf4a3ea8d9b664a'/>
<id>urn:sha1:029cfd6b74fc5c517865fad78cf4a3ea8d9b664a</id>
<content type='text'>
libata lets low level drivers build ata_port_operations table and
register it with libata core layer.  This allows low level drivers
high level of flexibility but also burdens them with lots of
boilerplate entries.

This becomes worse for drivers which support related similar
controllers which differ slightly.  They share most of the operations
except for a few.  However, the driver still needs to list all
operations for each variant.  This results in large number of
duplicate entries, which is not only inefficient but also error-prone
as it becomes very difficult to tell what the actual differences are.

This duplicate boilerplates all over the low level drivers also make
updating the core layer exteremely difficult and error-prone.  When
compounded with multi-branched development model, it ends up
accumulating inconsistencies over time.  Some of those inconsistencies
cause immediate problems and fixed.  Others just remain there dormant
making maintenance increasingly difficult.

To rectify the problem, this patch implements ata_port_operations
inheritance.  To allow LLDs to easily re-use their own ops tables
overriding only specific methods, this patch implements poor man's
class inheritance.  An ops table has -&gt;inherits field which can be set
to any ops table as long as it doesn't create a loop.  When the host
is started, the inheritance chain is followed and any operation which
isn't specified is taken from the nearest ancestor which has it
specified.  This operation is called finalization and done only once
per an ops table and the LLD doesn't have to do anything special about
it other than making the ops table non-const such that libata can
update it.

libata provides four base ops tables lower drivers can inherit from -
base, sata, pmp, sff and bmdma.  To avoid overriding these ops
accidentaly, these ops are declared const and LLDs should always
inherit these instead of using them directly.

After finalization, all the ops table are identical before and after
the patch except for setting .irq_handler to ata_interrupt in drivers
which didn't use to.  The .irq_handler doesn't have any actual effect
and the field will soon be removed by later patch.

* sata_sx4 is still using old style EH and currently doesn't take
  advantage of ops inheritance.

Signed-off-by: Tejun Heo &lt;htejun@gmail.com&gt;
</content>
</entry>
<entry>
<title>libata: implement and use SHT initializers</title>
<updated>2008-04-17T19:44:17+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>htejun@gmail.com</email>
</author>
<published>2008-03-25T03:22:49+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=68d1d07b510bb57a504588adc2bd2758adea0965'/>
<id>urn:sha1:68d1d07b510bb57a504588adc2bd2758adea0965</id>
<content type='text'>
libata lets low level drivers build scsi_host_template and register it
to the SCSI layer.  This allows low level drivers high level of
flexibility but also burdens them with lots of boilerplate entries.

This patch implements SHT initializers which can be used to initialize
all the boilerplate entries in a sht.  Three variants of them are
implemented - BASE, BMDMA and NCQ - for different types of drivers.
Note that entries can be overriden by putting individual initializers
after the helper macro.

All sht tables are identical before and after this patch.

Signed-off-by: Tejun Heo &lt;htejun@gmail.com&gt;
</content>
</entry>
<entry>
<title>libata: implement and use ata_noop_irq_clear()</title>
<updated>2008-04-17T19:44:16+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>htejun@gmail.com</email>
</author>
<published>2008-03-25T03:22:47+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=358f9a77a668660729e705fde9c3cf69f013aa98'/>
<id>urn:sha1:358f9a77a668660729e705fde9c3cf69f013aa98</id>
<content type='text'>
-&gt;irq_clear() is used to clear IRQ bit of a SFF controller and isn't
useful for drivers which don't use libata SFF HSM implementation.
However, it's a required callback and many drivers implement their own
noop version as placeholder.  This patch implements ata_noop_irq_clear
and use it to replace those custom placeholders.

Also, SFF drivers which don't support BMDMA don't need to use
ata_bmdma_irq_clear().  It becomes noop if BMDMA address isn't
initialized.  Convert them to use ata_noop_irq_clear().

Signed-off-by: Tejun Heo &lt;htejun@gmail.com&gt;
</content>
</entry>
<entry>
<title>libata: convert to chained sg</title>
<updated>2008-01-23T10:24:14+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>htejun@gmail.com</email>
</author>
<published>2007-12-05T07:43:11+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=ff2aeb1eb64c8a4770a6304f9addbae9f9828646'/>
<id>urn:sha1:ff2aeb1eb64c8a4770a6304f9addbae9f9828646</id>
<content type='text'>
libata used private sg iterator to handle padding sg.  Now that sg can
be chained, padding can be handled using standard sg ops.  Convert to
chained sg.

* s/qc-&gt;__sg/qc-&gt;sg/

* s/qc-&gt;pad_sgent/qc-&gt;extra_sg[]/.  Because chaining consumes one sg
  entry.  There need to be two extra sg entries.  The renaming is also
  for future addition of other extra sg entries.

* Padding setup is moved into ata_sg_setup_extra() which is organized
  in a way that future addition of other extra sg entries is easy.

* qc-&gt;orig_n_elem is unused and removed.

* qc-&gt;n_elem now contains the number of sg entries that LLDs should
  map.  qc-&gt;mapped_n_elem is added to carry the original number of
  mapped sgs for unmapping.

* The last sg of the original sg list is used to chain to extra sg
  list.  The original last sg is pointed to by qc-&gt;last_sg and the
  content is stored in qc-&gt;saved_last_sg.  It's restored during
  ata_sg_clean().

* All sg walking code has been updated.  Unnecessary assertions and
  checks for conditions the core layer already guarantees are removed.

Signed-off-by: Tejun Heo &lt;htejun@gmail.com&gt;
Cc: Jens Axboe &lt;jens.axboe@oracle.com&gt;
Signed-off-by: Jeff Garzik &lt;jeff@garzik.org&gt;
</content>
</entry>
<entry>
<title>libata: rename ATA_PROT_ATAPI_* to ATAPI_PROT_*</title>
<updated>2008-01-23T10:24:14+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>htejun@gmail.com</email>
</author>
<published>2007-12-18T21:34:43+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=0dc36888d4422140f9eaf50f24953ec109f750a3'/>
<id>urn:sha1:0dc36888d4422140f9eaf50f24953ec109f750a3</id>
<content type='text'>
ATA_PROT_ATAPI_* are ugly and naming schemes between ATA_PROT_* and
ATA_PROT_ATAPI_* are inconsistent causing confusion.  Rename them to
ATAPI_PROT_* and make them consistent with ATA counterpart.

Signed-off-by: Tejun Heo &lt;htejun@gmail.com&gt;
Signed-off-by: Jeff Garzik &lt;jgarzik@redhat.com&gt;
</content>
</entry>
</feed>
